diff --git a/.cargo/audit.toml b/.cargo/audit.toml index 23c3852b..268d3716 100644 --- a/.cargo/audit.toml +++ b/.cargo/audit.toml @@ -7,5 +7,5 @@ ignore = [ # wry needs kuchiki on Android "RUSTSEC-2023-0019", # atty is only used when the `colored` feature is enabled on tauri-plugin-log - "RUSTSEC-2021-0145" -] \ No newline at end of file + "RUSTSEC-2021-0145", +] diff --git a/.changes/beta.md b/.changes/beta.md deleted file mode 100644 index 3761074e..00000000 --- a/.changes/beta.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -"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 -"authenticator-js": patch -"autostart-js": patch -"barcode-scanner-js": patch -"biometric-js": patch -"cli-js": patch -"clipboard-manager-js": patch -"deep-link-js": patch -"dialog-js": patch -"fs-js": patch -"global-shortcut-js": patch -"http-js": patch -"log-js": patch -"nfc-js": patch -"notification-js": patch -"os-js": patch -"positioner-js": patch -"process-js": patch -"shell-js": patch -"sql-js": patch -"store-js": patch -"stronghold-js": patch -"updater-js": patch -"upload-js": patch -"websocket-js": patch -"window-state-js": patch ---- - -Update to tauri beta. diff --git a/.changes/clipboard-html.md b/.changes/clipboard-html.md deleted file mode 100644 index df19abfd..00000000 --- a/.changes/clipboard-html.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"clipboard-manager": patch -"clipboard-manager-js": patch ---- - -Add support for writing HTML content to the clipboard. \ No newline at end of file diff --git a/.changes/config.json b/.changes/config.json index 78bcd57b..5f5fe841 100644 --- a/.changes/config.json +++ b/.changes/config.json @@ -3,24 +3,40 @@ "pkgManagers": { "javascript": { "version": true, - "getPublishedVersion": "node ../../.scripts/covector/package-latest-version.cjs npm ${ pkgFile.pkg.name } ${ pkgFile.pkg.version }", - "publish": ["pnpm build", "pnpm publish --access public --no-git-checks"] + "getPublishedVersion": { + "use": "fetch:check", + "options": { + "url": "https://registry.npmjs.com/${ pkg.pkgFile.pkg.name }/${ pkg.pkgFile.version }" + } + }, + "publish": [ + { + "command": "pnpm build", + "dryRunCommand": "pnpm build" + }, + { + "command": "npm publish --provenance --access public", + "dryRunCommand": "npm publish --provenance --access public --dry-run", + "pipe": true + } + ] }, "rust": { "version": true, - "getPublishedVersion": "node ../../.scripts/covector/package-latest-version.cjs cargo ${ pkgFile.pkg.package.name } ${ pkgFile.pkg.package.version }", + "getPublishedVersion": { + "use": "fetch:check", + "options": { + "url": "https://crates.io/api/v1/crates/${ pkg.pkgFile.pkg.package.name }/${ pkg.pkgFile.version }" + } + }, "publish": [ - { - "command": "cargo package --no-verify", - "dryRunCommand": true - }, { "command": "echo '
\n

Cargo Publish

\n\n```'", "dryRunCommand": true, "pipe": true }, { - "command": "cargo publish", + "command": "cargo publish --no-verify", "dryRunCommand": "cargo publish --dry-run", "pipe": true }, @@ -52,7 +68,10 @@ "os", "process", "shell", - "updater" + "store", + "updater", + "geolocation", + "haptics" ] }, "api-example-js": { @@ -74,6 +93,7 @@ "os-js", "process-js", "shell-js", + "store-js", "updater-js" ], "postversion": "pnpm install --no-frozen-lockfile" @@ -85,14 +105,6 @@ "dependencies": ["deep-link-js"], "postversion": "pnpm install --no-frozen-lockfile" }, - "authenticator": { - "path": "./plugins/authenticator", - "manager": "rust" - }, - "authenticator-js": { - "path": "./plugins/authenticator", - "manager": "javascript" - }, "autostart": { "path": "./plugins/autostart", "manager": "rust" @@ -158,6 +170,14 @@ "path": "./plugins/dialog", "manager": "javascript" }, + "geolocation": { + "path": "./plugins/geolocation", + "manager": "rust" + }, + "geolocation-js": { + "path": "./plugins/geolocation", + "manager": "javascript" + }, "global-shortcut": { "path": "./plugins/global-shortcut", "manager": "rust" @@ -166,6 +186,14 @@ "path": "./plugins/global-shortcut", "manager": "javascript" }, + "haptics": { + "path": "./plugins/haptics", + "manager": "rust" + }, + "haptics-js": { + "path": "./plugins/haptics", + "manager": "javascript" + }, "http": { "path": "./plugins/http", "manager": "rust", @@ -242,32 +270,12 @@ }, "single-instance": { "path": "./plugins/single-instance", - "manager": "rust" + "manager": "rust", + "dependencies": ["deep-link"] }, "sql": { "path": "./plugins/sql", - "manager": "rust", - "publish": [ - { - "command": "cargo package --no-verify", - "dryRunCommand": true - }, - { - "command": "echo '
\n

Cargo Publish

\n\n```'", - "dryRunCommand": true, - "pipe": true - }, - { - "command": "cargo publish --features sqlite", - "dryRunCommand": "cargo publish --features sqlite --dry-run", - "pipe": true - }, - { - "command": "echo '```\n\n
\n'", - "dryRunCommand": true, - "pipe": true - } - ] + "manager": "rust" }, "sql-js": { "path": "./plugins/sql", diff --git a/.changes/dialog-can-create-directories.md b/.changes/dialog-can-create-directories.md deleted file mode 100644 index 9b62fbdb..00000000 --- a/.changes/dialog-can-create-directories.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"dialog": "patch" -"dialog-js": "patch" ---- - -Allow configuring `canCreateDirectories` for open and save dialogs on macOS, if not configured, it will be set to `true` by default. diff --git a/.changes/fix-sql-blocking.md b/.changes/fix-sql-blocking.md new file mode 100644 index 00000000..518f02a5 --- /dev/null +++ b/.changes/fix-sql-blocking.md @@ -0,0 +1,5 @@ +--- +sql: patch +--- + +Replace `Mutex` with `RwLock` to enable concurrent SQL execution. \ No newline at end of file diff --git a/.changes/fix-zbus-import.md b/.changes/fix-zbus-import.md deleted file mode 100644 index e78a3cc8..00000000 --- a/.changes/fix-zbus-import.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"single-instance": patch ---- - -Fix `zbus::blocking::connection::Builder` import. diff --git a/.changes/fs-writeTextFile-utf8-path.md b/.changes/fs-writeTextFile-utf8-path.md new file mode 100644 index 00000000..561e83e3 --- /dev/null +++ b/.changes/fs-writeTextFile-utf8-path.md @@ -0,0 +1,5 @@ +--- +"fs-js": "patch" +--- + +Fix `writeTextFile` converting UTF-8 characters (for example `äöü`) in the given path into replacement character (`�`) \ No newline at end of file diff --git a/.changes/http-user-agent.md b/.changes/http-user-agent.md deleted file mode 100644 index b323659d..00000000 --- a/.changes/http-user-agent.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"http": "patch" -"http-js": "patch" ---- - -Allow `User-Agent` header to be set. diff --git a/.changes/msrv-1.75.md b/.changes/msrv-1.75.md deleted file mode 100644 index c694ae87..00000000 --- a/.changes/msrv-1.75.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -"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 ---- - -Update MSRV to 1.75. diff --git a/.changes/pre.json b/.changes/pre.json deleted file mode 100644 index f9896471..00000000 --- a/.changes/pre.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "tag": "beta", - "changes": [ - ".changes/beta.md", - ".changes/fix-zbus-import.md", - ".changes/msrv-1.75.md", - ".changes/tauri-beta-4.md" - ] -} diff --git a/.changes/readme.md b/.changes/readme.md index 002f4643..96cb9f77 100644 --- a/.changes/readme.md +++ b/.changes/readme.md @@ -11,7 +11,7 @@ Use the following format: ```md --- "package-a": patch -"package-b": minor +"package-b": minor:feat --- Change summary goes here diff --git a/.changes/tauri-beta-4.md b/.changes/tauri-beta-4.md deleted file mode 100644 index 53026485..00000000 --- a/.changes/tauri-beta-4.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -"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 -"authenticator-js": patch -"autostart-js": patch -"barcode-scanner-js": patch -"biometric-js": patch -"cli-js": patch -"clipboard-manager-js": patch -"deep-link-js": patch -"dialog-js": patch -"fs-js": patch -"global-shortcut-js": patch -"http-js": patch -"log-js": patch -"nfc-js": patch -"notification-js": patch -"os-js": patch -"positioner-js": patch -"process-js": patch -"shell-js": patch -"sql-js": patch -"store-js": patch -"stronghold-js": patch -"updater-js": patch -"upload-js": patch -"websocket-js": patch -"window-state-js": patch ---- - -Update to tauri beta.4. diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index d7526cfb..00000000 --- a/.eslintignore +++ /dev/null @@ -1,8 +0,0 @@ -target -node_modules -dist -build/ -dist-js -api-iife.js -init-iife.js -init.js \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 84c29bc5..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "env": { - "browser": true, - "es2021": true - }, - "extends": [ - "prettier", - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:security/recommended-legacy" - ], - "overrides": [], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "plugins": ["@typescript-eslint"], - "rules": {} -} diff --git a/.github/sponsors/rescue.png b/.github/sponsors/rescue.png new file mode 100644 index 00000000..2b5916f4 Binary files /dev/null and b/.github/sponsors/rescue.png differ diff --git a/.github/workflows/audit-javascript.yml b/.github/workflows/audit-javascript.yml index 618ebf59..702811c2 100644 --- a/.github/workflows/audit-javascript.yml +++ b/.github/workflows/audit-javascript.yml @@ -7,23 +7,23 @@ name: Audit JavaScript on: workflow_dispatch: schedule: - - cron: "0 0 * * *" + - cron: '0 0 * * *' push: branches: - v1 - v2 paths: - - ".github/workflows/audit-javascript.yml" - - "**/pnpm-lock.yaml" - - "**/package.json" + - '.github/workflows/audit-javascript.yml' + - '**/pnpm-lock.yaml' + - '**/package.json' pull_request: branches: - v1 - v2 paths: - - ".github/workflows/audit-javascript.yml" - - "**/pnpm-lock.yaml" - - "**/package.json" + - '.github/workflows/audit-javascript.yml' + - '**/pnpm-lock.yaml' + - '**/package.json' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -33,20 +33,20 @@ jobs: audit-js: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Cache pnpm modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.pnpm-store key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}- - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18 - - uses: pnpm/action-setup@v2 + node-version: 'lts/*' + - uses: pnpm/action-setup@v4 with: - version: 7.x.x + version: 9.x.x run_install: true - name: audit run: pnpm audit diff --git a/.github/workflows/audit-rust.yml b/.github/workflows/audit-rust.yml index a2d61a7f..e0c72a89 100644 --- a/.github/workflows/audit-rust.yml +++ b/.github/workflows/audit-rust.yml @@ -7,23 +7,23 @@ name: Audit Rust on: workflow_dispatch: schedule: - - cron: "0 0 * * *" + - cron: '0 0 * * *' push: branches: - v1 - v2 paths: - - ".github/workflows/audit-rust.yml" - - "**/Cargo.lock" - - "**/Cargo.toml" + - '.github/workflows/audit-rust.yml' + - '**/Cargo.lock' + - '**/Cargo.toml' pull_request: branches: - v1 - v2 paths: - - ".github/workflows/audit-rust.yml" - - "**/Cargo.lock" - - "**/Cargo.toml" + - '.github/workflows/audit-rust.yml' + - '**/Cargo.lock' + - '**/Cargo.toml' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -33,7 +33,7 @@ jobs: audit-rust: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: rustsec/audit-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/check-generated-files.yml b/.github/workflows/check-generated-files.yml index 52be59f0..96bbdd05 100644 --- a/.github/workflows/check-generated-files.yml +++ b/.github/workflows/check-generated-files.yml @@ -7,8 +7,8 @@ name: check generated files on: pull_request: paths: - - ".github/workflows/check-generated-files.yml" - - "**/guest-js/**" + - '.github/workflows/check-generated-files.yml' + - '**/guest-js/**' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -20,15 +20,11 @@ jobs: outputs: packages: ${{ steps.filter.outputs.changes }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dorny/paths-filter@v2 id: filter with: filters: | - authenticator: - - .github/workflows/check-generated-files.yml - - plugins/authenticator/guest-js/** - - plugins/authenticator/src/api-iife.js autostart: - .github/workflows/check-generated-files.yml - plugins/autostart/guest-js/** @@ -49,10 +45,18 @@ jobs: - .github/workflows/check-generated-files.yml - plugins/fs/guest-js/** - plugins/fs/src/api-iife.js + geolocation: + - .github/workflows/check-generated-files.yml + - plugins/geolocation/guest-js/** + - plugins/geolocation/src/api-iife.js global-shortcut: - .github/workflows/check-generated-files.yml - plugins/global-shortcut/guest-js/** - plugins/global-shortcut/src/api-iife.js + haptics: + - .github/workflows/check-generated-files.yml + - plugins/haptics/guest-js/** + - plugins/haptics/src/api-iife.js http: - .github/workflows/check-generated-files.yml - plugins/http/guest-js/** @@ -121,21 +125,21 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Cache pnpm modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.pnpm-store key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}- - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18 - - uses: pnpm/action-setup@v2 + node-version: 'lts/*' + - uses: pnpm/action-setup@v4 with: - version: 7.x.x + version: 9.x.x run_install: true - name: build api diff --git a/.github/workflows/check-license-header.yml b/.github/workflows/check-license-header.yml index 011a1780..338a0041 100644 --- a/.github/workflows/check-license-header.yml +++ b/.github/workflows/check-license-header.yml @@ -15,7 +15,7 @@ jobs: check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: dorny/paths-filter@v2 id: filter with: diff --git a/.github/workflows/covector-comment-on-fork.yml b/.github/workflows/covector-comment-on-fork.yml new file mode 100644 index 00000000..494a5348 --- /dev/null +++ b/.github/workflows/covector-comment-on-fork.yml @@ -0,0 +1,30 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT + +name: covector comment +on: + workflow_run: + workflows: [covector status] # the `name` of the workflow run on `pull_request` running `status` with `comment: true` + types: + - completed + +# note all other permissions are set to none if not specified +# and these set the permissions for `secrets.GITHUB_TOKEN` +permissions: + # to read the action artifacts on `covector status` workflows + actions: read + # to write the comment + pull-requests: write + +jobs: + download: + runs-on: ubuntu-latest + if: github.event.workflow_run.conclusion == 'success' && + (github.event.workflow_run.head_repository.full_name != github.repository || github.actor == 'dependabot[bot]') + steps: + - name: covector status + uses: jbolda/covector/packages/action@covector-v0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + command: 'status' diff --git a/.github/workflows/covector-status.yml b/.github/workflows/covector-status.yml index 562dd70a..7eeda427 100644 --- a/.github/workflows/covector-status.yml +++ b/.github/workflows/covector-status.yml @@ -10,11 +10,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # required for use of git history - name: covector status uses: jbolda/covector/packages/action@covector-v0 id: covector with: - command: "status" + command: 'status' + token: ${{ secrets.GITHUB_TOKEN }} + comment: true diff --git a/.github/workflows/covector-version-or-publish-v2.yml b/.github/workflows/covector-version-or-publish-v2.yml deleted file mode 100644 index 6d1ce3a7..00000000 --- a/.github/workflows/covector-version-or-publish-v2.yml +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright 2019-2023 Tauri Programme within The Commons Conservancy -# SPDX-License-Identifier: Apache-2.0 -# SPDX-License-Identifier: MIT - -name: version or publish - -on: - push: - branches: - - v2 - -jobs: - version-or-publish: - runs-on: ubuntu-latest - timeout-minutes: 65 - outputs: - change: ${{ steps.covector.outputs.change }} - commandRan: ${{ steps.covector.outputs.commandRan }} - successfulPublish: ${{ steps.covector.outputs.successfulPublish }} - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 # required for use of git history - - - uses: actions/setup-node@v3 - with: - node-version: "lts/*" - registry-url: "https://registry.npmjs.org" - - - uses: pnpm/action-setup@v2 - with: - version: 7.x.x - run_install: true - - - name: install webkit2gtk and libudev for [authenticator] - run: | - sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libudev-dev - - - name: cargo login - run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }} - - - name: git config - run: | - git config --global user.name "${{ github.event.pusher.name }}" - git config --global user.email "${{ github.event.pusher.email }}" - - - name: covector version or publish (publish when no change files present) - uses: jbolda/covector/packages/action@covector-v0 - id: covector - env: - NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }} - with: - token: ${{ secrets.GITHUB_TOKEN }} - command: "version-or-publish" - createRelease: true - - - name: Create Pull Request With Versions Bumped - id: cpr - uses: tauri-apps/create-pull-request@v3 - if: steps.covector.outputs.commandRan == 'version' - with: - title: "Publish New Versions (v2)" - commit-message: "publish new versions" - labels: "version updates" - branch: "release-v2" - body: ${{ steps.covector.outputs.change }} diff --git a/.github/workflows/covector-version-or-publish.yml b/.github/workflows/covector-version-or-publish.yml index c5ef8161..22e945af 100644 --- a/.github/workflows/covector-version-or-publish.yml +++ b/.github/workflows/covector-version-or-publish.yml @@ -8,6 +8,15 @@ on: push: branches: - v1 + - v2 + +permissions: + # required for npm provenance + id-token: write + # required to create the GitHub Release + contents: write + # required for creating the Version Packages Release + pull-requests: write jobs: version-or-publish: @@ -19,25 +28,20 @@ jobs: successfulPublish: ${{ steps.covector.outputs.successfulPublish }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # required for use of git history - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: "lts/*" - registry-url: "https://registry.npmjs.org" + node-version: 'lts/*' + registry-url: 'https://registry.npmjs.org' - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: - version: 7.x.x + version: 9.x.x run_install: true - - name: install webkit2gtk and libudev for [authenticator] - run: | - sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libudev-dev - - name: cargo login run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }} @@ -46,23 +50,36 @@ jobs: git config --global user.name "${{ github.event.pusher.name }}" git config --global user.email "${{ github.event.pusher.email }}" + - name: Setup target dir on /mnt + # This directory has a larger partition size + 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) uses: jbolda/covector/packages/action@covector-v0 id: covector env: + CARGO_TARGET_DIR: /mnt/target NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }} with: token: ${{ secrets.GITHUB_TOKEN }} - command: "version-or-publish" + command: 'version-or-publish' createRelease: true + recognizeContributors: true + + - name: Sync Cargo.lock + if: steps.covector.outputs.commandRan == 'version' + run: cargo tree --depth 0 - name: Create Pull Request With Versions Bumped id: cpr uses: tauri-apps/create-pull-request@v3 if: steps.covector.outputs.commandRan == 'version' with: - title: "Publish New Versions" - commit-message: "publish new versions" - labels: "version updates" - branch: "release" + title: 'Publish New Versions (${{ github.ref_name }})' + commit-message: 'publish new versions' + labels: 'version updates' + branch: 'ci/release-${{ github.ref_name }}' body: ${{ steps.covector.outputs.change }} diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml new file mode 100644 index 00000000..bd378799 --- /dev/null +++ b/.github/workflows/fmt.yml @@ -0,0 +1,59 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT + +name: check formatting + +on: + pull_request: + +jobs: + rustfmt: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: install Rust stable and rustfmt + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + + - name: run cargo fmt + run: cargo fmt --all -- --check + + prettier: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Cache pnpm modules + uses: actions/cache@v4 + with: + path: ~/.pnpm-store + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}- + - uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + - uses: pnpm/action-setup@v4 + with: + version: 9.x.x + run_install: true + - run: pnpm format:check + + taplo: + name: taplo (.toml files) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: install Rust stable + uses: dtolnay/rust-toolchain@stable + + - name: install taplo-cli + uses: taiki-e/install-action@v2 + with: + tool: taplo-cli + + - run: taplo fmt --check --diff diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index f616ef6f..fbbca96a 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -10,15 +10,15 @@ on: - v1 - v2 paths: - - ".github/workflows/integration-tests.yml" - - "plugins/updater/src/**" + - '.github/workflows/integration-tests.yml' + - 'plugins/updater/src/**' pull_request: branches: - v1 - v2 paths: - - ".github/workflows/integration-tests.yml" - - "plugins/updater/src/**" + - '.github/workflows/integration-tests.yml' + - 'plugins/updater/src/**' jobs: run-integration-tests: @@ -27,23 +27,21 @@ jobs: strategy: fail-fast: false matrix: - platform: [ubuntu-latest, macos-latest, windows-latest] + platform: [ubuntu-22.04, macos-latest, windows-latest] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: install stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable + uses: dtolnay/rust-toolchain@stable - name: install Linux dependencies - if: matrix.platform == 'ubuntu-latest' + if: matrix.platform == 'ubuntu-22.04' run: | sudo apt-get update - sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev libfuse2 + sudo apt-get install -y webkit2gtk-4.0 libwebkit2gtk-4.1-dev libayatana-appindicator3-dev libfuse2 - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/lint-javascript.yml b/.github/workflows/lint-javascript.yml index 02b96541..df6b17d9 100644 --- a/.github/workflows/lint-javascript.yml +++ b/.github/workflows/lint-javascript.yml @@ -10,23 +10,23 @@ on: - v1 - v2 paths: - - ".github/workflows/lint-javascript.yml" - - "plugins/*/guest-js/**" - - ".eslintignore" - - ".eslintrc.json" - - ".prettierignore" - - "**/package.json" + - '.github/workflows/lint-javascript.yml' + - 'plugins/*/guest-js/**' + - '.eslintignore' + - '.eslintrc.json' + - '.prettierignore' + - '**/package.json' pull_request: branches: - v1 - v2 paths: - - ".github/workflows/lint-javascript.yml" - - "plugins/*/guest-js/**" - - ".eslintignore" - - ".eslintrc.json" - - ".prettierignore" - - "**/package.json" + - '.github/workflows/lint-javascript.yml' + - 'plugins/*/guest-js/**' + - '.eslintignore' + - '.eslintrc.json' + - '.prettierignore' + - '**/package.json' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -36,40 +36,20 @@ jobs: eslint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Cache pnpm modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.pnpm-store key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}- - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18 - - uses: pnpm/action-setup@v2 + node-version: 'lts/*' + - uses: pnpm/action-setup@v4 with: - version: 7.x.x + version: 9.x.x run_install: true - name: eslint run: pnpm lint - prettier: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Cache pnpm modules - uses: actions/cache@v3 - with: - path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}- - - uses: actions/setup-node@v3 - with: - node-version: 18 - - uses: pnpm/action-setup@v2 - with: - version: 7.x.x - run_install: true - - name: prettier check - run: pnpm format-check diff --git a/.github/workflows/lint-rust.yml b/.github/workflows/lint-rust.yml index b2e2a933..d9e0c50c 100644 --- a/.github/workflows/lint-rust.yml +++ b/.github/workflows/lint-rust.yml @@ -10,19 +10,19 @@ on: - v1 - v2 paths: - - ".github/workflows/lint-rust.yml" - - "plugins/*/src/**" - - "!plugins/*/src/api-iife.js" - - "**/Cargo.toml" + - '.github/workflows/lint-rust.yml' + - 'plugins/*/src/**' + - '!plugins/*/src/api-iife.js' + - '**/Cargo.toml' pull_request: branches: - v1 - v2 paths: - - ".github/workflows/lint-rust.yml" - - "plugins/*/src/**" - - "!plugins/*/src/api-iife.js" - - "**/Cargo.toml" + - '.github/workflows/lint-rust.yml' + - 'plugins/*/src/**' + - '!plugins/*/src/api-iife.js' + - '**/Cargo.toml' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -36,14 +36,11 @@ jobs: outputs: packages: ${{ steps.filter.outputs.changes }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dorny/paths-filter@v2 id: filter with: filters: | - tauri-plugin-authenticator: - - .github/workflows/lint-rust.yml - - plugins/authenticator/** tauri-plugin-autostart: - .github/workflows/lint-rust.yml - plugins/autostart/** @@ -53,6 +50,9 @@ jobs: tauri-plugin-clipboard-manager: - .github/workflows/lint-rust.yml - plugins/clipboard-manager/** + tauri-plugin-deep-link: + - .github/workflows/lint-rust.yml + - plugins/deep-link/** tauri-plugin-dialog: - .github/workflows/lint-rust.yml - plugins/dialog/** @@ -60,9 +60,15 @@ jobs: tauri-plugin-fs: - .github/workflows/lint-rust.yml - plugins/fs/** + tauri-plugin-geolocation: + - .github/workflows/lint-rust.yml + - plugins/geolocation/** tauri-plugin-global-shortcut: - .github/workflows/lint-rust.yml - plugins/global-shortcut/** + tauri-plugin-haptics: + - .github/workflows/lint-rust.yml + - plugins/haptics/** tauri-plugin-http: - .github/workflows/lint-rust.yml - plugins/http/** @@ -120,19 +126,19 @@ jobs: clippy: needs: changes if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: package: ${{ fromJSON(needs.changes.outputs.packages) }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: install webkit2gtk and libudev for [authenticator] + - name: install webkit2gtk run: | sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libudev-dev + sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev - name: Install clippy with stable toolchain uses: dtolnay/rust-toolchain@stable @@ -141,32 +147,8 @@ jobs: - uses: Swatinem/rust-cache@v2 - - name: create dummy dist - working-directory: examples/api - run: mkdir dist - - name: clippy ${{ matrix.package }} - if: matrix.package != 'tauri-plugin-sql' run: cargo clippy --package ${{ matrix.package }} --all-targets -- -D warnings - - name: clippy ${{ matrix.package }} mysql - if: matrix.package == 'tauri-plugin-sql' - run: cargo clippy --package ${{ matrix.package }} --all-targets --no-default-features --features mysql -- -D warnings - - - name: clippy ${{ matrix.package }} postgres - if: matrix.package == 'tauri-plugin-sql' - run: cargo clippy --package ${{ matrix.package }} --all-targets --no-default-features --features postgres -- -D warnings - - fmt: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Install rustfmt with nightly toolchain - uses: dtolnay/rust-toolchain@nightly - with: - components: rustfmt - - - name: Check formatting - run: cargo fmt --all -- --check + - name: clippy ${{ matrix.package }} --all-features + run: cargo clippy --package ${{ matrix.package }} --all-targets --all-features -- -D warnings diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index b34ccc7c..3b8e70db 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -19,26 +19,26 @@ jobs: sync-to-mirrors: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Fetch git tags run: git fetch origin 'refs/tags/*:refs/tags/*' - name: Cache pnpm modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.pnpm-store key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}- - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 'lts/*' - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: - version: 7.x.x + version: 9.x.x run_install: true - name: Build packages diff --git a/.github/workflows/test-rust.yml b/.github/workflows/test-rust.yml index ead80be3..3793160d 100644 --- a/.github/workflows/test-rust.yml +++ b/.github/workflows/test-rust.yml @@ -10,21 +10,21 @@ on: - v1 - v2 paths: - - ".github/workflows/test-rust.yml" - - "plugins/*/src/**" - - "!plugins/*/src/api-iife.js" - - "**/Cargo.toml" - - "**/Cargo.lock" + - '.github/workflows/test-rust.yml' + - 'plugins/*/src/**' + - '!plugins/*/src/api-iife.js' + - '**/Cargo.toml' + - '**/Cargo.lock' pull_request: branches: - v1 - v2 paths: - - ".github/workflows/test-rust.yml" - - "plugins/*/src/**" - - "!plugins/*/src/api-iife.js" - - "**/Cargo.toml" - - "**/Cargo.lock" + - '.github/workflows/test-rust.yml' + - 'plugins/*/src/**' + - '!plugins/*/src/api-iife.js' + - '**/Cargo.toml' + - '**/Cargo.lock' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -38,85 +38,118 @@ jobs: outputs: packages: ${{ steps.filter.outputs.changes }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dorny/paths-filter@v2 id: filter with: + base: v2 filters: | - tauri-plugin-authenticator: - - .github/workflows/test-rust.yml - - plugins/authenticator/** tauri-plugin-autostart: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/autostart/** tauri-plugin-cli: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/cli/** tauri-plugin-clipboard-manager: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/clipboard-manager/** + tauri-plugin-deep-link: + - .github/workflows/test-rust.yml + - Cargo.toml + - plugins/deep-link/** tauri-plugin-dialog: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/dialog/** - plugins/fs/** tauri-plugin-fs: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/fs/** + tauri-plugin-geolocation: + - .github/workflows/test-rust.yml + - Cargo.toml + - plugins/geolocation/** tauri-plugin-global-shortcut: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/global-shortcut/** + tauri-plugin-haptics: + - .github/workflows/test-rust.yml + - Cargo.toml + - plugins/haptics/** tauri-plugin-http: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/http/** - plugins/fs/** tauri-plugin-localhost: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/localhost/** tauri-plugin-log: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/log/** tauri-plugin-notification: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/notification/** tauri-plugin-os: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/os/** tauri-plugin-persisted-scope: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/persisted-scope/** - plugins/fs/** tauri-plugin-positioner: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/positioner/** tauri-plugin-process: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/process/** tauri-plugin-shell: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/shell/** tauri-plugin-single-instance: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/single-instance/** tauri-plugin-sql: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/sql/** tauri-plugin-store: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/store/** tauri-plugin-stronghold: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/stronghold/** tauri-plugin-updater: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/updater/** tauri-plugin-upload: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/upload/** tauri-plugin-websocket: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/websocket/** tauri-plugin-window-state: - .github/workflows/test-rust.yml + - Cargo.toml - plugins/window-state/** test: @@ -131,51 +164,45 @@ jobs: target: x86_64-pc-windows-msvc, os: windows-latest, runner: 'cargo', - command: "test", + command: 'test' } - { target: x86_64-unknown-linux-gnu, - os: ubuntu-latest, + os: ubuntu-22.04, runner: 'cargo', - command: "test", + command: 'test' } - { - target: x86_64-apple-darwin, + target: aarch64-apple-darwin, os: macos-latest, runner: 'cargo', - command: "test", + command: 'test' } - { target: aarch64-apple-ios, os: macos-latest, runner: 'cargo', - command: "build", + command: 'build' } - { target: aarch64-linux-android, os: ubuntu-latest, runner: 'cross', - command: "build", + command: 'build' } runs-on: ${{ matrix.platform.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: install webkit2gtk and libudev for [authenticator] + - name: install webkit2gtk if: contains(matrix.platform.target, 'unknown-linux') run: | sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libudev-dev + sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev - - name: install openssl - if: ${{ matrix.platform.os == 'windows-latest' && matrix.package == 'tauri-plugin-authenticator' }} - run: | - echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append - vcpkg install openssl:x64-windows-static-md - - - uses: dtolnay/rust-toolchain@1.75.0 + - uses: dtolnay/rust-toolchain@1.77.2 with: targets: ${{ matrix.platform.target }} @@ -183,30 +210,14 @@ jobs: with: key: cache-${{ matrix.package }}-${{ matrix.platform.target }} - - name: create dummy dist - working-directory: examples/api - run: mkdir dist - - name: install cross if: ${{ matrix.platform.runner == 'cross' }} run: cargo +stable install cross --git https://github.com/cross-rs/cross - name: test ${{ matrix.package }} - if: matrix.package != 'tauri-plugin-sql' && matrix.package != 'tauri-plugin-http' + if: matrix.package != 'tauri-plugin-http' run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --all-features - name: test ${{ matrix.package }} if: matrix.package == 'tauri-plugin-http' run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets - - - name: test ${{ matrix.package }} sqlite - if: matrix.package == 'tauri-plugin-sql' - run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --features sqlite - - - name: test ${{ matrix.package }} mysql - if: matrix.package == 'tauri-plugin-sql' - run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --features mysql - - - name: test ${{ matrix.package }} postgres - if: matrix.package == 'tauri-plugin-sql' - run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --features postgres diff --git a/.gitignore b/.gitignore index f8932e56..72e5a397 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,58 @@ -target -node_modules -dist-js -dist \ No newline at end of file +# dependency directories +node_modules/ +target/ + +# Optional npm and yarn cache directory +.npm/ +.yarn/ + +# Output of 'npm pack' +*.tgz + +# dotenv environment variables file +.env + +# .vscode workspace settings file +.vscode/settings.json + +# npm, yarn and bun lock files +package-lock.json +yarn.lock +bun.lockb + +# rust compiled folders +target/ + +# compiled plugins +dist-js/ + +# plugins .tauri directory +/plugins/*/.tauri + +# examples +examples/*/dist +plugins/*/examples/*/dist +examples/*/src-tauri/gen/schemas +plugins/*/examples/*/src-tauri/gen/schemas + +# logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# runtime data +pids +*.pid +*.seed +*.pid.lock + +# miscellaneous +/.vs +.DS_Store +.Thumbs.db +*.sublime* +.idea +debug.log +TODO.md \ No newline at end of file diff --git a/.npmrc b/.npmrc index f87a0443..30ab299d 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1 @@ -auto-install-peers=true \ No newline at end of file +link-workspace-packages=true diff --git a/.prettierignore b/.prettierignore index c5d0524a..bc4fca6d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,12 +1,27 @@ -target -node_modules -dist -dist-js +/.changes +/.vscode + +# dependcies and artifacts directories +node_modules/ +target/ +dist-js/ +dist/ + +# lock files pnpm-lock.yaml -Cargo.lock -.build -build + +# examples gen directory +examples/*/src-tauri/gen/ +plugins/*/examples/*/src-tauri/gen/ + +# autogenerated files +**/autogenerated/**/*.md api-iife.js init-iife.js -intermediates/ -*schema.json \ No newline at end of file +CHANGELOG.md +*schema.json + +# mobile build +**/ios/.build +**/.tauri +plugins/*/android/build diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..299b9e14 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "semi": false, + "trailingComma": "none" +} diff --git a/.scripts/ci/check-license-header.js b/.scripts/ci/check-license-header.js index 7c69bb33..ed653809 100644 --- a/.scripts/ci/check-license-header.js +++ b/.scripts/ci/check-license-header.js @@ -2,129 +2,129 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import fs from "fs"; -import path from "path"; -import readline from "readline"; +import fs from 'fs' +import path from 'path' +import readline from 'readline' const header = `Copyright 2019-2023 Tauri Programme within The Commons Conservancy SPDX-License-Identifier: Apache-2.0 -SPDX-License-Identifier: MIT`; +SPDX-License-Identifier: MIT` const ignoredLicenses = [ - "// Copyright 2021 Flavio Oliveira", - "// Copyright 2021 Jonas Kruckenberg", - "// Copyright 2018-2023 the Deno authors.", -]; + '// Copyright 2021 Flavio Oliveira', + '// Copyright 2021 Jonas Kruckenberg', + '// Copyright 2018-2023 the Deno authors.' +] -const extensions = [".rs", ".js", ".ts", ".yml", ".swift", ".kt"]; +const extensions = ['.rs', '.js', '.ts', '.yml', '.swift', '.kt'] const ignore = [ - "target", - "templates", - "node_modules", - "gen", - "dist", - "dist-js", - ".svelte-kit", - "api-iife.js", - "init-iife.js", - ".build", - "notify_rust", -]; + 'target', + 'templates', + 'node_modules', + 'gen', + 'dist', + 'dist-js', + '.svelte-kit', + 'api-iife.js', + 'init-iife.js', + '.build', + 'notify_rust' +] async function checkFile(file) { if ( extensions.some((e) => file.endsWith(e)) && !ignore.some((i) => file.includes(`${path.sep}${i}`)) ) { - const fileStream = fs.createReadStream(file); + const fileStream = fs.createReadStream(file) const rl = readline.createInterface({ input: fileStream, - crlfDelay: Infinity, - }); + crlfDelay: Infinity + }) - let contents = ``; - let i = 0; + let contents = `` + let i = 0 for await (let line of rl) { // ignore empty lines, allow shebang, swift-tools-version and bundler license if ( line.length === 0 || - line.startsWith("#!") || - line.startsWith("// swift-tools-version:") || + line.startsWith('#!') || + line.startsWith('// swift-tools-version:') || ignoredLicenses.includes(line) ) { - continue; + continue } // strip comment marker - if (line.startsWith("// ")) { - line = line.substring(3); - } else if (line.startsWith("# ")) { - line = line.substring(2); + if (line.startsWith('// ')) { + line = line.substring(3) + } else if (line.startsWith('# ')) { + line = line.substring(2) } - contents += line; + contents += line if (++i === 3) { - break; + break } - contents += "\n"; + contents += '\n' } if (contents !== header) { - return true; + return true } } - return false; + return false } async function check(src) { - const missingHeader = []; + const missingHeader = [] for (const entry of fs.readdirSync(src, { - withFileTypes: true, + withFileTypes: true })) { - const p = path.join(src, entry.name); + const p = path.join(src, entry.name) if (entry.isSymbolicLink() || ignore.includes(entry.name)) { - continue; + continue } if (entry.isDirectory()) { - const missing = await check(p); - missingHeader.push(...missing); + const missing = await check(p) + missingHeader.push(...missing) } else { - const isMissing = await checkFile(p); + const isMissing = await checkFile(p) if (isMissing) { - missingHeader.push(p); + missingHeader.push(p) } } } - return missingHeader; + return missingHeader } -const [_bin, _script, ...files] = process.argv; +const [_bin, _script, ...files] = process.argv if (files.length > 0) { async function run() { - const missing = []; + const missing = [] for (const f of files) { - const isMissing = await checkFile(f); + const isMissing = await checkFile(f) if (isMissing) { - missing.push(f); + missing.push(f) } } if (missing.length > 0) { - console.log(missing.join("\n")); - process.exit(1); + console.log(missing.join('\n')) + process.exit(1) } } - run(); + run() } else { - check(path.resolve(new URL(import.meta.url).pathname, "../../..")).then( + check(path.resolve(new URL(import.meta.url).pathname, '../../..')).then( (missing) => { if (missing.length > 0) { - console.log(missing.join("\n")); - process.exit(1); + console.log(missing.join('\n')) + process.exit(1) } - }, - ); + } + ) } diff --git a/.scripts/ci/has-diff.sh b/.scripts/ci/has-diff.sh index dd40c06f..1f18ac64 100755 --- a/.scripts/ci/has-diff.sh +++ b/.scripts/ci/has-diff.sh @@ -5,5 +5,6 @@ then echo "working directory is clean" else echo "found diff" + git diff --name-status HEAD exit 1 fi diff --git a/.scripts/covector/package-latest-version.cjs b/.scripts/covector/package-latest-version.cjs deleted file mode 100644 index fde1d4c0..00000000 --- a/.scripts/covector/package-latest-version.cjs +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env node -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -/* -This script is solely intended to be run as part of the `covector publish` step to -check the latest version of a crate, considering the current minor version. -*/ - -const https = require("https"); - -const kind = process.argv[2]; -const packageName = process.argv[3]; -const packageVersion = process.argv[4]; -const target = packageVersion.substring(0, packageVersion.lastIndexOf(".")); - -let url = null; -switch (kind) { - case "cargo": - url = `https://crates.io/api/v1/crates/${packageName}`; - break; - case "npm": - url = `https://registry.npmjs.org/${packageName}`; - break; - default: - throw new Error("unexpected kind " + kind); -} - -const options = { - headers: { - "Content-Type": "application/json", - Accept: "application/json", - "User-Agent": "tauri (https://github.com/tauri-apps/tauri)", - }, -}; - -https.get(url, options, (response) => { - let chunks = []; - response.on("data", function (chunk) { - chunks.push(chunk); - }); - - response.on("end", function () { - const data = JSON.parse(chunks.join("")); - if (kind === "cargo") { - if (data.versions) { - const versions = data.versions.filter((v) => v.num.startsWith(target)); - console.log(versions.length ? versions[0].num : "0.0.0"); - } else { - console.log("0.0.0"); - } - } else if (kind === "npm") { - const versions = Object.keys(data.versions || {}).filter((v) => - v.startsWith(target), - ); - console.log(versions[versions.length - 1] || "0.0.0"); - } - }); -}); diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..68acfc90 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "rust-lang.rust-analyzer", + "EditorConfig.EditorConfig", + "esbenp.prettier-vscode", + "tamasfe.even-better-toml" + ] +} diff --git a/Cargo.lock b/Cargo.lock index e51b1053..7a57f09f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,11 +2,17 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" + [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] @@ -18,13 +24,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] -name = "aead" -version = "0.4.3" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" -dependencies = [ - "generic-array", -] +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "adler32" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] name = "aead" @@ -36,18 +45,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "aes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" -dependencies = [ - "cfg-if", - "cipher 0.3.0", - "cpufeatures", - "opaque-debug", -] - [[package]] name = "aes" version = "0.8.4" @@ -55,35 +52,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", - "cipher 0.4.4", + "cipher", "cpufeatures", ] -[[package]] -name = "aes-gcm" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc3be92e19a7ef47457b8e6f90707e12b6ac5d20c6f3866584fa3be0787d839f" -dependencies = [ - "aead 0.4.3", - "aes 0.7.5", - "cipher 0.3.0", - "ctr 0.7.0", - "ghash 0.4.4", - "subtle", -] - [[package]] name = "aes-gcm" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ - "aead 0.5.2", - "aes 0.8.4", - "cipher 0.4.4", - "ctr 0.9.2", - "ghash 0.5.0", + "aead", + "aes", + "cipher", + "ctr", + "ghash", "subtle", ] @@ -93,19 +76,18 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", "once_cell", "version_check", ] [[package]] name = "ahash" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b79b82693f705137f8fb9b37871d99e4f9a7df12b917eed79c3d3954830a60b" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom 0.2.12", "once_cell", "version_check", "zerocopy", @@ -113,13 +95,19 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] +[[package]] +name = "aligned-vec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aa90d7ce82d4be67b64039a3d588d38dbcc6736577de4a847025ce5b0c468d1" + [[package]] name = "alloc-no-stdlib" version = "2.0.4" @@ -137,9 +125,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -149,20 +137,19 @@ checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" [[package]] name = "android_log-sys" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85965b6739a430150bdd138e2374a98af0c3ee0d030b3bb7fc3bddff58d0102e" +checksum = "5ecc8056bf6ab9892dcd53216c83d1597487d7dacac16c8df6b877d127df9937" [[package]] name = "android_logger" -version = "0.11.3" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8619b80c242aa7bd638b5c7ddd952addeecb71f69c75e33f1d47b2804f8f883a" +checksum = "05b07e8e73d720a1f2e4b6014766e6039fd2e96a4fa44e2a78d0e1fa2ff49826" dependencies = [ "android_log-sys", - "env_logger", + "env_filter", "log", - "once_cell", ] [[package]] @@ -176,47 +163,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -224,13 +212,13 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.80" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "api" -version = "2.0.0-beta.1" +version = "2.0.4" dependencies = [ "log", "serde", @@ -243,7 +231,9 @@ dependencies = [ "tauri-plugin-clipboard-manager", "tauri-plugin-dialog", "tauri-plugin-fs", + "tauri-plugin-geolocation", "tauri-plugin-global-shortcut", + "tauri-plugin-haptics", "tauri-plugin-http", "tauri-plugin-log", "tauri-plugin-nfc", @@ -251,9 +241,10 @@ dependencies = [ "tauri-plugin-os", "tauri-plugin-process", "tauri-plugin-shell", + "tauri-plugin-store", "tauri-plugin-updater", - "tiny_http 0.11.0", - "window-shadows", + "tauri-plugin-window-state", + "tiny_http", ] [[package]] @@ -266,45 +257,81 @@ dependencies = [ "tauri-build", "tauri-plugin-updater", "time", - "tiny_http 0.11.0", + "tiny_http", +] + +[[package]] +name = "app-updater-v2" +version = "0.1.0" +dependencies = [ + "serde", + "serde_json", + "tauri", + "tauri-build", + "tauri-plugin-updater", + "tiny_http", +] + +[[package]] +name = "app_settings_manager" +version = "0.0.0" +dependencies = [ + "serde", + "serde_json", + "tauri", + "tauri-build", + "tauri-plugin-store", +] + +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +dependencies = [ + "derive_arbitrary", ] [[package]] name = "arboard" -version = "3.3.1" +version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1faa3c733d9a3dd6fbaf85da5d162a2e03b2e0033a90dceb0e2a90fdd1e5380a" +checksum = "df099ccb16cd014ff054ac1bf392c67feeef57164b05c42f037cd40f5d4357f4" dependencies = [ "clipboard-win", - "core-graphics 0.23.1", + "core-graphics 0.23.2", "image", "log", - "objc", - "objc-foundation", - "objc_id", + "objc2", + "objc2-app-kit", + "objc2-foundation", "parking_lot", - "thiserror", "windows-sys 0.48.0", "x11rb", ] [[package]] -name = "arrayref" -version = "0.3.7" +name = "arg_enum_proc_macro" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] [[package]] -name = "arrayvec" -version = "0.7.4" +name = "arrayref" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] -name = "as-raw-xcb-connection" -version = "1.0.1" +name = "arrayvec" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii" @@ -314,18 +341,22 @@ checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" [[package]] name = "ashpd" -version = "0.8.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b22517ee647547c01a687cf9b76074e1c91334032a4324f7243c6ee0f949390" +checksum = "4d43c03d9e36dd40cab48435be0b09646da362c278223ca535493877b2c1dee9" dependencies = [ "enumflags2", "futures-channel", "futures-util", "rand 0.8.5", + "raw-window-handle", "serde", "serde_repr", "tokio", "url", + "wayland-backend", + "wayland-client", + "wayland-protocols", "zbus", ] @@ -341,36 +372,35 @@ dependencies = [ [[package]] name = "async-broadcast" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258b52a1aa741b9f09783b2d86cf0aeeb617bbf847f6933340a39644227acbdb" +checksum = "20cd0e2e25ea8e5f7e9df04578dc6cf5c83577fd09b1a46aaf5c85e1c33f2a7e" dependencies = [ - "event-listener 5.1.0", - "event-listener-strategy 0.5.0", + "event-listener", + "event-listener-strategy", "futures-core", "pin-project-lite", ] [[package]] name = "async-channel" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener 5.1.0", - "event-listener-strategy 0.5.0", + "event-listener-strategy", "futures-core", "pin-project-lite", ] [[package]] name = "async-compression" -version = "0.4.6" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a116f46a969224200a0a97f29cfd4c50e7534e4b4826bd23ea2c3c533039c82c" +checksum = "103db485efc3e41214fe4fda9f3dbeae2eb9082f48fd236e6095627a9422066e" dependencies = [ - "brotli", + "brotli 7.0.0", "flate2", "futures-core", "memchr", @@ -380,11 +410,10 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.8.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" dependencies = [ - "async-lock 3.3.0", "async-task", "concurrent-queue", "fastrand", @@ -394,22 +423,22 @@ dependencies = [ [[package]] name = "async-fs" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc19683171f287921f2405677dd2ed2549c3b3bda697a563ebc3a121ace2aba1" +checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" dependencies = [ - "async-lock 3.3.0", + "async-lock", "blocking", "futures-lite", ] [[package]] name = "async-io" -version = "2.3.1" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" +checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" dependencies = [ - "async-lock 3.3.0", + "async-lock", "cfg-if", "concurrent-queue", "futures-io", @@ -419,66 +448,58 @@ dependencies = [ "rustix", "slab", "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", + "windows-sys 0.59.0", ] [[package]] name = "async-lock" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", + "event-listener", + "event-listener-strategy", "pin-project-lite", ] [[package]] name = "async-process" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451e3cf68011bd56771c79db04a9e333095ab6349f7e47592b788e9b98720cc8" +checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb" dependencies = [ "async-channel", "async-io", - "async-lock 3.3.0", + "async-lock", "async-signal", + "async-task", "blocking", "cfg-if", - "event-listener 5.1.0", + "event-listener", "futures-lite", "rustix", - "windows-sys 0.52.0", + "tracing", ] [[package]] name = "async-recursion" -version = "1.0.5" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] name = "async-signal" -version = "0.2.5" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" dependencies = [ "async-io", - "async-lock 2.8.0", + "async-lock", "atomic-waker", "cfg-if", "futures-core", @@ -486,24 +507,24 @@ dependencies = [ "rustix", "signal-hook-registry", "slab", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "async-task" -version = "4.7.0" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] @@ -513,7 +534,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4af014b17dd80e8af9fa689b2d4a211ddba6eb583c1622f35d0cb543f6b17e4" dependencies = [ "atk-sys", - "glib 0.18.5", + "glib", "libc", ] @@ -523,8 +544,8 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "251e0b7d90e33e0ba930891a505a9a35ece37b2dd37a14f3ffc306c13b980009" dependencies = [ - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "glib-sys", + "gobject-sys", "libc", "system-deps", ] @@ -545,75 +566,66 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] -name = "atomic-write-file" -version = "0.1.2" +name = "auto-launch" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edcdbedc2236483ab103a53415653d6b4442ea6141baf1ffa85df29635e88436" +checksum = "1f012b8cc0c850f34117ec8252a44418f2e34a2cf501de89e29b241ae5f79471" dependencies = [ - "nix 0.27.1", - "rand 0.8.5", + "dirs 4.0.0", + "thiserror", + "winreg 0.10.1", ] [[package]] -name = "atty" -version = "0.2.14" +name = "autocfg" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi 0.3.9", -] +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] -name = "authenticator" -version = "0.3.1" +name = "av1-grain" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08cee7a0952628fde958e149507c2bb321ab4fccfafd225da0b20adc956ef88a" +checksum = "6678909d8c5d46a42abcf571271e15fdbc0a225e3646cf23762cd415046c78bf" dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "devd-rs", - "libc", - "libudev", + "anyhow", + "arrayvec", "log", - "rand 0.7.3", - "runloop", - "winapi 0.3.9", + "nom", + "num-rational", + "v_frame", ] [[package]] -name = "auto-launch" -version = "0.5.0" +name = "avif-serialize" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f012b8cc0c850f34117ec8252a44418f2e34a2cf501de89e29b241ae5f79471" +checksum = "e335041290c43101ca215eed6f43ec437eb5a42125573f600fc3fa42b9bddd62" dependencies = [ - "dirs", - "thiserror", - "winreg 0.10.1", + "arrayvec", ] -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.8.0", "object", "rustc-demangle", + "windows-targets 0.52.6", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "base64" version = "0.13.1" @@ -626,6 +638,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -655,13 +673,19 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "serde", ] +[[package]] +name = "bitstream-io" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b81e1519b0d82120d2fd469d5bfb2919a9361c48b02d82d04befc1cdd2002452" + [[package]] name = "bitvec" version = "1.0.1" @@ -680,7 +704,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "digest 0.10.7", + "digest", ] [[package]] @@ -691,7 +715,7 @@ checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", "arrayvec", - "constant_time_eq 0.3.0", + "constant_time_eq 0.3.1", ] [[package]] @@ -702,36 +726,42 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "block-buffer" -version = "0.9.0" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] [[package]] -name = "block-buffer" -version = "0.10.4" +name = "block-padding" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" dependencies = [ "generic-array", ] +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2", +] + [[package]] name = "blocking" -version = "1.5.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ "async-channel", - "async-lock 3.3.0", "async-task", - "fastrand", "futures-io", "futures-lite", "piper", - "tracing", ] [[package]] @@ -754,15 +784,26 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", "syn_derive", ] [[package]] name = "brotli" -version = "3.4.0" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" +checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -771,19 +812,25 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.5.1" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" +checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", ] +[[package]] +name = "built" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "236e6289eda5a812bc6b53c3b024039382a2895fbbeef2d748b2931546d392c4" + [[package]] name = "bumpalo" -version = "3.15.3" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-unit" @@ -820,23 +867,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.5.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.51", -] +checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d" [[package]] name = "byteorder" @@ -845,33 +878,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] -name = "bytes" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" -dependencies = [ - "serde", -] - -[[package]] -name = "bzip2" -version = "0.4.4" +name = "byteorder-lite" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" +name = "bytes" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" dependencies = [ - "cc", - "libc", - "pkg-config", + "serde", ] [[package]] @@ -880,9 +898,9 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "cairo-sys-rs", - "glib 0.18.5", + "glib", "libc", "once_cell", "thiserror", @@ -894,25 +912,25 @@ version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" dependencies = [ - "glib-sys 0.18.1", + "glib-sys", "libc", "system-deps", ] [[package]] name = "camino" -version = "1.1.6" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ "serde", ] @@ -943,11 +961,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.88" +version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" +checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ "libc", + "shlex", ] [[package]] @@ -969,9 +988,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" dependencies = [ "smallvec", "target-lexicon", @@ -991,48 +1010,45 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "cfg_aliases" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77e53693616d3075149f4ead59bdeecd204ac6b8192d8969757601b74bddf00f" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chacha20" -version = "0.8.2" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ "cfg-if", - "cipher 0.3.0", + "cipher", "cpufeatures", - "zeroize", ] [[package]] name = "chacha20poly1305" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ - "aead 0.4.3", + "aead", "chacha20", - "cipher 0.3.0", + "cipher", "poly1305", "zeroize", ] [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", - "js-sys", "num-traits", "serde", - "wasm-bindgen", - "windows-targets 0.52.3", + "windows-targets 0.52.6", ] [[package]] @@ -1041,15 +1057,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e4de3bc4ea267985becf712dc6d9eed8b04c953b3fcfb339ebc87acd9804901" -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array", -] - [[package]] name = "cipher" version = "0.4.4" @@ -1058,97 +1065,81 @@ checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ "crypto-common", "inout", + "zeroize", ] [[package]] name = "clap" -version = "4.5.1" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.1" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.0", + "strsim", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "clipboard-win" -version = "5.2.0" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f9a0700e0127ba15d1d52dd742097f821cd9c65939303a44d970465040a297" +checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" dependencies = [ "error-code", ] [[package]] name = "cocoa" -version = "0.24.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" +checksum = "f79398230a6e2c08f5c9760610eb6924b52aa9e7950a619602baba59dcbbdbb2" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "block", "cocoa-foundation", - "core-foundation", - "core-graphics 0.22.3", - "foreign-types 0.3.2", - "libc", - "objc", -] - -[[package]] -name = "cocoa" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c" -dependencies = [ - "bitflags 1.3.2", - "block", - "cocoa-foundation", - "core-foundation", - "core-graphics 0.23.1", - "foreign-types 0.5.0", + "core-foundation 0.10.0", + "core-graphics 0.24.0", + "foreign-types 0.5.0", "libc", "objc", ] [[package]] name = "cocoa-foundation" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" +checksum = "e14045fb83be07b5acf1c0884b2180461635b433455fa35d1cd6f17f1450679d" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "block", - "core-foundation", - "core-graphics-types", + "core-foundation 0.10.0", + "core-graphics-types 0.2.0", "libc", "objc", ] [[package]] name = "color-backtrace" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd6c04463c99389fff045d2b90ce84f5131332712c7ffbede020f5e9ad1ed685" +checksum = "150fd80a270c0671379f388c8204deb6a746bb4eac8a6c03fe2460b2c0127ea0" dependencies = [ - "atty", "backtrace", "termcolor", ] @@ -1161,9 +1152,9 @@ checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "colored" @@ -1173,7 +1164,7 @@ checksum = "5a5f741c91823341bebf717d4c71bda820630ce065443b58bd1b7451af008355" dependencies = [ "is-terminal", "lazy_static", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1188,9 +1179,9 @@ dependencies = [ [[package]] name = "combine" -version = "4.6.6" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ "bytes", "memchr", @@ -1198,9 +1189,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -1211,6 +1202,26 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom 0.2.15", + "once_cell", + "tiny-keccak", +] + [[package]] name = "constant_time_eq" version = "0.1.5" @@ -1219,9 +1230,9 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "constant_time_eq" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "convert_case" @@ -1231,9 +1242,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "cookie" -version = "0.17.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7efb37c3e1ccb1ff97164ad95ac1606e8ccd35b3fa0a7d99a304c7f4a428cc24" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" dependencies = [ "percent-encoding", "time", @@ -1242,12 +1253,12 @@ dependencies = [ [[package]] name = "cookie_store" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387461abbc748185c3a6e1673d826918b450b87ff22639429c694619a83b6cf6" +checksum = "4934e6b7e8419148b6ef56950d277af8561060b56afd59e2aadf98b59fce6baa" dependencies = [ "cookie", - "idna 0.3.0", + "idna 0.5.0", "log", "publicsuffix", "serde", @@ -1267,34 +1278,44 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "core-graphics" -version = "0.22.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" dependencies = [ "bitflags 1.3.2", - "core-foundation", - "core-graphics-types", - "foreign-types 0.3.2", + "core-foundation 0.9.4", + "core-graphics-types 0.1.3", + "foreign-types 0.5.0", "libc", ] [[package]] name = "core-graphics" -version = "0.23.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "970a29baf4110c26fedbc7f82107d42c23f7e88e404c4577ed73fe99ff85a212" +checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1" dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-graphics-types", + "bitflags 2.6.0", + "core-foundation 0.10.0", + "core-graphics-types 0.2.0", "foreign-types 0.5.0", "libc", ] @@ -1306,24 +1327,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" dependencies = [ "bitflags 1.3.2", - "core-foundation", + "core-foundation 0.9.4", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" +dependencies = [ + "bitflags 2.6.0", + "core-foundation 0.10.0", "libc", ] +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] [[package]] name = "crc" -version = "3.0.1" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" dependencies = [ "crc-catalog", ] @@ -1336,18 +1377,18 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.11" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] @@ -1382,9 +1423,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -1392,6 +1433,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -1427,26 +1480,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] name = "ctor" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad291aa74992b9b7a7e88c38acbbf6ad7e107f1d90ee8775b7bc1fc3394f485c" +checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.51", -] - -[[package]] -name = "ctr" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a232f92a03f37dd7d7dd2adc67166c77e9cd88de5b019b9a9eecfaeaf7bfd481" -dependencies = [ - "cipher 0.3.0", + "syn 2.0.79", ] [[package]] @@ -1455,27 +1499,41 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" dependencies = [ - "cipher 0.4.4", + "cipher", ] [[package]] name = "curve25519-dalek" -version = "3.2.0" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", "subtle", "zeroize", ] +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "darling" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ "darling_core", "darling_macro", @@ -1483,34 +1541,40 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", - "syn 2.0.51", + "strsim", + "syn 2.0.79", ] [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.51", + "syn 2.0.79", ] +[[package]] +name = "dary_heap" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7762d17f1241643615821a8455a0b2c3e803784b058693d990b11f2dce25a0ca" + [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "data-url" @@ -1522,18 +1586,21 @@ checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" name = "deep-link-example" version = "0.0.0" dependencies = [ + "log", "serde", "serde_json", "tauri", "tauri-build", "tauri-plugin-deep-link", + "tauri-plugin-log", + "tauri-plugin-single-instance", ] [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "pem-rfc7468", @@ -1562,35 +1629,27 @@ dependencies = [ ] [[package]] -name = "derive_more" -version = "0.99.17" +name = "derive_arbitrary" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ - "convert_case", "proc-macro2", "quote", - "rustc_version", - "syn 1.0.109", -] - -[[package]] -name = "devd-rs" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9313f104b590510b46fc01c0a324fc76505c13871454d3c48490468d04c8d395" -dependencies = [ - "libc", - "nom", + "syn 2.0.79", ] [[package]] -name = "digest" -version = "0.9.0" +name = "derive_more" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ - "generic-array", + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.79", ] [[package]] @@ -1599,7 +1658,7 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.4", + "block-buffer", "const-oid", "crypto-common", "subtle", @@ -1611,7 +1670,16 @@ version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" dependencies = [ - "dirs-sys", + "dirs-sys 0.3.7", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys 0.4.1", ] [[package]] @@ -1632,7 +1700,19 @@ checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" dependencies = [ "libc", "redox_users", - "winapi 0.3.9", + "winapi", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", ] [[package]] @@ -1643,7 +1723,7 @@ checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", "redox_users", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1652,13 +1732,24 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "dlib" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.1", + "libloading 0.8.5", ] [[package]] @@ -1670,7 +1761,7 @@ dependencies = [ "dlopen2_derive", "libc", "once_cell", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1681,58 +1772,37 @@ checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] -name = "dotenvy" -version = "0.15.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "drm" -version = "0.11.1" +name = "dlv-list" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0f8a69e60d75ae7dab4ef26a59ca99f2a89d4c142089b537775ae0c198bdcde" +checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" dependencies = [ - "bitflags 2.4.2", - "bytemuck", - "drm-ffi", - "drm-fourcc", - "rustix", + "const-random", ] [[package]] -name = "drm-ffi" -version = "0.7.1" +name = "dotenvy" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41334f8405792483e32ad05fbb9c5680ff4e84491883d2947a4757dc54cb2ac6" -dependencies = [ - "drm-sys", - "rustix", -] +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] -name = "drm-fourcc" -version = "2.2.0" +name = "downcast-rs" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] -name = "drm-sys" -version = "0.6.1" +name = "dpi" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d09ff881f92f118b11105ba5e34ff8f4adf27b30dae8f12e28c193af1c83176" +checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" dependencies = [ - "libc", - "linux-raw-sys 0.6.4", + "serde", ] [[package]] @@ -1743,18 +1813,18 @@ checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" [[package]] name = "dtoa-short" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbaceec3c6e4211c79e7b1800fb9680527106beb2f9c51904a3210c03a448c74" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" dependencies = [ "dtoa", ] [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "dyn-clone" @@ -1762,41 +1832,84 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + [[package]] name = "ed25519-zebra" -version = "3.1.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", - "hashbrown 0.12.3", + "ed25519", + "hashbrown 0.14.5", "hex", "rand_core 0.6.4", - "sha2 0.9.9", + "sha2", "zeroize", ] [[package]] name = "either" -version = "1.10.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" dependencies = [ "serde", ] +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embed-resource" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bde55e389bea6a966bd467ad1ad7da0ae14546a5bc794d16d1e55e7fca44881" +checksum = "f4e24052d7be71f0efb50c201557f6fe7d237cfd5a64fd5bcd7fd8fe32dbbffa" dependencies = [ "cc", "memchr", "rustc_version", "toml 0.8.10", "vswhom", - "winreg 0.51.0", + "winreg 0.52.0", ] [[package]] @@ -1807,9 +1920,9 @@ checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -1820,23 +1933,11 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" -[[package]] -name = "enum-as-inner" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.51", -] - [[package]] name = "enumflags2" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" +checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" dependencies = [ "enumflags2_derive", "serde", @@ -1844,26 +1945,23 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" +checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] -name = "env_logger" -version = "0.10.2" +name = "env_filter" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" dependencies = [ - "humantime", - "is-terminal", "log", "regex", - "termcolor", ] [[package]] @@ -1872,11 +1970,21 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "erased-serde" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" +dependencies = [ + "serde", + "typeid", +] + [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1884,9 +1992,9 @@ dependencies = [ [[package]] name = "error-code" -version = "3.2.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0474425d51df81997e2f90a21591180b38eccf27292d755f3e30750225c175b" +checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f" [[package]] name = "etcetera" @@ -1901,49 +2009,22 @@ dependencies = [ [[package]] name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "4.0.3" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", "pin-project-lite", ] -[[package]] -name = "event-listener" -version = "5.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7ad6fd685ce13acd6d9541a30f6db6567a7a24c9ffd4ba2955d29e3f22c8b27" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] - [[package]] name = "event-listener-strategy" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 5.1.0", + "event-listener", "pin-project-lite", ] @@ -1957,7 +2038,7 @@ dependencies = [ "flume", "half", "lebe", - "miniz_oxide", + "miniz_oxide 0.7.4", "rayon-core", "smallvec", "zune-inflate", @@ -1965,15 +2046,15 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fdeflate" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" +checksum = "d8090f921a24b04994d9929e204f50b498a33ea6ba559ffaa05e04f7ee7fb5ab" dependencies = [ "simd-adler32", ] @@ -1988,13 +2069,29 @@ dependencies = [ "log", ] +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + [[package]] name = "field-offset" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" dependencies = [ - "memoffset 0.9.0", + "memoffset 0.9.1", "rustc_version", ] @@ -2009,30 +2106,33 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", - "redox_syscall", - "windows-sys 0.52.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] -name = "finl_unicode" -version = "1.2.0" +name = "flate2" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.0", +] [[package]] -name = "flate2" -version = "1.0.28" +name = "fluent-uri" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "17c704e9dbe1ddd863da1e6ff3567795087b1eb201ce80d8fa81162e1516500d" dependencies = [ - "crc32fast", - "miniz_oxide", + "bitflags 1.3.2", ] [[package]] @@ -2043,7 +2143,7 @@ checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" dependencies = [ "futures-core", "futures-sink", - "spin 0.9.8", + "spin", ] [[package]] @@ -2079,7 +2179,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] @@ -2130,9 +2230,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -2145,9 +2245,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -2155,15 +2255,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -2183,15 +2283,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ "fastrand", "futures-core", @@ -2202,32 +2302,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -2260,7 +2360,7 @@ dependencies = [ "gdk-pixbuf", "gdk-sys", "gio", - "glib 0.18.5", + "glib", "libc", "pango", ] @@ -2273,7 +2373,7 @@ checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" dependencies = [ "gdk-pixbuf-sys", "gio", - "glib 0.18.5", + "glib", "libc", "once_cell", ] @@ -2284,9 +2384,9 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" dependencies = [ - "gio-sys 0.18.1", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", "system-deps", ] @@ -2299,9 +2399,9 @@ checksum = "31ff856cb3386dae1703a920f803abafcc580e9b5f711ca62ed1620c25b51ff2" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", - "gio-sys 0.18.1", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", "pango-sys", "pkg-config", @@ -2315,8 +2415,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a90fbf5c033c65d93792192a49a8efb5bb1e640c419682a58bb96f5ae77f3d4a" dependencies = [ "gdk-sys", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "glib-sys", + "gobject-sys", "libc", "pkg-config", "system-deps", @@ -2331,7 +2431,7 @@ dependencies = [ "gdk", "gdkx11-sys", "gio", - "glib 0.18.5", + "glib", "libc", "x11", ] @@ -2343,26 +2443,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fee8f00f4ee46cad2939b8990f5c70c94ff882c3028f3cc5abf950fa4ab53043" dependencies = [ "gdk-sys", - "glib-sys 0.18.1", + "glib-sys", "libc", "system-deps", "x11", ] -[[package]] -name = "generator" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b25e5b3e733153bcab35ee4671b46604b42516163cae442d1601cb716f2ac5" -dependencies = [ - "cc", - "cfg-if", - "libc", - "log", - "rustversion", - "windows 0.53.0", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -2371,6 +2457,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -2383,6 +2470,16 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "gethostname" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc3655aa6818d65bc620d6911f05aa7b6aeb596291e1e9f79e52df85583d1e30" +dependencies = [ + "rustix", + "windows-targets 0.52.6", +] + [[package]] name = "getrandom" version = "0.1.16" @@ -2396,9 +2493,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -2409,22 +2506,12 @@ dependencies = [ [[package]] name = "ghash" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" -dependencies = [ - "opaque-debug", - "polyval 0.5.3", -] - -[[package]] -name = "ghash" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" dependencies = [ "opaque-debug", - "polyval 0.6.1", + "polyval", ] [[package]] @@ -2439,9 +2526,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gio" @@ -2453,8 +2540,8 @@ dependencies = [ "futures-core", "futures-io", "futures-util", - "gio-sys 0.18.1", - "glib 0.18.5", + "gio-sys", + "glib", "libc", "once_cell", "pin-project-lite", @@ -2462,52 +2549,17 @@ dependencies = [ "thiserror", ] -[[package]] -name = "gio-sys" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9b693b8e39d042a95547fc258a7b07349b1f0b48f4b2fa3108ba3c51c0b5229" -dependencies = [ - "glib-sys 0.16.3", - "gobject-sys 0.16.3", - "libc", - "system-deps", - "winapi 0.3.9", -] - [[package]] name = "gio-sys" version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" dependencies = [ - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "glib-sys", + "gobject-sys", "libc", "system-deps", - "winapi 0.3.9", -] - -[[package]] -name = "glib" -version = "0.16.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16aa2475c9debed5a32832cb5ff2af5a3f9e1ab9e69df58eaadc1ab2004d6eba" -dependencies = [ - "bitflags 1.3.2", - "futures-channel", - "futures-core", - "futures-executor", - "futures-task", - "futures-util", - "gio-sys 0.16.3", - "glib-macros 0.16.8", - "glib-sys 0.16.3", - "gobject-sys 0.16.3", - "libc", - "once_cell", - "smallvec", - "thiserror", + "winapi", ] [[package]] @@ -2516,16 +2568,16 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "futures-channel", "futures-core", "futures-executor", "futures-task", "futures-util", - "gio-sys 0.18.1", - "glib-macros 0.18.5", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", "libc", "memchr", "once_cell", @@ -2533,43 +2585,18 @@ dependencies = [ "thiserror", ] -[[package]] -name = "glib-macros" -version = "0.16.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb1a9325847aa46f1e96ffea37611b9d51fc4827e67f79e7de502a297560a67b" -dependencies = [ - "anyhow", - "heck", - "proc-macro-crate 1.3.1", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "glib-macros" version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" dependencies = [ - "heck", - "proc-macro-crate 2.0.0", + "heck 0.4.1", + "proc-macro-crate 2.0.2", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.51", -] - -[[package]] -name = "glib-sys" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61a4f46316d06bfa33a7ac22df6f0524c8be58e3db2d9ca99ccb1f357b62a65" -dependencies = [ - "libc", - "system-deps", + "syn 2.0.79", ] [[package]] @@ -2590,38 +2617,41 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "global-hotkey" -version = "0.2.4" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c12993a445d59000c3994fcd3d179e7da026a4234cc46db652987aa2785e4a" +checksum = "d1b75248f33c73df1ed69673f6cb36d2e048ae84d29aa1d3e53199d138ebb1df" dependencies = [ "crossbeam-channel", - "keyboard-types 0.6.2", + "keyboard-types", + "objc2", + "objc2-app-kit", "once_cell", + "serde", "thiserror", - "windows-sys 0.48.0", + "windows-sys 0.59.0", "x11-dl", ] [[package]] name = "gobject-sys" -version = "0.16.3" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3520bb9c07ae2a12c7f2fbb24d4efc11231c8146a86956413fb1a79bb760a0f1" +checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" dependencies = [ - "glib-sys 0.16.3", + "glib-sys", "libc", "system-deps", ] [[package]] -name = "gobject-sys" -version = "0.18.0" +name = "group" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "glib-sys 0.18.1", - "libc", - "system-deps", + "ff", + "rand_core 0.6.4", + "subtle", ] [[package]] @@ -2637,7 +2667,7 @@ dependencies = [ "gdk", "gdk-pixbuf", "gio", - "glib 0.18.5", + "glib", "gtk-sys", "gtk3-macros", "libc", @@ -2655,9 +2685,9 @@ dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", "gdk-sys", - "gio-sys 0.18.1", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", "pango-sys", "system-deps", @@ -2673,63 +2703,33 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] name = "h2" -version = "0.3.24" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", - "http 0.2.11", - "indexmap 2.2.3", + "http", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", "tracing", ] -[[package]] -name = "h3" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b83e1915177ea624b5bbbdb16bc54f0c106c9664892c695f995e53f5c6793b80" -dependencies = [ - "bytes", - "fastrand", - "futures-util", - "http 0.2.11", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "h3-quinn" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac9675014d703c3d516a121757bbc02e53f1ee838e0729fc7534b35024a81ae4" -dependencies = [ - "bytes", - "futures", - "h3", - "quinn", - "quinn-proto", - "tokio", - "tokio-util", -] - [[package]] name = "half" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ "cfg-if", "crunchy", @@ -2746,21 +2746,27 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.10", + "ahash 0.8.11", "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" + [[package]] name = "hashlink" -version = "0.8.4" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -2768,24 +2774,24 @@ name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -dependencies = [ - "unicode-segmentation", -] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hermit-abi" -version = "0.3.8" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379dada1584ad501b383485dd706b8afb7a70fcbc7f4da7d780638a5a6124a60" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "hex" @@ -2808,7 +2814,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.7", + "digest", ] [[package]] @@ -2820,17 +2826,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "hostname" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" -dependencies = [ - "libc", - "match_cfg", - "winapi 0.3.9", -] - [[package]] name = "html5ever" version = "0.26.0" @@ -2847,34 +2842,35 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", - "itoa 1.0.10", + "itoa 1.0.11", ] [[package]] -name = "http" -version = "1.0.0" +name = "http-body" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "fnv", - "itoa 1.0.10", + "http", ] [[package]] -name = "http-body" -version = "0.4.6" +name = "http-body-util" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", - "http 0.2.11", + "futures-util", + "http", + "http-body", "pin-project-lite", ] @@ -2886,9 +2882,9 @@ checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -2896,68 +2892,86 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - [[package]] name = "hyper" -version = "0.14.28" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", "h2", - "http 0.2.11", + "http", "http-body", "httparse", "httpdate", - "itoa 1.0.10", + "itoa 1.0.11", "pin-project-lite", - "socket2", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] [[package]] name = "hyper-rustls" -version = "0.24.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", - "http 0.2.11", + "http", "hyper", - "rustls 0.21.10", + "hyper-util", + "rustls", + "rustls-native-certs", + "rustls-pki-types", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", + "tower-service", + "webpki-roots", ] [[package]] name = "hyper-tls" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", + "http-body-util", "hyper", + "hyper-util", "native-tls", "tokio", "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", ] [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -3002,16 +3016,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.5.0" @@ -3024,49 +3028,70 @@ dependencies = [ [[package]] name = "image" -version = "0.24.9" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" +checksum = "d97eb9a8e0cd5b76afea91d7eecd5cf8338cd44ced04256cf1f800474b227c52" dependencies = [ "bytemuck", - "byteorder", + "byteorder-lite", "color_quant", "exr", "gif", - "jpeg-decoder", + "image-webp", "num-traits", "png", "qoi", + "ravif", + "rayon", + "rgb", "tiff", + "zune-core", + "zune-jpeg", ] [[package]] -name = "indexmap" -version = "1.9.3" +name = "image-webp" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "e031e8e3d94711a9ccb5d6ea357439ef3dcbed361798bd4071dc4d9793fbe22f" dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", + "byteorder-lite", + "quick-error 2.0.1", ] [[package]] -name = "indexmap" -version = "2.2.3" +name = "imgref" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0263a3d970d5c054ed9312c0057b4f3bde9c0b33836d3637361d4a9e6e7a408" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.15.0", "serde", ] [[package]] name = "infer" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb33622da908807a06f9513c19b3c1ad50fab3e4137d82a78107d502075aa199" +checksum = "bc150e5ce2330295b8616ce0e3f53250e53af31759a9dbedad1621ba29151847" dependencies = [ "cfb", ] @@ -3097,63 +3122,74 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ + "block-padding", "generic-array", ] [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] +[[package]] +name = "interpolate_name" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "iota-crypto" -version = "0.15.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e04d492224bff6e97142f033d0a4383bcbc05918be1ff7b3abd2c1cc85205a2" +checksum = "98a38db844c910d78825e173c083f2ef416b69cb091bba8ac1055763c6db065b" dependencies = [ - "aead 0.4.3", - "aes 0.7.5", - "aes-gcm 0.9.2", + "aead", + "aes", + "aes-gcm", "autocfg", + "base64 0.21.7", "blake2", "chacha20poly1305", + "cipher", "curve25519-dalek", - "digest 0.10.7", + "digest", "ed25519-zebra", "generic-array", - "getrandom 0.2.12", + "getrandom 0.2.15", + "hkdf", "hmac", + "iterator-sorted", + "k256", "pbkdf2", + "rand 0.8.5", + "scrypt", "serde", - "sha2 0.10.8", + "sha2", + "tiny-keccak", "unicode-normalization", "x25519-dalek", "zeroize", ] -[[package]] -name = "iota-crypto" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5db0e2d85e258d6d0db66f4a6bf1e8bdf5b10c3353aa87d98b168778d13fdc1" -dependencies = [ - "autocfg", -] - [[package]] name = "iota_stronghold" -version = "1.0.5" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5baaa2460627283f54b968db7a38c9c754dc6059157cae64550ed1b79c91aa" +checksum = "8c0d301c7edbc31494d183b7d24c1bb51d3fb10fce2f3793df1baf45b6988e10" dependencies = [ "bincode", "hkdf", - "iota-crypto 0.15.3", - "rust-argon2", + "iota-crypto", + "rust-argon2 1.0.0", "serde", "stronghold-derive", "stronghold-utils", @@ -3162,23 +3198,11 @@ dependencies = [ "zeroize", ] -[[package]] -name = "ipconfig" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" -dependencies = [ - "socket2", - "widestring", - "windows-sys 0.48.0", - "winreg 0.50.0", -] - [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is-docker" @@ -3191,11 +3215,11 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ - "hermit-abi 0.3.8", + "hermit-abi 0.4.0", "libc", "windows-sys 0.52.0", ] @@ -3210,6 +3234,18 @@ dependencies = [ "once_cell", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "iterator-sorted" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d101775d2bc8f99f4ac18bf29b9ed70c0dd138b9a1e88d7b80179470cbbe8bd2" + [[package]] name = "itertools" version = "0.12.1" @@ -3227,9 +3263,9 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "javascriptcore-rs" @@ -3238,7 +3274,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" dependencies = [ "bitflags 1.3.2", - "glib 0.18.5", + "glib", "javascriptcore-rs-sys", ] @@ -3248,8 +3284,8 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" dependencies = [ - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "glib-sys", + "gobject-sys", "libc", "system-deps", ] @@ -3266,7 +3302,7 @@ dependencies = [ "jni-sys", "log", "thiserror", - "walkdir 2.4.0", + "walkdir", "windows-sys 0.45.0", ] @@ -3276,55 +3312,64 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + [[package]] name = "jpeg-decoder" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" -dependencies = [ - "rayon", -] [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] [[package]] name = "json-patch" -version = "1.2.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ff1e1486799e3f64129f8ccad108b38290df9cd7015cd31bed17239f0789d6" +checksum = "5b1fb8864823fad91877e6caea0baca82e49e8db50f8e5c9f9a453e27d3330fc" dependencies = [ + "jsonptr", "serde", "serde_json", "thiserror", - "treediff", ] [[package]] -name = "kernel32-sys" -version = "0.2.2" +name = "jsonptr" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +checksum = "1c6e529149475ca0b2820835d3dce8fcc41c6b943ca608d32f35b449255e4627" dependencies = [ - "winapi 0.2.8", - "winapi-build", + "fluent-uri", + "serde", + "serde_json", ] [[package]] -name = "keyboard-types" -version = "0.6.2" +name = "k256" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7668b7cff6a51fe61cdde64cd27c8a220786f399501b57ebe36f7d8112fd68" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ - "bitflags 1.3.2", - "serde", - "unicode-segmentation", + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2", ] [[package]] @@ -3333,7 +3378,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "serde", "unicode-segmentation", ] @@ -3373,11 +3418,11 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.5.2", + "spin", ] [[package]] @@ -3392,7 +3437,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" dependencies = [ - "glib 0.18.5", + "glib", "gtk", "gtk-sys", "libappindicator-sys", @@ -3412,9 +3457,44 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "f0b21006cd1874ae9e650973c565615676dc4a274c965bb0a73796dac838ce4f" + +[[package]] +name = "libflate" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45d9dfdc14ea4ef0900c1cddbc8dcd553fbaacd8a4a282cf4018ae9dd04fb21e" +dependencies = [ + "adler32", + "core2", + "crc32fast", + "dary_heap", + "libflate_lz77", +] + +[[package]] +name = "libflate_lz77" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e0d73b369f386f1c44abd9c570d5318f55ccde816ff4b562fa452e5182863d" +dependencies = [ + "core2", + "hashbrown 0.14.5", + "rle-decode-fast", +] + +[[package]] +name = "libfuzzer-sys" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a96cfd5557eb82f2b83fed4955246c988d331975a002961b07c81584d107e7f7" +dependencies = [ + "arbitrary", + "cc", + "once_cell", +] [[package]] name = "libloading" @@ -3423,17 +3503,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ "cfg-if", - "winapi 0.3.9", + "winapi", ] [[package]] name = "libloading" -version = "0.8.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.52.6", ] [[package]] @@ -3444,126 +3524,81 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "libc", "redox_syscall", ] [[package]] -name = "libsodium-sys" -version = "0.2.7" +name = "libsodium-sys-stable" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b779387cd56adfbc02ea4a668e704f729be8d6a6abd2c27ca5ee537849a92fd" +checksum = "90e7b5bc5a90cb1a680d8b0340f935d575292b8458e077f8da8cf134289d7dcf" dependencies = [ "cc", "libc", + "libflate", + "minisign-verify", "pkg-config", - "walkdir 2.4.0", + "tar", + "ureq", + "vcpkg", + "zip", ] [[package]] name = "libsqlite3-sys" -version = "0.27.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" dependencies = [ "cc", "pkg-config", "vcpkg", ] -[[package]] -name = "libudev" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea626d3bdf40a1c5aee3bcd4f40826970cae8d80a8fec934c82a63840094dcfe" -dependencies = [ - "libc", - "libudev-sys", -] - -[[package]] -name = "libudev-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c8469b4a23b962c1396b9b451dda50ef5b283e8dd309d69033475fa9b334324" -dependencies = [ - "libc", - "pkg-config", -] - -[[package]] -name = "line-wrap" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" -dependencies = [ - "safemem", -] - -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - -[[package]] -name = "linux-raw-sys" -version = "0.6.4" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b5399f6804fbab912acbd8878ed3532d506b7c951b8f9f164ef90fef39e3f4" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", ] [[package]] -name = "log" -version = "0.4.20" +name = "lockfree-object-pool" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" -dependencies = [ - "value-bag", -] +checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" [[package]] -name = "loom" -version = "0.5.6" +name = "log" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" dependencies = [ - "cfg-if", - "generator", - "scoped-tls", - "serde", - "serde_json", - "tracing", - "tracing-subscriber", + "value-bag", ] [[package]] -name = "lru-cache" -version = "0.1.2" +name = "loop9" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" dependencies = [ - "linked-hash-map", + "imgref", ] [[package]] @@ -3574,9 +3609,9 @@ checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" [[package]] name = "mac-notification-sys" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51fca4d74ff9dbaac16a01b924bc3693fa2bba0862c2c633abc73f9a8ea21f64" +checksum = "dce8f34f3717aa37177e723df6c1fc5fb02b2a1087374ea3fe0ea42316dc8f91" dependencies = [ "cc", "dirs-next", @@ -3615,26 +3650,20 @@ dependencies = [ ] [[package]] -name = "match_cfg" -version = "0.1.0" +name = "matches" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] -name = "matchers" -version = "0.1.0" +name = "maybe-rayon" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" dependencies = [ - "regex-automata 0.1.10", + "cfg-if", ] -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "md-5" version = "0.10.6" @@ -3642,23 +3671,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ "cfg-if", - "digest 0.10.7", + "digest", ] [[package]] name = "memchr" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" - -[[package]] -name = "memmap2" -version = "0.9.4" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" -dependencies = [ - "libc", -] +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memoffset" @@ -3671,9 +3691,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] @@ -3686,9 +3706,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -3702,25 +3722,34 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "minisign-verify" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881" +checksum = "a05b5d0594e0cb1ad8cee3373018d2b84e25905dc75b2468114cc9a8e86cfc20" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", "simd-adler32", ] [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", @@ -3728,49 +3757,68 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "mio" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + [[package]] name = "mockito" -version = "0.31.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80f9fece9bd97ab74339fe19f4bcaf52b76dcc18e5364c7977c1838f76b38de9" +checksum = "09b34bd91b9e5c5b06338d392463e1318d683cf82ec3d3af4014609be6e2108d" dependencies = [ "assert-json-diff", + "bytes", "colored 2.1.0", - "httparse", - "lazy_static", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", "log", "rand 0.8.5", "regex", "serde_json", "serde_urlencoded", "similar", + "tokio", ] [[package]] name = "muda" -version = "0.11.5" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c47e7625990fc1af2226ea4f34fb2412b03c12639fcb91868581eb3a6893453" +checksum = "b8123dfd4996055ac9b15a60ad263b44b01e539007523ad7a4a533a3d93b0591" dependencies = [ - "cocoa 0.25.0", "crossbeam-channel", + "dpi", "gtk", - "keyboard-types 0.7.0", - "objc", + "keyboard-types", + "objc2", + "objc2-app-kit", + "objc2-foundation", "once_cell", "png", "serde", "thiserror", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -3784,15 +3832,16 @@ dependencies = [ [[package]] name = "ndk" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "jni-sys", + "log", "ndk-sys", "num_enum", - "raw-window-handle 0.5.2", + "raw-window-handle", "thiserror", ] @@ -3804,18 +3853,18 @@ checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" [[package]] name = "ndk-sys" -version = "0.4.1+23.1.7779620" +version = "0.6.0+11769913" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" dependencies = [ "jni-sys", ] [[package]] name = "new_debug_unreachable" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "nix" @@ -3835,22 +3884,10 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.2", - "cfg-if", - "libc", -] - -[[package]] -name = "nix" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" -dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "cfg-if", - "cfg_aliases 0.1.1", "libc", - "memoffset 0.9.0", + "memoffset 0.9.1", ] [[package]] @@ -3869,171 +3906,411 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "noop_proc_macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" + [[package]] name = "notify" version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" +checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" +dependencies = [ + "bitflags 2.6.0", + "crossbeam-channel", + "filetime", + "fsevent-sys", + "inotify", + "kqueue", + "libc", + "log", + "mio 0.8.11", + "serde", + "walkdir", + "windows-sys 0.48.0", +] + +[[package]] +name = "notify-debouncer-full" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb7fd166739789c9ff169e654dc1501373db9d80a4c3f972817c8a4d7cf8f34e" +dependencies = [ + "crossbeam-channel", + "file-id", + "log", + "notify", + "parking_lot", + "walkdir", +] + +[[package]] +name = "notify-rust" +version = "4.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5134a72dc570b178bff81b01e81ab14a6fcc015391ed4b3b14853090658cd3a3" +dependencies = [ + "log", + "mac-notification-sys", + "serde", + "tauri-winrt-notification", + "zbus", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand 0.8.5", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro-crate 2.0.2", + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + +[[package]] +name = "objc-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +dependencies = [ + "block", + "objc", + "objc_id", +] + +[[package]] +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" +dependencies = [ + "cc", +] + +[[package]] +name = "objc2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" +dependencies = [ + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2-app-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ - "bitflags 2.4.2", - "crossbeam-channel", - "filetime", - "fsevent-sys", - "inotify", - "kqueue", + "bitflags 2.6.0", + "block2", "libc", - "log", - "mio", - "serde", - "walkdir 2.4.0", - "windows-sys 0.48.0", + "objc2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation", + "objc2-quartz-core", ] [[package]] -name = "notify-debouncer-full" -version = "0.3.1" +name = "objc2-cloud-kit" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f5dab59c348b9b50cf7f261960a20e389feb2713636399cd9082cd4b536154" +checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" dependencies = [ - "crossbeam-channel", - "file-id", - "log", - "notify", - "parking_lot", - "walkdir 2.4.0", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", ] [[package]] -name = "nu-ansi-term" -version = "0.46.0" +name = "objc2-contacts" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" dependencies = [ - "overload", - "winapi 0.3.9", + "block2", + "objc2", + "objc2-foundation", ] [[package]] -name = "num-bigint-dig" -version = "0.8.4" +name = "objc2-core-data" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand 0.8.5", - "smallvec", - "zeroize", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", ] [[package]] -name = "num-conv" -version = "0.1.0" +name = "objc2-core-image" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] [[package]] -name = "num-integer" -version = "0.1.46" +name = "objc2-core-location" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" dependencies = [ - "num-traits", + "block2", + "objc2", + "objc2-contacts", + "objc2-foundation", ] [[package]] -name = "num-iter" -version = "0.1.44" +name = "objc2-encode" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ - "autocfg", - "num-integer", - "num-traits", + "bitflags 2.6.0", + "block2", + "dispatch", + "libc", + "objc2", ] [[package]] -name = "num-traits" -version = "0.2.18" +name = "objc2-link-presentation" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" dependencies = [ - "autocfg", - "libm", + "block2", + "objc2", + "objc2-app-kit", + "objc2-foundation", ] [[package]] -name = "num_cpus" -version = "1.16.0" +name = "objc2-metal" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ - "hermit-abi 0.3.8", - "libc", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", ] [[package]] -name = "num_enum" -version = "0.5.11" +name = "objc2-quartz-core" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "num_enum_derive", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", ] [[package]] -name = "num_enum_derive" -version = "0.5.11" +name = "objc2-symbols" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.109", + "objc2", + "objc2-foundation", ] [[package]] -name = "num_threads" -version = "0.1.7" +name = "objc2-ui-kit" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" dependencies = [ - "libc", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-image", + "objc2-core-location", + "objc2-foundation", + "objc2-link-presentation", + "objc2-quartz-core", + "objc2-symbols", + "objc2-uniform-type-identifiers", + "objc2-user-notifications", ] [[package]] -name = "objc" -version = "0.2.7" +name = "objc2-uniform-type-identifiers" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" dependencies = [ - "malloc_buf", - "objc_exception", + "block2", + "objc2", + "objc2-foundation", ] [[package]] -name = "objc-foundation" -version = "0.1.1" +name = "objc2-user-notifications" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" dependencies = [ - "block", - "objc", - "objc_id", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", ] [[package]] -name = "objc_exception" -version = "0.1.2" +name = "objc2-web-kit" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +checksum = "68bc69301064cebefc6c4c90ce9cba69225239e4b8ff99d445a2b5563797da65" dependencies = [ - "cc", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-app-kit", + "objc2-foundation", ] [[package]] @@ -4047,30 +4324,30 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "open" -version = "4.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a083c0c7e5e4a8ec4176346cf61f67ac674e8bfb059d9226e1c54a96b377c12" +checksum = "61a877bf6abd716642a53ef1b89fb498923a4afca5c754f9050b4d081c05c4b3" dependencies = [ "is-wsl", "libc", @@ -4079,11 +4356,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "cfg-if", "foreign-types 0.3.2", "libc", @@ -4100,7 +4377,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] @@ -4111,18 +4388,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.2.3+3.2.1" +version = "300.3.2+3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cff92b6f71555b61bb9315f7c64da3ca43d87531622120fea0195fc761b4843" +checksum = "a211a18d945ef7e648cc6e0058f4c548ee46aab922ea203e0d30e966ea23647b" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.101" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -4131,6 +4408,22 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "ordered-multimap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49203cdcae0030493bad186b28da2fa25645fa276a51b6fec8010d281e02ef79" +dependencies = [ + "dlv-list", + "hashbrown 0.14.5", +] + [[package]] name = "ordered-stream" version = "0.2.0" @@ -4143,31 +4436,25 @@ dependencies = [ [[package]] name = "os_info" -version = "3.7.0" +version = "3.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006e42d5b888366f1880eda20371fedde764ed2213dc8496f49622fa0c99cd5e" +checksum = "ae99c7fa6dd38c7cafe1ec085e804f8f555a2f8659b0dbe03f1f9963a9b51092" dependencies = [ "log", "serde", - "winapi 0.3.9", + "windows-sys 0.52.0", ] [[package]] name = "os_pipe" -version = "1.1.5" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57119c3b893986491ec9aa85056780d3a0f3cf4da7cc09dd3650dbd6c6738fb9" +checksum = "5ffd2b0a5634335b135d5728d84c5e0fd726954b87111f7506a61c502280d982" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - [[package]] name = "pango" version = "0.18.3" @@ -4175,7 +4462,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" dependencies = [ "gio", - "glib 0.18.5", + "glib", "libc", "once_cell", "pango-sys", @@ -4187,23 +4474,23 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" dependencies = [ - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "glib-sys", + "gobject-sys", "libc", "system-deps", ] [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -4211,50 +4498,37 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.5", -] - -[[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core 0.6.4", - "subtle", + "windows-targets 0.52.6", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pathdiff" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +checksum = "d61c5ce1153ab5b689d0c074c4e7fc613e942dfb7dd9eea5ab202d2ad91fe361" [[package]] name = "pbkdf2" -version = "0.11.0" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ - "digest 0.10.7", + "digest", "hmac", - "password-hash", - "sha2 0.10.8", ] [[package]] @@ -4376,7 +4650,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] @@ -4408,9 +4682,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -4420,9 +4694,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.1" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", "fastrand", @@ -4452,84 +4726,72 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "plist" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef" +checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" dependencies = [ - "base64 0.21.7", - "indexmap 2.2.3", - "line-wrap", - "quick-xml 0.31.0", + "base64 0.22.1", + "indexmap 2.6.0", + "quick-xml 0.32.0", "serde", "time", ] [[package]] name = "png" -version = "0.17.13" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" +checksum = "52f9d46a34a05a6a57566bc2bfae066ef07585a6e3fa30fbbdff5936380623f0" dependencies = [ "bitflags 1.3.2", "crc32fast", "fdeflate", "flate2", - "miniz_oxide", + "miniz_oxide 0.8.0", ] [[package]] name = "polling" -version = "3.5.0" +version = "3.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9" +checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" dependencies = [ "cfg-if", "concurrent-queue", + "hermit-abi 0.4.0", "pin-project-lite", "rustix", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "poly1305" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" -dependencies = [ - "cpufeatures", - "opaque-debug", - "universal-hash 0.4.0", -] - -[[package]] -name = "polyval" -version = "0.5.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ - "cfg-if", "cpufeatures", "opaque-debug", - "universal-hash 0.4.0", + "universal-hash", ] [[package]] name = "polyval" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" dependencies = [ "cfg-if", "cpufeatures", "opaque-debug", - "universal-hash 0.5.1", + "universal-hash", ] [[package]] @@ -4540,9 +4802,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "precomputed-hash" @@ -4610,13 +4875,32 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" dependencies = [ "unicode-ident", ] +[[package]] +name = "profiling" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" +dependencies = [ + "profiling-procmacros", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a65f2e60fbf1063868558d69c6beacf412dc755f9fc020f514b7955fc914fe30" +dependencies = [ + "quote", + "syn 2.0.79", +] + [[package]] name = "psl-types" version = "2.0.11" @@ -4668,37 +4952,52 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + [[package]] name = "quick-xml" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" dependencies = [ "memchr", ] [[package]] name = "quick-xml" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" +dependencies = [ + "memchr", +] + +[[package]] +name = "quick-xml" +version = "0.36.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe" dependencies = [ "memchr", ] [[package]] name = "quinn" -version = "0.10.2" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" dependencies = [ "bytes", - "futures-io", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.21.10", + "rustls", + "socket2", "thiserror", "tokio", "tracing", @@ -4706,15 +5005,15 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.10.6" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ "bytes", "rand 0.8.5", - "ring 0.16.20", + "ring", "rustc-hash", - "rustls 0.21.10", + "rustls", "slab", "thiserror", "tinyvec", @@ -4723,22 +5022,22 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.4.1" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" dependencies = [ - "bytes", "libc", + "once_cell", "socket2", "tracing", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -4809,7 +5108,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", ] [[package]] @@ -4831,22 +5130,65 @@ dependencies = [ ] [[package]] -name = "raw-window-handle" -version = "0.5.2" +name = "rav1e" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" +checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" +dependencies = [ + "arbitrary", + "arg_enum_proc_macro", + "arrayvec", + "av1-grain", + "bitstream-io", + "built", + "cfg-if", + "interpolate_name", + "itertools", + "libc", + "libfuzzer-sys", + "log", + "maybe-rayon", + "new_debug_unreachable", + "noop_proc_macro", + "num-derive", + "num-traits", + "once_cell", + "paste", + "profiling", + "rand 0.8.5", + "rand_chacha 0.3.1", + "simd_helpers", + "system-deps", + "thiserror", + "v_frame", + "wasm-bindgen", +] + +[[package]] +name = "ravif" +version = "0.11.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f0bfd976333248de2078d350bfdf182ff96e168a24d23d2436cef320dd4bdd" +dependencies = [ + "avif-serialize", + "imgref", + "loop9", + "quick-error 2.0.1", + "rav1e", + "rgb", +] [[package]] name = "raw-window-handle" -version = "0.6.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" [[package]] name = "rayon" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -4875,67 +5217,52 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", ] [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.10.3" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.5", - "regex-syntax 0.8.2", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", + "regex-automata", + "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rend" @@ -4948,12 +5275,12 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.24" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "async-compression", - "base64 0.21.7", + "base64 0.22.1", "bytes", "cookie", "cookie_store", @@ -4962,13 +5289,13 @@ dependencies = [ "futures-core", "futures-util", "h2", - "h3", - "h3-quinn", - "http 0.2.11", + "http", "http-body", + "http-body-util", "hyper", "hyper-rustls", "hyper-tls", + "hyper-util", "ipnet", "js-sys", "log", @@ -4979,9 +5306,10 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.21.10", + "rustls", "rustls-native-certs", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", @@ -4989,48 +5317,46 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls 0.24.1", + "tokio-rustls", "tokio-socks", "tokio-util", "tower-service", - "trust-dns-resolver", "url", "wasm-bindgen", "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.25.4", - "winreg 0.50.0", + "webpki-roots", + "windows-registry 0.2.0", ] [[package]] -name = "resolv-conf" -version = "0.7.0" +name = "rfc6979" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "hostname", - "quick-error", + "hmac", + "subtle", ] [[package]] name = "rfd" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373d2fc6310e2d14943d4e66ebed5b774a2b6b3b1610e7377edf124fb2760d6b" +checksum = "8af382a047821a08aa6bfc09ab0d80ff48d45d8726f7cd8e44891f7cb4a4278e" dependencies = [ "ashpd", - "block", - "dispatch", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "block2", + "glib-sys", + "gobject-sys", "gtk-sys", "js-sys", "log", - "objc", - "objc-foundation", - "objc_id", - "raw-window-handle 0.6.0", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "raw-window-handle", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -5038,19 +5364,10 @@ dependencies = [ ] [[package]] -name = "ring" -version = "0.16.20" +name = "rgb" +version = "0.8.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi 0.3.9", -] +checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" [[package]] name = "ring" @@ -5060,18 +5377,18 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.12", + "getrandom 0.2.15", "libc", - "spin 0.9.8", - "untrusted 0.9.0", + "spin", + "untrusted", "windows-sys 0.52.0", ] [[package]] name = "rkyv" -version = "0.7.44" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" +checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" dependencies = [ "bitvec", "bytecheck", @@ -5087,15 +5404,21 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.44" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" +checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" dependencies = [ "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "rle-decode-fast" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" + [[package]] name = "rsa" version = "0.9.6" @@ -5103,7 +5426,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" dependencies = [ "const-oid", - "digest 0.10.7", + "digest", "num-bigint-dig", "num-integer", "num-traits", @@ -5116,12 +5439,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "runloop" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d79b4b604167921892e84afbbaad9d5ad74e091bf6c511d9dbfb0593f09fabd" - [[package]] name = "rust-argon2" version = "1.0.0" @@ -5134,11 +5451,33 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "rust-argon2" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d9848531d60c9cbbcf9d166c885316c24bc0e2a9d3eba0956bb6cbbd79bc6e8" +dependencies = [ + "base64 0.21.7", + "blake2b_simd", + "constant_time_eq 0.3.1", +] + +[[package]] +name = "rust-ini" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e310ef0e1b6eeb79169a1171daf9abcb87a2e17c03bee2c4bb100b55c75409f" +dependencies = [ + "cfg-if", + "ordered-multimap", + "trim-in-place", +] + [[package]] name = "rust_decimal" -version = "1.34.3" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39449a79f45e8da28c57c341891b69a183044b29518bb8f86dbac9df60bb7df" +checksum = "b082d80e3e3cc52b2ed634388d436fe1f4de6af5786cc2de9ba9737527bdf555" dependencies = [ "arrayvec", "borsh", @@ -5152,118 +5491,91 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "1.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys", "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" -dependencies = [ - "log", - "ring 0.17.8", - "rustls-webpki 0.101.7", - "sct", -] - -[[package]] -name = "rustls" -version = "0.22.2" +version = "0.23.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" +checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" dependencies = [ - "log", - "ring 0.17.8", + "once_cell", + "ring", "rustls-pki-types", - "rustls-webpki 0.102.2", + "rustls-webpki", "subtle", "zeroize", ] [[package]] name = "rustls-native-certs" -version = "0.6.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" dependencies = [ "openssl-probe", "rustls-pemfile", + "rustls-pki-types", "schannel", "security-framework", ] [[package]] name = "rustls-pemfile" -version = "1.0.4" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.21.7", + "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ede67b28608b4c60685c7d54122d4400d90f62b40caee7700e700380a390fa8" - -[[package]] -name = "rustls-webpki" -version = "0.101.7" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", -] +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-webpki" -version = "0.102.2" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ - "ring 0.17.8", + "ring", "rustls-pki-types", - "untrusted 0.9.0", + "untrusted", ] -[[package]] -name = "rustversion" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" - [[package]] name = "rusty-fork" version = "0.3.0" @@ -5271,31 +5583,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" dependencies = [ "fnv", - "quick-error", + "quick-error 1.2.3", "tempfile", "wait-timeout", ] [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] -name = "safemem" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" - -[[package]] -name = "same-file" -version = "0.1.3" +name = "salsa20" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d931a44fdaa43b8637009e7632a02adc4f2b2e0733c08caa4cf00e8da4a117a7" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" dependencies = [ - "kernel32-sys", - "winapi 0.2.8", + "cipher", ] [[package]] @@ -5309,18 +5614,18 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "schemars" -version = "0.8.16" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" dependencies = [ "dyn-clone", "indexmap 1.9.3", @@ -5328,18 +5633,19 @@ dependencies = [ "serde", "serde_json", "url", + "uuid", ] [[package]] name = "schemars_derive" -version = "0.8.16" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 1.0.109", + "syn 2.0.79", ] [[package]] @@ -5355,13 +5661,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "sct" -version = "0.7.1" +name = "scrypt" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "pbkdf2", + "salsa20", + "sha2", ] [[package]] @@ -5370,14 +5677,28 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", - "core-foundation", + "bitflags 2.6.0", + "core-foundation 0.9.4", "core-foundation-sys", "libc", "security-framework-sys", @@ -5385,9 +5706,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -5415,71 +5736,83 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.197" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] +[[package]] +name = "serde-untagged" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2676ba99bd82f75cae5cbd2c8eda6fa0b8760f18978ea840e980dd5567b5c5b6" +dependencies = [ + "erased-serde", + "serde", + "typeid", +] + [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] name = "serde_derive_internals" -version = "0.26.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.79", ] [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ - "itoa 1.0.10", + "itoa 1.0.11", + "memchr", "ryu", "serde", ] [[package]] name = "serde_repr" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -5491,22 +5824,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.10", + "itoa 1.0.11", "ryu", "serde", ] [[package]] name = "serde_with" -version = "3.6.1" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d167997bd841ec232f5b2b8e0e26606df2e7caa4c31b95ea9ca52b200bd270" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.3", + "indexmap 2.6.0", "serde", "serde_derive", "serde_json", @@ -5516,14 +5849,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.6.1" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "865f9743393e638991566a8b7a479043c2c8da94a33e0a31f18214c9cae0a64d" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] @@ -5566,20 +5899,7 @@ checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", + "digest", ] [[package]] @@ -5590,33 +5910,30 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] -name = "sharded-slab" -version = "0.1.7" +name = "shared_child" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +checksum = "09fa9338aed9a1df411814a5b2252f7cd206c55ae9bf2fa763f8de84603aa60c" dependencies = [ - "lazy_static", + "libc", + "windows-sys 0.59.0", ] [[package]] -name = "shared_child" -version = "1.0.0" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef" -dependencies = [ - "libc", - "winapi 0.3.9", -] +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -5627,7 +5944,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest 0.10.7", + "digest", "rand_core 0.6.4", ] @@ -5637,17 +5954,26 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +[[package]] +name = "simd_helpers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" +dependencies = [ + "quote", +] + [[package]] name = "simdutf8" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "similar" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21" +checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" [[package]] name = "single-instance-example" @@ -5657,6 +5983,7 @@ dependencies = [ "serde_json", "tauri", "tauri-build", + "tauri-plugin-cli", "tauri-plugin-single-instance", ] @@ -5677,15 +6004,18 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -5693,33 +6023,24 @@ dependencies = [ [[package]] name = "softbuffer" -version = "0.4.1" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071916a85d1db274b4ed57af3a14afb66bd836ae7f82ebb6f1fd3455107830d9" +checksum = "18051cdd562e792cad055119e0cdb2cfc137e44e3987532e0f9659a77931bb08" dependencies = [ - "as-raw-xcb-connection", "bytemuck", - "cfg_aliases 0.2.0", - "cocoa 0.25.0", - "core-graphics 0.23.1", - "drm", - "fastrand", + "cfg_aliases 0.2.1", + "core-graphics 0.24.0", "foreign-types 0.5.0", "js-sys", "log", - "memmap2", - "objc", - "raw-window-handle 0.6.0", + "objc2", + "objc2-foundation", + "objc2-quartz-core", + "raw-window-handle", "redox_syscall", - "rustix", - "tiny-xlib", "wasm-bindgen", - "wayland-backend", - "wayland-client", - "wayland-sys", "web-sys", - "windows-sys 0.52.0", - "x11rb", + "windows-sys 0.59.0", ] [[package]] @@ -5730,7 +6051,7 @@ checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" dependencies = [ "futures-channel", "gio", - "glib 0.18.5", + "glib", "libc", "soup3-sys", ] @@ -5741,18 +6062,35 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" dependencies = [ - "gio-sys 0.18.1", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", "system-deps", ] [[package]] -name = "spin" -version = "0.5.2" +name = "specta" +version = "2.0.0-rc.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "4ccbb212565d2dc177bc15ecb7b039d66c4490da892436a4eee5b394d620c9bc" +dependencies = [ + "paste", + "specta-macros", + "thiserror", +] + +[[package]] +name = "specta-macros" +version = "2.0.0-rc.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68999d29816965eb9e5201f60aec02a76512139811661a7e8e653abc810b8f72" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "syn 2.0.79", +] [[package]] name = "spin" @@ -5775,20 +6113,19 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.2.3" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" +checksum = "7bba3a93db0cc4f7bdece8bb09e77e2e785c20bfebf79eb8340ed80708048790" dependencies = [ - "itertools", "nom", "unicode_categories", ] [[package]] name = "sqlx" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba03c279da73694ef99763320dea58b51095dfe87d001b1d4b5fe78ba8763cf" +checksum = "93334716a037193fac19df402f8571269c84a00852f6a7066b5d2616dcd64d3e" dependencies = [ "sqlx-core", "sqlx-macros", @@ -5799,37 +6136,36 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d84b0a3c3739e220d94b3239fd69fb1f74bc36e16643423bd99de3b43c21bfbd" +checksum = "d4d8060b456358185f7d50c55d9b5066ad956956fddec42ee2e8567134a8936e" dependencies = [ - "ahash 0.8.10", "atoi", "byteorder", "bytes", "crc", "crossbeam-queue", - "dotenvy", "either", - "event-listener 2.5.3", + "event-listener", "futures-channel", "futures-core", "futures-intrusive", "futures-io", "futures-util", + "hashbrown 0.14.5", "hashlink", "hex", - "indexmap 2.2.3", + "indexmap 2.6.0", "log", "memchr", "once_cell", "paste", "percent-encoding", - "rustls 0.21.10", + "rustls", "rustls-pemfile", "serde", "serde_json", - "sha2 0.10.8", + "sha2", "smallvec", "sqlformat", "thiserror", @@ -5838,44 +6174,43 @@ dependencies = [ "tokio-stream", "tracing", "url", - "webpki-roots 0.25.4", + "webpki-roots", ] [[package]] name = "sqlx-macros" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89961c00dc4d7dffb7aee214964b065072bff69e36ddb9e2c107541f75e4f2a5" +checksum = "cac0692bcc9de3b073e8d747391827297e075c7710ff6276d9f7a1f3d58c6657" dependencies = [ "proc-macro2", "quote", "sqlx-core", "sqlx-macros-core", - "syn 1.0.109", + "syn 2.0.79", ] [[package]] name = "sqlx-macros-core" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0bd4519486723648186a08785143599760f7cc81c52334a55d6a83ea1e20841" +checksum = "1804e8a7c7865599c9c79be146dc8a9fd8cc86935fa641d3ea58e5f0688abaa5" dependencies = [ - "atomic-write-file", "dotenvy", "either", - "heck", + "heck 0.5.0", "hex", "once_cell", "proc-macro2", "quote", "serde", "serde_json", - "sha2 0.10.8", + "sha2", "sqlx-core", "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 1.0.109", + "syn 2.0.79", "tempfile", "tokio", "url", @@ -5883,17 +6218,17 @@ dependencies = [ [[package]] name = "sqlx-mysql" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37195395df71fd068f6e2082247891bc11e3289624bbc776a0cdfa1ca7f1ea4" +checksum = "64bb4714269afa44aef2755150a0fc19d756fb580a67db8885608cf02f47d06a" dependencies = [ "atoi", - "base64 0.21.7", - "bitflags 2.4.2", + "base64 0.22.1", + "bitflags 2.6.0", "byteorder", "bytes", "crc", - "digest 0.10.7", + "digest", "dotenvy", "either", "futures-channel", @@ -5904,7 +6239,7 @@ dependencies = [ "hex", "hkdf", "hmac", - "itoa 1.0.10", + "itoa 1.0.11", "log", "md-5", "memchr", @@ -5914,7 +6249,7 @@ dependencies = [ "rsa", "serde", "sha1", - "sha2 0.10.8", + "sha2", "smallvec", "sqlx-core", "stringprep", @@ -5926,13 +6261,13 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ac0ac3b7ccd10cc96c7ab29791a7dd236bd94021f31eec7ba3d46a74aa1c24" +checksum = "6fa91a732d854c5d7726349bb4bb879bb9478993ceb764247660aee25f67c2f8" dependencies = [ "atoi", - "base64 0.21.7", - "bitflags 2.4.2", + "base64 0.22.1", + "bitflags 2.6.0", "byteorder", "crc", "dotenvy", @@ -5945,7 +6280,7 @@ dependencies = [ "hkdf", "hmac", "home", - "itoa 1.0.10", + "itoa 1.0.11", "log", "md-5", "memchr", @@ -5953,8 +6288,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_json", - "sha1", - "sha2 0.10.8", + "sha2", "smallvec", "sqlx-core", "stringprep", @@ -5966,9 +6300,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "210976b7d948c7ba9fced8ca835b11cbb2d677c59c79de41ac0d397e14547490" +checksum = "d5b2cf34a45953bfd3daaf3db0f7a7878ab9b7a6b91b422d24a7a9e4c857b680" dependencies = [ "atoi", "flume", @@ -5981,11 +6315,11 @@ dependencies = [ "log", "percent-encoding", "serde", + "serde_urlencoded", "sqlx-core", "time", "tracing", "url", - "urlencoding", ] [[package]] @@ -5994,15 +6328,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "state" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" -dependencies = [ - "loom", -] - [[package]] name = "static_assertions" version = "1.1.0" @@ -6037,13 +6362,13 @@ dependencies = [ [[package]] name = "stringprep" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" dependencies = [ - "finl_unicode", "unicode-bidi", "unicode-normalization", + "unicode-properties", ] [[package]] @@ -6059,14 +6384,14 @@ dependencies = [ [[package]] name = "stronghold-runtime" -version = "1.0.2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93abb10fbd11335d31c33a70b2523c0caab348215caa2ce6da04a268c30afcb" +checksum = "18db7cc51450cefdab5f4990e128dd02c98da6d2992b93ffef8992ac0d2f3ddf" dependencies = [ - "dirs", - "iota-crypto 0.15.3", + "dirs 4.0.0", + "iota-crypto", "libc", - "libsodium-sys", + "libsodium-sys-stable", "log", "nix 0.24.3", "rand 0.8.5", @@ -6088,14 +6413,14 @@ dependencies = [ [[package]] name = "stronghold_engine" -version = "1.0.2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d68a609d0a4f05dbde8b704619faa7f861069bbc649e3abecb4d389f10236f" +checksum = "2fd7371c42e557dd71a7f860bb2ec6b6fdb32f97a97987ccc2435fdd1f3a8615" dependencies = [ "anyhow", "dirs-next", "hex", - "iota-crypto 0.15.3", + "iota-crypto", "once_cell", "paste", "serde", @@ -6106,27 +6431,21 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "swift-rs" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bbdb58577b6301f8d17ae2561f32002a5bae056d444e0f69e611e504a276204" +checksum = "4057c98e2e852d51fdcfca832aac7b571f6b351ad159f9eda5db1655f8d0c4d7" dependencies = [ "base64 0.21.7", "serde", @@ -6146,9 +6465,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.51" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab617d94515e94ae53b8406c628598680aa0c9587474ecbe58188f7b345d66c" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", @@ -6164,14 +6483,17 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] [[package]] name = "sys-locale" @@ -6184,20 +6506,20 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 1.3.2", - "core-foundation", + "bitflags 2.6.0", + "core-foundation 0.9.4", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -6205,12 +6527,12 @@ dependencies = [ [[package]] name = "system-deps" -version = "6.2.0" +version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2d580ff6a20c55dfb86be5f9c238f67835d0e81cbdea8bf5680e0897320331" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" dependencies = [ "cfg-expr", - "heck", + "heck 0.5.0", "pkg-config", "toml 0.8.10", "version-compare", @@ -6218,21 +6540,21 @@ dependencies = [ [[package]] name = "tao" -version = "0.26.0" +version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29d9325da2dd7ebd48a8a433c64240079b15dbe1249da04c72557611bcd08d1c" +checksum = "a0dbbebe82d02044dfa481adca1550d6dd7bd16e086bc34fa0fbecceb5a63751" dependencies = [ - "bitflags 1.3.2", - "cocoa 0.25.0", - "core-foundation", - "core-graphics 0.23.1", + "bitflags 2.6.0", + "cocoa", + "core-foundation 0.10.0", + "core-graphics 0.24.0", "crossbeam-channel", "dispatch", "dlopen2", + "dpi", "gdkwayland-sys", "gdkx11-sys", "gtk", - "image", "instant", "jni", "lazy_static", @@ -6244,27 +6566,26 @@ dependencies = [ "objc", "once_cell", "parking_lot", - "png", - "raw-window-handle 0.6.0", + "raw-window-handle", "scopeguard", "tao-macros", "unicode-segmentation", "url", - "windows 0.52.0", - "windows-implement", + "windows 0.58.0", + "windows-core 0.58.0", "windows-version", "x11-dl", ] [[package]] name = "tao-macros" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec114582505d158b669b136e6851f85840c109819d77c42bb7c0709f727d18c2" +checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.79", ] [[package]] @@ -6275,9 +6596,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.40" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +checksum = "4ff6c40d3aedb5e06b57c6f669ad17ab063dd1e63d977c6a88e7f4dfa4f04020" dependencies = [ "filetime", "libc", @@ -6286,46 +6607,46 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.14" +version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.0.0-beta.7" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ff52a838cb7c37ae344399a51eddb2669817142150a53dd47fe5c9c8f74daf" +checksum = "44438500b50708bfc1e6083844e135d1b516325aae58710dcd8fb67e050ae87c" dependencies = [ "anyhow", "bytes", - "cocoa 0.25.0", - "dirs-next", + "dirs 5.0.1", + "dunce", "embed_plist", "futures-util", - "getrandom 0.2.12", + "getrandom 0.2.15", "glob", "gtk", - "heck", - "http 0.2.11", + "heck 0.5.0", + "http", "http-range", - "ico", - "infer", + "image", "jni", "libc", "log", "mime", "muda", - "objc", + "objc2", + "objc2-app-kit", + "objc2-foundation", "percent-encoding", - "png", - "raw-window-handle 0.6.0", + "plist", + "raw-window-handle", "reqwest", "serde", "serde_json", "serde_repr", "serialize-to-javascript", - "state", - "static_assertions", + "specta", "swift-rs", "tauri-build", "tauri-macros", @@ -6336,24 +6657,25 @@ dependencies = [ "tokio", "tray-icon", "url", + "urlpattern", "uuid", "webkit2gtk", "webview2-com", "window-vibrancy", - "windows 0.52.0", + "windows 0.58.0", ] [[package]] name = "tauri-build" -version = "2.0.0-beta.5" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fcbbc1a1b4d71d6f4084cb292f77e46b26b8bdb6a8fd7783d2059bf41dcc9e0" +checksum = "935f9b3c49b22b3e2e485a57f46d61cd1ae07b1cbb2ba87387a387caf2d8c4e7" dependencies = [ "anyhow", "cargo_toml", - "dirs-next", + "dirs 5.0.1", "glob", - "heck", + "heck 0.5.0", "json-patch", "quote", "schemars", @@ -6363,18 +6685,18 @@ dependencies = [ "tauri-codegen", "tauri-utils", "tauri-winres", - "toml 0.8.10", - "walkdir 2.4.0", + "toml 0.8.2", + "walkdir", ] [[package]] name = "tauri-codegen" -version = "2.0.0-beta.5" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28990f57cb70a6c884810d22bfcf121ac04482b47c58f32487ec3f8f0746ee36" +checksum = "95d7443dd4f0b597704b6a14b964ee2ed16e99928d8e6292ae9825f09fbcd30e" dependencies = [ - "base64 0.21.7", - "brotli", + "base64 0.22.1", + "brotli 6.0.0", "ico", "json-patch", "plist", @@ -6384,72 +6706,50 @@ dependencies = [ "semver", "serde", "serde_json", - "sha2 0.10.8", - "syn 2.0.51", + "sha2", + "syn 2.0.79", "tauri-utils", "thiserror", "time", "url", "uuid", - "walkdir 2.4.0", + "walkdir", ] [[package]] name = "tauri-macros" -version = "2.0.0-beta.5" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c565fb3e1817401f4c90bc82c70184dbd65f11c01cc8d538c7d04b49245266c" +checksum = "4d2c0963ccfc3f5194415f2cce7acc975942a8797fbabfb0aa1ed6f59326ae7f" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", "tauri-codegen", "tauri-utils", ] [[package]] name = "tauri-plugin" -version = "2.0.0-beta.5" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5f58cf6b5e57a00edcec44ba0a54239a6a826ba068e4c931bf7f0f6014adbbc" -dependencies = [ - "anyhow", - "glob", - "plist", - "schemars", - "serde", - "serde_json", - "tauri-utils", - "toml 0.8.10", - "walkdir 1.0.7", -] - -[[package]] -name = "tauri-plugin-authenticator" -version = "2.0.0-beta.1" +checksum = "b2e6660a409963e4d57b9bfab4addd141eeff41bd3a7fb14e13004a832cf7ef6" dependencies = [ - "authenticator", - "base64 0.21.7", - "byteorder", - "bytes", - "chrono", - "log", - "once_cell", - "openssl", - "rand 0.8.5", - "rusty-fork", + "anyhow", + "glob", + "plist", + "schemars", "serde", "serde_json", - "sha2 0.10.8", - "tauri", - "tauri-plugin", - "thiserror", + "tauri-utils", + "toml 0.8.2", + "walkdir", ] [[package]] name = "tauri-plugin-autostart" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ "auto-launch", "log", @@ -6462,7 +6762,7 @@ dependencies = [ [[package]] name = "tauri-plugin-barcode-scanner" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ "log", "serde", @@ -6474,7 +6774,7 @@ dependencies = [ [[package]] name = "tauri-plugin-biometric" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ "log", "serde", @@ -6487,7 +6787,7 @@ dependencies = [ [[package]] name = "tauri-plugin-cli" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ "clap", "log", @@ -6500,9 +6800,10 @@ dependencies = [ [[package]] name = "tauri-plugin-clipboard-manager" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ "arboard", + "image", "log", "serde", "serde_json", @@ -6513,24 +6814,28 @@ dependencies = [ [[package]] name = "tauri-plugin-deep-link" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ + "dunce", "log", + "rust-ini", "serde", "serde_json", "tauri", "tauri-plugin", + "tauri-utils", "thiserror", "url", + "windows-registry 0.3.0", + "windows-result 0.2.0", ] [[package]] name = "tauri-plugin-dialog" -version = "2.0.0-beta.1" +version = "2.0.3" dependencies = [ - "glib 0.16.9", "log", - "raw-window-handle 0.6.0", + "raw-window-handle", "rfd", "serde", "serde_json", @@ -6538,16 +6843,19 @@ dependencies = [ "tauri-plugin", "tauri-plugin-fs", "thiserror", + "url", ] [[package]] name = "tauri-plugin-fs" -version = "2.0.0-beta.1" +version = "2.0.3" dependencies = [ "anyhow", + "dunce", "glob", "notify", "notify-debouncer-full", + "percent-encoding", "schemars", "serde", "serde_json", @@ -6559,9 +6867,22 @@ dependencies = [ "uuid", ] +[[package]] +name = "tauri-plugin-geolocation" +version = "2.0.1" +dependencies = [ + "log", + "serde", + "serde_json", + "specta", + "tauri", + "tauri-plugin", + "thiserror", +] + [[package]] name = "tauri-plugin-global-shortcut" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ "global-hotkey", "log", @@ -6572,13 +6893,26 @@ dependencies = [ "thiserror", ] +[[package]] +name = "tauri-plugin-haptics" +version = "2.0.1" +dependencies = [ + "log", + "serde", + "serde_json", + "specta", + "tauri", + "tauri-plugin", + "thiserror", +] + [[package]] name = "tauri-plugin-http" -version = "2.0.0-beta.1" +version = "2.0.3" dependencies = [ "data-url", - "glob", - "http 0.2.11", + "http", + "regex", "reqwest", "schemars", "serde", @@ -6587,29 +6921,31 @@ dependencies = [ "tauri-plugin", "tauri-plugin-fs", "thiserror", + "tokio", "url", + "urlpattern", ] [[package]] name = "tauri-plugin-localhost" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ - "http 1.0.0", + "http", "log", "serde", "serde_json", "tauri", "thiserror", - "tiny_http 0.12.0", + "tiny_http", ] [[package]] name = "tauri-plugin-log" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ "android_logger", "byte-unit", - "cocoa 0.24.1", + "cocoa", "fern", "log", "objc", @@ -6619,12 +6955,13 @@ dependencies = [ "swift-rs", "tauri", "tauri-plugin", + "thiserror", "time", ] [[package]] name = "tauri-plugin-nfc" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ "log", "serde", @@ -6637,37 +6974,31 @@ dependencies = [ [[package]] name = "tauri-plugin-notification" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ - "chrono", "color-backtrace", "ctor", - "env_logger", - "image", - "lazy_static", "log", - "mac-notification-sys", "maplit", + "notify-rust", "rand 0.8.5", "serde", "serde_json", "serde_repr", "tauri", "tauri-plugin", - "tauri-winrt-notification", "thiserror", "time", "url", "win7-notifications", "windows-version", - "zbus", ] [[package]] name = "tauri-plugin-os" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ - "gethostname", + "gethostname 0.5.0", "log", "os_info", "serde", @@ -6681,7 +7012,7 @@ dependencies = [ [[package]] name = "tauri-plugin-persisted-scope" -version = "2.0.0-beta.1" +version = "2.0.3" dependencies = [ "aho-corasick", "bincode", @@ -6695,7 +7026,7 @@ dependencies = [ [[package]] name = "tauri-plugin-positioner" -version = "2.0.0-beta.1" +version = "2.0.2" dependencies = [ "log", "serde", @@ -6708,7 +7039,7 @@ dependencies = [ [[package]] name = "tauri-plugin-process" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ "tauri", "tauri-plugin", @@ -6716,7 +7047,7 @@ dependencies = [ [[package]] name = "tauri-plugin-shell" -version = "2.0.0-beta.1" +version = "2.0.2" dependencies = [ "encoding_rs", "log", @@ -6730,27 +7061,30 @@ dependencies = [ "tauri", "tauri-plugin", "thiserror", - "windows 0.54.0", + "tokio", ] [[package]] name = "tauri-plugin-single-instance" -version = "2.0.0-beta.2" +version = "2.0.1" dependencies = [ "log", + "semver", "serde", "serde_json", "tauri", + "tauri-plugin-deep-link", "thiserror", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "zbus", ] [[package]] name = "tauri-plugin-sql" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ "futures-core", + "indexmap 2.6.0", "log", "serde", "serde_json", @@ -6764,28 +7098,30 @@ dependencies = [ [[package]] name = "tauri-plugin-store" -version = "2.0.0-beta.1" +version = "2.1.0" dependencies = [ + "dunce", "log", "serde", "serde_json", "tauri", "tauri-plugin", "thiserror", + "tokio", ] [[package]] name = "tauri-plugin-stronghold" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ "hex", - "iota-crypto 0.23.1", + "iota-crypto", "iota_stronghold", "log", "rand 0.8.5", "rand_chacha 0.3.1", "rand_core 0.6.4", - "rust-argon2", + "rust-argon2 2.1.0", "rusty-fork", "serde", "serde_json", @@ -6797,15 +7133,15 @@ dependencies = [ [[package]] name = "tauri-plugin-updater" -version = "2.0.0-beta.1" +version = "2.0.2" dependencies = [ - "base64 0.21.7", - "dirs-next", + "base64 0.22.1", + "dirs 5.0.1", "flate2", "futures-util", - "http 0.2.11", + "http", + "infer", "minisign-verify", - "mockito", "percent-encoding", "reqwest", "semver", @@ -6819,15 +7155,17 @@ dependencies = [ "time", "tokio", "url", + "windows-sys 0.59.0", "zip", ] [[package]] name = "tauri-plugin-upload" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ "futures-util", "log", + "mockito", "read-progress-stream", "reqwest", "serde", @@ -6841,10 +7179,10 @@ dependencies = [ [[package]] name = "tauri-plugin-websocket" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ "futures-util", - "http 1.0.0", + "http", "log", "rand 0.8.5", "serde", @@ -6858,10 +7196,9 @@ dependencies = [ [[package]] name = "tauri-plugin-window-state" -version = "2.0.0-beta.1" +version = "2.0.1" dependencies = [ - "bincode", - "bitflags 2.4.2", + "bitflags 2.6.0", "log", "serde", "serde_json", @@ -6872,34 +7209,38 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "2.0.0-beta.5" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d265cd2e7b319030ac9386a8bf711f8da3da292eef2a8f478a44df2042660dfd" +checksum = "c8f437293d6f5e5dce829250f4dbdce4e0b52905e297a6689cc2963eb53ac728" dependencies = [ + "dpi", "gtk", - "http 0.2.11", + "http", "jni", - "raw-window-handle 0.6.0", + "raw-window-handle", "serde", "serde_json", "tauri-utils", "thiserror", "url", - "windows 0.52.0", + "windows 0.58.0", ] [[package]] name = "tauri-runtime-wry" -version = "2.0.0-beta.5" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f428ea2dedaf129bbb72e5b2aaf7f44e541b46d5a67c8bdcbbe4f85f59b2e428" +checksum = "1431602bcc71f2f840ad623915c9842ecc32999b867c4a787d975a17a9625cc6" dependencies = [ - "cocoa 0.25.0", "gtk", - "http 0.2.11", + "http", "jni", + "log", + "objc2", + "objc2-app-kit", + "objc2-foundation", "percent-encoding", - "raw-window-handle 0.6.0", + "raw-window-handle", "softbuffer", "tao", "tauri-runtime", @@ -6907,24 +7248,23 @@ dependencies = [ "url", "webkit2gtk", "webview2-com", - "windows 0.52.0", + "windows 0.58.0", "wry", ] [[package]] name = "tauri-utils" -version = "2.0.0-beta.5" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66ed6c646be32b5e9df6f1380352f1ecdd720b149b35f53ba0bfc60b065b1e29" +checksum = "c38b0230d6880cf6dd07b6d7dd7789a0869f98ac12146e0d18d1c1049215a045" dependencies = [ - "aes-gcm 0.10.3", - "brotli", + "aes-gcm", + "brotli 6.0.0", "cargo_metadata", "ctor", "dunce", - "getrandom 0.2.12", + "getrandom 0.2.15", "glob", - "heck", "html5ever", "infer", "json-patch", @@ -6934,9 +7274,11 @@ dependencies = [ "phf 0.11.2", "proc-macro2", "quote", + "regex", "schemars", "semver", "serde", + "serde-untagged", "serde_json", "serde_with", "serialize-to-javascript", @@ -6944,7 +7286,9 @@ dependencies = [ "thiserror", "toml 0.8.10", "url", - "walkdir 2.4.0", + "urlpattern", + "uuid", + "walkdir", ] [[package]] @@ -6959,24 +7303,26 @@ dependencies = [ [[package]] name = "tauri-winrt-notification" -version = "0.1.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006851c9ccefa3c38a7646b8cec804bb429def3da10497bfa977179869c3e8e2" +checksum = "f89f5fb70d6f62381f5d9b2ba9008196150b40b75f3068eb24faeddf1c686871" dependencies = [ - "quick-xml 0.30.0", - "windows 0.51.1", + "quick-xml 0.31.0", + "windows 0.56.0", + "windows-version", ] [[package]] name = "tempfile" -version = "3.10.1" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -7007,32 +7353,22 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", + "syn 2.0.79", ] [[package]] @@ -7048,12 +7384,12 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", - "itoa 1.0.10", + "itoa 1.0.11", "libc", "num-conv", "num_threads", @@ -7071,37 +7407,21 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", ] [[package]] -name = "tiny-xlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4098d49269baa034a8d1eae9bd63e9fa532148d772121dace3bcd6a6c98eb6d" -dependencies = [ - "as-raw-xcb-connection", - "ctor", - "libloading 0.8.1", - "tracing", -] - -[[package]] -name = "tiny_http" -version = "0.11.0" +name = "tiny-keccak" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0d6ef4e10d23c1efb862eecad25c5054429a71958b4eeef85eb5e7170b477ca" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" dependencies = [ - "ascii", - "chunked_transfer", - "log", - "time", - "url", + "crunchy", ] [[package]] @@ -7118,9 +7438,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -7133,58 +7453,60 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", "libc", - "mio", - "num_cpus", + "mio 1.0.2", + "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", + "tokio-macros", "tracing", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] -name = "tokio-native-tls" -version = "0.3.1" +name = "tokio-macros" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ - "native-tls", - "tokio", + "proc-macro2", + "quote", + "syn 2.0.79", ] [[package]] -name = "tokio-rustls" -version = "0.24.1" +name = "tokio-native-tls" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ - "rustls 0.21.10", + "native-tls", "tokio", ] [[package]] name = "tokio-rustls" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.22.2", + "rustls", "rustls-pki-types", "tokio", ] [[package]] name = "tokio-socks" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51165dfa029d2a65969413a6cc96f354b86b464498702f174a4efa13608fd8c0" +checksum = "0d4770b8024672c1101b3f6733eab95b18007dbe0847a8afe341fcf79e06043f" dependencies = [ "either", "futures-util", @@ -7194,9 +7516,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -7205,34 +7527,34 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.21.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" +checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" dependencies = [ "futures-util", "log", "native-tls", - "rustls 0.22.2", + "rustls", + "rustls-native-certs", "rustls-pki-types", "tokio", "tokio-native-tls", - "tokio-rustls 0.25.0", + "tokio-rustls", "tungstenite", - "webpki-roots 0.26.1", + "webpki-roots", ] [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -7274,7 +7596,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -7309,7 +7631,7 @@ version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -7318,9 +7640,9 @@ dependencies = [ [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -7342,7 +7664,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] @@ -7352,112 +7674,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", ] [[package]] name = "tray-icon" -version = "0.11.3" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a4d9ddd4a7c0f3b6862af1c4911b529a49db4ee89310d3a258859c2f5053fdd" +checksum = "7c92af36a182b46206723bdf8a7942e20838cde1cf062e5b97854d57eb01763b" dependencies = [ - "cocoa 0.25.0", - "core-graphics 0.23.1", + "core-graphics 0.24.0", "crossbeam-channel", - "dirs-next", + "dirs 5.0.1", "libappindicator", "muda", - "objc", + "objc2", + "objc2-app-kit", + "objc2-foundation", "once_cell", "png", "serde", "thiserror", - "windows-sys 0.52.0", -] - -[[package]] -name = "treediff" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d127780145176e2b5d16611cc25a900150e86e9fd79d3bde6ff3a37359c9cb5" -dependencies = [ - "serde_json", -] - -[[package]] -name = "trust-dns-proto" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3119112651c157f4488931a01e586aa459736e9d6046d3bd9105ffb69352d374" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.4.0", - "ipnet", - "once_cell", - "rand 0.8.5", - "smallvec", - "thiserror", - "tinyvec", - "tokio", - "tracing", - "url", + "windows-sys 0.59.0", ] [[package]] -name = "trust-dns-resolver" -version = "0.23.2" +name = "trim-in-place" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a3e6c3aff1718b3c73e395d1f35202ba2ffa847c6a62eea0db8fb4cfe30be6" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lru-cache", - "once_cell", - "parking_lot", - "rand 0.8.5", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "tracing", - "trust-dns-proto", -] +checksum = "343e926fc669bc8cde4fa3129ab681c63671bae288b1f1081ceee6d9d37904fc" [[package]] name = "try-lock" @@ -7467,26 +7711,31 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.21.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" +checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" dependencies = [ "byteorder", "bytes", "data-encoding", - "http 1.0.0", + "http", "httparse", "log", "native-tls", "rand 0.8.5", - "rustls 0.22.2", + "rustls", "rustls-pki-types", "sha1", "thiserror", - "url", "utf-8", ] +[[package]] +name = "typeid" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" + [[package]] name = "typenum" version = "1.17.0" @@ -7499,9 +7748,50 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" dependencies = [ - "memoffset 0.9.0", + "memoffset 0.9.1", "tempfile", - "winapi 0.3.9", + "winapi", +] + +[[package]] +name = "unic-char-property" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" +dependencies = [ + "unic-char-range", +] + +[[package]] +name = "unic-char-range" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" + +[[package]] +name = "unic-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" + +[[package]] +name = "unic-ucd-ident" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e230a37c0381caa9219d67cf063aa3a375ffed5bf541a452db16e744bdab6987" +dependencies = [ + "unic-char-property", + "unic-char-range", + "unic-ucd-version", +] + +[[package]] +name = "unic-ucd-version" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" +dependencies = [ + "unic-common", ] [[package]] @@ -7515,46 +7805,42 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] -name = "unicode-segmentation" -version = "1.11.0" +name = "unicode-properties" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" [[package]] -name = "unicode_categories" -version = "0.1.1" +name = "unicode-segmentation" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" -[[package]] -name = "universal-hash" -version = "0.4.0" +[[package]] +name = "unicode_categories" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" -dependencies = [ - "generic-array", - "subtle", -] +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] name = "universal-hash" @@ -7568,21 +7854,40 @@ dependencies = [ [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] -name = "untrusted" -version = "0.9.0" +name = "updater-migration-test" +version = "0.1.0" +dependencies = [ + "serde", + "serde_json", + "tauri", + "tauri-build", + "tauri-plugin-updater", + "time", + "tiny_http", +] + +[[package]] +name = "ureq" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" +checksum = "b74fc6b57825be3373f7054754755f03ac3a8f5d70015ccad699ba2029956f4a" +dependencies = [ + "base64 0.22.1", + "log", + "once_cell", + "url", +] [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna 0.5.0", @@ -7591,10 +7896,16 @@ dependencies = [ ] [[package]] -name = "urlencoding" -version = "2.1.3" +name = "urlpattern" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" +checksum = "70acd30e3aa1450bc2eece896ce2ad0d178e9c079493819301573dae3c37ba6d" +dependencies = [ + "regex", + "serde", + "unic-ucd-ident", + "url", +] [[package]] name = "utf-8" @@ -7610,30 +7921,36 @@ checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.7.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", + "serde", ] [[package]] -name = "valuable" -version = "0.1.0" +name = "v_frame" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "d6f32aaa24bacd11e488aa9ba66369c7cd514885742c9fe08cfe85884db3e92b" +dependencies = [ + "aligned-vec", + "num-traits", + "wasm-bindgen", +] [[package]] name = "value-bag" -version = "1.7.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126e423afe2dd9ac52142e7e9d5ce4135d7e13776c529d27fd6bc49f19e3280b" +checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" [[package]] name = "vcpkg" @@ -7643,15 +7960,15 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version-compare" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" +checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vswhom" @@ -7684,22 +8001,11 @@ dependencies = [ [[package]] name = "walkdir" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff" -dependencies = [ - "kernel32-sys", - "same-file 0.1.3", - "winapi 0.2.8", -] - -[[package]] -name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ - "same-file 1.0.6", + "same-file", "winapi-util", ] @@ -7724,36 +8030,43 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -7763,9 +8076,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7773,28 +8086,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-streams" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +checksum = "4e072d4e72f700fb3443d8fe94a39315df013eef1104903cdb0a2abd322bbecd" dependencies = [ "futures-util", "js-sys", @@ -7805,9 +8118,9 @@ dependencies = [ [[package]] name = "wayland-backend" -version = "0.3.3" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d50fa61ce90d76474c87f5fc002828d81b32677340112b4ef08079a9d459a40" +checksum = "056535ced7a150d45159d3a8dc30f91a2e2d588ca0b23f70e56033622b8016f6" dependencies = [ "cc", "downcast-rs", @@ -7819,44 +8132,55 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.31.2" +version = "0.31.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f" +checksum = "e3f45d1222915ef1fd2057220c1d9d9624b7654443ea35c3877f7a52bd0a5a2d" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "rustix", "wayland-backend", "wayland-scanner", ] +[[package]] +name = "wayland-protocols" +version = "0.32.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b5755d77ae9040bb872a25026555ce4cb0ae75fd923e90d25fba07d81057de0" +dependencies = [ + "bitflags 2.6.0", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + [[package]] name = "wayland-scanner" -version = "0.31.1" +version = "0.31.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63b3a62929287001986fb58c789dce9b67604a397c15c611ad9f747300b6c283" +checksum = "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3" dependencies = [ "proc-macro2", - "quick-xml 0.31.0", + "quick-xml 0.36.2", "quote", ] [[package]] name = "wayland-sys" -version = "0.31.1" +version = "0.31.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" +checksum = "efa8ac0d8e8ed3e3b5c9fc92c7881406a268e11555abe36493efabe649a29e09" dependencies = [ "dlib", "log", - "once_cell", "pkg-config", ] [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -7873,10 +8197,10 @@ dependencies = [ "gdk", "gdk-sys", "gio", - "gio-sys 0.18.1", - "glib 0.18.5", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", "gtk", "gtk-sys", "javascriptcore-rs", @@ -7895,9 +8219,9 @@ dependencies = [ "bitflags 1.3.2", "cairo-sys-rs", "gdk-sys", - "gio-sys 0.18.1", - "glib-sys 0.18.1", - "gobject-sys 0.18.0", + "gio-sys", + "glib-sys", + "gobject-sys", "gtk-sys", "javascriptcore-rs-sys", "libc", @@ -7908,15 +8232,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - -[[package]] -name = "webpki-roots" -version = "0.26.1" +version = "0.26.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" dependencies = [ "rustls-pki-types", ] @@ -7937,38 +8255,38 @@ dependencies = [ [[package]] name = "webview2-com" -version = "0.28.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ae9c7e420783826cf769d2c06ac9ba462f450eca5893bb8c6c6529a4e5dd33" +checksum = "6f61ff3d9d0ee4efcb461b14eb3acfda2702d10dc329f339303fc3e57215ae2c" dependencies = [ "webview2-com-macros", "webview2-com-sys", - "windows 0.52.0", - "windows-core 0.52.0", - "windows-implement", - "windows-interface", + "windows 0.58.0", + "windows-core 0.58.0", + "windows-implement 0.58.0", + "windows-interface 0.58.0", ] [[package]] name = "webview2-com-macros" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc" +checksum = "1d228f15bba3b9d56dde8bddbee66fa24545bd17b48d5128ccf4a8742b18e431" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] name = "webview2-com-sys" -version = "0.28.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ad85fceee6c42fa3d61239eba5a11401bf38407a849ed5ea1b407df08cca72" +checksum = "a3a3e2eeb58f82361c93f9777014668eb3d07e7d174ee4c819575a9208011886" dependencies = [ "thiserror", - "windows 0.52.0", - "windows-core 0.52.0", + "windows 0.58.0", + "windows-core 0.58.0", ] [[package]] @@ -7979,32 +8297,24 @@ checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "whoami" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" - -[[package]] -name = "widestring" -version = "1.0.2" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" +checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" +dependencies = [ + "redox_syscall", + "wasite", +] [[package]] name = "win7-notifications" -version = "0.3.1" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "210952d7163b9ed83a6fd9754ab2a101d14480f8491b5f1d6292771d88dbee70" +checksum = "63b4745047a00800bd8f2b8fb4b0eb6f7d96822084127f0ff7d68d07f692fe38" dependencies = [ "once_cell", - "windows-sys 0.36.1", + "windows-sys 0.59.0", ] -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -8015,12 +8325,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -8029,11 +8333,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi 0.3.9", + "windows-sys 0.59.0", ] [[package]] @@ -8042,28 +8346,17 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "window-shadows" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ff424735b1ac21293b0492b069394b0a189c8a463fb015a16dea7c2e221c08" -dependencies = [ - "cocoa 0.25.0", - "objc", - "raw-window-handle 0.5.2", - "windows-sys 0.48.0", -] - [[package]] name = "window-vibrancy" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33082acd404763b315866e14a0d5193f3422c81086657583937a750cdd3ec340" +checksum = "3ea403deff7b51fff19e261330f71608ff2cdef5721d72b64180bb95be7c4150" dependencies = [ - "cocoa 0.25.0", - "objc", - "raw-window-handle 0.6.0", - "windows-sys 0.52.0", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "raw-window-handle", + "windows-sys 0.59.0", "windows-version", ] @@ -8082,126 +8375,159 @@ dependencies = [ [[package]] name = "windows" -version = "0.51.1" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" dependencies = [ - "windows-core 0.51.1", - "windows-targets 0.48.5", + "windows-core 0.56.0", + "windows-targets 0.52.6", ] [[package]] name = "windows" -version = "0.52.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" dependencies = [ - "windows-core 0.52.0", - "windows-implement", - "windows-interface", - "windows-targets 0.52.3", + "windows-core 0.58.0", + "windows-targets 0.52.6", ] [[package]] -name = "windows" -version = "0.53.0" +name = "windows-core" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efc5cf48f83140dcaab716eeaea345f9e93d0018fb81162753a3f76c3397b538" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-core 0.53.0", - "windows-targets 0.52.3", + "windows-targets 0.52.6", ] [[package]] -name = "windows" -version = "0.54.0" +name = "windows-core" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" +checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" dependencies = [ - "windows-core 0.54.0", - "windows-targets 0.52.3", + "windows-implement 0.56.0", + "windows-interface 0.56.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", ] [[package]] name = "windows-core" -version = "0.51.1" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" dependencies = [ - "windows-targets 0.48.5", + "windows-implement 0.58.0", + "windows-interface 0.58.0", + "windows-result 0.2.0", + "windows-strings 0.1.0", + "windows-targets 0.52.6", ] [[package]] -name = "windows-core" -version = "0.52.0" +name = "windows-implement" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" dependencies = [ - "windows-targets 0.52.3", + "proc-macro2", + "quote", + "syn 2.0.79", ] [[package]] -name = "windows-core" -version = "0.53.0" +name = "windows-implement" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dcc5b895a6377f1ab9fa55acedab1fd5ac0db66ad1e6c7f47e28a22e446a5dd" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ - "windows-result", - "windows-targets 0.52.3", + "proc-macro2", + "quote", + "syn 2.0.79", ] [[package]] -name = "windows-core" -version = "0.54.0" +name = "windows-interface" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" +checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" dependencies = [ - "windows-result", - "windows-targets 0.52.3", + "proc-macro2", + "quote", + "syn 2.0.79", ] [[package]] -name = "windows-implement" -version = "0.52.0" +name = "windows-interface" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12168c33176773b86799be25e2a2ba07c7aab9968b37541f1094dbd7a60c8946" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] -name = "windows-interface" -version = "0.52.0" +name = "windows-registry" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d8dc32e0095a7eeccebd0e3f09e9509365ecb3fc6ac4d6f5f14a3f6392942d1" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.51", + "windows-result 0.2.0", + "windows-strings 0.1.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-registry" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bafa604f2104cf5ae2cc2db1dee84b7e6a5d11b05f737b60def0ffdc398cbc0a" +dependencies = [ + "windows-result 0.2.0", + "windows-strings 0.2.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd19df78e5168dfb0aedc343d1d1b8d422ab2db6756d2dc3fef75035402a3f64" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ - "windows-targets 0.52.3", + "windows-result 0.2.0", + "windows-targets 0.52.6", ] [[package]] -name = "windows-sys" -version = "0.36.1" +name = "windows-strings" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "978d65aedf914c664c510d9de43c8fd85ca745eaff1ed53edf409b479e441663" dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", + "windows-targets 0.52.6", ] [[package]] @@ -8228,7 +8554,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -8263,26 +8598,27 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.3", - "windows_aarch64_msvc 0.52.3", - "windows_i686_gnu 0.52.3", - "windows_i686_msvc 0.52.3", - "windows_x86_64_gnu 0.52.3", - "windows_x86_64_gnullvm 0.52.3", - "windows_x86_64_msvc 0.52.3", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] name = "windows-version" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75aa004c988e080ad34aff5739c39d0312f4684699d6d71fc8a198d057b8b9b4" +checksum = "6998aa457c9ba8ff2fb9f13e9d2a930dabcea28f1d0ab94d687d8b3654844515" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.6", ] [[package]] @@ -8299,9 +8635,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -8323,9 +8659,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -8347,9 +8683,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.3" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -8371,9 +8713,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -8395,9 +8737,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -8413,9 +8755,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -8437,9 +8779,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -8465,24 +8807,14 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", + "winapi", ] [[package]] name = "winreg" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "937f3df7948156640f46aacef17a70db0de5917bda9c92b0f751f3a955b588fc" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ "cfg-if", "windows-sys 0.48.0", @@ -8490,45 +8822,41 @@ dependencies = [ [[package]] name = "wry" -version = "0.37.0" +version = "0.46.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b717040ba9771fd88eb428c6ea6b555f8e734ff8534f02c13e8f10d97f5935e" +checksum = "6fa1c8c760041c64ce6be99f83d6cb55fe3fcd85a1ad46d32895f6e65cee87ba" dependencies = [ - "base64 0.21.7", - "block", - "cfg_aliases 0.1.1", - "cocoa 0.25.0", - "core-graphics 0.23.1", + "base64 0.22.1", + "block2", "crossbeam-channel", + "dpi", "dunce", "gdkx11", "gtk", "html5ever", - "http 0.2.11", + "http", "javascriptcore-rs", "jni", "kuchikiki", "libc", - "log", "ndk", - "ndk-context", - "ndk-sys", - "objc", - "objc_id", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", "once_cell", "percent-encoding", - "raw-window-handle 0.6.0", - "serde", - "serde_json", - "sha2 0.10.8", + "raw-window-handle", + "sha2", "soup3", "tao-macros", "thiserror", "webkit2gtk", "webkit2gtk-sys", "webview2-com", - "windows 0.52.0", - "windows-implement", + "windows 0.58.0", + "windows-core 0.58.0", "windows-version", "x11-dl", ] @@ -8565,33 +8893,29 @@ dependencies = [ [[package]] name = "x11rb" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a" +checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" dependencies = [ - "as-raw-xcb-connection", - "gethostname", - "libc", - "libloading 0.8.1", - "once_cell", + "gethostname 0.4.3", "rustix", "x11rb-protocol", ] [[package]] name = "x11rb-protocol" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34" +checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" [[package]] name = "x25519-dalek" -version = "1.1.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ "curve25519-dalek", - "rand_core 0.5.1", + "rand_core 0.6.4", "zeroize", ] @@ -8602,18 +8926,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys", "rustix", ] [[package]] name = "xdg-home" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e5a325c3cb8398ad6cf859c1135b25dd29e186679cf2da7581d9679f63b38e" +checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" dependencies = [ "libc", - "winapi 0.3.9", + "windows-sys 0.59.0", ] [[package]] @@ -8626,7 +8950,7 @@ dependencies = [ "async-executor", "async-fs", "async-io", - "async-lock 3.3.0", + "async-lock", "async-process", "async-recursion", "async-task", @@ -8634,7 +8958,7 @@ dependencies = [ "blocking", "derivative", "enumflags2", - "event-listener 5.1.0", + "event-listener", "futures-core", "futures-sink", "futures-util", @@ -8683,30 +9007,32 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ + "serde", "zeroize_derive", ] @@ -8718,65 +9044,62 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.79", ] [[package]] name = "zip" -version = "0.6.6" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +checksum = "dc5e4288ea4057ae23afc69a4472434a87a2495cafce6632fd1c4ec9f5cf3494" dependencies = [ - "aes 0.8.4", - "byteorder", - "bzip2", - "constant_time_eq 0.1.5", + "arbitrary", "crc32fast", "crossbeam-utils", + "displaydoc", "flate2", - "hmac", - "pbkdf2", - "sha1", - "time", - "zstd", + "indexmap 2.6.0", + "memchr", + "thiserror", + "zopfli", ] [[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" +name = "zopfli" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +checksum = "e5019f391bac5cf252e93bbcc53d039ffd62c7bfb7c150414d61369afe57e946" dependencies = [ - "zstd-safe", + "bumpalo", + "crc32fast", + "lockfree-object-pool", + "log", + "once_cell", + "simd-adler32", ] [[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" +name = "zune-core" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", -] +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" [[package]] -name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" +name = "zune-inflate" +version = "0.2.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" dependencies = [ - "cc", - "pkg-config", + "simd-adler32", ] [[package]] -name = "zune-inflate" -version = "0.2.54" +name = "zune-jpeg" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" +checksum = "16099418600b4d8f028622f73ff6e3deaabdff330fb9a2a131dea781ee8b0768" dependencies = [ - "simd-adler32", + "zune-core", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index cdc5865e..a17d33ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ members = [ "plugins/*", "plugins/*/tests/*", + "plugins/updater/tests/updater-migration/v2-app", "plugins/*/examples/*/src-tauri", "examples/*/src-tauri", ] @@ -10,19 +11,24 @@ resolver = "2" [workspace.dependencies] serde = { version = "1", features = ["derive"] } log = "0.4" -tauri = "2.0.0-beta.4" -tauri-build = "2.0.0-beta.3" -tauri-plugin = "2.0.0-beta.3" +tauri = { version = "2.0.4", default-features = false } +tauri-build = "2.0.1" +tauri-plugin = "2.0.1" +tauri-utils = "2.0.1" serde_json = "1" thiserror = "1" url = "2" schemars = "0.8" +dunce = "1" +specta = "=2.0.0-rc.20" +#tauri-specta = "=2.0.0-rc.11" [workspace.package] edition = "2021" authors = ["Tauri Programme within The Commons Conservancy"] license = "Apache-2.0 OR MIT" -rust-version = "1.75" +rust-version = "1.77.2" +repository = "https://github.com/tauri-apps/plugins-workspace" # default to small, optimized release binaries [profile.release] diff --git a/README.md b/README.md index 444c4e99..dbb5b0c6 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,40 @@ ## Plugins Found Here -| | | Win | Mac | Lin | iOS | And | -| ----------------------------------------------- | ------------------------------------------------------ | --- | --- | --- | --- | --- | -| [authenticator](plugins/authenticator) | Interface with hardware security keys. | ✅ | ✅ | ✅ | ? | ? | -| [autostart](plugins/autostart) | Automatically launch your app at system startup. | ✅ | ✅ | ✅ | ? | ? | -| [barcode-scanner](plugins/barcode-scanner) | Allows your mobile application to use the camera to scan QR codes, EAN-13 and other kinds of barcodes. | ? | ? | ? | ✅ | ✅ | -| [biometric](plugins/biometric) | Prompt the user for biometric authentication on Android and iOS. | ? | ? | ? | ✅ | ✅ | -| [cli](plugins/cli) | Parse arguments from your Command Line Interface | ✅ | ✅ | ✅ | ? | ? | -| [clipboard-manager](plugins/clipboard-manager) | Read and write to the system clipboard. | ✅ | ✅ | ✅ | ✅ | ✅ | -| [deep-link](plugins/deep-link) | Set your Tauri application as the default handler for an URL. | ? | ? | ? | ✅ | ✅ | -| [dialog](plugins/dialog) | Native system dialogs for opening and saving files along with message dialogs. | ✅ | ✅ | ✅ | ✅ | ✅ | -| [fs](plugins/fs) | Access the file system. | ✅ | ✅ | ✅ | ? | ? | -| [global-shortcut](plugins/global-shortcut) | Register global shortcuts. | ✅ | ✅ | ✅ | ? | ? | -| [http](plugins/http) | Access the HTTP client written in Rust. | ✅ | ✅ | ✅ | ✅ | ✅ | -| [localhost](plugins/localhost) | Use a localhost server in production apps. | ✅ | ✅ | ✅ | ? | ? | -| [log](plugins/log) | Configurable logging. | ✅ | ✅ | ✅ | ✅ | ✅ | -| [nfc](plugins/nfc) | Read and write NFC tags on Android and iOS. | ? | ? | ? | ✅ | ✅ | -| [notification](plugins/notification) | Send message notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API. | ✅ | ✅ | ✅ | ✅ | ✅ | -| [os](plugins/os) | Read information about the operating system. | ✅ | ✅ | ✅ | ✅ | ✅ | -| [persisted-scope](plugins/persisted-scope) | Persist runtime scope changes on the filesystem. | ✅ | ✅ | ✅ | ? | ? | -| [positioner](plugins/positioner) | Move windows to common locations. | ✅ | ✅ | ✅ | ? | ? | -| [process](plugins/process) | This plugin provides APIs to access the current process. To spawn child processes, see the [`shell`](https://github.com/tauri-apps/tauri-plugin-shell) plugin. | ✅ | ✅ | ✅ | ? | ? | -| [shell](plugins/shell) | Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application. | ✅ | ✅ | ✅ | ? | ? | -| [single-instance](plugins/single-instance) | Ensure a single instance of your tauri app is running. | ✅ | ? | ✅ | ? | ? | -| [sql](plugins/sql) | Interface with SQL databases. | ✅ | ✅ | ✅ | ? | ? | -| [store](plugins/store) | Persistent key value storage. | ✅ | ✅ | ✅ | ? | ? | -| [stronghold](plugins/stronghold) | Encrypted, secure database. | ✅ | ✅ | ✅ | ? | ? | -| [updater](plugins/updater) | In-app updates for Tauri applications. | ✅ | ✅ | ✅ | ? | ? | -| [upload](plugins/upload) | Tauri plugin for file uploads through HTTP. | ✅ | ✅ | ✅ | ? | ? | -| [websocket](plugins/websocket) | Open a WebSocket connection using a Rust client in JS. | ✅ | ✅ | ✅ | ? | ? | -| [window-state](plugins/window-state) | Persist window sizes and positions. | ✅ | ✅ | ✅ | ? | ? | +| | | Win | Mac | Lin | iOS | And | +| ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --- | --- | --- | --- | +| [autostart](plugins/autostart) | Automatically launch your app at system startup. | ✅ | ✅ | ✅ | ? | ? | +| [barcode-scanner](plugins/barcode-scanner) | Allows your mobile application to use the camera to scan QR codes, EAN-13 and other kinds of barcodes. | ? | ? | ? | ✅ | ✅ | +| [biometric](plugins/biometric) | Prompt the user for biometric authentication on Android and iOS. | ? | ? | ? | ✅ | ✅ | +| [cli](plugins/cli) | Parse arguments from your Command Line Interface | ✅ | ✅ | ✅ | ? | ? | +| [clipboard-manager](plugins/clipboard-manager) | Read and write to the system clipboard. | ✅ | ✅ | ✅ | ✅ | ✅ | +| [deep-link](plugins/deep-link) | Set your Tauri application as the default handler for an URL. | ✅ | ✅ | ✅ | ✅ | ✅ | +| [dialog](plugins/dialog) | Native system dialogs for opening and saving files along with message dialogs. | ✅ | ✅ | ✅ | ✅ | ✅ | +| [fs](plugins/fs) | Access the file system. | ✅ | ✅ | ✅ | ? | ? | +| [global-shortcut](plugins/global-shortcut) | Register global shortcuts. | ✅ | ✅ | ✅ | ? | ? | +| [http](plugins/http) | Access the HTTP client written in Rust. | ✅ | ✅ | ✅ | ✅ | ✅ | +| [localhost](plugins/localhost) | Use a localhost server in production apps. | ✅ | ✅ | ✅ | ? | ? | +| [log](plugins/log) | Configurable logging. | ✅ | ✅ | ✅ | ✅ | ✅ | +| [nfc](plugins/nfc) | Read and write NFC tags on Android and iOS. | ? | ? | ? | ✅ | ✅ | +| [notification](plugins/notification) | Send message notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API. | ✅ | ✅ | ✅ | ✅ | ✅ | +| [os](plugins/os) | Read information about the operating system. | ✅ | ✅ | ✅ | ✅ | ✅ | +| [persisted-scope](plugins/persisted-scope) | Persist runtime scope changes on the filesystem. | ✅ | ✅ | ✅ | ? | ? | +| [positioner](plugins/positioner) | Move windows to common locations. | ✅ | ✅ | ✅ | ? | ? | +| [process](plugins/process) | This plugin provides APIs to access the current process. To spawn child processes, see the [`shell`](https://github.com/tauri-apps/tauri-plugin-shell) plugin. | ✅ | ✅ | ✅ | ? | ? | +| [shell](plugins/shell) | Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application. | ✅ | ✅ | ✅ | ? | ? | +| [single-instance](plugins/single-instance) | Ensure a single instance of your tauri app is running. | ✅ | ? | ✅ | ? | ? | +| [sql](plugins/sql) | Interface with SQL databases. | ✅ | ✅ | ✅ | ? | ? | +| [store](plugins/store) | Persistent key value storage. | ✅ | ✅ | ✅ | ✅ | ✅ | +| [stronghold](plugins/stronghold) | Encrypted, secure database. | ✅ | ✅ | ✅ | ? | ? | +| [updater](plugins/updater) | In-app updates for Tauri applications. | ✅ | ✅ | ✅ | ? | ? | +| [upload](plugins/upload) | Tauri plugin for file uploads through HTTP. | ✅ | ✅ | ✅ | ? | ? | +| [websocket](plugins/websocket) | Open a WebSocket connection using a Rust client in JS. | ✅ | ✅ | ✅ | ? | ? | +| [window-state](plugins/window-state) | Persist window sizes and positions. | ✅ | ✅ | ✅ | ? | ? | -_This repo and all plugins require a Rust version of at least **1.75**_ +_This repo and all plugins require a Rust version of at least **1.77.2**_ + +## Contributing + +PRs accepted. Please make sure to read the [Contributing Guide](https://github.com/tauri-apps/tauri/blob/dev/.github/CONTRIBUTING.md) before making a pull request. ## Partners diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..f34103ee --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,38 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import eslint from '@eslint/js' +import eslintConfigPrettier from 'eslint-config-prettier' +import eslintPluginSecurity from 'eslint-plugin-security' +import tseslint from 'typescript-eslint' + +export default tseslint.config( + { + ignores: [ + '**/target', + '**/node_modules', + '**/examples', + '**/dist', + '**/dist-js', + '**/build', + '**/api-iife.js', + '**/init-iife.js', + '**/init.js', + '**/rollup.config.js', + '**/bindings.ts', + '**/.test-server', + '.scripts', + 'eslint.config.js' + ] + }, + eslint.configs.recommended, + eslintConfigPrettier, + eslintPluginSecurity.configs.recommended, + ...tseslint.configs.recommendedTypeChecked, + { + languageOptions: { + parserOptions: { project: true, tsconfigRootDir: import.meta.dirname } + } + } +) diff --git a/examples/api/.gitignore b/examples/api/.gitignore deleted file mode 100644 index ac9643a2..00000000 --- a/examples/api/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/node_modules/ -/.vscode/ -.DS_Store -.cargo diff --git a/examples/api/CHANGELOG.md b/examples/api/CHANGELOG.md index 97bab4e7..0fc70ec0 100644 --- a/examples/api/CHANGELOG.md +++ b/examples/api/CHANGELOG.md @@ -1,5 +1,269 @@ # Changelog +## \[2.0.1] + +### Dependencies + +- Upgraded to `dialog-js@2.0.1` +- Upgraded to `fs-js@2.0.1` +- Upgraded to `http-js@2.0.1` +- Upgraded to `shell-js@2.0.1` +- Upgraded to `store-js@2.1.0` + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +### Dependencies + +- Upgraded to `barcode-scanner-js@2.0.0` +- Upgraded to `biometric-js@2.0.0` +- Upgraded to `cli-js@2.0.0` +- Upgraded to `clipboard-manager-js@2.0.0` +- Upgraded to `fs-js@2.0.0` +- Upgraded to `dialog-js@2.0.0` +- Upgraded to `global-shortcut-js@2.0.0` +- Upgraded to `http-js@2.0.0` +- Upgraded to `log-js@2.0.0` +- Upgraded to `nfc-js@2.0.0` +- Upgraded to `notification-js@2.0.0` +- Upgraded to `os-js@2.0.0` +- Upgraded to `process-js@2.0.0` +- Upgraded to `shell-js@2.0.0` +- Upgraded to `store-js@2.0.0` +- Upgraded to `updater-js@2.0.0` + +## \[2.0.0-rc.5] + +### Dependencies + +- Upgraded to `store-js@2.0.0-rc.2` + +## \[2.0.0-rc.4] + +### Dependencies + +- Upgraded to `barcode-scanner-js@2.0.0-rc.2` +- Upgraded to `clipboard-manager-js@2.0.0-rc.2` + +## \[2.0.0-rc.3] + +### Dependencies + +- Upgraded to `updater-js@2.0.0-rc.2` + +## \[2.0.0-rc.2] + +### Dependencies + +- Upgraded to `barcode-scanner-js@2.0.0-rc.1` +- Upgraded to `notification-js@2.0.0-rc.1` +- Upgraded to `dialog-js@2.0.0-rc.1` +- Upgraded to `biometric-js@2.0.0-rc.1` +- Upgraded to `cli-js@2.0.0-rc.1` +- Upgraded to `clipboard-manager-js@2.0.0-rc.1` +- Upgraded to `fs-js@2.0.0-rc.2` +- Upgraded to `global-shortcut-js@2.0.0-rc.1` +- Upgraded to `http-js@2.0.0-rc.2` +- Upgraded to `log-js@2.0.0-rc.1` +- Upgraded to `nfc-js@2.0.0-rc.1` +- Upgraded to `os-js@2.0.0-rc.1` +- Upgraded to `process-js@2.0.0-rc.1` +- Upgraded to `shell-js@2.0.0-rc.1` +- Upgraded to `store-js@2.0.0-rc.1` +- Upgraded to `updater-js@2.0.0-rc.1` + +## \[2.0.0-rc.1] + +### Dependencies + +- Upgraded to `http-js@2.0.0-rc.1` +- Upgraded to `fs-js@2.0.0-rc.1` + +## \[2.0.0-rc.0] + +### Dependencies + +- Upgraded to `barcode-scanner-js@2.0.0-rc.0` +- Upgraded to `biometric-js@2.0.0-rc.0` +- Upgraded to `cli-js@2.0.0-rc.0` +- Upgraded to `clipboard-manager-js@2.0.0-rc.0` +- Upgraded to `dialog-js@2.0.0-rc.0` +- Upgraded to `fs-js@2.0.0-rc.0` +- Upgraded to `global-shortcut-js@2.0.0-rc.0` +- Upgraded to `http-js@2.0.0-rc.0` +- Upgraded to `log-js@2.0.0-rc.0` +- Upgraded to `nfc-js@2.0.0-rc.0` +- Upgraded to `notification-js@2.0.0-rc.0` +- Upgraded to `os-js@2.0.0-rc.0` +- Upgraded to `process-js@2.0.0-rc.0` +- Upgraded to `shell-js@2.0.0-rc.0` +- Upgraded to `updater-js@2.0.0-rc.0` + +## \[2.0.0-beta.12] + +### Dependencies + +- Upgraded to `barcode-scanner-js@2.0.0-beta.8` +- Upgraded to `biometric-js@2.0.0-beta.8` +- Upgraded to `cli-js@2.0.0-beta.8` +- Upgraded to `clipboard-manager-js@2.1.0-beta.6` +- Upgraded to `dialog-js@2.0.0-beta.8` +- Upgraded to `fs-js@2.0.0-beta.8` +- Upgraded to `global-shortcut-js@2.0.0-beta.8` +- Upgraded to `http-js@2.0.0-beta.9` +- Upgraded to `log-js@2.0.0-beta.9` +- Upgraded to `nfc-js@2.0.0-beta.8` +- Upgraded to `notification-js@2.0.0-beta.8` +- Upgraded to `os-js@2.0.0-beta.8` +- Upgraded to `process-js@2.0.0-beta.8` +- Upgraded to `shell-js@2.0.0-beta.9` +- Upgraded to `updater-js@2.0.0-beta.8` + +## \[2.0.0-beta.11] + +### Dependencies + +- Upgraded to `global-shortcut-js@2.0.0-beta.7` +- Upgraded to `http-js@2.0.0-beta.8` +- Upgraded to `os-js@2.0.0-beta.7` +- Upgraded to `barcode-scanner-js@2.0.0-beta.7` +- Upgraded to `biometric-js@2.0.0-beta.7` +- Upgraded to `cli-js@2.0.0-beta.7` +- Upgraded to `clipboard-manager-js@2.1.0-beta.5` +- Upgraded to `dialog-js@2.0.0-beta.7` +- Upgraded to `fs-js@2.0.0-beta.7` +- Upgraded to `log-js@2.0.0-beta.8` +- Upgraded to `nfc-js@2.0.0-beta.7` +- Upgraded to `notification-js@2.0.0-beta.7` +- Upgraded to `process-js@2.0.0-beta.7` +- Upgraded to `shell-js@2.0.0-beta.8` +- Upgraded to `updater-js@2.0.0-beta.7` + +## \[2.0.0-beta.10] + +### Dependencies + +- Upgraded to `os-js@2.0.0-beta.6` +- Upgraded to `barcode-scanner-js@2.0.0-beta.6` +- Upgraded to `biometric-js@2.0.0-beta.6` +- Upgraded to `cli-js@2.0.0-beta.6` +- Upgraded to `clipboard-manager-js@2.1.0-beta.4` +- Upgraded to `dialog-js@2.0.0-beta.6` +- Upgraded to `fs-js@2.0.0-beta.6` +- Upgraded to `global-shortcut-js@2.0.0-beta.6` +- Upgraded to `http-js@2.0.0-beta.7` +- Upgraded to `log-js@2.0.0-beta.7` +- Upgraded to `nfc-js@2.0.0-beta.6` +- Upgraded to `notification-js@2.0.0-beta.6` +- Upgraded to `process-js@2.0.0-beta.6` +- Upgraded to `shell-js@2.0.0-beta.7` +- Upgraded to `updater-js@2.0.0-beta.6` + +## \[2.0.0-beta.9] + +### Dependencies + +- Upgraded to `http-js@2.0.0-beta.6` + +## \[2.0.0-beta.8] + +### Dependencies + +- Upgraded to `barcode-scanner-js@2.0.0-beta.5` +- Upgraded to `biometric-js@2.0.0-beta.5` +- Upgraded to `cli-js@2.0.0-beta.5` +- Upgraded to `clipboard-manager-js@2.1.0-beta.3` +- Upgraded to `dialog-js@2.0.0-beta.5` +- Upgraded to `fs-js@2.0.0-beta.5` +- Upgraded to `global-shortcut-js@2.0.0-beta.5` +- Upgraded to `http-js@2.0.0-beta.5` +- Upgraded to `log-js@2.0.0-beta.6` +- Upgraded to `nfc-js@2.0.0-beta.5` +- Upgraded to `notification-js@2.0.0-beta.5` +- Upgraded to `os-js@2.0.0-beta.5` +- Upgraded to `process-js@2.0.0-beta.5` +- Upgraded to `shell-js@2.0.0-beta.6` +- Upgraded to `updater-js@2.0.0-beta.5` + +## \[2.0.0-beta.7] + +### Dependencies + +- Upgraded to `http-js@2.0.0-beta.4` +- Upgraded to `barcode-scanner-js@2.0.0-beta.4` +- Upgraded to `biometric-js@2.0.0-beta.4` +- Upgraded to `cli-js@2.0.0-beta.4` +- Upgraded to `clipboard-manager-js@2.1.0-beta.2` +- Upgraded to `dialog-js@2.0.0-beta.4` +- Upgraded to `fs-js@2.0.0-beta.4` +- Upgraded to `global-shortcut-js@2.0.0-beta.4` +- Upgraded to `log-js@2.0.0-beta.5` +- Upgraded to `nfc-js@2.0.0-beta.4` +- Upgraded to `notification-js@2.0.0-beta.4` +- Upgraded to `os-js@2.0.0-beta.4` +- Upgraded to `process-js@2.0.0-beta.4` +- Upgraded to `shell-js@2.0.0-beta.5` +- Upgraded to `updater-js@2.0.0-beta.4` + +## \[2.0.0-beta.6] + +### Dependencies + +- Upgraded to `shell-js@2.0.0-beta.4` + +## \[2.0.0-beta.5] + +### Dependencies + +- Upgraded to `global-shortcut-js@2.0.0-beta.3` +- Upgraded to `barcode-scanner-js@2.0.0-beta.3` +- Upgraded to `biometric-js@2.0.0-beta.3` +- Upgraded to `cli-js@2.0.0-beta.3` +- Upgraded to `clipboard-manager-js@2.1.0-beta.1` +- Upgraded to `dialog-js@2.0.0-beta.3` +- Upgraded to `fs-js@2.0.0-beta.3` +- Upgraded to `http-js@2.0.0-beta.3` +- Upgraded to `log-js@2.0.0-beta.4` +- Upgraded to `nfc-js@2.0.0-beta.3` +- Upgraded to `notification-js@2.0.0-beta.3` +- Upgraded to `os-js@2.0.0-beta.3` +- Upgraded to `process-js@2.0.0-beta.3` +- Upgraded to `shell-js@2.0.0-beta.3` +- Upgraded to `updater-js@2.0.0-beta.3` + +## \[2.0.0-beta.4] + +### Dependencies + +- Upgraded to `log-js@2.0.0-beta.3` + +## \[2.0.0-beta.3] + +### Dependencies + +- Upgraded to `clipboard-manager-js@2.1.0-beta.0` + +## \[2.0.0-beta.2] + +### Dependencies + +- Upgraded to `clipboard-manager-js@2.0.0-beta.2` +- Upgraded to `dialog-js@2.0.0-beta.2` +- Upgraded to `fs-js@2.0.0-beta.2` +- Upgraded to `http-js@2.0.0-beta.2` +- Upgraded to `shell-js@2.0.0-beta.2` +- Upgraded to `barcode-scanner-js@2.0.0-beta.2` +- Upgraded to `biometric-js@2.0.0-beta.2` +- Upgraded to `cli-js@2.0.0-beta.2` +- Upgraded to `global-shortcut-js@2.0.0-beta.2` +- Upgraded to `log-js@2.0.0-beta.2` +- Upgraded to `nfc-js@2.0.0-beta.2` +- Upgraded to `notification-js@2.0.0-beta.2` +- Upgraded to `os-js@2.0.0-beta.2` +- Upgraded to `process-js@2.0.0-beta.2` +- Upgraded to `updater-js@2.0.0-beta.2` + ## \[2.0.0-beta.1] ### Dependencies diff --git a/examples/api/isolation-dist/index.js b/examples/api/isolation-dist/index.js index 83f35e0d..7e2df30d 100644 --- a/examples/api/isolation-dist/index.js +++ b/examples/api/isolation-dist/index.js @@ -3,5 +3,5 @@ // SPDX-License-Identifier: MIT window.__TAURI_ISOLATION_HOOK__ = (payload) => { - return payload; -}; + return payload +} diff --git a/examples/api/jsconfig.json b/examples/api/jsconfig.json index 42585941..5696a2de 100644 --- a/examples/api/jsconfig.json +++ b/examples/api/jsconfig.json @@ -1,14 +1,14 @@ { "compilerOptions": { - "moduleResolution": "node", - "target": "esnext", - "module": "esnext", + "moduleResolution": "bundler", + "target": "ESNext", + "module": "ESNext", /** * svelte-preprocess cannot figure out whether you have * a value or a type, so tell TypeScript to enforce using * `import type` instead of `import` for Types. */ - "importsNotUsedAsValues": "error", + "verbatimModuleSyntax": true, "isolatedModules": true, "resolveJsonModule": true, /** @@ -18,8 +18,6 @@ "sourceMap": true, "esModuleInterop": true, "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "baseUrl": ".", /** * Typecheck JS in `.svelte` and `.js` files by default. * Disable this if you'd like to use dynamic types. diff --git a/examples/api/package.json b/examples/api/package.json index f10d760a..8336c7d4 100644 --- a/examples/api/package.json +++ b/examples/api/package.json @@ -1,7 +1,7 @@ { "name": "svelte-app", "private": true, - "version": "2.0.0-beta.1", + "version": "2.0.1", "type": "module", "scripts": { "dev": "vite --clearScreen false", @@ -9,32 +9,34 @@ "serve": "vite preview" }, "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2", - "@tauri-apps/plugin-barcode-scanner": "2.0.0-beta.1", - "@tauri-apps/plugin-biometric": "2.0.0-beta.1", - "@tauri-apps/plugin-cli": "2.0.0-beta.1", - "@tauri-apps/plugin-clipboard-manager": "2.0.0-beta.1", - "@tauri-apps/plugin-dialog": "2.0.0-beta.1", - "@tauri-apps/plugin-fs": "2.0.0-beta.1", - "@tauri-apps/plugin-global-shortcut": "2.0.0-beta.1", - "@tauri-apps/plugin-http": "2.0.0-beta.1", - "@tauri-apps/plugin-nfc": "2.0.0-beta.1", - "@tauri-apps/plugin-notification": "2.0.0-beta.1", - "@tauri-apps/plugin-os": "2.0.0-beta.1", - "@tauri-apps/plugin-process": "2.0.0-beta.1", - "@tauri-apps/plugin-shell": "2.0.0-beta.1", - "@tauri-apps/plugin-updater": "2.0.0-beta.1", - "@zerodevx/svelte-json-view": "1.0.7" + "@tauri-apps/api": "2.0.2", + "@tauri-apps/plugin-barcode-scanner": "2.0.0", + "@tauri-apps/plugin-biometric": "2.0.0", + "@tauri-apps/plugin-cli": "2.0.0", + "@tauri-apps/plugin-clipboard-manager": "2.0.0", + "@tauri-apps/plugin-dialog": "2.0.1", + "@tauri-apps/plugin-fs": "2.0.1", + "@tauri-apps/plugin-geolocation": "2.0.0", + "@tauri-apps/plugin-global-shortcut": "2.0.0", + "@tauri-apps/plugin-haptics": "2.0.0", + "@tauri-apps/plugin-http": "2.0.1", + "@tauri-apps/plugin-nfc": "2.0.0", + "@tauri-apps/plugin-notification": "2.0.0", + "@tauri-apps/plugin-os": "2.0.0", + "@tauri-apps/plugin-process": "2.0.0", + "@tauri-apps/plugin-shell": "2.0.1", + "@tauri-apps/plugin-store": "2.1.0", + "@tauri-apps/plugin-updater": "2.0.0", + "@zerodevx/svelte-json-view": "1.0.11" }, "devDependencies": { "@iconify-json/codicon": "^1.1.37", "@iconify-json/ph": "^1.1.8", "@sveltejs/vite-plugin-svelte": "^3.0.1", - "@tauri-apps/cli": "2.0.0-beta.3", - "@unocss/extractor-svelte": "^0.58.0", - "internal-ip": "^8.0.0", - "svelte": "^4.2.8", - "unocss": "^0.58.0", - "vite": "^5.0.12" + "@tauri-apps/cli": "2.0.3", + "@unocss/extractor-svelte": "^0.63.0", + "svelte": "^4.2.19", + "unocss": "^0.63.0", + "vite": "^5.4.7" } } diff --git a/examples/api/src-tauri/CHANGELOG.md b/examples/api/src-tauri/CHANGELOG.md index 20364e9a..b914893a 100644 --- a/examples/api/src-tauri/CHANGELOG.md +++ b/examples/api/src-tauri/CHANGELOG.md @@ -1,5 +1,414 @@ # Changelog +## \[2.0.4] + +### Dependencies + +- Upgraded to `fs@2.0.3` +- Upgraded to `dialog@2.0.3` +- Upgraded to `http@2.0.3` + +## \[2.0.3] + +### Dependencies + +- Upgraded to `dialog@2.0.2` +- Upgraded to `fs@2.0.2` +- Upgraded to `http@2.0.2` +- Upgraded to `shell@2.0.2` +- Upgraded to `store@2.1.0` + +## \[2.0.2] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +### Dependencies + +- Upgraded to `barcode-scanner@2.0.1` +- Upgraded to `biometric@2.0.1` +- Upgraded to `cli@2.0.1` +- Upgraded to `clipboard-manager@2.0.1` +- Upgraded to `fs@2.0.1` +- Upgraded to `dialog@2.0.1` +- Upgraded to `geolocation@2.0.1` +- Upgraded to `global-shortcut@2.0.1` +- Upgraded to `haptics@2.0.1` +- Upgraded to `http@2.0.1` +- Upgraded to `log-plugin@2.0.1` +- Upgraded to `nfc@2.0.1` +- Upgraded to `notification@2.0.1` +- Upgraded to `os@2.0.1` +- Upgraded to `process@2.0.1` +- Upgraded to `shell@2.0.1` +- Upgraded to `store@2.0.1` +- Upgraded to `updater@2.0.2` + +## \[2.0.1] + +### Dependencies + +- Upgraded to `updater@2.0.1` + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +### Dependencies + +- Upgraded to `barcode-scanner@2.0.0` +- Upgraded to `biometric@2.0.0` +- Upgraded to `cli@2.0.0` +- Upgraded to `clipboard-manager@2.0.0` +- Upgraded to `fs@2.0.0` +- Upgraded to `dialog@2.0.0` +- Upgraded to `global-shortcut@2.0.0` +- Upgraded to `http@2.0.0` +- Upgraded to `log-plugin@2.0.0` +- Upgraded to `nfc@2.0.0` +- Upgraded to `notification@2.0.0` +- Upgraded to `os@2.0.0` +- Upgraded to `process@2.0.0` +- Upgraded to `shell@2.0.0` +- Upgraded to `store@2.0.0` +- Upgraded to `updater@2.0.0` + +## \[2.0.0-rc.8] + +### Dependencies + +- Upgraded to `cli@2.0.0-rc.2` +- Upgraded to `dialog@2.0.0-rc.8` +- Upgraded to `fs@2.0.0-rc.6` +- Upgraded to `shell@2.0.0-rc.4` +- Upgraded to `store@2.0.0-rc.4` +- Upgraded to `updater@2.0.0-rc.4` +- Upgraded to `http@2.0.0-rc.6` + +## \[2.0.0-rc.7] + +### Dependencies + +- Upgraded to `clipboard-manager@2.0.0-rc.4` +- Upgraded to `fs@2.0.0-rc.5` +- Upgraded to `notification@2.0.0-rc.5` +- Upgraded to `dialog@2.0.0-rc.7` +- Upgraded to `http@2.0.0-rc.5` + +## \[2.0.0-rc.6] + +### Dependencies + +- Upgraded to `dialog@2.0.0-rc.6` +- Upgraded to `fs@2.0.0-rc.4` +- Upgraded to `http@2.0.0-rc.4` + +## \[2.0.0-rc.5] + +### Dependencies + +- Upgraded to `barcode-scanner@2.0.0-rc.4` +- Upgraded to `notification@2.0.0-rc.4` + +## \[2.0.0-rc.4] + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.3` +- Upgraded to `dialog@2.0.0-rc.5` +- Upgraded to `updater@2.0.0-rc.3` +- Upgraded to `http@2.0.0-rc.3` + +## \[2.0.0-rc.3] + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.2` +- Upgraded to `dialog@2.0.0-rc.4` +- Upgraded to `http@2.0.0-rc.2` + +## \[2.0.0-rc.2] + +### Dependencies + +- Upgraded to `barcode-scanner@2.0.0-rc.3` +- Upgraded to `notification@2.0.0-rc.3` +- Upgraded to `dialog@2.0.0-rc.3` +- Upgraded to `fs@2.0.0-rc.1` +- Upgraded to `global-shortcut@2.0.0-rc.2` +- Upgraded to `store@2.0.0-rc.3` +- Upgraded to `biometric@2.0.0-rc.3` +- Upgraded to `cli@2.0.0-rc.1` +- Upgraded to `clipboard-manager@2.0.0-rc.3` +- Upgraded to `http@2.0.0-rc.1` +- Upgraded to `log-plugin@2.0.0-rc.2` +- Upgraded to `nfc@2.0.0-rc.3` +- Upgraded to `os@2.0.0-rc.1` +- Upgraded to `process@2.0.0-rc.1` +- Upgraded to `shell@2.0.0-rc.3` +- Upgraded to `updater@2.0.0-rc.2` + +## \[2.0.0-rc.1] + +### Dependencies + +- Upgraded to `barcode-scanner@2.0.0-rc.2` +- Upgraded to `biometric@2.0.0-rc.2` +- Upgraded to `clipboard-manager@2.0.0-rc.2` +- Upgraded to `dialog@2.0.0-rc.2` +- Upgraded to `log-plugin@2.0.0-rc.1` +- Upgraded to `nfc@2.0.0-rc.2` +- Upgraded to `notification@2.0.0-rc.2` +- Upgraded to `shell@2.0.0-rc.2` + +## \[2.0.0-rc.0] + +### Dependencies + +- Upgraded to `dialog@2.0.0-rc.1` +- Upgraded to `updater@2.0.0-rc.1` +- Upgraded to `barcode-scanner@2.0.0-rc.1` +- Upgraded to `clipboard-manager@2.0.0-rc.1` +- Upgraded to `global-shortcut@2.0.0-rc.1` +- Upgraded to `biometric@2.0.0-rc.1` +- Upgraded to `nfc@2.0.0-rc.1` +- Upgraded to `notification@2.0.0-rc.1` +- Upgraded to `shell@2.0.0-rc.1` + +## \[2.0.0-beta.17] + +### Dependencies + +- Upgraded to `barcode-scanner@2.0.0-rc.0` +- Upgraded to `biometric@2.0.0-rc.0` +- Upgraded to `cli@2.0.0-rc.0` +- Upgraded to `clipboard-manager@2.0.0-rc.0` +- Upgraded to `dialog@2.0.0-rc.0` +- Upgraded to `fs@2.0.0-rc.0` +- Upgraded to `global-shortcut@2.0.0-rc.0` +- Upgraded to `http@2.0.0-rc.0` +- Upgraded to `log-plugin@2.0.0-rc.0` +- Upgraded to `nfc@2.0.0-rc.0` +- Upgraded to `notification@2.0.0-rc.0` +- Upgraded to `os@2.0.0-rc.0` +- Upgraded to `process@2.0.0-rc.0` +- Upgraded to `shell@2.0.0-rc.0` +- Upgraded to `updater@2.0.0-rc.0` + +## \[2.0.0-beta.16] + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.12` +- Upgraded to `barcode-scanner@2.0.0-beta.10` +- Upgraded to `biometric@2.0.0-beta.9` +- Upgraded to `cli@2.0.0-beta.9` +- Upgraded to `clipboard-manager@2.1.0-beta.7` +- Upgraded to `dialog@2.0.0-beta.12` +- Upgraded to `global-shortcut@2.0.0-beta.9` +- Upgraded to `http@2.0.0-beta.13` +- Upgraded to `log-plugin@2.0.0-beta.10` +- Upgraded to `nfc@2.0.0-beta.9` +- Upgraded to `notification@2.0.0-beta.12` +- Upgraded to `os@2.0.0-beta.9` +- Upgraded to `process@2.0.0-beta.9` +- Upgraded to `shell@2.0.0-beta.10` +- Upgraded to `updater@2.0.0-beta.12` + +## \[2.0.0-beta.15] + +### Dependencies + +- Upgraded to `log-plugin@2.0.0-beta.9` + +## \[2.0.0-beta.14] + +### Dependencies + +- Upgraded to `notification@2.0.0-beta.11` +- Upgraded to `updater@2.0.0-beta.11` + +## \[2.0.0-beta.13] + +### Dependencies + +- Upgraded to `biometric@2.0.0-beta.8` +- Upgraded to `global-shortcut@2.0.0-beta.8` +- Upgraded to `http@2.0.0-beta.12` +- Upgraded to `barcode-scanner@2.0.0-beta.9` +- Upgraded to `cli@2.0.0-beta.8` +- Upgraded to `clipboard-manager@2.1.0-beta.6` +- Upgraded to `dialog@2.0.0-beta.11` +- Upgraded to `fs@2.0.0-beta.11` +- Upgraded to `log-plugin@2.0.0-beta.8` +- Upgraded to `nfc@2.0.0-beta.8` +- Upgraded to `notification@2.0.0-beta.10` +- Upgraded to `os@2.0.0-beta.8` +- Upgraded to `process@2.0.0-beta.8` +- Upgraded to `shell@2.0.0-beta.9` +- Upgraded to `updater@2.0.0-beta.10` + +## \[2.0.0-beta.12] + +### Dependencies + +- Upgraded to `clipboard-manager@2.1.0-beta.5` +- Upgraded to `fs@2.0.0-beta.10` +- Upgraded to `updater@2.0.0-beta.9` +- Upgraded to `notification@2.0.0-beta.9` +- Upgraded to `os@2.0.0-beta.7` +- Upgraded to `barcode-scanner@2.0.0-beta.8` +- Upgraded to `biometric@2.0.0-beta.7` +- Upgraded to `cli@2.0.0-beta.7` +- Upgraded to `dialog@2.0.0-beta.10` +- Upgraded to `global-shortcut@2.0.0-beta.7` +- Upgraded to `http@2.0.0-beta.11` +- Upgraded to `log-plugin@2.0.0-beta.7` +- Upgraded to `nfc@2.0.0-beta.7` +- Upgraded to `process@2.0.0-beta.7` +- Upgraded to `shell@2.0.0-beta.8` + +## \[2.0.0-beta.11] + +### Dependencies + +- Upgraded to `notification@2.0.0-beta.8` +- Upgraded to `http@2.0.0-beta.10` +- Upgraded to `updater@2.0.0-beta.8` + +## \[2.0.0-beta.10] + +### Dependencies + +- Upgraded to `barcode-scanner@2.0.0-beta.7` +- Upgraded to `biometric@2.0.0-beta.6` +- Upgraded to `clipboard-manager@2.1.0-beta.4` +- Upgraded to `nfc@2.0.0-beta.6` +- Upgraded to `notification@2.0.0-beta.7` +- Upgraded to `shell@2.0.0-beta.7` +- Upgraded to `cli@2.0.0-beta.6` +- Upgraded to `dialog@2.0.0-beta.9` +- Upgraded to `fs@2.0.0-beta.9` +- Upgraded to `global-shortcut@2.0.0-beta.6` +- Upgraded to `http@2.0.0-beta.9` +- Upgraded to `log-plugin@2.0.0-beta.6` +- Upgraded to `os@2.0.0-beta.6` +- Upgraded to `process@2.0.0-beta.6` +- Upgraded to `updater@2.0.0-beta.7` + +## \[2.0.0-beta.9] + +### Dependencies + +- Upgraded to `clipboard-manager@2.1.0-beta.3` +- Upgraded to `dialog@2.0.0-beta.8` +- Upgraded to `http@2.0.0-beta.8` +- Upgraded to `notification@2.0.0-beta.6` +- Upgraded to `shell@2.0.0-beta.6` +- Upgraded to `barcode-scanner@2.0.0-beta.6` +- Upgraded to `biometric@2.0.0-beta.5` +- Upgraded to `nfc@2.0.0-beta.5` +- Upgraded to `cli@2.0.0-beta.5` +- Upgraded to `fs@2.0.0-beta.8` +- Upgraded to `global-shortcut@2.0.0-beta.5` +- Upgraded to `log-plugin@2.0.0-beta.5` +- Upgraded to `os@2.0.0-beta.5` +- Upgraded to `process@2.0.0-beta.5` +- Upgraded to `updater@2.0.0-beta.6` + +## \[2.0.0-beta.8] + +### Dependencies + +- Upgraded to `shell@2.0.0-beta.5` + +## \[2.0.0-beta.7] + +### Dependencies + +- Upgraded to `clipboard-manager@2.1.0-beta.2` +- Upgraded to `global-shortcut@2.0.0-beta.4` +- Upgraded to `barcode-scanner@2.0.0-beta.5` +- Upgraded to `biometric@2.0.0-beta.4` +- Upgraded to `cli@2.0.0-beta.4` +- Upgraded to `dialog@2.0.0-beta.7` +- Upgraded to `fs@2.0.0-beta.7` +- Upgraded to `http@2.0.0-beta.7` +- Upgraded to `log-plugin@2.0.0-beta.4` +- Upgraded to `nfc@2.0.0-beta.4` +- Upgraded to `notification@2.0.0-beta.5` +- Upgraded to `os@2.0.0-beta.4` +- Upgraded to `process@2.0.0-beta.4` +- Upgraded to `shell@2.0.0-beta.4` +- Upgraded to `updater@2.0.0-beta.5` + +## \[2.0.0-beta.6] + +### Dependencies + +- Upgraded to `notification@2.0.0-beta.4` +- Upgraded to `barcode-scanner@2.0.0-beta.4` +- Upgraded to `dialog@2.0.0-beta.6` +- Upgraded to `fs@2.0.0-beta.6` +- Upgraded to `http@2.0.0-beta.6` + +## \[2.0.0-beta.5] + +### Dependencies + +- Upgraded to `clipboard-manager@2.1.0-beta.1` +- Upgraded to `http@2.0.0-beta.5` +- Upgraded to `updater@2.0.0-beta.4` +- Upgraded to `dialog@2.0.0-beta.5` +- Upgraded to `fs@2.0.0-beta.5` + +## \[2.0.0-beta.4] + +### Dependencies + +- Upgraded to `dialog@2.0.0-beta.4` +- Upgraded to `fs@2.0.0-beta.4` +- Upgraded to `http@2.0.0-beta.4` + +## \[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] + +### Dependencies + +- Upgraded to `clipboard-manager@2.0.0-beta.2` +- Upgraded to `dialog@2.0.0-beta.2` +- Upgraded to `http@2.0.0-beta.2` +- Upgraded to `fs@2.0.0-beta.2` +- Upgraded to `shell@2.0.0-beta.2` +- Upgraded to `barcode-scanner@2.0.0-beta.2` +- Upgraded to `biometric@2.0.0-beta.2` +- Upgraded to `cli@2.0.0-beta.2` +- Upgraded to `global-shortcut@2.0.0-beta.2` +- Upgraded to `log-plugin@2.0.0-beta.2` +- Upgraded to `nfc@2.0.0-beta.2` +- Upgraded to `notification@2.0.0-beta.2` +- Upgraded to `os@2.0.0-beta.2` +- Upgraded to `process@2.0.0-beta.2` +- Upgraded to `updater@2.0.0-beta.2` + ## \[2.0.0-beta.1] ### Dependencies diff --git a/examples/api/src-tauri/Cargo.toml b/examples/api/src-tauri/Cargo.toml index 9b0891c2..db6ec283 100644 --- a/examples/api/src-tauri/Cargo.toml +++ b/examples/api/src-tauri/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "api" publish = false -version = "2.0.0-beta.1" +version = "2.0.4" description = "An example Tauri Application showcasing the api" edition = "2021" rust-version = { workspace = true } @@ -9,49 +9,58 @@ license = "Apache-2.0 OR MIT" [lib] name = "api_lib" -crate-type = [ "staticlib", "cdylib", "rlib" ] +crate-type = ["staticlib", "cdylib", "rlib"] [build-dependencies] -tauri-build = { workspace = true, features = [ "codegen", "isolation" ] } +tauri-build = { workspace = true, features = ["codegen", "isolation"] } [dependencies] serde_json = { workspace = true } serde = { workspace = true } -tiny_http = "0.11" +tiny_http = "0.12" log = { workspace = true } -tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0-beta.1" } -tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-beta.1", features = [ "watch" ] } -tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.0-beta.1" } -tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0-beta.1" } -tauri-plugin-http = { path = "../../../plugins/http", features = [ "multipart" ], version = "2.0.0-beta.1" } -tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0-beta.1", features = [ "windows7-compat" ] } -tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.0-beta.1" } -tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0-beta.1" } -tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0-beta.1" } +tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.1" } +tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.3", features = [ + "watch", +] } +tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.1" } +tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.3" } +tauri-plugin-http = { path = "../../../plugins/http", features = [ + "multipart", +], version = "2.0.3" } +tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.1", features = [ + "windows7-compat", +] } +tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.1" } +tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.1" } +tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.2" } +tauri-plugin-store = { path = "../../../plugins/store", version = "2.1.0" } - [dependencies.tauri] - workspace = true - features = [ - "icon-ico", - "icon-png", +[dependencies.tauri] +workspace = true +features = [ + "wry", + "compression", + "image-ico", + "image-png", "isolation", "macos-private-api", "tray-icon", - "protocol-asset" + "protocol-asset", ] [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.1" } -tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.0-beta.1" } -tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0-beta.1" } +tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.0.1" } +tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.1" } +tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.2" } +tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.0.0" } [target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies] -tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.0.0-beta.1" } -tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.0.0-beta.1" } -tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.0-beta.1" } - -[target."cfg(target_os = \"windows\")".dependencies] -window-shadows = "0.2" +tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.0.1" } +tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.0.1" } +tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.1" } +tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.0.1" } +tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.0.1" } [features] -custom-protocol = [ "tauri/custom-protocol" ] +prod = ["tauri/custom-protocol"] diff --git a/examples/api/src-tauri/Info.plist b/examples/api/src-tauri/Info.plist index fe253ec7..4dcd6aca 100644 --- a/examples/api/src-tauri/Info.plist +++ b/examples/api/src-tauri/Info.plist @@ -1,10 +1,14 @@ - - NSCameraUsageDescription - Request camera access for WebRTC - NSMicrophoneUsageDescription - Request microphone access for WebRTC - + + NSCameraUsageDescription + Request camera access for WebRTC + NSMicrophoneUsageDescription + Request microphone access for WebRTC + NSFaceIDUsageDescription + Authenticate with biometrics + NFCReaderUsageDescription + Read and write to NFC tags for testing + diff --git a/examples/api/src-tauri/build.rs b/examples/api/src-tauri/build.rs index 322bc7bf..88537dde 100644 --- a/examples/api/src-tauri/build.rs +++ b/examples/api/src-tauri/build.rs @@ -3,11 +3,5 @@ // SPDX-License-Identifier: MIT fn main() { - let mut codegen = tauri_build::CodegenContext::new(); - if !cfg!(feature = "custom-protocol") { - codegen = codegen.dev(); - } - - tauri_build::try_build(tauri_build::Attributes::new().codegen(codegen)) - .expect("failed to run tauri_build::try_build"); + tauri_build::build(); } diff --git a/examples/api/src-tauri/capabilities/base.json b/examples/api/src-tauri/capabilities/base.json index f34be5ec..607828e9 100644 --- a/examples/api/src-tauri/capabilities/base.json +++ b/examples/api/src-tauri/capabilities/base.json @@ -8,27 +8,28 @@ { "identifier": "http:default", "allow": [ + "https://tauri.app", { "url": "http://localhost:3003" } ] }, - "app:default", - "resources:default", + "core:default", "fs:default", - "menu:default", - "path:default", - "tray:default", - "event:default", - "window:default", + "core:window:allow-minimize", + "core:window:allow-maximize", + "core:window:allow-unmaximize", + "core:window:allow-close", + "core:window:allow-start-dragging", "notification:default", "os:allow-platform", "dialog:allow-open", + "dialog:allow-ask", "dialog:allow-save", "dialog:allow-confirm", "dialog:allow-message", { - "identifier": "shell:allow-execute", + "identifier": "shell:allow-spawn", "allow": [ { "name": "sh", @@ -36,7 +37,7 @@ "args": [ "-c", { - "validator": "\\S+" + "validator": ".+" } ] }, @@ -46,7 +47,7 @@ "args": [ "/C", { - "validator": "\\S+" + "validator": ".+" } ] } @@ -54,8 +55,15 @@ }, "shell:allow-kill", "shell:allow-stdin-write", - "clipboard-manager:allow-read", - "clipboard-manager:allow-write", + "process:allow-exit", + "process:allow-restart", + "clipboard-manager:allow-read-text", + "clipboard-manager:allow-write-text", + "clipboard-manager:allow-read-image", + "clipboard-manager:allow-write-image", + "fs:allow-open", + "fs:allow-write", + "fs:allow-read", "fs:allow-rename", "fs:allow-mkdir", "fs:allow-remove", @@ -69,11 +77,8 @@ "path": "$APPDATA/db/**" } ], - "deny": [ - { - "path": "$APPDATA/db/*.stronghold" - } - ] - } + "deny": ["$APPDATA/db/*.stronghold"] + }, + "store:default" ] } diff --git a/examples/api/src-tauri/capabilities/mobile.json b/examples/api/src-tauri/capabilities/mobile.json index 40f547ff..93d46ad2 100644 --- a/examples/api/src-tauri/capabilities/mobile.json +++ b/examples/api/src-tauri/capabilities/mobile.json @@ -11,6 +11,10 @@ "barcode-scanner:allow-scan", "barcode-scanner:allow-cancel", "barcode-scanner:allow-request-permissions", - "barcode-scanner:allow-check-permissions" + "barcode-scanner:allow-check-permissions", + "geolocation:allow-check-permissions", + "geolocation:allow-request-permissions", + "geolocation:allow-watch-position", + "geolocation:allow-get-current-position" ] } diff --git a/examples/api/src-tauri/gen/android/.idea/.gitignore b/examples/api/src-tauri/gen/android/.idea/.gitignore deleted file mode 100644 index 26d33521..00000000 --- a/examples/api/src-tauri/gen/android/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/examples/api/src-tauri/gen/android/.idea/gradle.xml b/examples/api/src-tauri/gen/android/.idea/gradle.xml index 692c9e58..ff118549 100644 --- a/examples/api/src-tauri/gen/android/.idea/gradle.xml +++ b/examples/api/src-tauri/gen/android/.idea/gradle.xml @@ -4,13 +4,22 @@ diff --git a/examples/api/src-tauri/gen/android/.idea/jarRepositories.xml b/examples/api/src-tauri/gen/android/.idea/jarRepositories.xml deleted file mode 100644 index d2ce72d1..00000000 --- a/examples/api/src-tauri/gen/android/.idea/jarRepositories.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/api/src-tauri/gen/android/.idea/kotlinc.xml b/examples/api/src-tauri/gen/android/.idea/kotlinc.xml index 0fc31131..4cb74572 100644 --- a/examples/api/src-tauri/gen/android/.idea/kotlinc.xml +++ b/examples/api/src-tauri/gen/android/.idea/kotlinc.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/examples/api/src-tauri/gen/android/.idea/misc.xml b/examples/api/src-tauri/gen/android/.idea/misc.xml index 0ad17cbd..8978d23d 100644 --- a/examples/api/src-tauri/gen/android/.idea/misc.xml +++ b/examples/api/src-tauri/gen/android/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/examples/api/src-tauri/gen/android/app/.gitignore b/examples/api/src-tauri/gen/android/app/.gitignore index ff9cb538..4008dd74 100644 --- a/examples/api/src-tauri/gen/android/app/.gitignore +++ b/examples/api/src-tauri/gen/android/app/.gitignore @@ -2,4 +2,5 @@ /src/main/jniLibs/**/*.so /src/main/assets/tauri.conf.json /tauri.build.gradle.kts -/proguard-tauri.pro \ No newline at end of file +/proguard-tauri.pro +/tauri.properties \ No newline at end of file diff --git a/examples/api/src-tauri/gen/android/app/build.gradle.kts b/examples/api/src-tauri/gen/android/app/build.gradle.kts index e3de36fd..f7047ca0 100644 --- a/examples/api/src-tauri/gen/android/app/build.gradle.kts +++ b/examples/api/src-tauri/gen/android/app/build.gradle.kts @@ -1,19 +1,28 @@ +import java.util.Properties + plugins { id("com.android.application") id("org.jetbrains.kotlin.android") id("rust") } +val tauriProperties = Properties().apply { + val propFile = file("tauri.properties") + if (propFile.exists()) { + propFile.inputStream().use { load(it) } + } +} + android { - compileSdk = 33 + compileSdk = 34 namespace = "com.tauri.api" defaultConfig { manifestPlaceholders["usesCleartextTraffic"] = "false" applicationId = "com.tauri.api" minSdk = 24 - targetSdk = 33 - versionCode = 1 - versionName = "1.0" + targetSdk = 34 + versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt() + versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0") } buildTypes { getByName("debug") { @@ -39,6 +48,9 @@ android { kotlinOptions { jvmTarget = "1.8" } + buildFeatures { + buildConfig = true + } } rust { @@ -54,4 +66,4 @@ dependencies { androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0") } -apply(from = "tauri.build.gradle.kts") +apply(from = "tauri.build.gradle.kts") \ No newline at end of file diff --git a/examples/api/src-tauri/gen/android/app/src/main/AndroidManifest.xml b/examples/api/src-tauri/gen/android/app/src/main/AndroidManifest.xml index 4679a745..8ebe7c4b 100644 --- a/examples/api/src-tauri/gen/android/app/src/main/AndroidManifest.xml +++ b/examples/api/src-tauri/gen/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,10 @@ - + + + + + + diff --git a/examples/api/src-tauri/gen/android/app/src/main/java/com/tauri/api/MainActivity.kt b/examples/api/src-tauri/gen/android/app/src/main/java/com/tauri/api/MainActivity.kt index ad3fa238..0a05f42b 100644 --- a/examples/api/src-tauri/gen/android/app/src/main/java/com/tauri/api/MainActivity.kt +++ b/examples/api/src-tauri/gen/android/app/src/main/java/com/tauri/api/MainActivity.kt @@ -1,3 +1,3 @@ package com.tauri.api -class MainActivity : TauriActivity() +class MainActivity : TauriActivity() \ No newline at end of file diff --git a/examples/api/src-tauri/gen/android/build.gradle.kts b/examples/api/src-tauri/gen/android/build.gradle.kts index 5ce764e3..c5ef452a 100644 --- a/examples/api/src-tauri/gen/android/build.gradle.kts +++ b/examples/api/src-tauri/gen/android/build.gradle.kts @@ -4,8 +4,8 @@ buildscript { mavenCentral() } dependencies { - classpath("com.android.tools.build:gradle:8.0.0") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21") + classpath("com.android.tools.build:gradle:8.5.1") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25") } } diff --git a/examples/api/src-tauri/gen/android/buildSrc/build.gradle.kts b/examples/api/src-tauri/gen/android/buildSrc/build.gradle.kts index 099feff7..39e90b05 100644 --- a/examples/api/src-tauri/gen/android/buildSrc/build.gradle.kts +++ b/examples/api/src-tauri/gen/android/buildSrc/build.gradle.kts @@ -18,6 +18,6 @@ repositories { dependencies { compileOnly(gradleApi()) - implementation("com.android.tools.build:gradle:8.0.0") + implementation("com.android.tools.build:gradle:8.5.1") } diff --git a/examples/api/src-tauri/gen/android/buildSrc/src/main/java/com/tauri/api/kotlin/BuildTask.kt b/examples/api/src-tauri/gen/android/buildSrc/src/main/java/com/tauri/api/kotlin/BuildTask.kt index 2ad998b1..f9874825 100644 --- a/examples/api/src-tauri/gen/android/buildSrc/src/main/java/com/tauri/api/kotlin/BuildTask.kt +++ b/examples/api/src-tauri/gen/android/buildSrc/src/main/java/com/tauri/api/kotlin/BuildTask.kt @@ -16,7 +16,7 @@ open class BuildTask : DefaultTask() { @TaskAction fun assemble() { - val executable = """node"""; + val executable = """pnpm"""; try { runTauriCli(executable) } catch (e: Exception) { @@ -32,7 +32,7 @@ open class BuildTask : DefaultTask() { val rootDirRel = rootDirRel ?: throw GradleException("rootDirRel cannot be null") val target = target ?: throw GradleException("target cannot be null") val release = release ?: throw GradleException("release cannot be null") - val args = listOf("../node_modules/.bin/../@tauri-apps/cli/tauri.js", "android", "android-studio-script"); + val args = listOf("tauri", "android", "android-studio-script"); project.exec { workingDir(File(project.projectDir, rootDirRel)) diff --git a/examples/api/src-tauri/gen/android/gradle.properties b/examples/api/src-tauri/gen/android/gradle.properties index 022338b7..2a7ec695 100644 --- a/examples/api/src-tauri/gen/android/gradle.properties +++ b/examples/api/src-tauri/gen/android/gradle.properties @@ -21,5 +21,4 @@ kotlin.code.style=official # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true -android.defaults.buildfeatures.buildconfig=true android.nonFinalResIds=false \ No newline at end of file diff --git a/examples/api/src-tauri/gen/android/gradle/wrapper/gradle-wrapper.properties b/examples/api/src-tauri/gen/android/gradle/wrapper/gradle-wrapper.properties index 40a43506..0df10d55 100644 --- a/examples/api/src-tauri/gen/android/gradle/wrapper/gradle-wrapper.properties +++ b/examples/api/src-tauri/gen/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Tue May 10 19:22:52 CST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/examples/api/src-tauri/gen/android/gradlew.bat b/examples/api/src-tauri/gen/android/gradlew.bat index ac1b06f9..107acd32 100644 --- a/examples/api/src-tauri/gen/android/gradlew.bat +++ b/examples/api/src-tauri/gen/android/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png index f8b128e3..a6ac2a8c 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png index 6bbd9e3c..2869541f 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png index 6bbd9e3c..2869541f 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png index f702cc04..cf265a45 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png index c5e92f78..29c9746c 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png index 1c607d5c..a4e68c8d 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png index 1c607d5c..a4e68c8d 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png index 60e93a6a..e4adcbce 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png index 6bbd9e3c..2869541f 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png index 819410f9..a414e65b 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png index 819410f9..a414e65b 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png index e00ae5a6..a0807e5d 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png index f5301f37..704c9291 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-512x512@2x.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-512x512@2x.png deleted file mode 100644 index 5e9add73..00000000 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-512x512@2x.png and /dev/null differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png index e00ae5a6..a0807e5d 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png index 3546ca10..2a9fbc26 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png index d8367101..2cdf1848 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png index 29925f2a..4723e4b4 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png differ diff --git a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png index dfd22619..f26fee45 100644 Binary files a/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png and b/examples/api/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png differ diff --git a/examples/api/src-tauri/gen/apple/ExportOptions.plist b/examples/api/src-tauri/gen/apple/ExportOptions.plist index b69cf1de..0428a171 100644 --- a/examples/api/src-tauri/gen/apple/ExportOptions.plist +++ b/examples/api/src-tauri/gen/apple/ExportOptions.plist @@ -3,6 +3,6 @@ method - development + debugging diff --git a/examples/api/src-tauri/gen/apple/LaunchScreen.storyboard b/examples/api/src-tauri/gen/apple/LaunchScreen.storyboard new file mode 100644 index 00000000..dd79351e --- /dev/null +++ b/examples/api/src-tauri/gen/apple/LaunchScreen.storyboard @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/api/src-tauri/gen/apple/api.xcodeproj/project.pbxproj b/examples/api/src-tauri/gen/apple/api.xcodeproj/project.pbxproj index 8528f099..64ef20a8 100644 --- a/examples/api/src-tauri/gen/apple/api.xcodeproj/project.pbxproj +++ b/examples/api/src-tauri/gen/apple/api.xcodeproj/project.pbxproj @@ -3,16 +3,17 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 56; objects = { /* Begin PBXBuildFile section */ - 2ECFC1BC47D948875C8CEC41 /* libapi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FC53D4128D7F74E4E6338455 /* libapi.a */; }; 3043432501C9BC2DB6B4CB95 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 71EB788DE4662CFC0D97F567 /* CoreGraphics.framework */; }; 328B4ADB3700C1873BEB7B10 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 90D3B673AFAB8D8AB561F616 /* main.mm */; }; 6F379F15DA085785BA2624D4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6B7E79E23E646BA7968B457C /* Assets.xcassets */; }; + 832F9A55FEDEF3D807D8C40A /* libapp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 248286BAA086BB1A5F98B2B2 /* libapp.a */; }; 9AADB041D25772D04E543F15 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62601E25FA39E62BE119B74D /* Metal.framework */; }; 9DDA3BE70DD0E4013973FE38 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B6082E363D51372A7658C351 /* UIKit.framework */; }; + AC8BDC2C7A63FA3FDC5967F4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4B2D1B108AE002010BDEC6D2 /* LaunchScreen.storyboard */; }; AFA0CA286325FD7A34968CA2 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 384966E551417F94A02D2706 /* Security.framework */; }; B60763BD194DFACA215EC7DA /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC377692DC31A070A0188C9D /* QuartzCore.framework */; }; C6D80743F168BDF017B7769E /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59CFE20DCF760BE67D9CE3D6 /* WebKit.framework */; }; @@ -21,25 +22,26 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 0E96CE07CD20273DD46BF325 /* main.rs */ = {isa = PBXFileReference; path = main.rs; sourceTree = ""; }; - 1C1AB1B414CA2795AFBEDDB9 /* tray.rs */ = {isa = PBXFileReference; path = tray.rs; sourceTree = ""; }; + 0E96CE07CD20273DD46BF325 /* main.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = main.rs; sourceTree = ""; }; + 1C1AB1B414CA2795AFBEDDB9 /* tray.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = tray.rs; sourceTree = ""; }; + 248286BAA086BB1A5F98B2B2 /* libapp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libapp.a; sourceTree = ""; }; 2F63E2AA460089BB58D40C79 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; 338E66700FD330B99D434DD7 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = System/Library/Frameworks/MetalKit.framework; sourceTree = SDKROOT; }; 384966E551417F94A02D2706 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; + 4B2D1B108AE002010BDEC6D2 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; 59CFE20DCF760BE67D9CE3D6 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; - 5AC703CEBA41A121596066F3 /* api_iOS.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = api_iOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 5AC703CEBA41A121596066F3 /* Tauri API.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Tauri API.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 62601E25FA39E62BE119B74D /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; }; 6B7E79E23E646BA7968B457C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 71EB788DE4662CFC0D97F567 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 74A8FDFB350B966F5AAD4A24 /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; path = assets; sourceTree = SOURCE_ROOT; }; - 785D025E9542F7E098BF22B5 /* lib.rs */ = {isa = PBXFileReference; path = lib.rs; sourceTree = ""; }; + 785D025E9542F7E098BF22B5 /* lib.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = lib.rs; sourceTree = ""; }; 879941AE3DAA14534BBC6391 /* api_iOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = api_iOS.entitlements; sourceTree = ""; }; 90D3B673AFAB8D8AB561F616 /* main.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = ""; }; B6082E363D51372A7658C351 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; DC377692DC31A070A0188C9D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; EC8C7948C50C3C9B5D96CB61 /* bindings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bindings.h; sourceTree = ""; }; - F835F52713CE8F029D5D252C /* cmd.rs */ = {isa = PBXFileReference; path = cmd.rs; sourceTree = ""; }; - FC53D4128D7F74E4E6338455 /* libapi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libapi.a; sourceTree = ""; }; + F835F52713CE8F029D5D252C /* cmd.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = cmd.rs; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -47,7 +49,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2ECFC1BC47D948875C8CEC41 /* libapi.a in Frameworks */, + 832F9A55FEDEF3D807D8C40A /* libapp.a in Frameworks */, 3043432501C9BC2DB6B4CB95 /* CoreGraphics.framework in Frameworks */, 9AADB041D25772D04E543F15 /* Metal.framework in Frameworks */, DFFF888045C8D9D9FB69E8FD /* MetalKit.framework in Frameworks */, @@ -66,6 +68,7 @@ children = ( 74A8FDFB350B966F5AAD4A24 /* assets */, 6B7E79E23E646BA7968B457C /* Assets.xcassets */, + 4B2D1B108AE002010BDEC6D2 /* LaunchScreen.storyboard */, F2116A6428EED18BE2A07E2B /* api_iOS */, 86D903732E10FAC4D300E8DF /* Externals */, 7A9A7AC155D9E22E54D6D847 /* Sources */, @@ -87,7 +90,7 @@ isa = PBXGroup; children = ( 71EB788DE4662CFC0D97F567 /* CoreGraphics.framework */, - FC53D4128D7F74E4E6338455 /* libapi.a */, + 248286BAA086BB1A5F98B2B2 /* libapp.a */, 62601E25FA39E62BE119B74D /* Metal.framework */, 338E66700FD330B99D434DD7 /* MetalKit.framework */, DC377692DC31A070A0188C9D /* QuartzCore.framework */, @@ -101,7 +104,7 @@ 4AC51E67B71E27F15B02C5CD /* Products */ = { isa = PBXGroup; children = ( - 5AC703CEBA41A121596066F3 /* api_iOS.app */, + 5AC703CEBA41A121596066F3 /* Tauri API.app */, ); name = Products; sourceTree = ""; @@ -169,7 +172,7 @@ ); name = api_iOS; productName = api_iOS; - productReference = 5AC703CEBA41A121596066F3 /* api_iOS.app */; + productReference = 5AC703CEBA41A121596066F3 /* Tauri API.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -178,7 +181,8 @@ 9BC88C3717DA5D4B78A51C15 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1200; + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1430; TargetAttributes = { 54DC6E273C78071F3BA12EF3 = { DevelopmentTeam = Q93MBH6S2F; @@ -186,7 +190,7 @@ }; }; buildConfigurationList = 8FA67D0F928A09CD639137D1 /* Build configuration list for PBXProject "api" */; - compatibilityVersion = "Xcode 11.0"; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( @@ -208,6 +212,7 @@ buildActionMask = 2147483647; files = ( 6F379F15DA085785BA2624D4 /* Assets.xcassets in Resources */, + AC8BDC2C7A63FA3FDC5967F4 /* LaunchScreen.storyboard in Resources */, F86717F05E27C72C9FA1FB27 /* assets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -229,12 +234,13 @@ outputFileListPaths = ( ); outputPaths = ( - "$(SRCROOT)/target/aarch64-apple-ios/${CONFIGURATION}/deps/libapi.a", - "$(SRCROOT)/target/x86_64-apple-ios/${CONFIGURATION}/deps/libapi.a", + "$(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a", + "$(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a", + "$(SRCROOT)/Externals/arm64-sim/${CONFIGURATION}/libapp.a", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "node ../../../node_modules/.bin/../@tauri-apps/cli/tauri.js ios xcode-script -v --platform ${PLATFORM_DISPLAY_NAME:?} --sdk-root ${SDKROOT:?} --framework-search-paths \"${FRAMEWORK_SEARCH_PATHS:?}\" --header-search-paths \"${HEADER_SEARCH_PATHS:?}\" --gcc-preprocessor-definitions \"${GCC_PREPROCESSOR_DEFINITIONS:-}\" --configuration ${CONFIGURATION:?} ${FORCE_COLOR} ${ARCHS:?}"; + shellScript = "pnpm tauri ios xcode-script -v --platform ${PLATFORM_DISPLAY_NAME:?} --sdk-root ${SDKROOT:?} --framework-search-paths \"${FRAMEWORK_SEARCH_PATHS:?}\" --header-search-paths \"${HEADER_SEARCH_PATHS:?}\" --gcc-preprocessor-definitions \"${GCC_PREPROCESSOR_DEFINITIONS:-}\" --configuration ${CONFIGURATION:?} ${FORCE_COLOR} ${ARCHS:?}"; }; /* End PBXShellScriptBuildPhase section */ @@ -380,20 +386,42 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = api_iOS/api_iOS.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = Q93MBH6S2F; ENABLE_BITCODE = NO; + "EXCLUDED_ARCHS[sdk=iphoneos*]" = "arm64-sim x86_64"; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\".\"", ); INFOPLIST_FILE = api_iOS/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - "LIBRARY_SEARCH_PATHS[arch=arm64-sim]" = "$(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"; - "LIBRARY_SEARCH_PATHS[arch=arm64]" = "$(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"; - "LIBRARY_SEARCH_PATHS[arch=x86_64]" = "$(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"; + "LIBRARY_SEARCH_PATHS[arch=arm64-sim]" = ( + "$(inherited)", + "$(PROJECT_DIR)/Externals/arm64-sim/$(CONFIGURATION)", + "$(SDKROOT)/usr/lib/swift", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)", + ); + "LIBRARY_SEARCH_PATHS[arch=arm64]" = ( + "$(inherited)", + "$(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION)", + "$(SDKROOT)/usr/lib/swift", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)", + ); + "LIBRARY_SEARCH_PATHS[arch=x86_64]" = ( + "$(inherited)", + "$(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION)", + "$(SDKROOT)/usr/lib/swift", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)", + ); PRODUCT_BUNDLE_IDENTIFIER = com.tauri.api; PRODUCT_NAME = "Tauri API"; SDKROOT = iphoneos; @@ -413,20 +441,42 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = api_iOS/api_iOS.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = Q93MBH6S2F; ENABLE_BITCODE = NO; + "EXCLUDED_ARCHS[sdk=iphoneos*]" = "arm64-sim x86_64"; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\".\"", ); INFOPLIST_FILE = api_iOS/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - "LIBRARY_SEARCH_PATHS[arch=arm64-sim]" = "$(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"; - "LIBRARY_SEARCH_PATHS[arch=arm64]" = "$(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"; - "LIBRARY_SEARCH_PATHS[arch=x86_64]" = "$(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"; + "LIBRARY_SEARCH_PATHS[arch=arm64-sim]" = ( + "$(inherited)", + "$(PROJECT_DIR)/Externals/arm64-sim/$(CONFIGURATION)", + "$(SDKROOT)/usr/lib/swift", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)", + ); + "LIBRARY_SEARCH_PATHS[arch=arm64]" = ( + "$(inherited)", + "$(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION)", + "$(SDKROOT)/usr/lib/swift", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)", + ); + "LIBRARY_SEARCH_PATHS[arch=x86_64]" = ( + "$(inherited)", + "$(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION)", + "$(SDKROOT)/usr/lib/swift", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)", + ); PRODUCT_BUNDLE_IDENTIFIER = com.tauri.api; PRODUCT_NAME = "Tauri API"; SDKROOT = iphoneos; diff --git a/examples/api/src-tauri/gen/apple/api.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/examples/api/src-tauri/gen/apple/api.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/examples/api/src-tauri/gen/apple/api.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/examples/api/src-tauri/gen/apple/api.xcodeproj/xcshareddata/xcschemes/api_iOS.xcscheme b/examples/api/src-tauri/gen/apple/api.xcodeproj/xcshareddata/xcschemes/api_iOS.xcscheme index b4aafe53..2a9f5045 100644 --- a/examples/api/src-tauri/gen/apple/api.xcodeproj/xcshareddata/xcschemes/api_iOS.xcscheme +++ b/examples/api/src-tauri/gen/apple/api.xcodeproj/xcshareddata/xcschemes/api_iOS.xcscheme @@ -1,6 +1,6 @@ - NFCReaderUsageDescription - NFC Test - NSCameraUsageDescription - Request camera access for barcode scanner CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable @@ -45,6 +41,12 @@ UIInterfaceOrientationLandscapeRight NSFaceIDUsageDescription - Biometric Test + Authenticate with biometrics + NSCameraUsageDescription + Request camera access for WebRTC + NSMicrophoneUsageDescription + Request microphone access for WebRTC + NFCReaderUsageDescription + Read and write to NFC tags for testing - + \ No newline at end of file diff --git a/examples/api/src-tauri/gen/apple/api_iOS/api_iOS.entitlements b/examples/api/src-tauri/gen/apple/api_iOS/api_iOS.entitlements index 9db395a2..2bb4dee1 100644 --- a/examples/api/src-tauri/gen/apple/api_iOS/api_iOS.entitlements +++ b/examples/api/src-tauri/gen/apple/api_iOS/api_iOS.entitlements @@ -5,7 +5,6 @@ com.apple.developer.nfc.readersession.formats TAG - NDEF diff --git a/examples/api/src-tauri/gen/apple/project.yml b/examples/api/src-tauri/gen/apple/project.yml index 1be5cc64..9705de23 100644 --- a/examples/api/src-tauri/gen/apple/project.yml +++ b/examples/api/src-tauri/gen/apple/project.yml @@ -1,8 +1,8 @@ name: api options: - bundleIdPrefix: com.tauri + bundleIdPrefix: com.tauri.api deploymentTarget: - iOS: 13.0 + iOS: 14.0 fileGroups: [../../src] configs: debug: debug @@ -36,6 +36,7 @@ targets: - path: assets buildPhase: resources type: folder + - path: LaunchScreen.storyboard info: path: api_iOS/Info.plist properties: @@ -63,14 +64,16 @@ targets: base: ENABLE_BITCODE: false ARCHS: [arm64, arm64-sim] - VALID_ARCHS: arm64 arm64-sim - LIBRARY_SEARCH_PATHS[arch=x86_64]: $(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) - LIBRARY_SEARCH_PATHS[arch=arm64]: $(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) - LIBRARY_SEARCH_PATHS[arch=arm64-sim]: $(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) + VALID_ARCHS: arm64 arm64-sim + LIBRARY_SEARCH_PATHS[arch=x86_64]: $(inherited) $(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) + LIBRARY_SEARCH_PATHS[arch=arm64]: $(inherited) $(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) + LIBRARY_SEARCH_PATHS[arch=arm64-sim]: $(inherited) $(PROJECT_DIR)/Externals/arm64-sim/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES: true + EXCLUDED_ARCHS[sdk=iphonesimulator*]: arm64 + EXCLUDED_ARCHS[sdk=iphoneos*]: arm64-sim x86_64 groups: [app] dependencies: - - framework: libapi.a + - framework: libapp.a embed: false - sdk: CoreGraphics.framework - sdk: Metal.framework @@ -80,9 +83,10 @@ targets: - sdk: UIKit.framework - sdk: WebKit.framework preBuildScripts: - - script: node ../../../node_modules/.bin/../@tauri-apps/cli/tauri.js ios xcode-script -v --platform ${PLATFORM_DISPLAY_NAME:?} --sdk-root ${SDKROOT:?} --framework-search-paths "${FRAMEWORK_SEARCH_PATHS:?}" --header-search-paths "${HEADER_SEARCH_PATHS:?}" --gcc-preprocessor-definitions "${GCC_PREPROCESSOR_DEFINITIONS:-}" --configuration ${CONFIGURATION:?} ${FORCE_COLOR} ${ARCHS:?} + - script: pnpm tauri ios xcode-script -v --platform ${PLATFORM_DISPLAY_NAME:?} --sdk-root ${SDKROOT:?} --framework-search-paths "${FRAMEWORK_SEARCH_PATHS:?}" --header-search-paths "${HEADER_SEARCH_PATHS:?}" --gcc-preprocessor-definitions "${GCC_PREPROCESSOR_DEFINITIONS:-}" --configuration ${CONFIGURATION:?} ${FORCE_COLOR} ${ARCHS:?} name: Build Rust Code basedOnDependencyAnalysis: false outputFiles: - - $(SRCROOT)/target/aarch64-apple-ios/${CONFIGURATION}/deps/libapi.a - - $(SRCROOT)/target/x86_64-apple-ios/${CONFIGURATION}/deps/libapi.a \ No newline at end of file + - $(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a + - $(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a + - $(SRCROOT)/Externals/arm64-sim/${CONFIGURATION}/libapp.a diff --git a/examples/api/src-tauri/gen/schemas/desktop-schema.json b/examples/api/src-tauri/gen/schemas/desktop-schema.json deleted file mode 100644 index 88c01d5b..00000000 --- a/examples/api/src-tauri/gen/schemas/desktop-schema.json +++ /dev/null @@ -1,6826 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "CapabilityFile", - "description": "Capability formats accepted in a capability file.", - "anyOf": [ - { - "description": "A single capability.", - "allOf": [ - { - "$ref": "#/definitions/Capability" - } - ] - }, - { - "description": "A list of capabilities.", - "type": "object", - "required": [ - "capabilities" - ], - "properties": { - "capabilities": { - "description": "The list of capabilities.", - "type": "array", - "items": { - "$ref": "#/definitions/Capability" - } - } - } - } - ], - "definitions": { - "Capability": { - "description": "a grouping and boundary mechanism developers can use to separate windows or plugins functionality from each other at runtime.\n\nIf a window is not matching any capability then it has no access to the IPC layer at all.\n\nThis can be done to create trust groups and reduce impact of vulnerabilities in certain plugins or windows. Windows can be added to a capability by exact name or glob patterns like *, admin-* or main-window.", - "type": "object", - "required": [ - "identifier", - "permissions", - "windows" - ], - "properties": { - "identifier": { - "description": "Identifier of the capability.", - "type": "string" - }, - "description": { - "description": "Description of the capability.", - "default": "", - "type": "string" - }, - "context": { - "description": "Execution context of the capability.\n\nAt runtime, Tauri filters the IPC command together with the context to determine whether it is allowed or not and its scope.", - "default": "local", - "allOf": [ - { - "$ref": "#/definitions/CapabilityContext" - } - ] - }, - "windows": { - "description": "List of windows that uses this capability. Can be a glob pattern.\n\nOn multiwebview windows, prefer [`Self::webviews`] for a fine grained access control.", - "type": "array", - "items": { - "type": "string" - } - }, - "webviews": { - "description": "List of webviews that uses this capability. Can be a glob pattern.\n\nThis is only required when using on multiwebview contexts, by default all child webviews of a window that matches [`Self::windows`] are linked.", - "type": "array", - "items": { - "type": "string" - } - }, - "permissions": { - "description": "List of permissions attached to this capability. Must include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`.", - "type": "array", - "items": { - "$ref": "#/definitions/PermissionEntry" - } - }, - "platforms": { - "description": "Target platforms this capability applies. By default all platforms applies.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" - ], - "type": "array", - "items": { - "$ref": "#/definitions/Target" - } - } - } - }, - "CapabilityContext": { - "description": "Context of the capability.", - "oneOf": [ - { - "description": "Capability refers to local URL usage.", - "type": "string", - "enum": [ - "local" - ] - }, - { - "description": "Capability refers to remote usage.", - "type": "object", - "required": [ - "remote" - ], - "properties": { - "remote": { - "type": "object", - "required": [ - "urls" - ], - "properties": { - "urls": { - "description": "Remote domains this capability refers to. Can use glob patterns.", - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "additionalProperties": false - } - ] - }, - "PermissionEntry": { - "description": "An entry for a permission value in a [`Capability`] can be either a raw permission [`Identifier`] or an object that references a permission and extends its scope.", - "anyOf": [ - { - "description": "Reference a permission or permission set by identifier.", - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ] - }, - { - "description": "Reference a permission or permission set by identifier and extends its scope.", - "type": "object", - "oneOf": [ - { - "type": "object", - "required": [ - "identifier" - ], - "properties": { - "identifier": { - "oneOf": [ - { - "description": "fs:default -> # Tauri `fs` default permissions\n\nThis configuration file defines the default permissions granted\nto the filesystem.\n\n### Granted Permissions\n\nThis default permission set enables all read-related commands and\nallows access to the `$APP` folder and sub directories created in it.\nThe location of the `$APP` folder depends on the operating system,\nwhere the application is run.\n\nIn general the `$APP` folder needs to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\n### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\nOn Windows the webview data folder access is denied.\n\n", - "type": "string", - "enum": [ - "fs:default" - ] - }, - { - "description": "fs:allow-app-meta -> This allows read access to metadata of the `$APP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-app-meta" - ] - }, - { - "description": "fs:allow-app-meta-recursive -> This allows read access to metadata of the `$APP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-app-meta-recursive" - ] - }, - { - "description": "fs:allow-app-read -> This allows non-recursive read access to the `$APP` folder.", - "type": "string", - "enum": [ - "fs:allow-app-read" - ] - }, - { - "description": "fs:allow-app-read-recursive -> This allows full recursive read access to the complete `$APP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-app-read-recursive" - ] - }, - { - "description": "fs:allow-app-write -> This allows non-recursive write access to the `$APP` folder.", - "type": "string", - "enum": [ - "fs:allow-app-write" - ] - }, - { - "description": "fs:allow-app-write-recursive -> This allows full recusrive write access to the complete `$APP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-app-write-recursive" - ] - }, - { - "description": "fs:allow-appcache-meta -> This allows read access to metadata of the `$APPCACHE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appcache-meta" - ] - }, - { - "description": "fs:allow-appcache-meta-recursive -> This allows read access to metadata of the `$APPCACHE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appcache-meta-recursive" - ] - }, - { - "description": "fs:allow-appcache-read -> This allows non-recursive read access to the `$APPCACHE` folder.", - "type": "string", - "enum": [ - "fs:allow-appcache-read" - ] - }, - { - "description": "fs:allow-appcache-read-recursive -> This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appcache-read-recursive" - ] - }, - { - "description": "fs:allow-appcache-write -> This allows non-recursive write access to the `$APPCACHE` folder.", - "type": "string", - "enum": [ - "fs:allow-appcache-write" - ] - }, - { - "description": "fs:allow-appcache-write-recursive -> This allows full recusrive write access to the complete `$APPCACHE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appcache-write-recursive" - ] - }, - { - "description": "fs:allow-appconfig-meta -> This allows read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appconfig-meta" - ] - }, - { - "description": "fs:allow-appconfig-meta-recursive -> This allows read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appconfig-meta-recursive" - ] - }, - { - "description": "fs:allow-appconfig-read -> This allows non-recursive read access to the `$APPCONFIG` folder.", - "type": "string", - "enum": [ - "fs:allow-appconfig-read" - ] - }, - { - "description": "fs:allow-appconfig-read-recursive -> This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appconfig-read-recursive" - ] - }, - { - "description": "fs:allow-appconfig-write -> This allows non-recursive write access to the `$APPCONFIG` folder.", - "type": "string", - "enum": [ - "fs:allow-appconfig-write" - ] - }, - { - "description": "fs:allow-appconfig-write-recursive -> This allows full recusrive write access to the complete `$APPCONFIG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appconfig-write-recursive" - ] - }, - { - "description": "fs:allow-appdata-meta -> This allows read access to metadata of the `$APPDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appdata-meta" - ] - }, - { - "description": "fs:allow-appdata-meta-recursive -> This allows read access to metadata of the `$APPDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appdata-meta-recursive" - ] - }, - { - "description": "fs:allow-appdata-read -> This allows non-recursive read access to the `$APPDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-appdata-read" - ] - }, - { - "description": "fs:allow-appdata-read-recursive -> This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appdata-read-recursive" - ] - }, - { - "description": "fs:allow-appdata-write -> This allows non-recursive write access to the `$APPDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-appdata-write" - ] - }, - { - "description": "fs:allow-appdata-write-recursive -> This allows full recusrive write access to the complete `$APPDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appdata-write-recursive" - ] - }, - { - "description": "fs:allow-applocaldata-meta -> This allows read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-meta" - ] - }, - { - "description": "fs:allow-applocaldata-meta-recursive -> This allows read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-meta-recursive" - ] - }, - { - "description": "fs:allow-applocaldata-read -> This allows non-recursive read access to the `$APPLOCALDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-read" - ] - }, - { - "description": "fs:allow-applocaldata-read-recursive -> This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-read-recursive" - ] - }, - { - "description": "fs:allow-applocaldata-write -> This allows non-recursive write access to the `$APPLOCALDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-write" - ] - }, - { - "description": "fs:allow-applocaldata-write-recursive -> This allows full recusrive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-write-recursive" - ] - }, - { - "description": "fs:allow-applog-meta -> This allows read access to metadata of the `$APPLOG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-applog-meta" - ] - }, - { - "description": "fs:allow-applog-meta-recursive -> This allows read access to metadata of the `$APPLOG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-applog-meta-recursive" - ] - }, - { - "description": "fs:allow-applog-read -> This allows non-recursive read access to the `$APPLOG` folder.", - "type": "string", - "enum": [ - "fs:allow-applog-read" - ] - }, - { - "description": "fs:allow-applog-read-recursive -> This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-applog-read-recursive" - ] - }, - { - "description": "fs:allow-applog-write -> This allows non-recursive write access to the `$APPLOG` folder.", - "type": "string", - "enum": [ - "fs:allow-applog-write" - ] - }, - { - "description": "fs:allow-applog-write-recursive -> This allows full recusrive write access to the complete `$APPLOG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-applog-write-recursive" - ] - }, - { - "description": "fs:allow-audio-meta -> This allows read access to metadata of the `$AUDIO` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-audio-meta" - ] - }, - { - "description": "fs:allow-audio-meta-recursive -> This allows read access to metadata of the `$AUDIO` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-audio-meta-recursive" - ] - }, - { - "description": "fs:allow-audio-read -> This allows non-recursive read access to the `$AUDIO` folder.", - "type": "string", - "enum": [ - "fs:allow-audio-read" - ] - }, - { - "description": "fs:allow-audio-read-recursive -> This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-audio-read-recursive" - ] - }, - { - "description": "fs:allow-audio-write -> This allows non-recursive write access to the `$AUDIO` folder.", - "type": "string", - "enum": [ - "fs:allow-audio-write" - ] - }, - { - "description": "fs:allow-audio-write-recursive -> This allows full recusrive write access to the complete `$AUDIO` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-audio-write-recursive" - ] - }, - { - "description": "fs:allow-cache-meta -> This allows read access to metadata of the `$CACHE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-cache-meta" - ] - }, - { - "description": "fs:allow-cache-meta-recursive -> This allows read access to metadata of the `$CACHE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-cache-meta-recursive" - ] - }, - { - "description": "fs:allow-cache-read -> This allows non-recursive read access to the `$CACHE` folder.", - "type": "string", - "enum": [ - "fs:allow-cache-read" - ] - }, - { - "description": "fs:allow-cache-read-recursive -> This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-cache-read-recursive" - ] - }, - { - "description": "fs:allow-cache-write -> This allows non-recursive write access to the `$CACHE` folder.", - "type": "string", - "enum": [ - "fs:allow-cache-write" - ] - }, - { - "description": "fs:allow-cache-write-recursive -> This allows full recusrive write access to the complete `$CACHE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-cache-write-recursive" - ] - }, - { - "description": "fs:allow-config-meta -> This allows read access to metadata of the `$CONFIG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-config-meta" - ] - }, - { - "description": "fs:allow-config-meta-recursive -> This allows read access to metadata of the `$CONFIG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-config-meta-recursive" - ] - }, - { - "description": "fs:allow-config-read -> This allows non-recursive read access to the `$CONFIG` folder.", - "type": "string", - "enum": [ - "fs:allow-config-read" - ] - }, - { - "description": "fs:allow-config-read-recursive -> This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-config-read-recursive" - ] - }, - { - "description": "fs:allow-config-write -> This allows non-recursive write access to the `$CONFIG` folder.", - "type": "string", - "enum": [ - "fs:allow-config-write" - ] - }, - { - "description": "fs:allow-config-write-recursive -> This allows full recusrive write access to the complete `$CONFIG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-config-write-recursive" - ] - }, - { - "description": "fs:allow-data-meta -> This allows read access to metadata of the `$DATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-data-meta" - ] - }, - { - "description": "fs:allow-data-meta-recursive -> This allows read access to metadata of the `$DATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-data-meta-recursive" - ] - }, - { - "description": "fs:allow-data-read -> This allows non-recursive read access to the `$DATA` folder.", - "type": "string", - "enum": [ - "fs:allow-data-read" - ] - }, - { - "description": "fs:allow-data-read-recursive -> This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-data-read-recursive" - ] - }, - { - "description": "fs:allow-data-write -> This allows non-recursive write access to the `$DATA` folder.", - "type": "string", - "enum": [ - "fs:allow-data-write" - ] - }, - { - "description": "fs:allow-data-write-recursive -> This allows full recusrive write access to the complete `$DATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-data-write-recursive" - ] - }, - { - "description": "fs:allow-desktop-meta -> This allows read access to metadata of the `$DESKTOP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-desktop-meta" - ] - }, - { - "description": "fs:allow-desktop-meta-recursive -> This allows read access to metadata of the `$DESKTOP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-desktop-meta-recursive" - ] - }, - { - "description": "fs:allow-desktop-read -> This allows non-recursive read access to the `$DESKTOP` folder.", - "type": "string", - "enum": [ - "fs:allow-desktop-read" - ] - }, - { - "description": "fs:allow-desktop-read-recursive -> This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-desktop-read-recursive" - ] - }, - { - "description": "fs:allow-desktop-write -> This allows non-recursive write access to the `$DESKTOP` folder.", - "type": "string", - "enum": [ - "fs:allow-desktop-write" - ] - }, - { - "description": "fs:allow-desktop-write-recursive -> This allows full recusrive write access to the complete `$DESKTOP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-desktop-write-recursive" - ] - }, - { - "description": "fs:allow-document-meta -> This allows read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-document-meta" - ] - }, - { - "description": "fs:allow-document-meta-recursive -> This allows read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-document-meta-recursive" - ] - }, - { - "description": "fs:allow-document-read -> This allows non-recursive read access to the `$DOCUMENT` folder.", - "type": "string", - "enum": [ - "fs:allow-document-read" - ] - }, - { - "description": "fs:allow-document-read-recursive -> This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-document-read-recursive" - ] - }, - { - "description": "fs:allow-document-write -> This allows non-recursive write access to the `$DOCUMENT` folder.", - "type": "string", - "enum": [ - "fs:allow-document-write" - ] - }, - { - "description": "fs:allow-document-write-recursive -> This allows full recusrive write access to the complete `$DOCUMENT` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-document-write-recursive" - ] - }, - { - "description": "fs:allow-download-meta -> This allows read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-download-meta" - ] - }, - { - "description": "fs:allow-download-meta-recursive -> This allows read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-download-meta-recursive" - ] - }, - { - "description": "fs:allow-download-read -> This allows non-recursive read access to the `$DOWNLOAD` folder.", - "type": "string", - "enum": [ - "fs:allow-download-read" - ] - }, - { - "description": "fs:allow-download-read-recursive -> This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-download-read-recursive" - ] - }, - { - "description": "fs:allow-download-write -> This allows non-recursive write access to the `$DOWNLOAD` folder.", - "type": "string", - "enum": [ - "fs:allow-download-write" - ] - }, - { - "description": "fs:allow-download-write-recursive -> This allows full recusrive write access to the complete `$DOWNLOAD` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-download-write-recursive" - ] - }, - { - "description": "fs:allow-exe-meta -> This allows read access to metadata of the `$EXE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-exe-meta" - ] - }, - { - "description": "fs:allow-exe-meta-recursive -> This allows read access to metadata of the `$EXE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-exe-meta-recursive" - ] - }, - { - "description": "fs:allow-exe-read -> This allows non-recursive read access to the `$EXE` folder.", - "type": "string", - "enum": [ - "fs:allow-exe-read" - ] - }, - { - "description": "fs:allow-exe-read-recursive -> This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-exe-read-recursive" - ] - }, - { - "description": "fs:allow-exe-write -> This allows non-recursive write access to the `$EXE` folder.", - "type": "string", - "enum": [ - "fs:allow-exe-write" - ] - }, - { - "description": "fs:allow-exe-write-recursive -> This allows full recusrive write access to the complete `$EXE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-exe-write-recursive" - ] - }, - { - "description": "fs:allow-font-meta -> This allows read access to metadata of the `$FONT` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-font-meta" - ] - }, - { - "description": "fs:allow-font-meta-recursive -> This allows read access to metadata of the `$FONT` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-font-meta-recursive" - ] - }, - { - "description": "fs:allow-font-read -> This allows non-recursive read access to the `$FONT` folder.", - "type": "string", - "enum": [ - "fs:allow-font-read" - ] - }, - { - "description": "fs:allow-font-read-recursive -> This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-font-read-recursive" - ] - }, - { - "description": "fs:allow-font-write -> This allows non-recursive write access to the `$FONT` folder.", - "type": "string", - "enum": [ - "fs:allow-font-write" - ] - }, - { - "description": "fs:allow-font-write-recursive -> This allows full recusrive write access to the complete `$FONT` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-font-write-recursive" - ] - }, - { - "description": "fs:allow-home-meta -> This allows read access to metadata of the `$HOME` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-home-meta" - ] - }, - { - "description": "fs:allow-home-meta-recursive -> This allows read access to metadata of the `$HOME` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-home-meta-recursive" - ] - }, - { - "description": "fs:allow-home-read -> This allows non-recursive read access to the `$HOME` folder.", - "type": "string", - "enum": [ - "fs:allow-home-read" - ] - }, - { - "description": "fs:allow-home-read-recursive -> This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-home-read-recursive" - ] - }, - { - "description": "fs:allow-home-write -> This allows non-recursive write access to the `$HOME` folder.", - "type": "string", - "enum": [ - "fs:allow-home-write" - ] - }, - { - "description": "fs:allow-home-write-recursive -> This allows full recusrive write access to the complete `$HOME` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-home-write-recursive" - ] - }, - { - "description": "fs:allow-localdata-meta -> This allows read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-localdata-meta" - ] - }, - { - "description": "fs:allow-localdata-meta-recursive -> This allows read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-localdata-meta-recursive" - ] - }, - { - "description": "fs:allow-localdata-read -> This allows non-recursive read access to the `$LOCALDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-localdata-read" - ] - }, - { - "description": "fs:allow-localdata-read-recursive -> This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-localdata-read-recursive" - ] - }, - { - "description": "fs:allow-localdata-write -> This allows non-recursive write access to the `$LOCALDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-localdata-write" - ] - }, - { - "description": "fs:allow-localdata-write-recursive -> This allows full recusrive write access to the complete `$LOCALDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-localdata-write-recursive" - ] - }, - { - "description": "fs:allow-log-meta -> This allows read access to metadata of the `$LOG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-log-meta" - ] - }, - { - "description": "fs:allow-log-meta-recursive -> This allows read access to metadata of the `$LOG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-log-meta-recursive" - ] - }, - { - "description": "fs:allow-log-read -> This allows non-recursive read access to the `$LOG` folder.", - "type": "string", - "enum": [ - "fs:allow-log-read" - ] - }, - { - "description": "fs:allow-log-read-recursive -> This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-log-read-recursive" - ] - }, - { - "description": "fs:allow-log-write -> This allows non-recursive write access to the `$LOG` folder.", - "type": "string", - "enum": [ - "fs:allow-log-write" - ] - }, - { - "description": "fs:allow-log-write-recursive -> This allows full recusrive write access to the complete `$LOG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-log-write-recursive" - ] - }, - { - "description": "fs:allow-picture-meta -> This allows read access to metadata of the `$PICTURE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-picture-meta" - ] - }, - { - "description": "fs:allow-picture-meta-recursive -> This allows read access to metadata of the `$PICTURE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-picture-meta-recursive" - ] - }, - { - "description": "fs:allow-picture-read -> This allows non-recursive read access to the `$PICTURE` folder.", - "type": "string", - "enum": [ - "fs:allow-picture-read" - ] - }, - { - "description": "fs:allow-picture-read-recursive -> This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-picture-read-recursive" - ] - }, - { - "description": "fs:allow-picture-write -> This allows non-recursive write access to the `$PICTURE` folder.", - "type": "string", - "enum": [ - "fs:allow-picture-write" - ] - }, - { - "description": "fs:allow-picture-write-recursive -> This allows full recusrive write access to the complete `$PICTURE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-picture-write-recursive" - ] - }, - { - "description": "fs:allow-public-meta -> This allows read access to metadata of the `$PUBLIC` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-public-meta" - ] - }, - { - "description": "fs:allow-public-meta-recursive -> This allows read access to metadata of the `$PUBLIC` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-public-meta-recursive" - ] - }, - { - "description": "fs:allow-public-read -> This allows non-recursive read access to the `$PUBLIC` folder.", - "type": "string", - "enum": [ - "fs:allow-public-read" - ] - }, - { - "description": "fs:allow-public-read-recursive -> This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-public-read-recursive" - ] - }, - { - "description": "fs:allow-public-write -> This allows non-recursive write access to the `$PUBLIC` folder.", - "type": "string", - "enum": [ - "fs:allow-public-write" - ] - }, - { - "description": "fs:allow-public-write-recursive -> This allows full recusrive write access to the complete `$PUBLIC` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-public-write-recursive" - ] - }, - { - "description": "fs:allow-resource-meta -> This allows read access to metadata of the `$RESOURCE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-resource-meta" - ] - }, - { - "description": "fs:allow-resource-meta-recursive -> This allows read access to metadata of the `$RESOURCE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-resource-meta-recursive" - ] - }, - { - "description": "fs:allow-resource-read -> This allows non-recursive read access to the `$RESOURCE` folder.", - "type": "string", - "enum": [ - "fs:allow-resource-read" - ] - }, - { - "description": "fs:allow-resource-read-recursive -> This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-resource-read-recursive" - ] - }, - { - "description": "fs:allow-resource-write -> This allows non-recursive write access to the `$RESOURCE` folder.", - "type": "string", - "enum": [ - "fs:allow-resource-write" - ] - }, - { - "description": "fs:allow-resource-write-recursive -> This allows full recusrive write access to the complete `$RESOURCE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-resource-write-recursive" - ] - }, - { - "description": "fs:allow-runtime-meta -> This allows read access to metadata of the `$RUNTIME` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-runtime-meta" - ] - }, - { - "description": "fs:allow-runtime-meta-recursive -> This allows read access to metadata of the `$RUNTIME` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-runtime-meta-recursive" - ] - }, - { - "description": "fs:allow-runtime-read -> This allows non-recursive read access to the `$RUNTIME` folder.", - "type": "string", - "enum": [ - "fs:allow-runtime-read" - ] - }, - { - "description": "fs:allow-runtime-read-recursive -> This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-runtime-read-recursive" - ] - }, - { - "description": "fs:allow-runtime-write -> This allows non-recursive write access to the `$RUNTIME` folder.", - "type": "string", - "enum": [ - "fs:allow-runtime-write" - ] - }, - { - "description": "fs:allow-runtime-write-recursive -> This allows full recusrive write access to the complete `$RUNTIME` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-runtime-write-recursive" - ] - }, - { - "description": "fs:allow-temp-meta -> This allows read access to metadata of the `$TEMP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-temp-meta" - ] - }, - { - "description": "fs:allow-temp-meta-recursive -> This allows read access to metadata of the `$TEMP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-temp-meta-recursive" - ] - }, - { - "description": "fs:allow-temp-read -> This allows non-recursive read access to the `$TEMP` folder.", - "type": "string", - "enum": [ - "fs:allow-temp-read" - ] - }, - { - "description": "fs:allow-temp-read-recursive -> This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-temp-read-recursive" - ] - }, - { - "description": "fs:allow-temp-write -> This allows non-recursive write access to the `$TEMP` folder.", - "type": "string", - "enum": [ - "fs:allow-temp-write" - ] - }, - { - "description": "fs:allow-temp-write-recursive -> This allows full recusrive write access to the complete `$TEMP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-temp-write-recursive" - ] - }, - { - "description": "fs:allow-template-meta -> This allows read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-template-meta" - ] - }, - { - "description": "fs:allow-template-meta-recursive -> This allows read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-template-meta-recursive" - ] - }, - { - "description": "fs:allow-template-read -> This allows non-recursive read access to the `$TEMPLATE` folder.", - "type": "string", - "enum": [ - "fs:allow-template-read" - ] - }, - { - "description": "fs:allow-template-read-recursive -> This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-template-read-recursive" - ] - }, - { - "description": "fs:allow-template-write -> This allows non-recursive write access to the `$TEMPLATE` folder.", - "type": "string", - "enum": [ - "fs:allow-template-write" - ] - }, - { - "description": "fs:allow-template-write-recursive -> This allows full recusrive write access to the complete `$TEMPLATE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-template-write-recursive" - ] - }, - { - "description": "fs:allow-video-meta -> This allows read access to metadata of the `$VIDEO` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-video-meta" - ] - }, - { - "description": "fs:allow-video-meta-recursive -> This allows read access to metadata of the `$VIDEO` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-video-meta-recursive" - ] - }, - { - "description": "fs:allow-video-read -> This allows non-recursive read access to the `$VIDEO` folder.", - "type": "string", - "enum": [ - "fs:allow-video-read" - ] - }, - { - "description": "fs:allow-video-read-recursive -> This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-video-read-recursive" - ] - }, - { - "description": "fs:allow-video-write -> This allows non-recursive write access to the `$VIDEO` folder.", - "type": "string", - "enum": [ - "fs:allow-video-write" - ] - }, - { - "description": "fs:allow-video-write-recursive -> This allows full recusrive write access to the complete `$VIDEO` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-video-write-recursive" - ] - }, - { - "description": "fs:deny-default -> This denies access to dangerous Tauri relevant files and folders by default.", - "type": "string", - "enum": [ - "fs:deny-default" - ] - }, - { - "description": "fs:allow-copy-file -> Enables the copy_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-copy-file" - ] - }, - { - "description": "fs:allow-create -> Enables the create command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-create" - ] - }, - { - "description": "fs:allow-exists -> Enables the exists command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-exists" - ] - }, - { - "description": "fs:allow-fstat -> Enables the fstat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-fstat" - ] - }, - { - "description": "fs:allow-ftruncate -> Enables the ftruncate command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-ftruncate" - ] - }, - { - "description": "fs:allow-lstat -> Enables the lstat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-lstat" - ] - }, - { - "description": "fs:allow-mkdir -> Enables the mkdir command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-mkdir" - ] - }, - { - "description": "fs:allow-open -> Enables the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-open" - ] - }, - { - "description": "fs:allow-read -> Enables the read command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read" - ] - }, - { - "description": "fs:allow-read-dir -> Enables the read_dir command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-dir" - ] - }, - { - "description": "fs:allow-read-file -> Enables the read_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-file" - ] - }, - { - "description": "fs:allow-read-text-file -> Enables the read_text_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-text-file" - ] - }, - { - "description": "fs:allow-read-text-file-lines -> Enables the read_text_file_lines command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-text-file-lines" - ] - }, - { - "description": "fs:allow-read-text-file-lines-next -> Enables the read_text_file_lines_next command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-text-file-lines-next" - ] - }, - { - "description": "fs:allow-remove -> Enables the remove command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-remove" - ] - }, - { - "description": "fs:allow-rename -> Enables the rename command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-rename" - ] - }, - { - "description": "fs:allow-seek -> Enables the seek command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-seek" - ] - }, - { - "description": "fs:allow-stat -> Enables the stat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-stat" - ] - }, - { - "description": "fs:allow-truncate -> Enables the truncate command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-truncate" - ] - }, - { - "description": "fs:allow-unwatch -> Enables the unwatch command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-unwatch" - ] - }, - { - "description": "fs:allow-watch -> Enables the watch command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-watch" - ] - }, - { - "description": "fs:allow-write -> Enables the write command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-write" - ] - }, - { - "description": "fs:allow-write-file -> Enables the write_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-write-file" - ] - }, - { - "description": "fs:allow-write-text-file -> Enables the write_text_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-write-text-file" - ] - }, - { - "description": "fs:deny-copy-file -> Denies the copy_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-copy-file" - ] - }, - { - "description": "fs:deny-create -> Denies the create command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-create" - ] - }, - { - "description": "fs:deny-exists -> Denies the exists command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-exists" - ] - }, - { - "description": "fs:deny-fstat -> Denies the fstat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-fstat" - ] - }, - { - "description": "fs:deny-ftruncate -> Denies the ftruncate command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-ftruncate" - ] - }, - { - "description": "fs:deny-lstat -> Denies the lstat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-lstat" - ] - }, - { - "description": "fs:deny-mkdir -> Denies the mkdir command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-mkdir" - ] - }, - { - "description": "fs:deny-open -> Denies the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-open" - ] - }, - { - "description": "fs:deny-read -> Denies the read command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read" - ] - }, - { - "description": "fs:deny-read-dir -> Denies the read_dir command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-dir" - ] - }, - { - "description": "fs:deny-read-file -> Denies the read_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-file" - ] - }, - { - "description": "fs:deny-read-text-file -> Denies the read_text_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-text-file" - ] - }, - { - "description": "fs:deny-read-text-file-lines -> Denies the read_text_file_lines command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-text-file-lines" - ] - }, - { - "description": "fs:deny-read-text-file-lines-next -> Denies the read_text_file_lines_next command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-text-file-lines-next" - ] - }, - { - "description": "fs:deny-remove -> Denies the remove command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-remove" - ] - }, - { - "description": "fs:deny-rename -> Denies the rename command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-rename" - ] - }, - { - "description": "fs:deny-seek -> Denies the seek command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-seek" - ] - }, - { - "description": "fs:deny-stat -> Denies the stat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-stat" - ] - }, - { - "description": "fs:deny-truncate -> Denies the truncate command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-truncate" - ] - }, - { - "description": "fs:deny-unwatch -> Denies the unwatch command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-unwatch" - ] - }, - { - "description": "fs:deny-watch -> Denies the watch command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-watch" - ] - }, - { - "description": "fs:deny-webview-data-linux -> This denies read access to the\n`$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.", - "type": "string", - "enum": [ - "fs:deny-webview-data-linux" - ] - }, - { - "description": "fs:deny-webview-data-windows -> This denies read access to the\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.", - "type": "string", - "enum": [ - "fs:deny-webview-data-windows" - ] - }, - { - "description": "fs:deny-write -> Denies the write command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-write" - ] - }, - { - "description": "fs:deny-write-file -> Denies the write_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-write-file" - ] - }, - { - "description": "fs:deny-write-text-file -> Denies the write_text_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-write-text-file" - ] - }, - { - "description": "fs:read-all -> This enables all read related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:read-all" - ] - }, - { - "description": "fs:read-dirs -> This enables directory read and file metadata related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:read-dirs" - ] - }, - { - "description": "fs:read-files -> This enables file read related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:read-files" - ] - }, - { - "description": "fs:read-meta -> This enables all index or metadata related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:read-meta" - ] - }, - { - "description": "fs:scope -> An empty permission you can use to modify the global scope.", - "type": "string", - "enum": [ - "fs:scope" - ] - }, - { - "description": "fs:scope-app -> This scope permits access to all files and list content of top level directories in the `$APP`folder.", - "type": "string", - "enum": [ - "fs:scope-app" - ] - }, - { - "description": "fs:scope-app-index -> This scope permits to list all files and folders in the `$APP`folder.", - "type": "string", - "enum": [ - "fs:scope-app-index" - ] - }, - { - "description": "fs:scope-app-recursive -> This scope recursive access to the complete `$APP` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-app-recursive" - ] - }, - { - "description": "fs:scope-appcache -> This scope permits access to all files and list content of top level directories in the `$APPCACHE`folder.", - "type": "string", - "enum": [ - "fs:scope-appcache" - ] - }, - { - "description": "fs:scope-appcache-index -> This scope permits to list all files and folders in the `$APPCACHE`folder.", - "type": "string", - "enum": [ - "fs:scope-appcache-index" - ] - }, - { - "description": "fs:scope-appcache-recursive -> This scope recursive access to the complete `$APPCACHE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-appcache-recursive" - ] - }, - { - "description": "fs:scope-appconfig -> This scope permits access to all files and list content of top level directories in the `$APPCONFIG`folder.", - "type": "string", - "enum": [ - "fs:scope-appconfig" - ] - }, - { - "description": "fs:scope-appconfig-index -> This scope permits to list all files and folders in the `$APPCONFIG`folder.", - "type": "string", - "enum": [ - "fs:scope-appconfig-index" - ] - }, - { - "description": "fs:scope-appconfig-recursive -> This scope recursive access to the complete `$APPCONFIG` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-appconfig-recursive" - ] - }, - { - "description": "fs:scope-appdata -> This scope permits access to all files and list content of top level directories in the `$APPDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-appdata" - ] - }, - { - "description": "fs:scope-appdata-index -> This scope permits to list all files and folders in the `$APPDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-appdata-index" - ] - }, - { - "description": "fs:scope-appdata-recursive -> This scope recursive access to the complete `$APPDATA` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-appdata-recursive" - ] - }, - { - "description": "fs:scope-applocaldata -> This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-applocaldata" - ] - }, - { - "description": "fs:scope-applocaldata-index -> This scope permits to list all files and folders in the `$APPLOCALDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-applocaldata-index" - ] - }, - { - "description": "fs:scope-applocaldata-recursive -> This scope recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-applocaldata-recursive" - ] - }, - { - "description": "fs:scope-applog -> This scope permits access to all files and list content of top level directories in the `$APPLOG`folder.", - "type": "string", - "enum": [ - "fs:scope-applog" - ] - }, - { - "description": "fs:scope-applog-index -> This scope permits to list all files and folders in the `$APPLOG`folder.", - "type": "string", - "enum": [ - "fs:scope-applog-index" - ] - }, - { - "description": "fs:scope-applog-recursive -> This scope recursive access to the complete `$APPLOG` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-applog-recursive" - ] - }, - { - "description": "fs:scope-audio -> This scope permits access to all files and list content of top level directories in the `$AUDIO`folder.", - "type": "string", - "enum": [ - "fs:scope-audio" - ] - }, - { - "description": "fs:scope-audio-index -> This scope permits to list all files and folders in the `$AUDIO`folder.", - "type": "string", - "enum": [ - "fs:scope-audio-index" - ] - }, - { - "description": "fs:scope-audio-recursive -> This scope recursive access to the complete `$AUDIO` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-audio-recursive" - ] - }, - { - "description": "fs:scope-cache -> This scope permits access to all files and list content of top level directories in the `$CACHE`folder.", - "type": "string", - "enum": [ - "fs:scope-cache" - ] - }, - { - "description": "fs:scope-cache-index -> This scope permits to list all files and folders in the `$CACHE`folder.", - "type": "string", - "enum": [ - "fs:scope-cache-index" - ] - }, - { - "description": "fs:scope-cache-recursive -> This scope recursive access to the complete `$CACHE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-cache-recursive" - ] - }, - { - "description": "fs:scope-config -> This scope permits access to all files and list content of top level directories in the `$CONFIG`folder.", - "type": "string", - "enum": [ - "fs:scope-config" - ] - }, - { - "description": "fs:scope-config-index -> This scope permits to list all files and folders in the `$CONFIG`folder.", - "type": "string", - "enum": [ - "fs:scope-config-index" - ] - }, - { - "description": "fs:scope-config-recursive -> This scope recursive access to the complete `$CONFIG` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-config-recursive" - ] - }, - { - "description": "fs:scope-data -> This scope permits access to all files and list content of top level directories in the `$DATA`folder.", - "type": "string", - "enum": [ - "fs:scope-data" - ] - }, - { - "description": "fs:scope-data-index -> This scope permits to list all files and folders in the `$DATA`folder.", - "type": "string", - "enum": [ - "fs:scope-data-index" - ] - }, - { - "description": "fs:scope-data-recursive -> This scope recursive access to the complete `$DATA` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-data-recursive" - ] - }, - { - "description": "fs:scope-desktop -> This scope permits access to all files and list content of top level directories in the `$DESKTOP`folder.", - "type": "string", - "enum": [ - "fs:scope-desktop" - ] - }, - { - "description": "fs:scope-desktop-index -> This scope permits to list all files and folders in the `$DESKTOP`folder.", - "type": "string", - "enum": [ - "fs:scope-desktop-index" - ] - }, - { - "description": "fs:scope-desktop-recursive -> This scope recursive access to the complete `$DESKTOP` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-desktop-recursive" - ] - }, - { - "description": "fs:scope-document -> This scope permits access to all files and list content of top level directories in the `$DOCUMENT`folder.", - "type": "string", - "enum": [ - "fs:scope-document" - ] - }, - { - "description": "fs:scope-document-index -> This scope permits to list all files and folders in the `$DOCUMENT`folder.", - "type": "string", - "enum": [ - "fs:scope-document-index" - ] - }, - { - "description": "fs:scope-document-recursive -> This scope recursive access to the complete `$DOCUMENT` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-document-recursive" - ] - }, - { - "description": "fs:scope-download -> This scope permits access to all files and list content of top level directories in the `$DOWNLOAD`folder.", - "type": "string", - "enum": [ - "fs:scope-download" - ] - }, - { - "description": "fs:scope-download-index -> This scope permits to list all files and folders in the `$DOWNLOAD`folder.", - "type": "string", - "enum": [ - "fs:scope-download-index" - ] - }, - { - "description": "fs:scope-download-recursive -> This scope recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-download-recursive" - ] - }, - { - "description": "fs:scope-exe -> This scope permits access to all files and list content of top level directories in the `$EXE`folder.", - "type": "string", - "enum": [ - "fs:scope-exe" - ] - }, - { - "description": "fs:scope-exe-index -> This scope permits to list all files and folders in the `$EXE`folder.", - "type": "string", - "enum": [ - "fs:scope-exe-index" - ] - }, - { - "description": "fs:scope-exe-recursive -> This scope recursive access to the complete `$EXE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-exe-recursive" - ] - }, - { - "description": "fs:scope-font -> This scope permits access to all files and list content of top level directories in the `$FONT`folder.", - "type": "string", - "enum": [ - "fs:scope-font" - ] - }, - { - "description": "fs:scope-font-index -> This scope permits to list all files and folders in the `$FONT`folder.", - "type": "string", - "enum": [ - "fs:scope-font-index" - ] - }, - { - "description": "fs:scope-font-recursive -> This scope recursive access to the complete `$FONT` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-font-recursive" - ] - }, - { - "description": "fs:scope-home -> This scope permits access to all files and list content of top level directories in the `$HOME`folder.", - "type": "string", - "enum": [ - "fs:scope-home" - ] - }, - { - "description": "fs:scope-home-index -> This scope permits to list all files and folders in the `$HOME`folder.", - "type": "string", - "enum": [ - "fs:scope-home-index" - ] - }, - { - "description": "fs:scope-home-recursive -> This scope recursive access to the complete `$HOME` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-home-recursive" - ] - }, - { - "description": "fs:scope-localdata -> This scope permits access to all files and list content of top level directories in the `$LOCALDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-localdata" - ] - }, - { - "description": "fs:scope-localdata-index -> This scope permits to list all files and folders in the `$LOCALDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-localdata-index" - ] - }, - { - "description": "fs:scope-localdata-recursive -> This scope recursive access to the complete `$LOCALDATA` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-localdata-recursive" - ] - }, - { - "description": "fs:scope-log -> This scope permits access to all files and list content of top level directories in the `$LOG`folder.", - "type": "string", - "enum": [ - "fs:scope-log" - ] - }, - { - "description": "fs:scope-log-index -> This scope permits to list all files and folders in the `$LOG`folder.", - "type": "string", - "enum": [ - "fs:scope-log-index" - ] - }, - { - "description": "fs:scope-log-recursive -> This scope recursive access to the complete `$LOG` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-log-recursive" - ] - }, - { - "description": "fs:scope-picture -> This scope permits access to all files and list content of top level directories in the `$PICTURE`folder.", - "type": "string", - "enum": [ - "fs:scope-picture" - ] - }, - { - "description": "fs:scope-picture-index -> This scope permits to list all files and folders in the `$PICTURE`folder.", - "type": "string", - "enum": [ - "fs:scope-picture-index" - ] - }, - { - "description": "fs:scope-picture-recursive -> This scope recursive access to the complete `$PICTURE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-picture-recursive" - ] - }, - { - "description": "fs:scope-public -> This scope permits access to all files and list content of top level directories in the `$PUBLIC`folder.", - "type": "string", - "enum": [ - "fs:scope-public" - ] - }, - { - "description": "fs:scope-public-index -> This scope permits to list all files and folders in the `$PUBLIC`folder.", - "type": "string", - "enum": [ - "fs:scope-public-index" - ] - }, - { - "description": "fs:scope-public-recursive -> This scope recursive access to the complete `$PUBLIC` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-public-recursive" - ] - }, - { - "description": "fs:scope-resource -> This scope permits access to all files and list content of top level directories in the `$RESOURCE`folder.", - "type": "string", - "enum": [ - "fs:scope-resource" - ] - }, - { - "description": "fs:scope-resource-index -> This scope permits to list all files and folders in the `$RESOURCE`folder.", - "type": "string", - "enum": [ - "fs:scope-resource-index" - ] - }, - { - "description": "fs:scope-resource-recursive -> This scope recursive access to the complete `$RESOURCE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-resource-recursive" - ] - }, - { - "description": "fs:scope-runtime -> This scope permits access to all files and list content of top level directories in the `$RUNTIME`folder.", - "type": "string", - "enum": [ - "fs:scope-runtime" - ] - }, - { - "description": "fs:scope-runtime-index -> This scope permits to list all files and folders in the `$RUNTIME`folder.", - "type": "string", - "enum": [ - "fs:scope-runtime-index" - ] - }, - { - "description": "fs:scope-runtime-recursive -> This scope recursive access to the complete `$RUNTIME` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-runtime-recursive" - ] - }, - { - "description": "fs:scope-temp -> This scope permits access to all files and list content of top level directories in the `$TEMP`folder.", - "type": "string", - "enum": [ - "fs:scope-temp" - ] - }, - { - "description": "fs:scope-temp-index -> This scope permits to list all files and folders in the `$TEMP`folder.", - "type": "string", - "enum": [ - "fs:scope-temp-index" - ] - }, - { - "description": "fs:scope-temp-recursive -> This scope recursive access to the complete `$TEMP` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-temp-recursive" - ] - }, - { - "description": "fs:scope-template -> This scope permits access to all files and list content of top level directories in the `$TEMPLATE`folder.", - "type": "string", - "enum": [ - "fs:scope-template" - ] - }, - { - "description": "fs:scope-template-index -> This scope permits to list all files and folders in the `$TEMPLATE`folder.", - "type": "string", - "enum": [ - "fs:scope-template-index" - ] - }, - { - "description": "fs:scope-template-recursive -> This scope recursive access to the complete `$TEMPLATE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-template-recursive" - ] - }, - { - "description": "fs:scope-video -> This scope permits access to all files and list content of top level directories in the `$VIDEO`folder.", - "type": "string", - "enum": [ - "fs:scope-video" - ] - }, - { - "description": "fs:scope-video-index -> This scope permits to list all files and folders in the `$VIDEO`folder.", - "type": "string", - "enum": [ - "fs:scope-video-index" - ] - }, - { - "description": "fs:scope-video-recursive -> This scope recursive access to the complete `$VIDEO` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-video-recursive" - ] - }, - { - "description": "fs:write-all -> This enables all write related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:write-all" - ] - }, - { - "description": "fs:write-files -> This enables all file write related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:write-files" - ] - } - ] - }, - "allow": { - "items": { - "title": "Entry", - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "type": "string" - } - } - } - }, - "deny": { - "items": { - "title": "Entry", - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "type": "string" - } - } - } - } - } - }, - { - "type": "object", - "required": [ - "identifier" - ], - "properties": { - "identifier": { - "oneOf": [ - { - "description": "http:default -> Allows all fetch operations", - "type": "string", - "enum": [ - "http:default" - ] - }, - { - "description": "http:allow-fetch -> Enables the fetch command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:allow-fetch" - ] - }, - { - "description": "http:allow-fetch-cancel -> Enables the fetch_cancel command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:allow-fetch-cancel" - ] - }, - { - "description": "http:allow-fetch-read-body -> Enables the fetch_read_body command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:allow-fetch-read-body" - ] - }, - { - "description": "http:allow-fetch-send -> Enables the fetch_send command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:allow-fetch-send" - ] - }, - { - "description": "http:deny-fetch -> Denies the fetch command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:deny-fetch" - ] - }, - { - "description": "http:deny-fetch-cancel -> Denies the fetch_cancel command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:deny-fetch-cancel" - ] - }, - { - "description": "http:deny-fetch-read-body -> Denies the fetch_read_body command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:deny-fetch-read-body" - ] - }, - { - "description": "http:deny-fetch-send -> Denies the fetch_send command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:deny-fetch-send" - ] - } - ] - }, - "allow": { - "items": { - "title": "ScopeEntry", - "description": "HTTP scope entry object definition.", - "type": "object", - "required": [ - "url" - ], - "properties": { - "url": { - "description": "A URL that can be accessed by the webview when using the HTTP APIs. The scoped URL is matched against the request URL using a glob pattern.\n\nExamples:\n\n- \"https://*\" or \"https://**\" : allows all HTTPS urls\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/\"", - "type": "string" - } - } - } - }, - "deny": { - "items": { - "title": "ScopeEntry", - "description": "HTTP scope entry object definition.", - "type": "object", - "required": [ - "url" - ], - "properties": { - "url": { - "description": "A URL that can be accessed by the webview when using the HTTP APIs. The scoped URL is matched against the request URL using a glob pattern.\n\nExamples:\n\n- \"https://*\" or \"https://**\" : allows all HTTPS urls\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/\"", - "type": "string" - } - } - } - } - } - }, - { - "type": "object", - "required": [ - "identifier" - ], - "properties": { - "identifier": { - "oneOf": [ - { - "description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:allow-execute" - ] - }, - { - "description": "shell:allow-kill -> Enables the kill command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:allow-kill" - ] - }, - { - "description": "shell:allow-open -> Enables the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:allow-open" - ] - }, - { - "description": "shell:allow-stdin-write -> Enables the stdin_write command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:allow-stdin-write" - ] - }, - { - "description": "shell:deny-execute -> Denies the execute command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:deny-execute" - ] - }, - { - "description": "shell:deny-kill -> Denies the kill command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:deny-kill" - ] - }, - { - "description": "shell:deny-open -> Denies the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:deny-open" - ] - }, - { - "description": "shell:deny-stdin-write -> Denies the stdin_write command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:deny-stdin-write" - ] - } - ] - }, - "allow": { - "items": { - "title": "Entry", - "description": "A command allowed to be executed by the webview API.", - "type": "object", - "required": [ - "args", - "command", - "name", - "sidecar" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellAllowedArgs" - } - ] - }, - "command": { - "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" - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - }, - "sidecar": { - "description": "If this command is a sidecar command.", - "type": "boolean" - } - } - } - }, - "deny": { - "items": { - "title": "Entry", - "description": "A command allowed to be executed by the webview API.", - "type": "object", - "required": [ - "args", - "command", - "name", - "sidecar" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellAllowedArgs" - } - ] - }, - "command": { - "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" - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - }, - "sidecar": { - "description": "If this command is a sidecar command.", - "type": "boolean" - } - } - } - } - } - } - ] - } - ] - }, - "Identifier": { - "oneOf": [ - { - "description": "app:default -> Default permissions for the plugin.", - "type": "string", - "enum": [ - "app:default" - ] - }, - { - "description": "app:allow-app-hide -> Enables the app_hide command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:allow-app-hide" - ] - }, - { - "description": "app:allow-app-show -> Enables the app_show command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:allow-app-show" - ] - }, - { - "description": "app:allow-name -> Enables the name command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:allow-name" - ] - }, - { - "description": "app:allow-tauri-version -> Enables the tauri_version command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:allow-tauri-version" - ] - }, - { - "description": "app:allow-version -> Enables the version command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:allow-version" - ] - }, - { - "description": "app:deny-app-hide -> Denies the app_hide command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:deny-app-hide" - ] - }, - { - "description": "app:deny-app-show -> Denies the app_show command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:deny-app-show" - ] - }, - { - "description": "app:deny-name -> Denies the name command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:deny-name" - ] - }, - { - "description": "app:deny-tauri-version -> Denies the tauri_version command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:deny-tauri-version" - ] - }, - { - "description": "app:deny-version -> Denies the version command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:deny-version" - ] - }, - { - "description": "cli:default -> Allows reading the CLI matches", - "type": "string", - "enum": [ - "cli:default" - ] - }, - { - "description": "cli:allow-cli-matches -> Enables the cli_matches command without any pre-configured scope.", - "type": "string", - "enum": [ - "cli:allow-cli-matches" - ] - }, - { - "description": "cli:deny-cli-matches -> Denies the cli_matches command without any pre-configured scope.", - "type": "string", - "enum": [ - "cli:deny-cli-matches" - ] - }, - { - "description": "clipboard-manager:allow-read -> Enables the read command without any pre-configured scope.", - "type": "string", - "enum": [ - "clipboard-manager:allow-read" - ] - }, - { - "description": "clipboard-manager:allow-write -> Enables the write command without any pre-configured scope.", - "type": "string", - "enum": [ - "clipboard-manager:allow-write" - ] - }, - { - "description": "clipboard-manager:deny-read -> Denies the read command without any pre-configured scope.", - "type": "string", - "enum": [ - "clipboard-manager:deny-read" - ] - }, - { - "description": "clipboard-manager:deny-write -> Denies the write command without any pre-configured scope.", - "type": "string", - "enum": [ - "clipboard-manager:deny-write" - ] - }, - { - "description": "dialog:allow-ask -> Enables the ask command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:allow-ask" - ] - }, - { - "description": "dialog:allow-confirm -> Enables the confirm command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:allow-confirm" - ] - }, - { - "description": "dialog:allow-message -> Enables the message command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:allow-message" - ] - }, - { - "description": "dialog:allow-open -> Enables the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:allow-open" - ] - }, - { - "description": "dialog:allow-save -> Enables the save command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:allow-save" - ] - }, - { - "description": "dialog:deny-ask -> Denies the ask command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:deny-ask" - ] - }, - { - "description": "dialog:deny-confirm -> Denies the confirm command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:deny-confirm" - ] - }, - { - "description": "dialog:deny-message -> Denies the message command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:deny-message" - ] - }, - { - "description": "dialog:deny-open -> Denies the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:deny-open" - ] - }, - { - "description": "dialog:deny-save -> Denies the save command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:deny-save" - ] - }, - { - "description": "event:default -> Default permissions for the plugin.", - "type": "string", - "enum": [ - "event:default" - ] - }, - { - "description": "event:allow-emit -> Enables the emit command without any pre-configured scope.", - "type": "string", - "enum": [ - "event:allow-emit" - ] - }, - { - "description": "event:allow-emit-to -> Enables the emit_to command without any pre-configured scope.", - "type": "string", - "enum": [ - "event:allow-emit-to" - ] - }, - { - "description": "event:allow-listen -> Enables the listen command without any pre-configured scope.", - "type": "string", - "enum": [ - "event:allow-listen" - ] - }, - { - "description": "event:allow-unlisten -> Enables the unlisten command without any pre-configured scope.", - "type": "string", - "enum": [ - "event:allow-unlisten" - ] - }, - { - "description": "event:deny-emit -> Denies the emit command without any pre-configured scope.", - "type": "string", - "enum": [ - "event:deny-emit" - ] - }, - { - "description": "event:deny-emit-to -> Denies the emit_to command without any pre-configured scope.", - "type": "string", - "enum": [ - "event:deny-emit-to" - ] - }, - { - "description": "event:deny-listen -> Denies the listen command without any pre-configured scope.", - "type": "string", - "enum": [ - "event:deny-listen" - ] - }, - { - "description": "event:deny-unlisten -> Denies the unlisten command without any pre-configured scope.", - "type": "string", - "enum": [ - "event:deny-unlisten" - ] - }, - { - "description": "fs:allow-app-meta -> This allows read access to metadata of the `$APP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-app-meta" - ] - }, - { - "description": "fs:allow-app-meta-recursive -> This allows read access to metadata of the `$APP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-app-meta-recursive" - ] - }, - { - "description": "fs:allow-app-read -> This allows non-recursive read access to the `$APP` folder.", - "type": "string", - "enum": [ - "fs:allow-app-read" - ] - }, - { - "description": "fs:allow-app-read-recursive -> This allows full recursive read access to the complete `$APP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-app-read-recursive" - ] - }, - { - "description": "fs:allow-app-write -> This allows non-recursive write access to the `$APP` folder.", - "type": "string", - "enum": [ - "fs:allow-app-write" - ] - }, - { - "description": "fs:allow-app-write-recursive -> This allows full recusrive write access to the complete `$APP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-app-write-recursive" - ] - }, - { - "description": "fs:allow-appcache-meta -> This allows read access to metadata of the `$APPCACHE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appcache-meta" - ] - }, - { - "description": "fs:allow-appcache-meta-recursive -> This allows read access to metadata of the `$APPCACHE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appcache-meta-recursive" - ] - }, - { - "description": "fs:allow-appcache-read -> This allows non-recursive read access to the `$APPCACHE` folder.", - "type": "string", - "enum": [ - "fs:allow-appcache-read" - ] - }, - { - "description": "fs:allow-appcache-read-recursive -> This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appcache-read-recursive" - ] - }, - { - "description": "fs:allow-appcache-write -> This allows non-recursive write access to the `$APPCACHE` folder.", - "type": "string", - "enum": [ - "fs:allow-appcache-write" - ] - }, - { - "description": "fs:allow-appcache-write-recursive -> This allows full recusrive write access to the complete `$APPCACHE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appcache-write-recursive" - ] - }, - { - "description": "fs:allow-appconfig-meta -> This allows read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appconfig-meta" - ] - }, - { - "description": "fs:allow-appconfig-meta-recursive -> This allows read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appconfig-meta-recursive" - ] - }, - { - "description": "fs:allow-appconfig-read -> This allows non-recursive read access to the `$APPCONFIG` folder.", - "type": "string", - "enum": [ - "fs:allow-appconfig-read" - ] - }, - { - "description": "fs:allow-appconfig-read-recursive -> This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appconfig-read-recursive" - ] - }, - { - "description": "fs:allow-appconfig-write -> This allows non-recursive write access to the `$APPCONFIG` folder.", - "type": "string", - "enum": [ - "fs:allow-appconfig-write" - ] - }, - { - "description": "fs:allow-appconfig-write-recursive -> This allows full recusrive write access to the complete `$APPCONFIG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appconfig-write-recursive" - ] - }, - { - "description": "fs:allow-appdata-meta -> This allows read access to metadata of the `$APPDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appdata-meta" - ] - }, - { - "description": "fs:allow-appdata-meta-recursive -> This allows read access to metadata of the `$APPDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appdata-meta-recursive" - ] - }, - { - "description": "fs:allow-appdata-read -> This allows non-recursive read access to the `$APPDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-appdata-read" - ] - }, - { - "description": "fs:allow-appdata-read-recursive -> This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appdata-read-recursive" - ] - }, - { - "description": "fs:allow-appdata-write -> This allows non-recursive write access to the `$APPDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-appdata-write" - ] - }, - { - "description": "fs:allow-appdata-write-recursive -> This allows full recusrive write access to the complete `$APPDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appdata-write-recursive" - ] - }, - { - "description": "fs:allow-applocaldata-meta -> This allows read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-meta" - ] - }, - { - "description": "fs:allow-applocaldata-meta-recursive -> This allows read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-meta-recursive" - ] - }, - { - "description": "fs:allow-applocaldata-read -> This allows non-recursive read access to the `$APPLOCALDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-read" - ] - }, - { - "description": "fs:allow-applocaldata-read-recursive -> This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-read-recursive" - ] - }, - { - "description": "fs:allow-applocaldata-write -> This allows non-recursive write access to the `$APPLOCALDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-write" - ] - }, - { - "description": "fs:allow-applocaldata-write-recursive -> This allows full recusrive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-write-recursive" - ] - }, - { - "description": "fs:allow-applog-meta -> This allows read access to metadata of the `$APPLOG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-applog-meta" - ] - }, - { - "description": "fs:allow-applog-meta-recursive -> This allows read access to metadata of the `$APPLOG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-applog-meta-recursive" - ] - }, - { - "description": "fs:allow-applog-read -> This allows non-recursive read access to the `$APPLOG` folder.", - "type": "string", - "enum": [ - "fs:allow-applog-read" - ] - }, - { - "description": "fs:allow-applog-read-recursive -> This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-applog-read-recursive" - ] - }, - { - "description": "fs:allow-applog-write -> This allows non-recursive write access to the `$APPLOG` folder.", - "type": "string", - "enum": [ - "fs:allow-applog-write" - ] - }, - { - "description": "fs:allow-applog-write-recursive -> This allows full recusrive write access to the complete `$APPLOG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-applog-write-recursive" - ] - }, - { - "description": "fs:allow-audio-meta -> This allows read access to metadata of the `$AUDIO` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-audio-meta" - ] - }, - { - "description": "fs:allow-audio-meta-recursive -> This allows read access to metadata of the `$AUDIO` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-audio-meta-recursive" - ] - }, - { - "description": "fs:allow-audio-read -> This allows non-recursive read access to the `$AUDIO` folder.", - "type": "string", - "enum": [ - "fs:allow-audio-read" - ] - }, - { - "description": "fs:allow-audio-read-recursive -> This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-audio-read-recursive" - ] - }, - { - "description": "fs:allow-audio-write -> This allows non-recursive write access to the `$AUDIO` folder.", - "type": "string", - "enum": [ - "fs:allow-audio-write" - ] - }, - { - "description": "fs:allow-audio-write-recursive -> This allows full recusrive write access to the complete `$AUDIO` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-audio-write-recursive" - ] - }, - { - "description": "fs:allow-cache-meta -> This allows read access to metadata of the `$CACHE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-cache-meta" - ] - }, - { - "description": "fs:allow-cache-meta-recursive -> This allows read access to metadata of the `$CACHE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-cache-meta-recursive" - ] - }, - { - "description": "fs:allow-cache-read -> This allows non-recursive read access to the `$CACHE` folder.", - "type": "string", - "enum": [ - "fs:allow-cache-read" - ] - }, - { - "description": "fs:allow-cache-read-recursive -> This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-cache-read-recursive" - ] - }, - { - "description": "fs:allow-cache-write -> This allows non-recursive write access to the `$CACHE` folder.", - "type": "string", - "enum": [ - "fs:allow-cache-write" - ] - }, - { - "description": "fs:allow-cache-write-recursive -> This allows full recusrive write access to the complete `$CACHE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-cache-write-recursive" - ] - }, - { - "description": "fs:allow-config-meta -> This allows read access to metadata of the `$CONFIG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-config-meta" - ] - }, - { - "description": "fs:allow-config-meta-recursive -> This allows read access to metadata of the `$CONFIG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-config-meta-recursive" - ] - }, - { - "description": "fs:allow-config-read -> This allows non-recursive read access to the `$CONFIG` folder.", - "type": "string", - "enum": [ - "fs:allow-config-read" - ] - }, - { - "description": "fs:allow-config-read-recursive -> This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-config-read-recursive" - ] - }, - { - "description": "fs:allow-config-write -> This allows non-recursive write access to the `$CONFIG` folder.", - "type": "string", - "enum": [ - "fs:allow-config-write" - ] - }, - { - "description": "fs:allow-config-write-recursive -> This allows full recusrive write access to the complete `$CONFIG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-config-write-recursive" - ] - }, - { - "description": "fs:allow-data-meta -> This allows read access to metadata of the `$DATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-data-meta" - ] - }, - { - "description": "fs:allow-data-meta-recursive -> This allows read access to metadata of the `$DATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-data-meta-recursive" - ] - }, - { - "description": "fs:allow-data-read -> This allows non-recursive read access to the `$DATA` folder.", - "type": "string", - "enum": [ - "fs:allow-data-read" - ] - }, - { - "description": "fs:allow-data-read-recursive -> This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-data-read-recursive" - ] - }, - { - "description": "fs:allow-data-write -> This allows non-recursive write access to the `$DATA` folder.", - "type": "string", - "enum": [ - "fs:allow-data-write" - ] - }, - { - "description": "fs:allow-data-write-recursive -> This allows full recusrive write access to the complete `$DATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-data-write-recursive" - ] - }, - { - "description": "fs:allow-desktop-meta -> This allows read access to metadata of the `$DESKTOP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-desktop-meta" - ] - }, - { - "description": "fs:allow-desktop-meta-recursive -> This allows read access to metadata of the `$DESKTOP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-desktop-meta-recursive" - ] - }, - { - "description": "fs:allow-desktop-read -> This allows non-recursive read access to the `$DESKTOP` folder.", - "type": "string", - "enum": [ - "fs:allow-desktop-read" - ] - }, - { - "description": "fs:allow-desktop-read-recursive -> This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-desktop-read-recursive" - ] - }, - { - "description": "fs:allow-desktop-write -> This allows non-recursive write access to the `$DESKTOP` folder.", - "type": "string", - "enum": [ - "fs:allow-desktop-write" - ] - }, - { - "description": "fs:allow-desktop-write-recursive -> This allows full recusrive write access to the complete `$DESKTOP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-desktop-write-recursive" - ] - }, - { - "description": "fs:allow-document-meta -> This allows read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-document-meta" - ] - }, - { - "description": "fs:allow-document-meta-recursive -> This allows read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-document-meta-recursive" - ] - }, - { - "description": "fs:allow-document-read -> This allows non-recursive read access to the `$DOCUMENT` folder.", - "type": "string", - "enum": [ - "fs:allow-document-read" - ] - }, - { - "description": "fs:allow-document-read-recursive -> This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-document-read-recursive" - ] - }, - { - "description": "fs:allow-document-write -> This allows non-recursive write access to the `$DOCUMENT` folder.", - "type": "string", - "enum": [ - "fs:allow-document-write" - ] - }, - { - "description": "fs:allow-document-write-recursive -> This allows full recusrive write access to the complete `$DOCUMENT` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-document-write-recursive" - ] - }, - { - "description": "fs:allow-download-meta -> This allows read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-download-meta" - ] - }, - { - "description": "fs:allow-download-meta-recursive -> This allows read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-download-meta-recursive" - ] - }, - { - "description": "fs:allow-download-read -> This allows non-recursive read access to the `$DOWNLOAD` folder.", - "type": "string", - "enum": [ - "fs:allow-download-read" - ] - }, - { - "description": "fs:allow-download-read-recursive -> This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-download-read-recursive" - ] - }, - { - "description": "fs:allow-download-write -> This allows non-recursive write access to the `$DOWNLOAD` folder.", - "type": "string", - "enum": [ - "fs:allow-download-write" - ] - }, - { - "description": "fs:allow-download-write-recursive -> This allows full recusrive write access to the complete `$DOWNLOAD` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-download-write-recursive" - ] - }, - { - "description": "fs:allow-exe-meta -> This allows read access to metadata of the `$EXE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-exe-meta" - ] - }, - { - "description": "fs:allow-exe-meta-recursive -> This allows read access to metadata of the `$EXE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-exe-meta-recursive" - ] - }, - { - "description": "fs:allow-exe-read -> This allows non-recursive read access to the `$EXE` folder.", - "type": "string", - "enum": [ - "fs:allow-exe-read" - ] - }, - { - "description": "fs:allow-exe-read-recursive -> This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-exe-read-recursive" - ] - }, - { - "description": "fs:allow-exe-write -> This allows non-recursive write access to the `$EXE` folder.", - "type": "string", - "enum": [ - "fs:allow-exe-write" - ] - }, - { - "description": "fs:allow-exe-write-recursive -> This allows full recusrive write access to the complete `$EXE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-exe-write-recursive" - ] - }, - { - "description": "fs:allow-font-meta -> This allows read access to metadata of the `$FONT` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-font-meta" - ] - }, - { - "description": "fs:allow-font-meta-recursive -> This allows read access to metadata of the `$FONT` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-font-meta-recursive" - ] - }, - { - "description": "fs:allow-font-read -> This allows non-recursive read access to the `$FONT` folder.", - "type": "string", - "enum": [ - "fs:allow-font-read" - ] - }, - { - "description": "fs:allow-font-read-recursive -> This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-font-read-recursive" - ] - }, - { - "description": "fs:allow-font-write -> This allows non-recursive write access to the `$FONT` folder.", - "type": "string", - "enum": [ - "fs:allow-font-write" - ] - }, - { - "description": "fs:allow-font-write-recursive -> This allows full recusrive write access to the complete `$FONT` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-font-write-recursive" - ] - }, - { - "description": "fs:allow-home-meta -> This allows read access to metadata of the `$HOME` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-home-meta" - ] - }, - { - "description": "fs:allow-home-meta-recursive -> This allows read access to metadata of the `$HOME` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-home-meta-recursive" - ] - }, - { - "description": "fs:allow-home-read -> This allows non-recursive read access to the `$HOME` folder.", - "type": "string", - "enum": [ - "fs:allow-home-read" - ] - }, - { - "description": "fs:allow-home-read-recursive -> This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-home-read-recursive" - ] - }, - { - "description": "fs:allow-home-write -> This allows non-recursive write access to the `$HOME` folder.", - "type": "string", - "enum": [ - "fs:allow-home-write" - ] - }, - { - "description": "fs:allow-home-write-recursive -> This allows full recusrive write access to the complete `$HOME` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-home-write-recursive" - ] - }, - { - "description": "fs:allow-localdata-meta -> This allows read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-localdata-meta" - ] - }, - { - "description": "fs:allow-localdata-meta-recursive -> This allows read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-localdata-meta-recursive" - ] - }, - { - "description": "fs:allow-localdata-read -> This allows non-recursive read access to the `$LOCALDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-localdata-read" - ] - }, - { - "description": "fs:allow-localdata-read-recursive -> This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-localdata-read-recursive" - ] - }, - { - "description": "fs:allow-localdata-write -> This allows non-recursive write access to the `$LOCALDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-localdata-write" - ] - }, - { - "description": "fs:allow-localdata-write-recursive -> This allows full recusrive write access to the complete `$LOCALDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-localdata-write-recursive" - ] - }, - { - "description": "fs:allow-log-meta -> This allows read access to metadata of the `$LOG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-log-meta" - ] - }, - { - "description": "fs:allow-log-meta-recursive -> This allows read access to metadata of the `$LOG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-log-meta-recursive" - ] - }, - { - "description": "fs:allow-log-read -> This allows non-recursive read access to the `$LOG` folder.", - "type": "string", - "enum": [ - "fs:allow-log-read" - ] - }, - { - "description": "fs:allow-log-read-recursive -> This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-log-read-recursive" - ] - }, - { - "description": "fs:allow-log-write -> This allows non-recursive write access to the `$LOG` folder.", - "type": "string", - "enum": [ - "fs:allow-log-write" - ] - }, - { - "description": "fs:allow-log-write-recursive -> This allows full recusrive write access to the complete `$LOG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-log-write-recursive" - ] - }, - { - "description": "fs:allow-picture-meta -> This allows read access to metadata of the `$PICTURE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-picture-meta" - ] - }, - { - "description": "fs:allow-picture-meta-recursive -> This allows read access to metadata of the `$PICTURE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-picture-meta-recursive" - ] - }, - { - "description": "fs:allow-picture-read -> This allows non-recursive read access to the `$PICTURE` folder.", - "type": "string", - "enum": [ - "fs:allow-picture-read" - ] - }, - { - "description": "fs:allow-picture-read-recursive -> This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-picture-read-recursive" - ] - }, - { - "description": "fs:allow-picture-write -> This allows non-recursive write access to the `$PICTURE` folder.", - "type": "string", - "enum": [ - "fs:allow-picture-write" - ] - }, - { - "description": "fs:allow-picture-write-recursive -> This allows full recusrive write access to the complete `$PICTURE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-picture-write-recursive" - ] - }, - { - "description": "fs:allow-public-meta -> This allows read access to metadata of the `$PUBLIC` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-public-meta" - ] - }, - { - "description": "fs:allow-public-meta-recursive -> This allows read access to metadata of the `$PUBLIC` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-public-meta-recursive" - ] - }, - { - "description": "fs:allow-public-read -> This allows non-recursive read access to the `$PUBLIC` folder.", - "type": "string", - "enum": [ - "fs:allow-public-read" - ] - }, - { - "description": "fs:allow-public-read-recursive -> This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-public-read-recursive" - ] - }, - { - "description": "fs:allow-public-write -> This allows non-recursive write access to the `$PUBLIC` folder.", - "type": "string", - "enum": [ - "fs:allow-public-write" - ] - }, - { - "description": "fs:allow-public-write-recursive -> This allows full recusrive write access to the complete `$PUBLIC` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-public-write-recursive" - ] - }, - { - "description": "fs:allow-resource-meta -> This allows read access to metadata of the `$RESOURCE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-resource-meta" - ] - }, - { - "description": "fs:allow-resource-meta-recursive -> This allows read access to metadata of the `$RESOURCE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-resource-meta-recursive" - ] - }, - { - "description": "fs:allow-resource-read -> This allows non-recursive read access to the `$RESOURCE` folder.", - "type": "string", - "enum": [ - "fs:allow-resource-read" - ] - }, - { - "description": "fs:allow-resource-read-recursive -> This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-resource-read-recursive" - ] - }, - { - "description": "fs:allow-resource-write -> This allows non-recursive write access to the `$RESOURCE` folder.", - "type": "string", - "enum": [ - "fs:allow-resource-write" - ] - }, - { - "description": "fs:allow-resource-write-recursive -> This allows full recusrive write access to the complete `$RESOURCE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-resource-write-recursive" - ] - }, - { - "description": "fs:allow-runtime-meta -> This allows read access to metadata of the `$RUNTIME` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-runtime-meta" - ] - }, - { - "description": "fs:allow-runtime-meta-recursive -> This allows read access to metadata of the `$RUNTIME` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-runtime-meta-recursive" - ] - }, - { - "description": "fs:allow-runtime-read -> This allows non-recursive read access to the `$RUNTIME` folder.", - "type": "string", - "enum": [ - "fs:allow-runtime-read" - ] - }, - { - "description": "fs:allow-runtime-read-recursive -> This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-runtime-read-recursive" - ] - }, - { - "description": "fs:allow-runtime-write -> This allows non-recursive write access to the `$RUNTIME` folder.", - "type": "string", - "enum": [ - "fs:allow-runtime-write" - ] - }, - { - "description": "fs:allow-runtime-write-recursive -> This allows full recusrive write access to the complete `$RUNTIME` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-runtime-write-recursive" - ] - }, - { - "description": "fs:allow-temp-meta -> This allows read access to metadata of the `$TEMP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-temp-meta" - ] - }, - { - "description": "fs:allow-temp-meta-recursive -> This allows read access to metadata of the `$TEMP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-temp-meta-recursive" - ] - }, - { - "description": "fs:allow-temp-read -> This allows non-recursive read access to the `$TEMP` folder.", - "type": "string", - "enum": [ - "fs:allow-temp-read" - ] - }, - { - "description": "fs:allow-temp-read-recursive -> This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-temp-read-recursive" - ] - }, - { - "description": "fs:allow-temp-write -> This allows non-recursive write access to the `$TEMP` folder.", - "type": "string", - "enum": [ - "fs:allow-temp-write" - ] - }, - { - "description": "fs:allow-temp-write-recursive -> This allows full recusrive write access to the complete `$TEMP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-temp-write-recursive" - ] - }, - { - "description": "fs:allow-template-meta -> This allows read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-template-meta" - ] - }, - { - "description": "fs:allow-template-meta-recursive -> This allows read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-template-meta-recursive" - ] - }, - { - "description": "fs:allow-template-read -> This allows non-recursive read access to the `$TEMPLATE` folder.", - "type": "string", - "enum": [ - "fs:allow-template-read" - ] - }, - { - "description": "fs:allow-template-read-recursive -> This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-template-read-recursive" - ] - }, - { - "description": "fs:allow-template-write -> This allows non-recursive write access to the `$TEMPLATE` folder.", - "type": "string", - "enum": [ - "fs:allow-template-write" - ] - }, - { - "description": "fs:allow-template-write-recursive -> This allows full recusrive write access to the complete `$TEMPLATE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-template-write-recursive" - ] - }, - { - "description": "fs:allow-video-meta -> This allows read access to metadata of the `$VIDEO` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-video-meta" - ] - }, - { - "description": "fs:allow-video-meta-recursive -> This allows read access to metadata of the `$VIDEO` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-video-meta-recursive" - ] - }, - { - "description": "fs:allow-video-read -> This allows non-recursive read access to the `$VIDEO` folder.", - "type": "string", - "enum": [ - "fs:allow-video-read" - ] - }, - { - "description": "fs:allow-video-read-recursive -> This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-video-read-recursive" - ] - }, - { - "description": "fs:allow-video-write -> This allows non-recursive write access to the `$VIDEO` folder.", - "type": "string", - "enum": [ - "fs:allow-video-write" - ] - }, - { - "description": "fs:allow-video-write-recursive -> This allows full recusrive write access to the complete `$VIDEO` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-video-write-recursive" - ] - }, - { - "description": "fs:deny-default -> This denies access to dangerous Tauri relevant files and folders by default.", - "type": "string", - "enum": [ - "fs:deny-default" - ] - }, - { - "description": "fs:default -> # Tauri `fs` default permissions\n\nThis configuration file defines the default permissions granted\nto the filesystem.\n\n### Granted Permissions\n\nThis default permission set enables all read-related commands and\nallows access to the `$APP` folder and sub directories created in it.\nThe location of the `$APP` folder depends on the operating system,\nwhere the application is run.\n\nIn general the `$APP` folder needs to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\n### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\nOn Windows the webview data folder access is denied.\n\n", - "type": "string", - "enum": [ - "fs:default" - ] - }, - { - "description": "fs:allow-copy-file -> Enables the copy_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-copy-file" - ] - }, - { - "description": "fs:allow-create -> Enables the create command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-create" - ] - }, - { - "description": "fs:allow-exists -> Enables the exists command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-exists" - ] - }, - { - "description": "fs:allow-fstat -> Enables the fstat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-fstat" - ] - }, - { - "description": "fs:allow-ftruncate -> Enables the ftruncate command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-ftruncate" - ] - }, - { - "description": "fs:allow-lstat -> Enables the lstat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-lstat" - ] - }, - { - "description": "fs:allow-mkdir -> Enables the mkdir command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-mkdir" - ] - }, - { - "description": "fs:allow-open -> Enables the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-open" - ] - }, - { - "description": "fs:allow-read -> Enables the read command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read" - ] - }, - { - "description": "fs:allow-read-dir -> Enables the read_dir command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-dir" - ] - }, - { - "description": "fs:allow-read-file -> Enables the read_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-file" - ] - }, - { - "description": "fs:allow-read-text-file -> Enables the read_text_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-text-file" - ] - }, - { - "description": "fs:allow-read-text-file-lines -> Enables the read_text_file_lines command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-text-file-lines" - ] - }, - { - "description": "fs:allow-read-text-file-lines-next -> Enables the read_text_file_lines_next command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-text-file-lines-next" - ] - }, - { - "description": "fs:allow-remove -> Enables the remove command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-remove" - ] - }, - { - "description": "fs:allow-rename -> Enables the rename command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-rename" - ] - }, - { - "description": "fs:allow-seek -> Enables the seek command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-seek" - ] - }, - { - "description": "fs:allow-stat -> Enables the stat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-stat" - ] - }, - { - "description": "fs:allow-truncate -> Enables the truncate command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-truncate" - ] - }, - { - "description": "fs:allow-unwatch -> Enables the unwatch command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-unwatch" - ] - }, - { - "description": "fs:allow-watch -> Enables the watch command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-watch" - ] - }, - { - "description": "fs:allow-write -> Enables the write command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-write" - ] - }, - { - "description": "fs:allow-write-file -> Enables the write_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-write-file" - ] - }, - { - "description": "fs:allow-write-text-file -> Enables the write_text_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-write-text-file" - ] - }, - { - "description": "fs:deny-copy-file -> Denies the copy_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-copy-file" - ] - }, - { - "description": "fs:deny-create -> Denies the create command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-create" - ] - }, - { - "description": "fs:deny-exists -> Denies the exists command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-exists" - ] - }, - { - "description": "fs:deny-fstat -> Denies the fstat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-fstat" - ] - }, - { - "description": "fs:deny-ftruncate -> Denies the ftruncate command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-ftruncate" - ] - }, - { - "description": "fs:deny-lstat -> Denies the lstat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-lstat" - ] - }, - { - "description": "fs:deny-mkdir -> Denies the mkdir command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-mkdir" - ] - }, - { - "description": "fs:deny-open -> Denies the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-open" - ] - }, - { - "description": "fs:deny-read -> Denies the read command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read" - ] - }, - { - "description": "fs:deny-read-dir -> Denies the read_dir command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-dir" - ] - }, - { - "description": "fs:deny-read-file -> Denies the read_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-file" - ] - }, - { - "description": "fs:deny-read-text-file -> Denies the read_text_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-text-file" - ] - }, - { - "description": "fs:deny-read-text-file-lines -> Denies the read_text_file_lines command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-text-file-lines" - ] - }, - { - "description": "fs:deny-read-text-file-lines-next -> Denies the read_text_file_lines_next command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-text-file-lines-next" - ] - }, - { - "description": "fs:deny-remove -> Denies the remove command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-remove" - ] - }, - { - "description": "fs:deny-rename -> Denies the rename command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-rename" - ] - }, - { - "description": "fs:deny-seek -> Denies the seek command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-seek" - ] - }, - { - "description": "fs:deny-stat -> Denies the stat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-stat" - ] - }, - { - "description": "fs:deny-truncate -> Denies the truncate command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-truncate" - ] - }, - { - "description": "fs:deny-unwatch -> Denies the unwatch command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-unwatch" - ] - }, - { - "description": "fs:deny-watch -> Denies the watch command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-watch" - ] - }, - { - "description": "fs:deny-webview-data-linux -> This denies read access to the\n`$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.", - "type": "string", - "enum": [ - "fs:deny-webview-data-linux" - ] - }, - { - "description": "fs:deny-webview-data-windows -> This denies read access to the\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.", - "type": "string", - "enum": [ - "fs:deny-webview-data-windows" - ] - }, - { - "description": "fs:deny-write -> Denies the write command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-write" - ] - }, - { - "description": "fs:deny-write-file -> Denies the write_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-write-file" - ] - }, - { - "description": "fs:deny-write-text-file -> Denies the write_text_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-write-text-file" - ] - }, - { - "description": "fs:read-all -> This enables all read related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:read-all" - ] - }, - { - "description": "fs:read-dirs -> This enables directory read and file metadata related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:read-dirs" - ] - }, - { - "description": "fs:read-files -> This enables file read related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:read-files" - ] - }, - { - "description": "fs:read-meta -> This enables all index or metadata related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:read-meta" - ] - }, - { - "description": "fs:scope -> An empty permission you can use to modify the global scope.", - "type": "string", - "enum": [ - "fs:scope" - ] - }, - { - "description": "fs:scope-app -> This scope permits access to all files and list content of top level directories in the `$APP`folder.", - "type": "string", - "enum": [ - "fs:scope-app" - ] - }, - { - "description": "fs:scope-app-index -> This scope permits to list all files and folders in the `$APP`folder.", - "type": "string", - "enum": [ - "fs:scope-app-index" - ] - }, - { - "description": "fs:scope-app-recursive -> This scope recursive access to the complete `$APP` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-app-recursive" - ] - }, - { - "description": "fs:scope-appcache -> This scope permits access to all files and list content of top level directories in the `$APPCACHE`folder.", - "type": "string", - "enum": [ - "fs:scope-appcache" - ] - }, - { - "description": "fs:scope-appcache-index -> This scope permits to list all files and folders in the `$APPCACHE`folder.", - "type": "string", - "enum": [ - "fs:scope-appcache-index" - ] - }, - { - "description": "fs:scope-appcache-recursive -> This scope recursive access to the complete `$APPCACHE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-appcache-recursive" - ] - }, - { - "description": "fs:scope-appconfig -> This scope permits access to all files and list content of top level directories in the `$APPCONFIG`folder.", - "type": "string", - "enum": [ - "fs:scope-appconfig" - ] - }, - { - "description": "fs:scope-appconfig-index -> This scope permits to list all files and folders in the `$APPCONFIG`folder.", - "type": "string", - "enum": [ - "fs:scope-appconfig-index" - ] - }, - { - "description": "fs:scope-appconfig-recursive -> This scope recursive access to the complete `$APPCONFIG` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-appconfig-recursive" - ] - }, - { - "description": "fs:scope-appdata -> This scope permits access to all files and list content of top level directories in the `$APPDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-appdata" - ] - }, - { - "description": "fs:scope-appdata-index -> This scope permits to list all files and folders in the `$APPDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-appdata-index" - ] - }, - { - "description": "fs:scope-appdata-recursive -> This scope recursive access to the complete `$APPDATA` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-appdata-recursive" - ] - }, - { - "description": "fs:scope-applocaldata -> This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-applocaldata" - ] - }, - { - "description": "fs:scope-applocaldata-index -> This scope permits to list all files and folders in the `$APPLOCALDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-applocaldata-index" - ] - }, - { - "description": "fs:scope-applocaldata-recursive -> This scope recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-applocaldata-recursive" - ] - }, - { - "description": "fs:scope-applog -> This scope permits access to all files and list content of top level directories in the `$APPLOG`folder.", - "type": "string", - "enum": [ - "fs:scope-applog" - ] - }, - { - "description": "fs:scope-applog-index -> This scope permits to list all files and folders in the `$APPLOG`folder.", - "type": "string", - "enum": [ - "fs:scope-applog-index" - ] - }, - { - "description": "fs:scope-applog-recursive -> This scope recursive access to the complete `$APPLOG` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-applog-recursive" - ] - }, - { - "description": "fs:scope-audio -> This scope permits access to all files and list content of top level directories in the `$AUDIO`folder.", - "type": "string", - "enum": [ - "fs:scope-audio" - ] - }, - { - "description": "fs:scope-audio-index -> This scope permits to list all files and folders in the `$AUDIO`folder.", - "type": "string", - "enum": [ - "fs:scope-audio-index" - ] - }, - { - "description": "fs:scope-audio-recursive -> This scope recursive access to the complete `$AUDIO` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-audio-recursive" - ] - }, - { - "description": "fs:scope-cache -> This scope permits access to all files and list content of top level directories in the `$CACHE`folder.", - "type": "string", - "enum": [ - "fs:scope-cache" - ] - }, - { - "description": "fs:scope-cache-index -> This scope permits to list all files and folders in the `$CACHE`folder.", - "type": "string", - "enum": [ - "fs:scope-cache-index" - ] - }, - { - "description": "fs:scope-cache-recursive -> This scope recursive access to the complete `$CACHE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-cache-recursive" - ] - }, - { - "description": "fs:scope-config -> This scope permits access to all files and list content of top level directories in the `$CONFIG`folder.", - "type": "string", - "enum": [ - "fs:scope-config" - ] - }, - { - "description": "fs:scope-config-index -> This scope permits to list all files and folders in the `$CONFIG`folder.", - "type": "string", - "enum": [ - "fs:scope-config-index" - ] - }, - { - "description": "fs:scope-config-recursive -> This scope recursive access to the complete `$CONFIG` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-config-recursive" - ] - }, - { - "description": "fs:scope-data -> This scope permits access to all files and list content of top level directories in the `$DATA`folder.", - "type": "string", - "enum": [ - "fs:scope-data" - ] - }, - { - "description": "fs:scope-data-index -> This scope permits to list all files and folders in the `$DATA`folder.", - "type": "string", - "enum": [ - "fs:scope-data-index" - ] - }, - { - "description": "fs:scope-data-recursive -> This scope recursive access to the complete `$DATA` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-data-recursive" - ] - }, - { - "description": "fs:scope-desktop -> This scope permits access to all files and list content of top level directories in the `$DESKTOP`folder.", - "type": "string", - "enum": [ - "fs:scope-desktop" - ] - }, - { - "description": "fs:scope-desktop-index -> This scope permits to list all files and folders in the `$DESKTOP`folder.", - "type": "string", - "enum": [ - "fs:scope-desktop-index" - ] - }, - { - "description": "fs:scope-desktop-recursive -> This scope recursive access to the complete `$DESKTOP` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-desktop-recursive" - ] - }, - { - "description": "fs:scope-document -> This scope permits access to all files and list content of top level directories in the `$DOCUMENT`folder.", - "type": "string", - "enum": [ - "fs:scope-document" - ] - }, - { - "description": "fs:scope-document-index -> This scope permits to list all files and folders in the `$DOCUMENT`folder.", - "type": "string", - "enum": [ - "fs:scope-document-index" - ] - }, - { - "description": "fs:scope-document-recursive -> This scope recursive access to the complete `$DOCUMENT` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-document-recursive" - ] - }, - { - "description": "fs:scope-download -> This scope permits access to all files and list content of top level directories in the `$DOWNLOAD`folder.", - "type": "string", - "enum": [ - "fs:scope-download" - ] - }, - { - "description": "fs:scope-download-index -> This scope permits to list all files and folders in the `$DOWNLOAD`folder.", - "type": "string", - "enum": [ - "fs:scope-download-index" - ] - }, - { - "description": "fs:scope-download-recursive -> This scope recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-download-recursive" - ] - }, - { - "description": "fs:scope-exe -> This scope permits access to all files and list content of top level directories in the `$EXE`folder.", - "type": "string", - "enum": [ - "fs:scope-exe" - ] - }, - { - "description": "fs:scope-exe-index -> This scope permits to list all files and folders in the `$EXE`folder.", - "type": "string", - "enum": [ - "fs:scope-exe-index" - ] - }, - { - "description": "fs:scope-exe-recursive -> This scope recursive access to the complete `$EXE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-exe-recursive" - ] - }, - { - "description": "fs:scope-font -> This scope permits access to all files and list content of top level directories in the `$FONT`folder.", - "type": "string", - "enum": [ - "fs:scope-font" - ] - }, - { - "description": "fs:scope-font-index -> This scope permits to list all files and folders in the `$FONT`folder.", - "type": "string", - "enum": [ - "fs:scope-font-index" - ] - }, - { - "description": "fs:scope-font-recursive -> This scope recursive access to the complete `$FONT` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-font-recursive" - ] - }, - { - "description": "fs:scope-home -> This scope permits access to all files and list content of top level directories in the `$HOME`folder.", - "type": "string", - "enum": [ - "fs:scope-home" - ] - }, - { - "description": "fs:scope-home-index -> This scope permits to list all files and folders in the `$HOME`folder.", - "type": "string", - "enum": [ - "fs:scope-home-index" - ] - }, - { - "description": "fs:scope-home-recursive -> This scope recursive access to the complete `$HOME` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-home-recursive" - ] - }, - { - "description": "fs:scope-localdata -> This scope permits access to all files and list content of top level directories in the `$LOCALDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-localdata" - ] - }, - { - "description": "fs:scope-localdata-index -> This scope permits to list all files and folders in the `$LOCALDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-localdata-index" - ] - }, - { - "description": "fs:scope-localdata-recursive -> This scope recursive access to the complete `$LOCALDATA` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-localdata-recursive" - ] - }, - { - "description": "fs:scope-log -> This scope permits access to all files and list content of top level directories in the `$LOG`folder.", - "type": "string", - "enum": [ - "fs:scope-log" - ] - }, - { - "description": "fs:scope-log-index -> This scope permits to list all files and folders in the `$LOG`folder.", - "type": "string", - "enum": [ - "fs:scope-log-index" - ] - }, - { - "description": "fs:scope-log-recursive -> This scope recursive access to the complete `$LOG` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-log-recursive" - ] - }, - { - "description": "fs:scope-picture -> This scope permits access to all files and list content of top level directories in the `$PICTURE`folder.", - "type": "string", - "enum": [ - "fs:scope-picture" - ] - }, - { - "description": "fs:scope-picture-index -> This scope permits to list all files and folders in the `$PICTURE`folder.", - "type": "string", - "enum": [ - "fs:scope-picture-index" - ] - }, - { - "description": "fs:scope-picture-recursive -> This scope recursive access to the complete `$PICTURE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-picture-recursive" - ] - }, - { - "description": "fs:scope-public -> This scope permits access to all files and list content of top level directories in the `$PUBLIC`folder.", - "type": "string", - "enum": [ - "fs:scope-public" - ] - }, - { - "description": "fs:scope-public-index -> This scope permits to list all files and folders in the `$PUBLIC`folder.", - "type": "string", - "enum": [ - "fs:scope-public-index" - ] - }, - { - "description": "fs:scope-public-recursive -> This scope recursive access to the complete `$PUBLIC` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-public-recursive" - ] - }, - { - "description": "fs:scope-resource -> This scope permits access to all files and list content of top level directories in the `$RESOURCE`folder.", - "type": "string", - "enum": [ - "fs:scope-resource" - ] - }, - { - "description": "fs:scope-resource-index -> This scope permits to list all files and folders in the `$RESOURCE`folder.", - "type": "string", - "enum": [ - "fs:scope-resource-index" - ] - }, - { - "description": "fs:scope-resource-recursive -> This scope recursive access to the complete `$RESOURCE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-resource-recursive" - ] - }, - { - "description": "fs:scope-runtime -> This scope permits access to all files and list content of top level directories in the `$RUNTIME`folder.", - "type": "string", - "enum": [ - "fs:scope-runtime" - ] - }, - { - "description": "fs:scope-runtime-index -> This scope permits to list all files and folders in the `$RUNTIME`folder.", - "type": "string", - "enum": [ - "fs:scope-runtime-index" - ] - }, - { - "description": "fs:scope-runtime-recursive -> This scope recursive access to the complete `$RUNTIME` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-runtime-recursive" - ] - }, - { - "description": "fs:scope-temp -> This scope permits access to all files and list content of top level directories in the `$TEMP`folder.", - "type": "string", - "enum": [ - "fs:scope-temp" - ] - }, - { - "description": "fs:scope-temp-index -> This scope permits to list all files and folders in the `$TEMP`folder.", - "type": "string", - "enum": [ - "fs:scope-temp-index" - ] - }, - { - "description": "fs:scope-temp-recursive -> This scope recursive access to the complete `$TEMP` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-temp-recursive" - ] - }, - { - "description": "fs:scope-template -> This scope permits access to all files and list content of top level directories in the `$TEMPLATE`folder.", - "type": "string", - "enum": [ - "fs:scope-template" - ] - }, - { - "description": "fs:scope-template-index -> This scope permits to list all files and folders in the `$TEMPLATE`folder.", - "type": "string", - "enum": [ - "fs:scope-template-index" - ] - }, - { - "description": "fs:scope-template-recursive -> This scope recursive access to the complete `$TEMPLATE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-template-recursive" - ] - }, - { - "description": "fs:scope-video -> This scope permits access to all files and list content of top level directories in the `$VIDEO`folder.", - "type": "string", - "enum": [ - "fs:scope-video" - ] - }, - { - "description": "fs:scope-video-index -> This scope permits to list all files and folders in the `$VIDEO`folder.", - "type": "string", - "enum": [ - "fs:scope-video-index" - ] - }, - { - "description": "fs:scope-video-recursive -> This scope recursive access to the complete `$VIDEO` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-video-recursive" - ] - }, - { - "description": "fs:write-all -> This enables all write related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:write-all" - ] - }, - { - "description": "fs:write-files -> This enables all file write related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:write-files" - ] - }, - { - "description": "global-shortcut:allow-is-registered -> Enables the is_registered command without any pre-configured scope.", - "type": "string", - "enum": [ - "global-shortcut:allow-is-registered" - ] - }, - { - "description": "global-shortcut:allow-register -> Enables the register command without any pre-configured scope.", - "type": "string", - "enum": [ - "global-shortcut:allow-register" - ] - }, - { - "description": "global-shortcut:allow-register-all -> Enables the register_all command without any pre-configured scope.", - "type": "string", - "enum": [ - "global-shortcut:allow-register-all" - ] - }, - { - "description": "global-shortcut:allow-unregister -> Enables the unregister command without any pre-configured scope.", - "type": "string", - "enum": [ - "global-shortcut:allow-unregister" - ] - }, - { - "description": "global-shortcut:allow-unregister-all -> Enables the unregister_all command without any pre-configured scope.", - "type": "string", - "enum": [ - "global-shortcut:allow-unregister-all" - ] - }, - { - "description": "global-shortcut:deny-is-registered -> Denies the is_registered command without any pre-configured scope.", - "type": "string", - "enum": [ - "global-shortcut:deny-is-registered" - ] - }, - { - "description": "global-shortcut:deny-register -> Denies the register command without any pre-configured scope.", - "type": "string", - "enum": [ - "global-shortcut:deny-register" - ] - }, - { - "description": "global-shortcut:deny-register-all -> Denies the register_all command without any pre-configured scope.", - "type": "string", - "enum": [ - "global-shortcut:deny-register-all" - ] - }, - { - "description": "global-shortcut:deny-unregister -> Denies the unregister command without any pre-configured scope.", - "type": "string", - "enum": [ - "global-shortcut:deny-unregister" - ] - }, - { - "description": "global-shortcut:deny-unregister-all -> Denies the unregister_all command without any pre-configured scope.", - "type": "string", - "enum": [ - "global-shortcut:deny-unregister-all" - ] - }, - { - "description": "http:default -> Allows all fetch operations", - "type": "string", - "enum": [ - "http:default" - ] - }, - { - "description": "http:allow-fetch -> Enables the fetch command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:allow-fetch" - ] - }, - { - "description": "http:allow-fetch-cancel -> Enables the fetch_cancel command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:allow-fetch-cancel" - ] - }, - { - "description": "http:allow-fetch-read-body -> Enables the fetch_read_body command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:allow-fetch-read-body" - ] - }, - { - "description": "http:allow-fetch-send -> Enables the fetch_send command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:allow-fetch-send" - ] - }, - { - "description": "http:deny-fetch -> Denies the fetch command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:deny-fetch" - ] - }, - { - "description": "http:deny-fetch-cancel -> Denies the fetch_cancel command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:deny-fetch-cancel" - ] - }, - { - "description": "http:deny-fetch-read-body -> Denies the fetch_read_body command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:deny-fetch-read-body" - ] - }, - { - "description": "http:deny-fetch-send -> Denies the fetch_send command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:deny-fetch-send" - ] - }, - { - "description": "log:default -> Allows the log command", - "type": "string", - "enum": [ - "log:default" - ] - }, - { - "description": "log:allow-log -> Enables the log command without any pre-configured scope.", - "type": "string", - "enum": [ - "log:allow-log" - ] - }, - { - "description": "log:deny-log -> Denies the log command without any pre-configured scope.", - "type": "string", - "enum": [ - "log:deny-log" - ] - }, - { - "description": "menu:default -> Default permissions for the plugin.", - "type": "string", - "enum": [ - "menu:default" - ] - }, - { - "description": "menu:allow-append -> Enables the append command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-append" - ] - }, - { - "description": "menu:allow-create-default -> Enables the create_default command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-create-default" - ] - }, - { - "description": "menu:allow-get -> Enables the get command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-get" - ] - }, - { - "description": "menu:allow-insert -> Enables the insert command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-insert" - ] - }, - { - "description": "menu:allow-is-checked -> Enables the is_checked command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-is-checked" - ] - }, - { - "description": "menu:allow-is-enabled -> Enables the is_enabled command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-is-enabled" - ] - }, - { - "description": "menu:allow-items -> Enables the items command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-items" - ] - }, - { - "description": "menu:allow-new -> Enables the new command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-new" - ] - }, - { - "description": "menu:allow-popup -> Enables the popup command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-popup" - ] - }, - { - "description": "menu:allow-prepend -> Enables the prepend command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-prepend" - ] - }, - { - "description": "menu:allow-remove -> Enables the remove command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-remove" - ] - }, - { - "description": "menu:allow-remove-at -> Enables the remove_at command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-remove-at" - ] - }, - { - "description": "menu:allow-set-accelerator -> Enables the set_accelerator command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-accelerator" - ] - }, - { - "description": "menu:allow-set-as-app-menu -> Enables the set_as_app_menu command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-as-app-menu" - ] - }, - { - "description": "menu:allow-set-as-help-menu-for-nsapp -> Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-as-help-menu-for-nsapp" - ] - }, - { - "description": "menu:allow-set-as-window-menu -> Enables the set_as_window_menu command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-as-window-menu" - ] - }, - { - "description": "menu:allow-set-as-windows-menu-for-nsapp -> Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-as-windows-menu-for-nsapp" - ] - }, - { - "description": "menu:allow-set-checked -> Enables the set_checked command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-checked" - ] - }, - { - "description": "menu:allow-set-enabled -> Enables the set_enabled command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-enabled" - ] - }, - { - "description": "menu:allow-set-icon -> Enables the set_icon command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-icon" - ] - }, - { - "description": "menu:allow-set-text -> Enables the set_text command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-text" - ] - }, - { - "description": "menu:allow-text -> Enables the text command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-text" - ] - }, - { - "description": "menu:deny-append -> Denies the append command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-append" - ] - }, - { - "description": "menu:deny-create-default -> Denies the create_default command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-create-default" - ] - }, - { - "description": "menu:deny-get -> Denies the get command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-get" - ] - }, - { - "description": "menu:deny-insert -> Denies the insert command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-insert" - ] - }, - { - "description": "menu:deny-is-checked -> Denies the is_checked command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-is-checked" - ] - }, - { - "description": "menu:deny-is-enabled -> Denies the is_enabled command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-is-enabled" - ] - }, - { - "description": "menu:deny-items -> Denies the items command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-items" - ] - }, - { - "description": "menu:deny-new -> Denies the new command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-new" - ] - }, - { - "description": "menu:deny-popup -> Denies the popup command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-popup" - ] - }, - { - "description": "menu:deny-prepend -> Denies the prepend command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-prepend" - ] - }, - { - "description": "menu:deny-remove -> Denies the remove command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-remove" - ] - }, - { - "description": "menu:deny-remove-at -> Denies the remove_at command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-remove-at" - ] - }, - { - "description": "menu:deny-set-accelerator -> Denies the set_accelerator command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-accelerator" - ] - }, - { - "description": "menu:deny-set-as-app-menu -> Denies the set_as_app_menu command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-as-app-menu" - ] - }, - { - "description": "menu:deny-set-as-help-menu-for-nsapp -> Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-as-help-menu-for-nsapp" - ] - }, - { - "description": "menu:deny-set-as-window-menu -> Denies the set_as_window_menu command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-as-window-menu" - ] - }, - { - "description": "menu:deny-set-as-windows-menu-for-nsapp -> Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-as-windows-menu-for-nsapp" - ] - }, - { - "description": "menu:deny-set-checked -> Denies the set_checked command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-checked" - ] - }, - { - "description": "menu:deny-set-enabled -> Denies the set_enabled command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-enabled" - ] - }, - { - "description": "menu:deny-set-icon -> Denies the set_icon command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-icon" - ] - }, - { - "description": "menu:deny-set-text -> Denies the set_text command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-text" - ] - }, - { - "description": "menu:deny-text -> Denies the text command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-text" - ] - }, - { - "description": "notification:default -> Allows requesting permission, checking permission state and sending notifications", - "type": "string", - "enum": [ - "notification:default" - ] - }, - { - "description": "notification:allow-is-permission-granted -> Enables the is_permission_granted command without any pre-configured scope.", - "type": "string", - "enum": [ - "notification:allow-is-permission-granted" - ] - }, - { - "description": "notification:allow-notify -> Enables the notify command without any pre-configured scope.", - "type": "string", - "enum": [ - "notification:allow-notify" - ] - }, - { - "description": "notification:allow-request-permission -> Enables the request_permission command without any pre-configured scope.", - "type": "string", - "enum": [ - "notification:allow-request-permission" - ] - }, - { - "description": "notification:deny-is-permission-granted -> Denies the is_permission_granted command without any pre-configured scope.", - "type": "string", - "enum": [ - "notification:deny-is-permission-granted" - ] - }, - { - "description": "notification:deny-notify -> Denies the notify command without any pre-configured scope.", - "type": "string", - "enum": [ - "notification:deny-notify" - ] - }, - { - "description": "notification:deny-request-permission -> Denies the request_permission command without any pre-configured scope.", - "type": "string", - "enum": [ - "notification:deny-request-permission" - ] - }, - { - "description": "os:allow-arch -> Enables the arch command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:allow-arch" - ] - }, - { - "description": "os:allow-exe-extension -> Enables the exe_extension command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:allow-exe-extension" - ] - }, - { - "description": "os:allow-family -> Enables the family command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:allow-family" - ] - }, - { - "description": "os:allow-hostname -> Enables the hostname command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:allow-hostname" - ] - }, - { - "description": "os:allow-locale -> Enables the locale command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:allow-locale" - ] - }, - { - "description": "os:allow-os-type -> Enables the os_type command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:allow-os-type" - ] - }, - { - "description": "os:allow-platform -> Enables the platform command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:allow-platform" - ] - }, - { - "description": "os:allow-version -> Enables the version command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:allow-version" - ] - }, - { - "description": "os:deny-arch -> Denies the arch command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:deny-arch" - ] - }, - { - "description": "os:deny-exe-extension -> Denies the exe_extension command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:deny-exe-extension" - ] - }, - { - "description": "os:deny-family -> Denies the family command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:deny-family" - ] - }, - { - "description": "os:deny-hostname -> Denies the hostname command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:deny-hostname" - ] - }, - { - "description": "os:deny-locale -> Denies the locale command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:deny-locale" - ] - }, - { - "description": "os:deny-os-type -> Denies the os_type command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:deny-os-type" - ] - }, - { - "description": "os:deny-platform -> Denies the platform command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:deny-platform" - ] - }, - { - "description": "os:deny-version -> Denies the version command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:deny-version" - ] - }, - { - "description": "path:default -> Default permissions for the plugin.", - "type": "string", - "enum": [ - "path:default" - ] - }, - { - "description": "path:allow-basename -> Enables the basename command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:allow-basename" - ] - }, - { - "description": "path:allow-dirname -> Enables the dirname command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:allow-dirname" - ] - }, - { - "description": "path:allow-extname -> Enables the extname command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:allow-extname" - ] - }, - { - "description": "path:allow-is-absolute -> Enables the is_absolute command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:allow-is-absolute" - ] - }, - { - "description": "path:allow-join -> Enables the join command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:allow-join" - ] - }, - { - "description": "path:allow-normalize -> Enables the normalize command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:allow-normalize" - ] - }, - { - "description": "path:allow-resolve -> Enables the resolve command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:allow-resolve" - ] - }, - { - "description": "path:allow-resolve-directory -> Enables the resolve_directory command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:allow-resolve-directory" - ] - }, - { - "description": "path:deny-basename -> Denies the basename command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:deny-basename" - ] - }, - { - "description": "path:deny-dirname -> Denies the dirname command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:deny-dirname" - ] - }, - { - "description": "path:deny-extname -> Denies the extname command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:deny-extname" - ] - }, - { - "description": "path:deny-is-absolute -> Denies the is_absolute command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:deny-is-absolute" - ] - }, - { - "description": "path:deny-join -> Denies the join command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:deny-join" - ] - }, - { - "description": "path:deny-normalize -> Denies the normalize command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:deny-normalize" - ] - }, - { - "description": "path:deny-resolve -> Denies the resolve command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:deny-resolve" - ] - }, - { - "description": "path:deny-resolve-directory -> Denies the resolve_directory command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:deny-resolve-directory" - ] - }, - { - "description": "process:allow-exit -> Enables the exit command without any pre-configured scope.", - "type": "string", - "enum": [ - "process:allow-exit" - ] - }, - { - "description": "process:allow-restart -> Enables the restart command without any pre-configured scope.", - "type": "string", - "enum": [ - "process:allow-restart" - ] - }, - { - "description": "process:deny-exit -> Denies the exit command without any pre-configured scope.", - "type": "string", - "enum": [ - "process:deny-exit" - ] - }, - { - "description": "process:deny-restart -> Denies the restart command without any pre-configured scope.", - "type": "string", - "enum": [ - "process:deny-restart" - ] - }, - { - "description": "resources:default -> Default permissions for the plugin.", - "type": "string", - "enum": [ - "resources:default" - ] - }, - { - "description": "resources:allow-close -> Enables the close command without any pre-configured scope.", - "type": "string", - "enum": [ - "resources:allow-close" - ] - }, - { - "description": "resources:deny-close -> Denies the close command without any pre-configured scope.", - "type": "string", - "enum": [ - "resources:deny-close" - ] - }, - { - "description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:allow-execute" - ] - }, - { - "description": "shell:allow-kill -> Enables the kill command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:allow-kill" - ] - }, - { - "description": "shell:allow-open -> Enables the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:allow-open" - ] - }, - { - "description": "shell:allow-stdin-write -> Enables the stdin_write command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:allow-stdin-write" - ] - }, - { - "description": "shell:deny-execute -> Denies the execute command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:deny-execute" - ] - }, - { - "description": "shell:deny-kill -> Denies the kill command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:deny-kill" - ] - }, - { - "description": "shell:deny-open -> Denies the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:deny-open" - ] - }, - { - "description": "shell:deny-stdin-write -> Denies the stdin_write command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:deny-stdin-write" - ] - }, - { - "description": "tray:default -> Default permissions for the plugin.", - "type": "string", - "enum": [ - "tray:default" - ] - }, - { - "description": "tray:allow-new -> Enables the new command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-new" - ] - }, - { - "description": "tray:allow-set-icon -> Enables the set_icon command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-set-icon" - ] - }, - { - "description": "tray:allow-set-icon-as-template -> Enables the set_icon_as_template command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-set-icon-as-template" - ] - }, - { - "description": "tray:allow-set-menu -> Enables the set_menu command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-set-menu" - ] - }, - { - "description": "tray:allow-set-show-menu-on-left-click -> Enables the set_show_menu_on_left_click command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-set-show-menu-on-left-click" - ] - }, - { - "description": "tray:allow-set-temp-dir-path -> Enables the set_temp_dir_path command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-set-temp-dir-path" - ] - }, - { - "description": "tray:allow-set-title -> Enables the set_title command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-set-title" - ] - }, - { - "description": "tray:allow-set-tooltip -> Enables the set_tooltip command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-set-tooltip" - ] - }, - { - "description": "tray:allow-set-visible -> Enables the set_visible command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-set-visible" - ] - }, - { - "description": "tray:deny-new -> Denies the new command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-new" - ] - }, - { - "description": "tray:deny-set-icon -> Denies the set_icon command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-set-icon" - ] - }, - { - "description": "tray:deny-set-icon-as-template -> Denies the set_icon_as_template command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-set-icon-as-template" - ] - }, - { - "description": "tray:deny-set-menu -> Denies the set_menu command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-set-menu" - ] - }, - { - "description": "tray:deny-set-show-menu-on-left-click -> Denies the set_show_menu_on_left_click command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-set-show-menu-on-left-click" - ] - }, - { - "description": "tray:deny-set-temp-dir-path -> Denies the set_temp_dir_path command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-set-temp-dir-path" - ] - }, - { - "description": "tray:deny-set-title -> Denies the set_title command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-set-title" - ] - }, - { - "description": "tray:deny-set-tooltip -> Denies the set_tooltip command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-set-tooltip" - ] - }, - { - "description": "tray:deny-set-visible -> Denies the set_visible command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-set-visible" - ] - }, - { - "description": "updater:default -> Allows checking for new updates and installing them", - "type": "string", - "enum": [ - "updater:default" - ] - }, - { - "description": "updater:allow-check -> Enables the check command without any pre-configured scope.", - "type": "string", - "enum": [ - "updater:allow-check" - ] - }, - { - "description": "updater:allow-download-and-install -> Enables the download_and_install command without any pre-configured scope.", - "type": "string", - "enum": [ - "updater:allow-download-and-install" - ] - }, - { - "description": "updater:deny-check -> Denies the check command without any pre-configured scope.", - "type": "string", - "enum": [ - "updater:deny-check" - ] - }, - { - "description": "updater:deny-download-and-install -> Denies the download_and_install command without any pre-configured scope.", - "type": "string", - "enum": [ - "updater:deny-download-and-install" - ] - }, - { - "description": "webview:default -> Default permissions for the plugin.", - "type": "string", - "enum": [ - "webview:default" - ] - }, - { - "description": "webview:allow-create-webview -> Enables the create_webview command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-create-webview" - ] - }, - { - "description": "webview:allow-create-webview-window -> Enables the create_webview_window command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-create-webview-window" - ] - }, - { - "description": "webview:allow-internal-toggle-devtools -> Enables the internal_toggle_devtools command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-internal-toggle-devtools" - ] - }, - { - "description": "webview:allow-print -> Enables the print command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-print" - ] - }, - { - "description": "webview:allow-set-webview-focus -> Enables the set_webview_focus command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-set-webview-focus" - ] - }, - { - "description": "webview:allow-set-webview-position -> Enables the set_webview_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-set-webview-position" - ] - }, - { - "description": "webview:allow-set-webview-size -> Enables the set_webview_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-set-webview-size" - ] - }, - { - "description": "webview:allow-webview-close -> Enables the webview_close command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-webview-close" - ] - }, - { - "description": "webview:allow-webview-position -> Enables the webview_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-webview-position" - ] - }, - { - "description": "webview:allow-webview-size -> Enables the webview_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-webview-size" - ] - }, - { - "description": "webview:deny-create-webview -> Denies the create_webview command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-create-webview" - ] - }, - { - "description": "webview:deny-create-webview-window -> Denies the create_webview_window command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-create-webview-window" - ] - }, - { - "description": "webview:deny-internal-toggle-devtools -> Denies the internal_toggle_devtools command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-internal-toggle-devtools" - ] - }, - { - "description": "webview:deny-print -> Denies the print command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-print" - ] - }, - { - "description": "webview:deny-set-webview-focus -> Denies the set_webview_focus command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-set-webview-focus" - ] - }, - { - "description": "webview:deny-set-webview-position -> Denies the set_webview_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-set-webview-position" - ] - }, - { - "description": "webview:deny-set-webview-size -> Denies the set_webview_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-set-webview-size" - ] - }, - { - "description": "webview:deny-webview-close -> Denies the webview_close command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-webview-close" - ] - }, - { - "description": "webview:deny-webview-position -> Denies the webview_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-webview-position" - ] - }, - { - "description": "webview:deny-webview-size -> Denies the webview_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-webview-size" - ] - }, - { - "description": "window:default -> Default permissions for the plugin.", - "type": "string", - "enum": [ - "window:default" - ] - }, - { - "description": "window:allow-available-monitors -> Enables the available_monitors command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-available-monitors" - ] - }, - { - "description": "window:allow-center -> Enables the center command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-center" - ] - }, - { - "description": "window:allow-close -> Enables the close command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-close" - ] - }, - { - "description": "window:allow-create -> Enables the create command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-create" - ] - }, - { - "description": "window:allow-current-monitor -> Enables the current_monitor command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-current-monitor" - ] - }, - { - "description": "window:allow-destroy -> Enables the destroy command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-destroy" - ] - }, - { - "description": "window:allow-hide -> Enables the hide command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-hide" - ] - }, - { - "description": "window:allow-inner-position -> Enables the inner_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-inner-position" - ] - }, - { - "description": "window:allow-inner-size -> Enables the inner_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-inner-size" - ] - }, - { - "description": "window:allow-internal-toggle-maximize -> Enables the internal_toggle_maximize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-internal-toggle-maximize" - ] - }, - { - "description": "window:allow-is-closable -> Enables the is_closable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-closable" - ] - }, - { - "description": "window:allow-is-decorated -> Enables the is_decorated command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-decorated" - ] - }, - { - "description": "window:allow-is-focused -> Enables the is_focused command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-focused" - ] - }, - { - "description": "window:allow-is-fullscreen -> Enables the is_fullscreen command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-fullscreen" - ] - }, - { - "description": "window:allow-is-maximizable -> Enables the is_maximizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-maximizable" - ] - }, - { - "description": "window:allow-is-maximized -> Enables the is_maximized command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-maximized" - ] - }, - { - "description": "window:allow-is-minimizable -> Enables the is_minimizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-minimizable" - ] - }, - { - "description": "window:allow-is-minimized -> Enables the is_minimized command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-minimized" - ] - }, - { - "description": "window:allow-is-resizable -> Enables the is_resizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-resizable" - ] - }, - { - "description": "window:allow-is-visible -> Enables the is_visible command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-visible" - ] - }, - { - "description": "window:allow-maximize -> Enables the maximize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-maximize" - ] - }, - { - "description": "window:allow-minimize -> Enables the minimize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-minimize" - ] - }, - { - "description": "window:allow-outer-position -> Enables the outer_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-outer-position" - ] - }, - { - "description": "window:allow-outer-size -> Enables the outer_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-outer-size" - ] - }, - { - "description": "window:allow-primary-monitor -> Enables the primary_monitor command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-primary-monitor" - ] - }, - { - "description": "window:allow-request-user-attention -> Enables the request_user_attention command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-request-user-attention" - ] - }, - { - "description": "window:allow-scale-factor -> Enables the scale_factor command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-scale-factor" - ] - }, - { - "description": "window:allow-set-always-on-bottom -> Enables the set_always_on_bottom command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-always-on-bottom" - ] - }, - { - "description": "window:allow-set-always-on-top -> Enables the set_always_on_top command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-always-on-top" - ] - }, - { - "description": "window:allow-set-closable -> Enables the set_closable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-closable" - ] - }, - { - "description": "window:allow-set-content-protected -> Enables the set_content_protected command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-content-protected" - ] - }, - { - "description": "window:allow-set-cursor-grab -> Enables the set_cursor_grab command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-cursor-grab" - ] - }, - { - "description": "window:allow-set-cursor-icon -> Enables the set_cursor_icon command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-cursor-icon" - ] - }, - { - "description": "window:allow-set-cursor-position -> Enables the set_cursor_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-cursor-position" - ] - }, - { - "description": "window:allow-set-cursor-visible -> Enables the set_cursor_visible command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-cursor-visible" - ] - }, - { - "description": "window:allow-set-decorations -> Enables the set_decorations command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-decorations" - ] - }, - { - "description": "window:allow-set-effects -> Enables the set_effects command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-effects" - ] - }, - { - "description": "window:allow-set-focus -> Enables the set_focus command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-focus" - ] - }, - { - "description": "window:allow-set-fullscreen -> Enables the set_fullscreen command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-fullscreen" - ] - }, - { - "description": "window:allow-set-icon -> Enables the set_icon command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-icon" - ] - }, - { - "description": "window:allow-set-ignore-cursor-events -> Enables the set_ignore_cursor_events command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-ignore-cursor-events" - ] - }, - { - "description": "window:allow-set-max-size -> Enables the set_max_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-max-size" - ] - }, - { - "description": "window:allow-set-maximizable -> Enables the set_maximizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-maximizable" - ] - }, - { - "description": "window:allow-set-min-size -> Enables the set_min_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-min-size" - ] - }, - { - "description": "window:allow-set-minimizable -> Enables the set_minimizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-minimizable" - ] - }, - { - "description": "window:allow-set-position -> Enables the set_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-position" - ] - }, - { - "description": "window:allow-set-progress-bar -> Enables the set_progress_bar command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-progress-bar" - ] - }, - { - "description": "window:allow-set-resizable -> Enables the set_resizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-resizable" - ] - }, - { - "description": "window:allow-set-shadow -> Enables the set_shadow command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-shadow" - ] - }, - { - "description": "window:allow-set-size -> Enables the set_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-size" - ] - }, - { - "description": "window:allow-set-skip-taskbar -> Enables the set_skip_taskbar command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-skip-taskbar" - ] - }, - { - "description": "window:allow-set-title -> Enables the set_title command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-title" - ] - }, - { - "description": "window:allow-set-visible-on-all-workspaces -> Enables the set_visible_on_all_workspaces command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-visible-on-all-workspaces" - ] - }, - { - "description": "window:allow-show -> Enables the show command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-show" - ] - }, - { - "description": "window:allow-start-dragging -> Enables the start_dragging command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-start-dragging" - ] - }, - { - "description": "window:allow-theme -> Enables the theme command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-theme" - ] - }, - { - "description": "window:allow-title -> Enables the title command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-title" - ] - }, - { - "description": "window:allow-toggle-maximize -> Enables the toggle_maximize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-toggle-maximize" - ] - }, - { - "description": "window:allow-unmaximize -> Enables the unmaximize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-unmaximize" - ] - }, - { - "description": "window:allow-unminimize -> Enables the unminimize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-unminimize" - ] - }, - { - "description": "window:deny-available-monitors -> Denies the available_monitors command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-available-monitors" - ] - }, - { - "description": "window:deny-center -> Denies the center command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-center" - ] - }, - { - "description": "window:deny-close -> Denies the close command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-close" - ] - }, - { - "description": "window:deny-create -> Denies the create command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-create" - ] - }, - { - "description": "window:deny-current-monitor -> Denies the current_monitor command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-current-monitor" - ] - }, - { - "description": "window:deny-destroy -> Denies the destroy command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-destroy" - ] - }, - { - "description": "window:deny-hide -> Denies the hide command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-hide" - ] - }, - { - "description": "window:deny-inner-position -> Denies the inner_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-inner-position" - ] - }, - { - "description": "window:deny-inner-size -> Denies the inner_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-inner-size" - ] - }, - { - "description": "window:deny-internal-toggle-maximize -> Denies the internal_toggle_maximize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-internal-toggle-maximize" - ] - }, - { - "description": "window:deny-is-closable -> Denies the is_closable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-closable" - ] - }, - { - "description": "window:deny-is-decorated -> Denies the is_decorated command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-decorated" - ] - }, - { - "description": "window:deny-is-focused -> Denies the is_focused command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-focused" - ] - }, - { - "description": "window:deny-is-fullscreen -> Denies the is_fullscreen command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-fullscreen" - ] - }, - { - "description": "window:deny-is-maximizable -> Denies the is_maximizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-maximizable" - ] - }, - { - "description": "window:deny-is-maximized -> Denies the is_maximized command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-maximized" - ] - }, - { - "description": "window:deny-is-minimizable -> Denies the is_minimizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-minimizable" - ] - }, - { - "description": "window:deny-is-minimized -> Denies the is_minimized command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-minimized" - ] - }, - { - "description": "window:deny-is-resizable -> Denies the is_resizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-resizable" - ] - }, - { - "description": "window:deny-is-visible -> Denies the is_visible command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-visible" - ] - }, - { - "description": "window:deny-maximize -> Denies the maximize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-maximize" - ] - }, - { - "description": "window:deny-minimize -> Denies the minimize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-minimize" - ] - }, - { - "description": "window:deny-outer-position -> Denies the outer_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-outer-position" - ] - }, - { - "description": "window:deny-outer-size -> Denies the outer_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-outer-size" - ] - }, - { - "description": "window:deny-primary-monitor -> Denies the primary_monitor command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-primary-monitor" - ] - }, - { - "description": "window:deny-request-user-attention -> Denies the request_user_attention command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-request-user-attention" - ] - }, - { - "description": "window:deny-scale-factor -> Denies the scale_factor command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-scale-factor" - ] - }, - { - "description": "window:deny-set-always-on-bottom -> Denies the set_always_on_bottom command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-always-on-bottom" - ] - }, - { - "description": "window:deny-set-always-on-top -> Denies the set_always_on_top command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-always-on-top" - ] - }, - { - "description": "window:deny-set-closable -> Denies the set_closable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-closable" - ] - }, - { - "description": "window:deny-set-content-protected -> Denies the set_content_protected command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-content-protected" - ] - }, - { - "description": "window:deny-set-cursor-grab -> Denies the set_cursor_grab command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-cursor-grab" - ] - }, - { - "description": "window:deny-set-cursor-icon -> Denies the set_cursor_icon command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-cursor-icon" - ] - }, - { - "description": "window:deny-set-cursor-position -> Denies the set_cursor_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-cursor-position" - ] - }, - { - "description": "window:deny-set-cursor-visible -> Denies the set_cursor_visible command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-cursor-visible" - ] - }, - { - "description": "window:deny-set-decorations -> Denies the set_decorations command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-decorations" - ] - }, - { - "description": "window:deny-set-effects -> Denies the set_effects command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-effects" - ] - }, - { - "description": "window:deny-set-focus -> Denies the set_focus command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-focus" - ] - }, - { - "description": "window:deny-set-fullscreen -> Denies the set_fullscreen command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-fullscreen" - ] - }, - { - "description": "window:deny-set-icon -> Denies the set_icon command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-icon" - ] - }, - { - "description": "window:deny-set-ignore-cursor-events -> Denies the set_ignore_cursor_events command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-ignore-cursor-events" - ] - }, - { - "description": "window:deny-set-max-size -> Denies the set_max_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-max-size" - ] - }, - { - "description": "window:deny-set-maximizable -> Denies the set_maximizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-maximizable" - ] - }, - { - "description": "window:deny-set-min-size -> Denies the set_min_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-min-size" - ] - }, - { - "description": "window:deny-set-minimizable -> Denies the set_minimizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-minimizable" - ] - }, - { - "description": "window:deny-set-position -> Denies the set_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-position" - ] - }, - { - "description": "window:deny-set-progress-bar -> Denies the set_progress_bar command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-progress-bar" - ] - }, - { - "description": "window:deny-set-resizable -> Denies the set_resizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-resizable" - ] - }, - { - "description": "window:deny-set-shadow -> Denies the set_shadow command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-shadow" - ] - }, - { - "description": "window:deny-set-size -> Denies the set_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-size" - ] - }, - { - "description": "window:deny-set-skip-taskbar -> Denies the set_skip_taskbar command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-skip-taskbar" - ] - }, - { - "description": "window:deny-set-title -> Denies the set_title command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-title" - ] - }, - { - "description": "window:deny-set-visible-on-all-workspaces -> Denies the set_visible_on_all_workspaces command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-visible-on-all-workspaces" - ] - }, - { - "description": "window:deny-show -> Denies the show command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-show" - ] - }, - { - "description": "window:deny-start-dragging -> Denies the start_dragging command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-start-dragging" - ] - }, - { - "description": "window:deny-theme -> Denies the theme command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-theme" - ] - }, - { - "description": "window:deny-title -> Denies the title command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-title" - ] - }, - { - "description": "window:deny-toggle-maximize -> Denies the toggle_maximize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-toggle-maximize" - ] - }, - { - "description": "window:deny-unmaximize -> Denies the unmaximize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-unmaximize" - ] - }, - { - "description": "window:deny-unminimize -> Denies the unminimize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-unminimize" - ] - } - ] - }, - "Value": { - "description": "All supported ACL values.", - "anyOf": [ - { - "description": "Represents a null JSON value.", - "type": "null" - }, - { - "description": "Represents a [`bool`].", - "type": "boolean" - }, - { - "description": "Represents a valid ACL [`Number`].", - "allOf": [ - { - "$ref": "#/definitions/Number" - } - ] - }, - { - "description": "Represents a [`String`].", - "type": "string" - }, - { - "description": "Represents a list of other [`Value`]s.", - "type": "array", - "items": { - "$ref": "#/definitions/Value" - } - }, - { - "description": "Represents a map of [`String`] keys to [`Value`]s.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Value" - } - } - ] - }, - "Number": { - "description": "A valid ACL number.", - "anyOf": [ - { - "description": "Represents an [`i64`].", - "type": "integer", - "format": "int64" - }, - { - "description": "Represents a [`f64`].", - "type": "number", - "format": "double" - } - ] - }, - "Target": { - "description": "Platform target.", - "oneOf": [ - { - "description": "MacOS.", - "type": "string", - "enum": [ - "macOS" - ] - }, - { - "description": "Windows.", - "type": "string", - "enum": [ - "windows" - ] - }, - { - "description": "Linux.", - "type": "string", - "enum": [ - "linux" - ] - }, - { - "description": "Android.", - "type": "string", - "enum": [ - "android" - ] - }, - { - "description": "iOS.", - "type": "string", - "enum": [ - "iOS" - ] - } - ] - }, - "ShellAllowedArg": { - "description": "A command argument allowed to be executed by the webview API.", - "anyOf": [ - { - "description": "A non-configurable argument that is passed to the command in the order it was specified.", - "type": "string" - }, - { - "description": "A variable that is set while calling the command from the webview API.", - "type": "object", - "required": [ - "validator" - ], - "properties": { - "validator": { - "description": "[regex] validator to require passed values to conform to an expected input.\n\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\n\n[regex]: https://docs.rs/regex/latest/regex/#syntax", - "type": "string" - } - }, - "additionalProperties": false - } - ] - }, - "ShellAllowedArgs": { - "description": "A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration.", - "anyOf": [ - { - "description": "Use a simple boolean to allow all or disable all arguments to this command configuration.", - "type": "boolean" - }, - { - "description": "A specific set of [`ShellAllowedArg`] that are valid to call for the command configuration.", - "type": "array", - "items": { - "$ref": "#/definitions/ShellAllowedArg" - } - } - ] - } - } -} \ No newline at end of file diff --git a/examples/api/src-tauri/gen/schemas/mobile-schema.json b/examples/api/src-tauri/gen/schemas/mobile-schema.json deleted file mode 100644 index 884d268f..00000000 --- a/examples/api/src-tauri/gen/schemas/mobile-schema.json +++ /dev/null @@ -1,6854 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "CapabilityFile", - "description": "Capability formats accepted in a capability file.", - "anyOf": [ - { - "description": "A single capability.", - "allOf": [ - { - "$ref": "#/definitions/Capability" - } - ] - }, - { - "description": "A list of capabilities.", - "type": "object", - "required": [ - "capabilities" - ], - "properties": { - "capabilities": { - "description": "The list of capabilities.", - "type": "array", - "items": { - "$ref": "#/definitions/Capability" - } - } - } - } - ], - "definitions": { - "Capability": { - "description": "a grouping and boundary mechanism developers can use to separate windows or plugins functionality from each other at runtime.\n\nIf a window is not matching any capability then it has no access to the IPC layer at all.\n\nThis can be done to create trust groups and reduce impact of vulnerabilities in certain plugins or windows. Windows can be added to a capability by exact name or glob patterns like *, admin-* or main-window.", - "type": "object", - "required": [ - "identifier", - "permissions", - "windows" - ], - "properties": { - "identifier": { - "description": "Identifier of the capability.", - "type": "string" - }, - "description": { - "description": "Description of the capability.", - "default": "", - "type": "string" - }, - "context": { - "description": "Execution context of the capability.\n\nAt runtime, Tauri filters the IPC command together with the context to determine whether it is allowed or not and its scope.", - "default": "local", - "allOf": [ - { - "$ref": "#/definitions/CapabilityContext" - } - ] - }, - "windows": { - "description": "List of windows that uses this capability. Can be a glob pattern.\n\nOn multiwebview windows, prefer [`Self::webviews`] for a fine grained access control.", - "type": "array", - "items": { - "type": "string" - } - }, - "webviews": { - "description": "List of webviews that uses this capability. Can be a glob pattern.\n\nThis is only required when using on multiwebview contexts, by default all child webviews of a window that matches [`Self::windows`] are linked.", - "type": "array", - "items": { - "type": "string" - } - }, - "permissions": { - "description": "List of permissions attached to this capability. Must include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`.", - "type": "array", - "items": { - "$ref": "#/definitions/PermissionEntry" - } - }, - "platforms": { - "description": "Target platforms this capability applies. By default all platforms applies.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" - ], - "type": "array", - "items": { - "$ref": "#/definitions/Target" - } - } - } - }, - "CapabilityContext": { - "description": "Context of the capability.", - "oneOf": [ - { - "description": "Capability refers to local URL usage.", - "type": "string", - "enum": [ - "local" - ] - }, - { - "description": "Capability refers to remote usage.", - "type": "object", - "required": [ - "remote" - ], - "properties": { - "remote": { - "type": "object", - "required": [ - "urls" - ], - "properties": { - "urls": { - "description": "Remote domains this capability refers to. Can use glob patterns.", - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "additionalProperties": false - } - ] - }, - "PermissionEntry": { - "description": "An entry for a permission value in a [`Capability`] can be either a raw permission [`Identifier`] or an object that references a permission and extends its scope.", - "anyOf": [ - { - "description": "Reference a permission or permission set by identifier.", - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ] - }, - { - "description": "Reference a permission or permission set by identifier and extends its scope.", - "type": "object", - "oneOf": [ - { - "type": "object", - "required": [ - "identifier" - ], - "properties": { - "identifier": { - "oneOf": [ - { - "description": "fs:default -> # Tauri `fs` default permissions\n\nThis configuration file defines the default permissions granted\nto the filesystem.\n\n### Granted Permissions\n\nThis default permission set enables all read-related commands and\nallows access to the `$APP` folder and sub directories created in it.\nThe location of the `$APP` folder depends on the operating system,\nwhere the application is run.\n\nIn general the `$APP` folder needs to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\n### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\nOn Windows the webview data folder access is denied.\n\n", - "type": "string", - "enum": [ - "fs:default" - ] - }, - { - "description": "fs:allow-app-meta -> This allows read access to metadata of the `$APP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-app-meta" - ] - }, - { - "description": "fs:allow-app-meta-recursive -> This allows read access to metadata of the `$APP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-app-meta-recursive" - ] - }, - { - "description": "fs:allow-app-read -> This allows non-recursive read access to the `$APP` folder.", - "type": "string", - "enum": [ - "fs:allow-app-read" - ] - }, - { - "description": "fs:allow-app-read-recursive -> This allows full recursive read access to the complete `$APP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-app-read-recursive" - ] - }, - { - "description": "fs:allow-app-write -> This allows non-recursive write access to the `$APP` folder.", - "type": "string", - "enum": [ - "fs:allow-app-write" - ] - }, - { - "description": "fs:allow-app-write-recursive -> This allows full recusrive write access to the complete `$APP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-app-write-recursive" - ] - }, - { - "description": "fs:allow-appcache-meta -> This allows read access to metadata of the `$APPCACHE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appcache-meta" - ] - }, - { - "description": "fs:allow-appcache-meta-recursive -> This allows read access to metadata of the `$APPCACHE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appcache-meta-recursive" - ] - }, - { - "description": "fs:allow-appcache-read -> This allows non-recursive read access to the `$APPCACHE` folder.", - "type": "string", - "enum": [ - "fs:allow-appcache-read" - ] - }, - { - "description": "fs:allow-appcache-read-recursive -> This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appcache-read-recursive" - ] - }, - { - "description": "fs:allow-appcache-write -> This allows non-recursive write access to the `$APPCACHE` folder.", - "type": "string", - "enum": [ - "fs:allow-appcache-write" - ] - }, - { - "description": "fs:allow-appcache-write-recursive -> This allows full recusrive write access to the complete `$APPCACHE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appcache-write-recursive" - ] - }, - { - "description": "fs:allow-appconfig-meta -> This allows read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appconfig-meta" - ] - }, - { - "description": "fs:allow-appconfig-meta-recursive -> This allows read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appconfig-meta-recursive" - ] - }, - { - "description": "fs:allow-appconfig-read -> This allows non-recursive read access to the `$APPCONFIG` folder.", - "type": "string", - "enum": [ - "fs:allow-appconfig-read" - ] - }, - { - "description": "fs:allow-appconfig-read-recursive -> This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appconfig-read-recursive" - ] - }, - { - "description": "fs:allow-appconfig-write -> This allows non-recursive write access to the `$APPCONFIG` folder.", - "type": "string", - "enum": [ - "fs:allow-appconfig-write" - ] - }, - { - "description": "fs:allow-appconfig-write-recursive -> This allows full recusrive write access to the complete `$APPCONFIG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appconfig-write-recursive" - ] - }, - { - "description": "fs:allow-appdata-meta -> This allows read access to metadata of the `$APPDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appdata-meta" - ] - }, - { - "description": "fs:allow-appdata-meta-recursive -> This allows read access to metadata of the `$APPDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appdata-meta-recursive" - ] - }, - { - "description": "fs:allow-appdata-read -> This allows non-recursive read access to the `$APPDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-appdata-read" - ] - }, - { - "description": "fs:allow-appdata-read-recursive -> This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appdata-read-recursive" - ] - }, - { - "description": "fs:allow-appdata-write -> This allows non-recursive write access to the `$APPDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-appdata-write" - ] - }, - { - "description": "fs:allow-appdata-write-recursive -> This allows full recusrive write access to the complete `$APPDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appdata-write-recursive" - ] - }, - { - "description": "fs:allow-applocaldata-meta -> This allows read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-meta" - ] - }, - { - "description": "fs:allow-applocaldata-meta-recursive -> This allows read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-meta-recursive" - ] - }, - { - "description": "fs:allow-applocaldata-read -> This allows non-recursive read access to the `$APPLOCALDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-read" - ] - }, - { - "description": "fs:allow-applocaldata-read-recursive -> This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-read-recursive" - ] - }, - { - "description": "fs:allow-applocaldata-write -> This allows non-recursive write access to the `$APPLOCALDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-write" - ] - }, - { - "description": "fs:allow-applocaldata-write-recursive -> This allows full recusrive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-write-recursive" - ] - }, - { - "description": "fs:allow-applog-meta -> This allows read access to metadata of the `$APPLOG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-applog-meta" - ] - }, - { - "description": "fs:allow-applog-meta-recursive -> This allows read access to metadata of the `$APPLOG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-applog-meta-recursive" - ] - }, - { - "description": "fs:allow-applog-read -> This allows non-recursive read access to the `$APPLOG` folder.", - "type": "string", - "enum": [ - "fs:allow-applog-read" - ] - }, - { - "description": "fs:allow-applog-read-recursive -> This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-applog-read-recursive" - ] - }, - { - "description": "fs:allow-applog-write -> This allows non-recursive write access to the `$APPLOG` folder.", - "type": "string", - "enum": [ - "fs:allow-applog-write" - ] - }, - { - "description": "fs:allow-applog-write-recursive -> This allows full recusrive write access to the complete `$APPLOG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-applog-write-recursive" - ] - }, - { - "description": "fs:allow-audio-meta -> This allows read access to metadata of the `$AUDIO` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-audio-meta" - ] - }, - { - "description": "fs:allow-audio-meta-recursive -> This allows read access to metadata of the `$AUDIO` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-audio-meta-recursive" - ] - }, - { - "description": "fs:allow-audio-read -> This allows non-recursive read access to the `$AUDIO` folder.", - "type": "string", - "enum": [ - "fs:allow-audio-read" - ] - }, - { - "description": "fs:allow-audio-read-recursive -> This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-audio-read-recursive" - ] - }, - { - "description": "fs:allow-audio-write -> This allows non-recursive write access to the `$AUDIO` folder.", - "type": "string", - "enum": [ - "fs:allow-audio-write" - ] - }, - { - "description": "fs:allow-audio-write-recursive -> This allows full recusrive write access to the complete `$AUDIO` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-audio-write-recursive" - ] - }, - { - "description": "fs:allow-cache-meta -> This allows read access to metadata of the `$CACHE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-cache-meta" - ] - }, - { - "description": "fs:allow-cache-meta-recursive -> This allows read access to metadata of the `$CACHE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-cache-meta-recursive" - ] - }, - { - "description": "fs:allow-cache-read -> This allows non-recursive read access to the `$CACHE` folder.", - "type": "string", - "enum": [ - "fs:allow-cache-read" - ] - }, - { - "description": "fs:allow-cache-read-recursive -> This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-cache-read-recursive" - ] - }, - { - "description": "fs:allow-cache-write -> This allows non-recursive write access to the `$CACHE` folder.", - "type": "string", - "enum": [ - "fs:allow-cache-write" - ] - }, - { - "description": "fs:allow-cache-write-recursive -> This allows full recusrive write access to the complete `$CACHE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-cache-write-recursive" - ] - }, - { - "description": "fs:allow-config-meta -> This allows read access to metadata of the `$CONFIG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-config-meta" - ] - }, - { - "description": "fs:allow-config-meta-recursive -> This allows read access to metadata of the `$CONFIG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-config-meta-recursive" - ] - }, - { - "description": "fs:allow-config-read -> This allows non-recursive read access to the `$CONFIG` folder.", - "type": "string", - "enum": [ - "fs:allow-config-read" - ] - }, - { - "description": "fs:allow-config-read-recursive -> This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-config-read-recursive" - ] - }, - { - "description": "fs:allow-config-write -> This allows non-recursive write access to the `$CONFIG` folder.", - "type": "string", - "enum": [ - "fs:allow-config-write" - ] - }, - { - "description": "fs:allow-config-write-recursive -> This allows full recusrive write access to the complete `$CONFIG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-config-write-recursive" - ] - }, - { - "description": "fs:allow-data-meta -> This allows read access to metadata of the `$DATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-data-meta" - ] - }, - { - "description": "fs:allow-data-meta-recursive -> This allows read access to metadata of the `$DATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-data-meta-recursive" - ] - }, - { - "description": "fs:allow-data-read -> This allows non-recursive read access to the `$DATA` folder.", - "type": "string", - "enum": [ - "fs:allow-data-read" - ] - }, - { - "description": "fs:allow-data-read-recursive -> This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-data-read-recursive" - ] - }, - { - "description": "fs:allow-data-write -> This allows non-recursive write access to the `$DATA` folder.", - "type": "string", - "enum": [ - "fs:allow-data-write" - ] - }, - { - "description": "fs:allow-data-write-recursive -> This allows full recusrive write access to the complete `$DATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-data-write-recursive" - ] - }, - { - "description": "fs:allow-desktop-meta -> This allows read access to metadata of the `$DESKTOP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-desktop-meta" - ] - }, - { - "description": "fs:allow-desktop-meta-recursive -> This allows read access to metadata of the `$DESKTOP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-desktop-meta-recursive" - ] - }, - { - "description": "fs:allow-desktop-read -> This allows non-recursive read access to the `$DESKTOP` folder.", - "type": "string", - "enum": [ - "fs:allow-desktop-read" - ] - }, - { - "description": "fs:allow-desktop-read-recursive -> This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-desktop-read-recursive" - ] - }, - { - "description": "fs:allow-desktop-write -> This allows non-recursive write access to the `$DESKTOP` folder.", - "type": "string", - "enum": [ - "fs:allow-desktop-write" - ] - }, - { - "description": "fs:allow-desktop-write-recursive -> This allows full recusrive write access to the complete `$DESKTOP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-desktop-write-recursive" - ] - }, - { - "description": "fs:allow-document-meta -> This allows read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-document-meta" - ] - }, - { - "description": "fs:allow-document-meta-recursive -> This allows read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-document-meta-recursive" - ] - }, - { - "description": "fs:allow-document-read -> This allows non-recursive read access to the `$DOCUMENT` folder.", - "type": "string", - "enum": [ - "fs:allow-document-read" - ] - }, - { - "description": "fs:allow-document-read-recursive -> This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-document-read-recursive" - ] - }, - { - "description": "fs:allow-document-write -> This allows non-recursive write access to the `$DOCUMENT` folder.", - "type": "string", - "enum": [ - "fs:allow-document-write" - ] - }, - { - "description": "fs:allow-document-write-recursive -> This allows full recusrive write access to the complete `$DOCUMENT` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-document-write-recursive" - ] - }, - { - "description": "fs:allow-download-meta -> This allows read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-download-meta" - ] - }, - { - "description": "fs:allow-download-meta-recursive -> This allows read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-download-meta-recursive" - ] - }, - { - "description": "fs:allow-download-read -> This allows non-recursive read access to the `$DOWNLOAD` folder.", - "type": "string", - "enum": [ - "fs:allow-download-read" - ] - }, - { - "description": "fs:allow-download-read-recursive -> This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-download-read-recursive" - ] - }, - { - "description": "fs:allow-download-write -> This allows non-recursive write access to the `$DOWNLOAD` folder.", - "type": "string", - "enum": [ - "fs:allow-download-write" - ] - }, - { - "description": "fs:allow-download-write-recursive -> This allows full recusrive write access to the complete `$DOWNLOAD` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-download-write-recursive" - ] - }, - { - "description": "fs:allow-exe-meta -> This allows read access to metadata of the `$EXE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-exe-meta" - ] - }, - { - "description": "fs:allow-exe-meta-recursive -> This allows read access to metadata of the `$EXE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-exe-meta-recursive" - ] - }, - { - "description": "fs:allow-exe-read -> This allows non-recursive read access to the `$EXE` folder.", - "type": "string", - "enum": [ - "fs:allow-exe-read" - ] - }, - { - "description": "fs:allow-exe-read-recursive -> This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-exe-read-recursive" - ] - }, - { - "description": "fs:allow-exe-write -> This allows non-recursive write access to the `$EXE` folder.", - "type": "string", - "enum": [ - "fs:allow-exe-write" - ] - }, - { - "description": "fs:allow-exe-write-recursive -> This allows full recusrive write access to the complete `$EXE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-exe-write-recursive" - ] - }, - { - "description": "fs:allow-font-meta -> This allows read access to metadata of the `$FONT` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-font-meta" - ] - }, - { - "description": "fs:allow-font-meta-recursive -> This allows read access to metadata of the `$FONT` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-font-meta-recursive" - ] - }, - { - "description": "fs:allow-font-read -> This allows non-recursive read access to the `$FONT` folder.", - "type": "string", - "enum": [ - "fs:allow-font-read" - ] - }, - { - "description": "fs:allow-font-read-recursive -> This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-font-read-recursive" - ] - }, - { - "description": "fs:allow-font-write -> This allows non-recursive write access to the `$FONT` folder.", - "type": "string", - "enum": [ - "fs:allow-font-write" - ] - }, - { - "description": "fs:allow-font-write-recursive -> This allows full recusrive write access to the complete `$FONT` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-font-write-recursive" - ] - }, - { - "description": "fs:allow-home-meta -> This allows read access to metadata of the `$HOME` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-home-meta" - ] - }, - { - "description": "fs:allow-home-meta-recursive -> This allows read access to metadata of the `$HOME` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-home-meta-recursive" - ] - }, - { - "description": "fs:allow-home-read -> This allows non-recursive read access to the `$HOME` folder.", - "type": "string", - "enum": [ - "fs:allow-home-read" - ] - }, - { - "description": "fs:allow-home-read-recursive -> This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-home-read-recursive" - ] - }, - { - "description": "fs:allow-home-write -> This allows non-recursive write access to the `$HOME` folder.", - "type": "string", - "enum": [ - "fs:allow-home-write" - ] - }, - { - "description": "fs:allow-home-write-recursive -> This allows full recusrive write access to the complete `$HOME` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-home-write-recursive" - ] - }, - { - "description": "fs:allow-localdata-meta -> This allows read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-localdata-meta" - ] - }, - { - "description": "fs:allow-localdata-meta-recursive -> This allows read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-localdata-meta-recursive" - ] - }, - { - "description": "fs:allow-localdata-read -> This allows non-recursive read access to the `$LOCALDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-localdata-read" - ] - }, - { - "description": "fs:allow-localdata-read-recursive -> This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-localdata-read-recursive" - ] - }, - { - "description": "fs:allow-localdata-write -> This allows non-recursive write access to the `$LOCALDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-localdata-write" - ] - }, - { - "description": "fs:allow-localdata-write-recursive -> This allows full recusrive write access to the complete `$LOCALDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-localdata-write-recursive" - ] - }, - { - "description": "fs:allow-log-meta -> This allows read access to metadata of the `$LOG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-log-meta" - ] - }, - { - "description": "fs:allow-log-meta-recursive -> This allows read access to metadata of the `$LOG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-log-meta-recursive" - ] - }, - { - "description": "fs:allow-log-read -> This allows non-recursive read access to the `$LOG` folder.", - "type": "string", - "enum": [ - "fs:allow-log-read" - ] - }, - { - "description": "fs:allow-log-read-recursive -> This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-log-read-recursive" - ] - }, - { - "description": "fs:allow-log-write -> This allows non-recursive write access to the `$LOG` folder.", - "type": "string", - "enum": [ - "fs:allow-log-write" - ] - }, - { - "description": "fs:allow-log-write-recursive -> This allows full recusrive write access to the complete `$LOG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-log-write-recursive" - ] - }, - { - "description": "fs:allow-picture-meta -> This allows read access to metadata of the `$PICTURE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-picture-meta" - ] - }, - { - "description": "fs:allow-picture-meta-recursive -> This allows read access to metadata of the `$PICTURE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-picture-meta-recursive" - ] - }, - { - "description": "fs:allow-picture-read -> This allows non-recursive read access to the `$PICTURE` folder.", - "type": "string", - "enum": [ - "fs:allow-picture-read" - ] - }, - { - "description": "fs:allow-picture-read-recursive -> This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-picture-read-recursive" - ] - }, - { - "description": "fs:allow-picture-write -> This allows non-recursive write access to the `$PICTURE` folder.", - "type": "string", - "enum": [ - "fs:allow-picture-write" - ] - }, - { - "description": "fs:allow-picture-write-recursive -> This allows full recusrive write access to the complete `$PICTURE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-picture-write-recursive" - ] - }, - { - "description": "fs:allow-public-meta -> This allows read access to metadata of the `$PUBLIC` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-public-meta" - ] - }, - { - "description": "fs:allow-public-meta-recursive -> This allows read access to metadata of the `$PUBLIC` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-public-meta-recursive" - ] - }, - { - "description": "fs:allow-public-read -> This allows non-recursive read access to the `$PUBLIC` folder.", - "type": "string", - "enum": [ - "fs:allow-public-read" - ] - }, - { - "description": "fs:allow-public-read-recursive -> This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-public-read-recursive" - ] - }, - { - "description": "fs:allow-public-write -> This allows non-recursive write access to the `$PUBLIC` folder.", - "type": "string", - "enum": [ - "fs:allow-public-write" - ] - }, - { - "description": "fs:allow-public-write-recursive -> This allows full recusrive write access to the complete `$PUBLIC` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-public-write-recursive" - ] - }, - { - "description": "fs:allow-resource-meta -> This allows read access to metadata of the `$RESOURCE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-resource-meta" - ] - }, - { - "description": "fs:allow-resource-meta-recursive -> This allows read access to metadata of the `$RESOURCE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-resource-meta-recursive" - ] - }, - { - "description": "fs:allow-resource-read -> This allows non-recursive read access to the `$RESOURCE` folder.", - "type": "string", - "enum": [ - "fs:allow-resource-read" - ] - }, - { - "description": "fs:allow-resource-read-recursive -> This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-resource-read-recursive" - ] - }, - { - "description": "fs:allow-resource-write -> This allows non-recursive write access to the `$RESOURCE` folder.", - "type": "string", - "enum": [ - "fs:allow-resource-write" - ] - }, - { - "description": "fs:allow-resource-write-recursive -> This allows full recusrive write access to the complete `$RESOURCE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-resource-write-recursive" - ] - }, - { - "description": "fs:allow-runtime-meta -> This allows read access to metadata of the `$RUNTIME` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-runtime-meta" - ] - }, - { - "description": "fs:allow-runtime-meta-recursive -> This allows read access to metadata of the `$RUNTIME` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-runtime-meta-recursive" - ] - }, - { - "description": "fs:allow-runtime-read -> This allows non-recursive read access to the `$RUNTIME` folder.", - "type": "string", - "enum": [ - "fs:allow-runtime-read" - ] - }, - { - "description": "fs:allow-runtime-read-recursive -> This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-runtime-read-recursive" - ] - }, - { - "description": "fs:allow-runtime-write -> This allows non-recursive write access to the `$RUNTIME` folder.", - "type": "string", - "enum": [ - "fs:allow-runtime-write" - ] - }, - { - "description": "fs:allow-runtime-write-recursive -> This allows full recusrive write access to the complete `$RUNTIME` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-runtime-write-recursive" - ] - }, - { - "description": "fs:allow-temp-meta -> This allows read access to metadata of the `$TEMP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-temp-meta" - ] - }, - { - "description": "fs:allow-temp-meta-recursive -> This allows read access to metadata of the `$TEMP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-temp-meta-recursive" - ] - }, - { - "description": "fs:allow-temp-read -> This allows non-recursive read access to the `$TEMP` folder.", - "type": "string", - "enum": [ - "fs:allow-temp-read" - ] - }, - { - "description": "fs:allow-temp-read-recursive -> This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-temp-read-recursive" - ] - }, - { - "description": "fs:allow-temp-write -> This allows non-recursive write access to the `$TEMP` folder.", - "type": "string", - "enum": [ - "fs:allow-temp-write" - ] - }, - { - "description": "fs:allow-temp-write-recursive -> This allows full recusrive write access to the complete `$TEMP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-temp-write-recursive" - ] - }, - { - "description": "fs:allow-template-meta -> This allows read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-template-meta" - ] - }, - { - "description": "fs:allow-template-meta-recursive -> This allows read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-template-meta-recursive" - ] - }, - { - "description": "fs:allow-template-read -> This allows non-recursive read access to the `$TEMPLATE` folder.", - "type": "string", - "enum": [ - "fs:allow-template-read" - ] - }, - { - "description": "fs:allow-template-read-recursive -> This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-template-read-recursive" - ] - }, - { - "description": "fs:allow-template-write -> This allows non-recursive write access to the `$TEMPLATE` folder.", - "type": "string", - "enum": [ - "fs:allow-template-write" - ] - }, - { - "description": "fs:allow-template-write-recursive -> This allows full recusrive write access to the complete `$TEMPLATE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-template-write-recursive" - ] - }, - { - "description": "fs:allow-video-meta -> This allows read access to metadata of the `$VIDEO` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-video-meta" - ] - }, - { - "description": "fs:allow-video-meta-recursive -> This allows read access to metadata of the `$VIDEO` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-video-meta-recursive" - ] - }, - { - "description": "fs:allow-video-read -> This allows non-recursive read access to the `$VIDEO` folder.", - "type": "string", - "enum": [ - "fs:allow-video-read" - ] - }, - { - "description": "fs:allow-video-read-recursive -> This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-video-read-recursive" - ] - }, - { - "description": "fs:allow-video-write -> This allows non-recursive write access to the `$VIDEO` folder.", - "type": "string", - "enum": [ - "fs:allow-video-write" - ] - }, - { - "description": "fs:allow-video-write-recursive -> This allows full recusrive write access to the complete `$VIDEO` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-video-write-recursive" - ] - }, - { - "description": "fs:deny-default -> This denies access to dangerous Tauri relevant files and folders by default.", - "type": "string", - "enum": [ - "fs:deny-default" - ] - }, - { - "description": "fs:allow-copy-file -> Enables the copy_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-copy-file" - ] - }, - { - "description": "fs:allow-create -> Enables the create command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-create" - ] - }, - { - "description": "fs:allow-exists -> Enables the exists command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-exists" - ] - }, - { - "description": "fs:allow-fstat -> Enables the fstat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-fstat" - ] - }, - { - "description": "fs:allow-ftruncate -> Enables the ftruncate command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-ftruncate" - ] - }, - { - "description": "fs:allow-lstat -> Enables the lstat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-lstat" - ] - }, - { - "description": "fs:allow-mkdir -> Enables the mkdir command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-mkdir" - ] - }, - { - "description": "fs:allow-open -> Enables the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-open" - ] - }, - { - "description": "fs:allow-read -> Enables the read command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read" - ] - }, - { - "description": "fs:allow-read-dir -> Enables the read_dir command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-dir" - ] - }, - { - "description": "fs:allow-read-file -> Enables the read_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-file" - ] - }, - { - "description": "fs:allow-read-text-file -> Enables the read_text_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-text-file" - ] - }, - { - "description": "fs:allow-read-text-file-lines -> Enables the read_text_file_lines command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-text-file-lines" - ] - }, - { - "description": "fs:allow-read-text-file-lines-next -> Enables the read_text_file_lines_next command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-text-file-lines-next" - ] - }, - { - "description": "fs:allow-remove -> Enables the remove command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-remove" - ] - }, - { - "description": "fs:allow-rename -> Enables the rename command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-rename" - ] - }, - { - "description": "fs:allow-seek -> Enables the seek command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-seek" - ] - }, - { - "description": "fs:allow-stat -> Enables the stat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-stat" - ] - }, - { - "description": "fs:allow-truncate -> Enables the truncate command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-truncate" - ] - }, - { - "description": "fs:allow-unwatch -> Enables the unwatch command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-unwatch" - ] - }, - { - "description": "fs:allow-watch -> Enables the watch command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-watch" - ] - }, - { - "description": "fs:allow-write -> Enables the write command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-write" - ] - }, - { - "description": "fs:allow-write-file -> Enables the write_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-write-file" - ] - }, - { - "description": "fs:allow-write-text-file -> Enables the write_text_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-write-text-file" - ] - }, - { - "description": "fs:deny-copy-file -> Denies the copy_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-copy-file" - ] - }, - { - "description": "fs:deny-create -> Denies the create command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-create" - ] - }, - { - "description": "fs:deny-exists -> Denies the exists command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-exists" - ] - }, - { - "description": "fs:deny-fstat -> Denies the fstat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-fstat" - ] - }, - { - "description": "fs:deny-ftruncate -> Denies the ftruncate command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-ftruncate" - ] - }, - { - "description": "fs:deny-lstat -> Denies the lstat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-lstat" - ] - }, - { - "description": "fs:deny-mkdir -> Denies the mkdir command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-mkdir" - ] - }, - { - "description": "fs:deny-open -> Denies the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-open" - ] - }, - { - "description": "fs:deny-read -> Denies the read command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read" - ] - }, - { - "description": "fs:deny-read-dir -> Denies the read_dir command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-dir" - ] - }, - { - "description": "fs:deny-read-file -> Denies the read_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-file" - ] - }, - { - "description": "fs:deny-read-text-file -> Denies the read_text_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-text-file" - ] - }, - { - "description": "fs:deny-read-text-file-lines -> Denies the read_text_file_lines command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-text-file-lines" - ] - }, - { - "description": "fs:deny-read-text-file-lines-next -> Denies the read_text_file_lines_next command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-text-file-lines-next" - ] - }, - { - "description": "fs:deny-remove -> Denies the remove command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-remove" - ] - }, - { - "description": "fs:deny-rename -> Denies the rename command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-rename" - ] - }, - { - "description": "fs:deny-seek -> Denies the seek command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-seek" - ] - }, - { - "description": "fs:deny-stat -> Denies the stat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-stat" - ] - }, - { - "description": "fs:deny-truncate -> Denies the truncate command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-truncate" - ] - }, - { - "description": "fs:deny-unwatch -> Denies the unwatch command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-unwatch" - ] - }, - { - "description": "fs:deny-watch -> Denies the watch command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-watch" - ] - }, - { - "description": "fs:deny-webview-data-linux -> This denies read access to the\n`$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.", - "type": "string", - "enum": [ - "fs:deny-webview-data-linux" - ] - }, - { - "description": "fs:deny-webview-data-windows -> This denies read access to the\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.", - "type": "string", - "enum": [ - "fs:deny-webview-data-windows" - ] - }, - { - "description": "fs:deny-write -> Denies the write command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-write" - ] - }, - { - "description": "fs:deny-write-file -> Denies the write_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-write-file" - ] - }, - { - "description": "fs:deny-write-text-file -> Denies the write_text_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-write-text-file" - ] - }, - { - "description": "fs:read-all -> This enables all read related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:read-all" - ] - }, - { - "description": "fs:read-dirs -> This enables directory read and file metadata related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:read-dirs" - ] - }, - { - "description": "fs:read-files -> This enables file read related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:read-files" - ] - }, - { - "description": "fs:read-meta -> This enables all index or metadata related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:read-meta" - ] - }, - { - "description": "fs:scope -> An empty permission you can use to modify the global scope.", - "type": "string", - "enum": [ - "fs:scope" - ] - }, - { - "description": "fs:scope-app -> This scope permits access to all files and list content of top level directories in the `$APP`folder.", - "type": "string", - "enum": [ - "fs:scope-app" - ] - }, - { - "description": "fs:scope-app-index -> This scope permits to list all files and folders in the `$APP`folder.", - "type": "string", - "enum": [ - "fs:scope-app-index" - ] - }, - { - "description": "fs:scope-app-recursive -> This scope recursive access to the complete `$APP` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-app-recursive" - ] - }, - { - "description": "fs:scope-appcache -> This scope permits access to all files and list content of top level directories in the `$APPCACHE`folder.", - "type": "string", - "enum": [ - "fs:scope-appcache" - ] - }, - { - "description": "fs:scope-appcache-index -> This scope permits to list all files and folders in the `$APPCACHE`folder.", - "type": "string", - "enum": [ - "fs:scope-appcache-index" - ] - }, - { - "description": "fs:scope-appcache-recursive -> This scope recursive access to the complete `$APPCACHE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-appcache-recursive" - ] - }, - { - "description": "fs:scope-appconfig -> This scope permits access to all files and list content of top level directories in the `$APPCONFIG`folder.", - "type": "string", - "enum": [ - "fs:scope-appconfig" - ] - }, - { - "description": "fs:scope-appconfig-index -> This scope permits to list all files and folders in the `$APPCONFIG`folder.", - "type": "string", - "enum": [ - "fs:scope-appconfig-index" - ] - }, - { - "description": "fs:scope-appconfig-recursive -> This scope recursive access to the complete `$APPCONFIG` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-appconfig-recursive" - ] - }, - { - "description": "fs:scope-appdata -> This scope permits access to all files and list content of top level directories in the `$APPDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-appdata" - ] - }, - { - "description": "fs:scope-appdata-index -> This scope permits to list all files and folders in the `$APPDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-appdata-index" - ] - }, - { - "description": "fs:scope-appdata-recursive -> This scope recursive access to the complete `$APPDATA` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-appdata-recursive" - ] - }, - { - "description": "fs:scope-applocaldata -> This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-applocaldata" - ] - }, - { - "description": "fs:scope-applocaldata-index -> This scope permits to list all files and folders in the `$APPLOCALDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-applocaldata-index" - ] - }, - { - "description": "fs:scope-applocaldata-recursive -> This scope recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-applocaldata-recursive" - ] - }, - { - "description": "fs:scope-applog -> This scope permits access to all files and list content of top level directories in the `$APPLOG`folder.", - "type": "string", - "enum": [ - "fs:scope-applog" - ] - }, - { - "description": "fs:scope-applog-index -> This scope permits to list all files and folders in the `$APPLOG`folder.", - "type": "string", - "enum": [ - "fs:scope-applog-index" - ] - }, - { - "description": "fs:scope-applog-recursive -> This scope recursive access to the complete `$APPLOG` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-applog-recursive" - ] - }, - { - "description": "fs:scope-audio -> This scope permits access to all files and list content of top level directories in the `$AUDIO`folder.", - "type": "string", - "enum": [ - "fs:scope-audio" - ] - }, - { - "description": "fs:scope-audio-index -> This scope permits to list all files and folders in the `$AUDIO`folder.", - "type": "string", - "enum": [ - "fs:scope-audio-index" - ] - }, - { - "description": "fs:scope-audio-recursive -> This scope recursive access to the complete `$AUDIO` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-audio-recursive" - ] - }, - { - "description": "fs:scope-cache -> This scope permits access to all files and list content of top level directories in the `$CACHE`folder.", - "type": "string", - "enum": [ - "fs:scope-cache" - ] - }, - { - "description": "fs:scope-cache-index -> This scope permits to list all files and folders in the `$CACHE`folder.", - "type": "string", - "enum": [ - "fs:scope-cache-index" - ] - }, - { - "description": "fs:scope-cache-recursive -> This scope recursive access to the complete `$CACHE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-cache-recursive" - ] - }, - { - "description": "fs:scope-config -> This scope permits access to all files and list content of top level directories in the `$CONFIG`folder.", - "type": "string", - "enum": [ - "fs:scope-config" - ] - }, - { - "description": "fs:scope-config-index -> This scope permits to list all files and folders in the `$CONFIG`folder.", - "type": "string", - "enum": [ - "fs:scope-config-index" - ] - }, - { - "description": "fs:scope-config-recursive -> This scope recursive access to the complete `$CONFIG` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-config-recursive" - ] - }, - { - "description": "fs:scope-data -> This scope permits access to all files and list content of top level directories in the `$DATA`folder.", - "type": "string", - "enum": [ - "fs:scope-data" - ] - }, - { - "description": "fs:scope-data-index -> This scope permits to list all files and folders in the `$DATA`folder.", - "type": "string", - "enum": [ - "fs:scope-data-index" - ] - }, - { - "description": "fs:scope-data-recursive -> This scope recursive access to the complete `$DATA` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-data-recursive" - ] - }, - { - "description": "fs:scope-desktop -> This scope permits access to all files and list content of top level directories in the `$DESKTOP`folder.", - "type": "string", - "enum": [ - "fs:scope-desktop" - ] - }, - { - "description": "fs:scope-desktop-index -> This scope permits to list all files and folders in the `$DESKTOP`folder.", - "type": "string", - "enum": [ - "fs:scope-desktop-index" - ] - }, - { - "description": "fs:scope-desktop-recursive -> This scope recursive access to the complete `$DESKTOP` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-desktop-recursive" - ] - }, - { - "description": "fs:scope-document -> This scope permits access to all files and list content of top level directories in the `$DOCUMENT`folder.", - "type": "string", - "enum": [ - "fs:scope-document" - ] - }, - { - "description": "fs:scope-document-index -> This scope permits to list all files and folders in the `$DOCUMENT`folder.", - "type": "string", - "enum": [ - "fs:scope-document-index" - ] - }, - { - "description": "fs:scope-document-recursive -> This scope recursive access to the complete `$DOCUMENT` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-document-recursive" - ] - }, - { - "description": "fs:scope-download -> This scope permits access to all files and list content of top level directories in the `$DOWNLOAD`folder.", - "type": "string", - "enum": [ - "fs:scope-download" - ] - }, - { - "description": "fs:scope-download-index -> This scope permits to list all files and folders in the `$DOWNLOAD`folder.", - "type": "string", - "enum": [ - "fs:scope-download-index" - ] - }, - { - "description": "fs:scope-download-recursive -> This scope recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-download-recursive" - ] - }, - { - "description": "fs:scope-exe -> This scope permits access to all files and list content of top level directories in the `$EXE`folder.", - "type": "string", - "enum": [ - "fs:scope-exe" - ] - }, - { - "description": "fs:scope-exe-index -> This scope permits to list all files and folders in the `$EXE`folder.", - "type": "string", - "enum": [ - "fs:scope-exe-index" - ] - }, - { - "description": "fs:scope-exe-recursive -> This scope recursive access to the complete `$EXE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-exe-recursive" - ] - }, - { - "description": "fs:scope-font -> This scope permits access to all files and list content of top level directories in the `$FONT`folder.", - "type": "string", - "enum": [ - "fs:scope-font" - ] - }, - { - "description": "fs:scope-font-index -> This scope permits to list all files and folders in the `$FONT`folder.", - "type": "string", - "enum": [ - "fs:scope-font-index" - ] - }, - { - "description": "fs:scope-font-recursive -> This scope recursive access to the complete `$FONT` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-font-recursive" - ] - }, - { - "description": "fs:scope-home -> This scope permits access to all files and list content of top level directories in the `$HOME`folder.", - "type": "string", - "enum": [ - "fs:scope-home" - ] - }, - { - "description": "fs:scope-home-index -> This scope permits to list all files and folders in the `$HOME`folder.", - "type": "string", - "enum": [ - "fs:scope-home-index" - ] - }, - { - "description": "fs:scope-home-recursive -> This scope recursive access to the complete `$HOME` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-home-recursive" - ] - }, - { - "description": "fs:scope-localdata -> This scope permits access to all files and list content of top level directories in the `$LOCALDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-localdata" - ] - }, - { - "description": "fs:scope-localdata-index -> This scope permits to list all files and folders in the `$LOCALDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-localdata-index" - ] - }, - { - "description": "fs:scope-localdata-recursive -> This scope recursive access to the complete `$LOCALDATA` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-localdata-recursive" - ] - }, - { - "description": "fs:scope-log -> This scope permits access to all files and list content of top level directories in the `$LOG`folder.", - "type": "string", - "enum": [ - "fs:scope-log" - ] - }, - { - "description": "fs:scope-log-index -> This scope permits to list all files and folders in the `$LOG`folder.", - "type": "string", - "enum": [ - "fs:scope-log-index" - ] - }, - { - "description": "fs:scope-log-recursive -> This scope recursive access to the complete `$LOG` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-log-recursive" - ] - }, - { - "description": "fs:scope-picture -> This scope permits access to all files and list content of top level directories in the `$PICTURE`folder.", - "type": "string", - "enum": [ - "fs:scope-picture" - ] - }, - { - "description": "fs:scope-picture-index -> This scope permits to list all files and folders in the `$PICTURE`folder.", - "type": "string", - "enum": [ - "fs:scope-picture-index" - ] - }, - { - "description": "fs:scope-picture-recursive -> This scope recursive access to the complete `$PICTURE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-picture-recursive" - ] - }, - { - "description": "fs:scope-public -> This scope permits access to all files and list content of top level directories in the `$PUBLIC`folder.", - "type": "string", - "enum": [ - "fs:scope-public" - ] - }, - { - "description": "fs:scope-public-index -> This scope permits to list all files and folders in the `$PUBLIC`folder.", - "type": "string", - "enum": [ - "fs:scope-public-index" - ] - }, - { - "description": "fs:scope-public-recursive -> This scope recursive access to the complete `$PUBLIC` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-public-recursive" - ] - }, - { - "description": "fs:scope-resource -> This scope permits access to all files and list content of top level directories in the `$RESOURCE`folder.", - "type": "string", - "enum": [ - "fs:scope-resource" - ] - }, - { - "description": "fs:scope-resource-index -> This scope permits to list all files and folders in the `$RESOURCE`folder.", - "type": "string", - "enum": [ - "fs:scope-resource-index" - ] - }, - { - "description": "fs:scope-resource-recursive -> This scope recursive access to the complete `$RESOURCE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-resource-recursive" - ] - }, - { - "description": "fs:scope-runtime -> This scope permits access to all files and list content of top level directories in the `$RUNTIME`folder.", - "type": "string", - "enum": [ - "fs:scope-runtime" - ] - }, - { - "description": "fs:scope-runtime-index -> This scope permits to list all files and folders in the `$RUNTIME`folder.", - "type": "string", - "enum": [ - "fs:scope-runtime-index" - ] - }, - { - "description": "fs:scope-runtime-recursive -> This scope recursive access to the complete `$RUNTIME` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-runtime-recursive" - ] - }, - { - "description": "fs:scope-temp -> This scope permits access to all files and list content of top level directories in the `$TEMP`folder.", - "type": "string", - "enum": [ - "fs:scope-temp" - ] - }, - { - "description": "fs:scope-temp-index -> This scope permits to list all files and folders in the `$TEMP`folder.", - "type": "string", - "enum": [ - "fs:scope-temp-index" - ] - }, - { - "description": "fs:scope-temp-recursive -> This scope recursive access to the complete `$TEMP` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-temp-recursive" - ] - }, - { - "description": "fs:scope-template -> This scope permits access to all files and list content of top level directories in the `$TEMPLATE`folder.", - "type": "string", - "enum": [ - "fs:scope-template" - ] - }, - { - "description": "fs:scope-template-index -> This scope permits to list all files and folders in the `$TEMPLATE`folder.", - "type": "string", - "enum": [ - "fs:scope-template-index" - ] - }, - { - "description": "fs:scope-template-recursive -> This scope recursive access to the complete `$TEMPLATE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-template-recursive" - ] - }, - { - "description": "fs:scope-video -> This scope permits access to all files and list content of top level directories in the `$VIDEO`folder.", - "type": "string", - "enum": [ - "fs:scope-video" - ] - }, - { - "description": "fs:scope-video-index -> This scope permits to list all files and folders in the `$VIDEO`folder.", - "type": "string", - "enum": [ - "fs:scope-video-index" - ] - }, - { - "description": "fs:scope-video-recursive -> This scope recursive access to the complete `$VIDEO` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-video-recursive" - ] - }, - { - "description": "fs:write-all -> This enables all write related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:write-all" - ] - }, - { - "description": "fs:write-files -> This enables all file write related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:write-files" - ] - } - ] - }, - "allow": { - "items": { - "title": "Entry", - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "type": "string" - } - } - } - }, - "deny": { - "items": { - "title": "Entry", - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "type": "string" - } - } - } - } - } - }, - { - "type": "object", - "required": [ - "identifier" - ], - "properties": { - "identifier": { - "oneOf": [ - { - "description": "http:default -> Allows all fetch operations", - "type": "string", - "enum": [ - "http:default" - ] - }, - { - "description": "http:allow-fetch -> Enables the fetch command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:allow-fetch" - ] - }, - { - "description": "http:allow-fetch-cancel -> Enables the fetch_cancel command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:allow-fetch-cancel" - ] - }, - { - "description": "http:allow-fetch-read-body -> Enables the fetch_read_body command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:allow-fetch-read-body" - ] - }, - { - "description": "http:allow-fetch-send -> Enables the fetch_send command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:allow-fetch-send" - ] - }, - { - "description": "http:deny-fetch -> Denies the fetch command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:deny-fetch" - ] - }, - { - "description": "http:deny-fetch-cancel -> Denies the fetch_cancel command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:deny-fetch-cancel" - ] - }, - { - "description": "http:deny-fetch-read-body -> Denies the fetch_read_body command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:deny-fetch-read-body" - ] - }, - { - "description": "http:deny-fetch-send -> Denies the fetch_send command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:deny-fetch-send" - ] - } - ] - }, - "allow": { - "items": { - "title": "ScopeEntry", - "description": "HTTP scope entry object definition.", - "type": "object", - "required": [ - "url" - ], - "properties": { - "url": { - "description": "A URL that can be accessed by the webview when using the HTTP APIs. The scoped URL is matched against the request URL using a glob pattern.\n\nExamples:\n\n- \"https://*\" or \"https://**\" : allows all HTTPS urls\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/\"", - "type": "string" - } - } - } - }, - "deny": { - "items": { - "title": "ScopeEntry", - "description": "HTTP scope entry object definition.", - "type": "object", - "required": [ - "url" - ], - "properties": { - "url": { - "description": "A URL that can be accessed by the webview when using the HTTP APIs. The scoped URL is matched against the request URL using a glob pattern.\n\nExamples:\n\n- \"https://*\" or \"https://**\" : allows all HTTPS urls\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/\"", - "type": "string" - } - } - } - } - } - }, - { - "type": "object", - "required": [ - "identifier" - ], - "properties": { - "identifier": { - "oneOf": [ - { - "description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:allow-execute" - ] - }, - { - "description": "shell:allow-kill -> Enables the kill command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:allow-kill" - ] - }, - { - "description": "shell:allow-open -> Enables the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:allow-open" - ] - }, - { - "description": "shell:allow-stdin-write -> Enables the stdin_write command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:allow-stdin-write" - ] - }, - { - "description": "shell:deny-execute -> Denies the execute command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:deny-execute" - ] - }, - { - "description": "shell:deny-kill -> Denies the kill command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:deny-kill" - ] - }, - { - "description": "shell:deny-open -> Denies the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:deny-open" - ] - }, - { - "description": "shell:deny-stdin-write -> Denies the stdin_write command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:deny-stdin-write" - ] - } - ] - }, - "allow": { - "items": { - "title": "Entry", - "description": "A command allowed to be executed by the webview API.", - "type": "object", - "required": [ - "args", - "command", - "name", - "sidecar" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellAllowedArgs" - } - ] - }, - "command": { - "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" - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - }, - "sidecar": { - "description": "If this command is a sidecar command.", - "type": "boolean" - } - } - } - }, - "deny": { - "items": { - "title": "Entry", - "description": "A command allowed to be executed by the webview API.", - "type": "object", - "required": [ - "args", - "command", - "name", - "sidecar" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellAllowedArgs" - } - ] - }, - "command": { - "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" - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - }, - "sidecar": { - "description": "If this command is a sidecar command.", - "type": "boolean" - } - } - } - } - } - } - ] - } - ] - }, - "Identifier": { - "oneOf": [ - { - "description": "app:default -> Default permissions for the plugin.", - "type": "string", - "enum": [ - "app:default" - ] - }, - { - "description": "app:allow-app-hide -> Enables the app_hide command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:allow-app-hide" - ] - }, - { - "description": "app:allow-app-show -> Enables the app_show command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:allow-app-show" - ] - }, - { - "description": "app:allow-name -> Enables the name command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:allow-name" - ] - }, - { - "description": "app:allow-tauri-version -> Enables the tauri_version command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:allow-tauri-version" - ] - }, - { - "description": "app:allow-version -> Enables the version command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:allow-version" - ] - }, - { - "description": "app:deny-app-hide -> Denies the app_hide command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:deny-app-hide" - ] - }, - { - "description": "app:deny-app-show -> Denies the app_show command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:deny-app-show" - ] - }, - { - "description": "app:deny-name -> Denies the name command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:deny-name" - ] - }, - { - "description": "app:deny-tauri-version -> Denies the tauri_version command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:deny-tauri-version" - ] - }, - { - "description": "app:deny-version -> Denies the version command without any pre-configured scope.", - "type": "string", - "enum": [ - "app:deny-version" - ] - }, - { - "description": "barcode-scanner:allow-cancel -> Enables the cancel command without any pre-configured scope.", - "type": "string", - "enum": [ - "barcode-scanner:allow-cancel" - ] - }, - { - "description": "barcode-scanner:allow-check-permissions -> Enables the check_permissions command without any pre-configured scope.", - "type": "string", - "enum": [ - "barcode-scanner:allow-check-permissions" - ] - }, - { - "description": "barcode-scanner:allow-open-app-settings -> Enables the open_app_settings command without any pre-configured scope.", - "type": "string", - "enum": [ - "barcode-scanner:allow-open-app-settings" - ] - }, - { - "description": "barcode-scanner:allow-request-permissions -> Enables the request_permissions command without any pre-configured scope.", - "type": "string", - "enum": [ - "barcode-scanner:allow-request-permissions" - ] - }, - { - "description": "barcode-scanner:allow-scan -> Enables the scan command without any pre-configured scope.", - "type": "string", - "enum": [ - "barcode-scanner:allow-scan" - ] - }, - { - "description": "barcode-scanner:allow-vibrate -> Enables the vibrate command without any pre-configured scope.", - "type": "string", - "enum": [ - "barcode-scanner:allow-vibrate" - ] - }, - { - "description": "barcode-scanner:deny-cancel -> Denies the cancel command without any pre-configured scope.", - "type": "string", - "enum": [ - "barcode-scanner:deny-cancel" - ] - }, - { - "description": "barcode-scanner:deny-check-permissions -> Denies the check_permissions command without any pre-configured scope.", - "type": "string", - "enum": [ - "barcode-scanner:deny-check-permissions" - ] - }, - { - "description": "barcode-scanner:deny-open-app-settings -> Denies the open_app_settings command without any pre-configured scope.", - "type": "string", - "enum": [ - "barcode-scanner:deny-open-app-settings" - ] - }, - { - "description": "barcode-scanner:deny-request-permissions -> Denies the request_permissions command without any pre-configured scope.", - "type": "string", - "enum": [ - "barcode-scanner:deny-request-permissions" - ] - }, - { - "description": "barcode-scanner:deny-scan -> Denies the scan command without any pre-configured scope.", - "type": "string", - "enum": [ - "barcode-scanner:deny-scan" - ] - }, - { - "description": "barcode-scanner:deny-vibrate -> Denies the vibrate command without any pre-configured scope.", - "type": "string", - "enum": [ - "barcode-scanner:deny-vibrate" - ] - }, - { - "description": "biometric:allow-authenticate -> Enables the authenticate command without any pre-configured scope.", - "type": "string", - "enum": [ - "biometric:allow-authenticate" - ] - }, - { - "description": "biometric:allow-status -> Enables the status command without any pre-configured scope.", - "type": "string", - "enum": [ - "biometric:allow-status" - ] - }, - { - "description": "biometric:deny-authenticate -> Denies the authenticate command without any pre-configured scope.", - "type": "string", - "enum": [ - "biometric:deny-authenticate" - ] - }, - { - "description": "biometric:deny-status -> Denies the status command without any pre-configured scope.", - "type": "string", - "enum": [ - "biometric:deny-status" - ] - }, - { - "description": "clipboard-manager:allow-read -> Enables the read command without any pre-configured scope.", - "type": "string", - "enum": [ - "clipboard-manager:allow-read" - ] - }, - { - "description": "clipboard-manager:allow-write -> Enables the write command without any pre-configured scope.", - "type": "string", - "enum": [ - "clipboard-manager:allow-write" - ] - }, - { - "description": "clipboard-manager:deny-read -> Denies the read command without any pre-configured scope.", - "type": "string", - "enum": [ - "clipboard-manager:deny-read" - ] - }, - { - "description": "clipboard-manager:deny-write -> Denies the write command without any pre-configured scope.", - "type": "string", - "enum": [ - "clipboard-manager:deny-write" - ] - }, - { - "description": "dialog:allow-ask -> Enables the ask command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:allow-ask" - ] - }, - { - "description": "dialog:allow-confirm -> Enables the confirm command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:allow-confirm" - ] - }, - { - "description": "dialog:allow-message -> Enables the message command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:allow-message" - ] - }, - { - "description": "dialog:allow-open -> Enables the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:allow-open" - ] - }, - { - "description": "dialog:allow-save -> Enables the save command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:allow-save" - ] - }, - { - "description": "dialog:deny-ask -> Denies the ask command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:deny-ask" - ] - }, - { - "description": "dialog:deny-confirm -> Denies the confirm command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:deny-confirm" - ] - }, - { - "description": "dialog:deny-message -> Denies the message command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:deny-message" - ] - }, - { - "description": "dialog:deny-open -> Denies the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:deny-open" - ] - }, - { - "description": "dialog:deny-save -> Denies the save command without any pre-configured scope.", - "type": "string", - "enum": [ - "dialog:deny-save" - ] - }, - { - "description": "event:default -> Default permissions for the plugin.", - "type": "string", - "enum": [ - "event:default" - ] - }, - { - "description": "event:allow-emit -> Enables the emit command without any pre-configured scope.", - "type": "string", - "enum": [ - "event:allow-emit" - ] - }, - { - "description": "event:allow-emit-to -> Enables the emit_to command without any pre-configured scope.", - "type": "string", - "enum": [ - "event:allow-emit-to" - ] - }, - { - "description": "event:allow-listen -> Enables the listen command without any pre-configured scope.", - "type": "string", - "enum": [ - "event:allow-listen" - ] - }, - { - "description": "event:allow-unlisten -> Enables the unlisten command without any pre-configured scope.", - "type": "string", - "enum": [ - "event:allow-unlisten" - ] - }, - { - "description": "event:deny-emit -> Denies the emit command without any pre-configured scope.", - "type": "string", - "enum": [ - "event:deny-emit" - ] - }, - { - "description": "event:deny-emit-to -> Denies the emit_to command without any pre-configured scope.", - "type": "string", - "enum": [ - "event:deny-emit-to" - ] - }, - { - "description": "event:deny-listen -> Denies the listen command without any pre-configured scope.", - "type": "string", - "enum": [ - "event:deny-listen" - ] - }, - { - "description": "event:deny-unlisten -> Denies the unlisten command without any pre-configured scope.", - "type": "string", - "enum": [ - "event:deny-unlisten" - ] - }, - { - "description": "fs:allow-app-meta -> This allows read access to metadata of the `$APP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-app-meta" - ] - }, - { - "description": "fs:allow-app-meta-recursive -> This allows read access to metadata of the `$APP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-app-meta-recursive" - ] - }, - { - "description": "fs:allow-app-read -> This allows non-recursive read access to the `$APP` folder.", - "type": "string", - "enum": [ - "fs:allow-app-read" - ] - }, - { - "description": "fs:allow-app-read-recursive -> This allows full recursive read access to the complete `$APP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-app-read-recursive" - ] - }, - { - "description": "fs:allow-app-write -> This allows non-recursive write access to the `$APP` folder.", - "type": "string", - "enum": [ - "fs:allow-app-write" - ] - }, - { - "description": "fs:allow-app-write-recursive -> This allows full recusrive write access to the complete `$APP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-app-write-recursive" - ] - }, - { - "description": "fs:allow-appcache-meta -> This allows read access to metadata of the `$APPCACHE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appcache-meta" - ] - }, - { - "description": "fs:allow-appcache-meta-recursive -> This allows read access to metadata of the `$APPCACHE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appcache-meta-recursive" - ] - }, - { - "description": "fs:allow-appcache-read -> This allows non-recursive read access to the `$APPCACHE` folder.", - "type": "string", - "enum": [ - "fs:allow-appcache-read" - ] - }, - { - "description": "fs:allow-appcache-read-recursive -> This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appcache-read-recursive" - ] - }, - { - "description": "fs:allow-appcache-write -> This allows non-recursive write access to the `$APPCACHE` folder.", - "type": "string", - "enum": [ - "fs:allow-appcache-write" - ] - }, - { - "description": "fs:allow-appcache-write-recursive -> This allows full recusrive write access to the complete `$APPCACHE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appcache-write-recursive" - ] - }, - { - "description": "fs:allow-appconfig-meta -> This allows read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appconfig-meta" - ] - }, - { - "description": "fs:allow-appconfig-meta-recursive -> This allows read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appconfig-meta-recursive" - ] - }, - { - "description": "fs:allow-appconfig-read -> This allows non-recursive read access to the `$APPCONFIG` folder.", - "type": "string", - "enum": [ - "fs:allow-appconfig-read" - ] - }, - { - "description": "fs:allow-appconfig-read-recursive -> This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appconfig-read-recursive" - ] - }, - { - "description": "fs:allow-appconfig-write -> This allows non-recursive write access to the `$APPCONFIG` folder.", - "type": "string", - "enum": [ - "fs:allow-appconfig-write" - ] - }, - { - "description": "fs:allow-appconfig-write-recursive -> This allows full recusrive write access to the complete `$APPCONFIG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appconfig-write-recursive" - ] - }, - { - "description": "fs:allow-appdata-meta -> This allows read access to metadata of the `$APPDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appdata-meta" - ] - }, - { - "description": "fs:allow-appdata-meta-recursive -> This allows read access to metadata of the `$APPDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-appdata-meta-recursive" - ] - }, - { - "description": "fs:allow-appdata-read -> This allows non-recursive read access to the `$APPDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-appdata-read" - ] - }, - { - "description": "fs:allow-appdata-read-recursive -> This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appdata-read-recursive" - ] - }, - { - "description": "fs:allow-appdata-write -> This allows non-recursive write access to the `$APPDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-appdata-write" - ] - }, - { - "description": "fs:allow-appdata-write-recursive -> This allows full recusrive write access to the complete `$APPDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-appdata-write-recursive" - ] - }, - { - "description": "fs:allow-applocaldata-meta -> This allows read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-meta" - ] - }, - { - "description": "fs:allow-applocaldata-meta-recursive -> This allows read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-meta-recursive" - ] - }, - { - "description": "fs:allow-applocaldata-read -> This allows non-recursive read access to the `$APPLOCALDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-read" - ] - }, - { - "description": "fs:allow-applocaldata-read-recursive -> This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-read-recursive" - ] - }, - { - "description": "fs:allow-applocaldata-write -> This allows non-recursive write access to the `$APPLOCALDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-write" - ] - }, - { - "description": "fs:allow-applocaldata-write-recursive -> This allows full recusrive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-applocaldata-write-recursive" - ] - }, - { - "description": "fs:allow-applog-meta -> This allows read access to metadata of the `$APPLOG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-applog-meta" - ] - }, - { - "description": "fs:allow-applog-meta-recursive -> This allows read access to metadata of the `$APPLOG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-applog-meta-recursive" - ] - }, - { - "description": "fs:allow-applog-read -> This allows non-recursive read access to the `$APPLOG` folder.", - "type": "string", - "enum": [ - "fs:allow-applog-read" - ] - }, - { - "description": "fs:allow-applog-read-recursive -> This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-applog-read-recursive" - ] - }, - { - "description": "fs:allow-applog-write -> This allows non-recursive write access to the `$APPLOG` folder.", - "type": "string", - "enum": [ - "fs:allow-applog-write" - ] - }, - { - "description": "fs:allow-applog-write-recursive -> This allows full recusrive write access to the complete `$APPLOG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-applog-write-recursive" - ] - }, - { - "description": "fs:allow-audio-meta -> This allows read access to metadata of the `$AUDIO` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-audio-meta" - ] - }, - { - "description": "fs:allow-audio-meta-recursive -> This allows read access to metadata of the `$AUDIO` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-audio-meta-recursive" - ] - }, - { - "description": "fs:allow-audio-read -> This allows non-recursive read access to the `$AUDIO` folder.", - "type": "string", - "enum": [ - "fs:allow-audio-read" - ] - }, - { - "description": "fs:allow-audio-read-recursive -> This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-audio-read-recursive" - ] - }, - { - "description": "fs:allow-audio-write -> This allows non-recursive write access to the `$AUDIO` folder.", - "type": "string", - "enum": [ - "fs:allow-audio-write" - ] - }, - { - "description": "fs:allow-audio-write-recursive -> This allows full recusrive write access to the complete `$AUDIO` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-audio-write-recursive" - ] - }, - { - "description": "fs:allow-cache-meta -> This allows read access to metadata of the `$CACHE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-cache-meta" - ] - }, - { - "description": "fs:allow-cache-meta-recursive -> This allows read access to metadata of the `$CACHE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-cache-meta-recursive" - ] - }, - { - "description": "fs:allow-cache-read -> This allows non-recursive read access to the `$CACHE` folder.", - "type": "string", - "enum": [ - "fs:allow-cache-read" - ] - }, - { - "description": "fs:allow-cache-read-recursive -> This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-cache-read-recursive" - ] - }, - { - "description": "fs:allow-cache-write -> This allows non-recursive write access to the `$CACHE` folder.", - "type": "string", - "enum": [ - "fs:allow-cache-write" - ] - }, - { - "description": "fs:allow-cache-write-recursive -> This allows full recusrive write access to the complete `$CACHE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-cache-write-recursive" - ] - }, - { - "description": "fs:allow-config-meta -> This allows read access to metadata of the `$CONFIG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-config-meta" - ] - }, - { - "description": "fs:allow-config-meta-recursive -> This allows read access to metadata of the `$CONFIG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-config-meta-recursive" - ] - }, - { - "description": "fs:allow-config-read -> This allows non-recursive read access to the `$CONFIG` folder.", - "type": "string", - "enum": [ - "fs:allow-config-read" - ] - }, - { - "description": "fs:allow-config-read-recursive -> This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-config-read-recursive" - ] - }, - { - "description": "fs:allow-config-write -> This allows non-recursive write access to the `$CONFIG` folder.", - "type": "string", - "enum": [ - "fs:allow-config-write" - ] - }, - { - "description": "fs:allow-config-write-recursive -> This allows full recusrive write access to the complete `$CONFIG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-config-write-recursive" - ] - }, - { - "description": "fs:allow-data-meta -> This allows read access to metadata of the `$DATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-data-meta" - ] - }, - { - "description": "fs:allow-data-meta-recursive -> This allows read access to metadata of the `$DATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-data-meta-recursive" - ] - }, - { - "description": "fs:allow-data-read -> This allows non-recursive read access to the `$DATA` folder.", - "type": "string", - "enum": [ - "fs:allow-data-read" - ] - }, - { - "description": "fs:allow-data-read-recursive -> This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-data-read-recursive" - ] - }, - { - "description": "fs:allow-data-write -> This allows non-recursive write access to the `$DATA` folder.", - "type": "string", - "enum": [ - "fs:allow-data-write" - ] - }, - { - "description": "fs:allow-data-write-recursive -> This allows full recusrive write access to the complete `$DATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-data-write-recursive" - ] - }, - { - "description": "fs:allow-desktop-meta -> This allows read access to metadata of the `$DESKTOP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-desktop-meta" - ] - }, - { - "description": "fs:allow-desktop-meta-recursive -> This allows read access to metadata of the `$DESKTOP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-desktop-meta-recursive" - ] - }, - { - "description": "fs:allow-desktop-read -> This allows non-recursive read access to the `$DESKTOP` folder.", - "type": "string", - "enum": [ - "fs:allow-desktop-read" - ] - }, - { - "description": "fs:allow-desktop-read-recursive -> This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-desktop-read-recursive" - ] - }, - { - "description": "fs:allow-desktop-write -> This allows non-recursive write access to the `$DESKTOP` folder.", - "type": "string", - "enum": [ - "fs:allow-desktop-write" - ] - }, - { - "description": "fs:allow-desktop-write-recursive -> This allows full recusrive write access to the complete `$DESKTOP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-desktop-write-recursive" - ] - }, - { - "description": "fs:allow-document-meta -> This allows read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-document-meta" - ] - }, - { - "description": "fs:allow-document-meta-recursive -> This allows read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-document-meta-recursive" - ] - }, - { - "description": "fs:allow-document-read -> This allows non-recursive read access to the `$DOCUMENT` folder.", - "type": "string", - "enum": [ - "fs:allow-document-read" - ] - }, - { - "description": "fs:allow-document-read-recursive -> This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-document-read-recursive" - ] - }, - { - "description": "fs:allow-document-write -> This allows non-recursive write access to the `$DOCUMENT` folder.", - "type": "string", - "enum": [ - "fs:allow-document-write" - ] - }, - { - "description": "fs:allow-document-write-recursive -> This allows full recusrive write access to the complete `$DOCUMENT` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-document-write-recursive" - ] - }, - { - "description": "fs:allow-download-meta -> This allows read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-download-meta" - ] - }, - { - "description": "fs:allow-download-meta-recursive -> This allows read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-download-meta-recursive" - ] - }, - { - "description": "fs:allow-download-read -> This allows non-recursive read access to the `$DOWNLOAD` folder.", - "type": "string", - "enum": [ - "fs:allow-download-read" - ] - }, - { - "description": "fs:allow-download-read-recursive -> This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-download-read-recursive" - ] - }, - { - "description": "fs:allow-download-write -> This allows non-recursive write access to the `$DOWNLOAD` folder.", - "type": "string", - "enum": [ - "fs:allow-download-write" - ] - }, - { - "description": "fs:allow-download-write-recursive -> This allows full recusrive write access to the complete `$DOWNLOAD` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-download-write-recursive" - ] - }, - { - "description": "fs:allow-exe-meta -> This allows read access to metadata of the `$EXE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-exe-meta" - ] - }, - { - "description": "fs:allow-exe-meta-recursive -> This allows read access to metadata of the `$EXE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-exe-meta-recursive" - ] - }, - { - "description": "fs:allow-exe-read -> This allows non-recursive read access to the `$EXE` folder.", - "type": "string", - "enum": [ - "fs:allow-exe-read" - ] - }, - { - "description": "fs:allow-exe-read-recursive -> This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-exe-read-recursive" - ] - }, - { - "description": "fs:allow-exe-write -> This allows non-recursive write access to the `$EXE` folder.", - "type": "string", - "enum": [ - "fs:allow-exe-write" - ] - }, - { - "description": "fs:allow-exe-write-recursive -> This allows full recusrive write access to the complete `$EXE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-exe-write-recursive" - ] - }, - { - "description": "fs:allow-font-meta -> This allows read access to metadata of the `$FONT` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-font-meta" - ] - }, - { - "description": "fs:allow-font-meta-recursive -> This allows read access to metadata of the `$FONT` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-font-meta-recursive" - ] - }, - { - "description": "fs:allow-font-read -> This allows non-recursive read access to the `$FONT` folder.", - "type": "string", - "enum": [ - "fs:allow-font-read" - ] - }, - { - "description": "fs:allow-font-read-recursive -> This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-font-read-recursive" - ] - }, - { - "description": "fs:allow-font-write -> This allows non-recursive write access to the `$FONT` folder.", - "type": "string", - "enum": [ - "fs:allow-font-write" - ] - }, - { - "description": "fs:allow-font-write-recursive -> This allows full recusrive write access to the complete `$FONT` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-font-write-recursive" - ] - }, - { - "description": "fs:allow-home-meta -> This allows read access to metadata of the `$HOME` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-home-meta" - ] - }, - { - "description": "fs:allow-home-meta-recursive -> This allows read access to metadata of the `$HOME` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-home-meta-recursive" - ] - }, - { - "description": "fs:allow-home-read -> This allows non-recursive read access to the `$HOME` folder.", - "type": "string", - "enum": [ - "fs:allow-home-read" - ] - }, - { - "description": "fs:allow-home-read-recursive -> This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-home-read-recursive" - ] - }, - { - "description": "fs:allow-home-write -> This allows non-recursive write access to the `$HOME` folder.", - "type": "string", - "enum": [ - "fs:allow-home-write" - ] - }, - { - "description": "fs:allow-home-write-recursive -> This allows full recusrive write access to the complete `$HOME` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-home-write-recursive" - ] - }, - { - "description": "fs:allow-localdata-meta -> This allows read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-localdata-meta" - ] - }, - { - "description": "fs:allow-localdata-meta-recursive -> This allows read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-localdata-meta-recursive" - ] - }, - { - "description": "fs:allow-localdata-read -> This allows non-recursive read access to the `$LOCALDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-localdata-read" - ] - }, - { - "description": "fs:allow-localdata-read-recursive -> This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-localdata-read-recursive" - ] - }, - { - "description": "fs:allow-localdata-write -> This allows non-recursive write access to the `$LOCALDATA` folder.", - "type": "string", - "enum": [ - "fs:allow-localdata-write" - ] - }, - { - "description": "fs:allow-localdata-write-recursive -> This allows full recusrive write access to the complete `$LOCALDATA` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-localdata-write-recursive" - ] - }, - { - "description": "fs:allow-log-meta -> This allows read access to metadata of the `$LOG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-log-meta" - ] - }, - { - "description": "fs:allow-log-meta-recursive -> This allows read access to metadata of the `$LOG` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-log-meta-recursive" - ] - }, - { - "description": "fs:allow-log-read -> This allows non-recursive read access to the `$LOG` folder.", - "type": "string", - "enum": [ - "fs:allow-log-read" - ] - }, - { - "description": "fs:allow-log-read-recursive -> This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-log-read-recursive" - ] - }, - { - "description": "fs:allow-log-write -> This allows non-recursive write access to the `$LOG` folder.", - "type": "string", - "enum": [ - "fs:allow-log-write" - ] - }, - { - "description": "fs:allow-log-write-recursive -> This allows full recusrive write access to the complete `$LOG` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-log-write-recursive" - ] - }, - { - "description": "fs:allow-picture-meta -> This allows read access to metadata of the `$PICTURE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-picture-meta" - ] - }, - { - "description": "fs:allow-picture-meta-recursive -> This allows read access to metadata of the `$PICTURE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-picture-meta-recursive" - ] - }, - { - "description": "fs:allow-picture-read -> This allows non-recursive read access to the `$PICTURE` folder.", - "type": "string", - "enum": [ - "fs:allow-picture-read" - ] - }, - { - "description": "fs:allow-picture-read-recursive -> This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-picture-read-recursive" - ] - }, - { - "description": "fs:allow-picture-write -> This allows non-recursive write access to the `$PICTURE` folder.", - "type": "string", - "enum": [ - "fs:allow-picture-write" - ] - }, - { - "description": "fs:allow-picture-write-recursive -> This allows full recusrive write access to the complete `$PICTURE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-picture-write-recursive" - ] - }, - { - "description": "fs:allow-public-meta -> This allows read access to metadata of the `$PUBLIC` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-public-meta" - ] - }, - { - "description": "fs:allow-public-meta-recursive -> This allows read access to metadata of the `$PUBLIC` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-public-meta-recursive" - ] - }, - { - "description": "fs:allow-public-read -> This allows non-recursive read access to the `$PUBLIC` folder.", - "type": "string", - "enum": [ - "fs:allow-public-read" - ] - }, - { - "description": "fs:allow-public-read-recursive -> This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-public-read-recursive" - ] - }, - { - "description": "fs:allow-public-write -> This allows non-recursive write access to the `$PUBLIC` folder.", - "type": "string", - "enum": [ - "fs:allow-public-write" - ] - }, - { - "description": "fs:allow-public-write-recursive -> This allows full recusrive write access to the complete `$PUBLIC` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-public-write-recursive" - ] - }, - { - "description": "fs:allow-resource-meta -> This allows read access to metadata of the `$RESOURCE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-resource-meta" - ] - }, - { - "description": "fs:allow-resource-meta-recursive -> This allows read access to metadata of the `$RESOURCE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-resource-meta-recursive" - ] - }, - { - "description": "fs:allow-resource-read -> This allows non-recursive read access to the `$RESOURCE` folder.", - "type": "string", - "enum": [ - "fs:allow-resource-read" - ] - }, - { - "description": "fs:allow-resource-read-recursive -> This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-resource-read-recursive" - ] - }, - { - "description": "fs:allow-resource-write -> This allows non-recursive write access to the `$RESOURCE` folder.", - "type": "string", - "enum": [ - "fs:allow-resource-write" - ] - }, - { - "description": "fs:allow-resource-write-recursive -> This allows full recusrive write access to the complete `$RESOURCE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-resource-write-recursive" - ] - }, - { - "description": "fs:allow-runtime-meta -> This allows read access to metadata of the `$RUNTIME` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-runtime-meta" - ] - }, - { - "description": "fs:allow-runtime-meta-recursive -> This allows read access to metadata of the `$RUNTIME` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-runtime-meta-recursive" - ] - }, - { - "description": "fs:allow-runtime-read -> This allows non-recursive read access to the `$RUNTIME` folder.", - "type": "string", - "enum": [ - "fs:allow-runtime-read" - ] - }, - { - "description": "fs:allow-runtime-read-recursive -> This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-runtime-read-recursive" - ] - }, - { - "description": "fs:allow-runtime-write -> This allows non-recursive write access to the `$RUNTIME` folder.", - "type": "string", - "enum": [ - "fs:allow-runtime-write" - ] - }, - { - "description": "fs:allow-runtime-write-recursive -> This allows full recusrive write access to the complete `$RUNTIME` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-runtime-write-recursive" - ] - }, - { - "description": "fs:allow-temp-meta -> This allows read access to metadata of the `$TEMP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-temp-meta" - ] - }, - { - "description": "fs:allow-temp-meta-recursive -> This allows read access to metadata of the `$TEMP` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-temp-meta-recursive" - ] - }, - { - "description": "fs:allow-temp-read -> This allows non-recursive read access to the `$TEMP` folder.", - "type": "string", - "enum": [ - "fs:allow-temp-read" - ] - }, - { - "description": "fs:allow-temp-read-recursive -> This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-temp-read-recursive" - ] - }, - { - "description": "fs:allow-temp-write -> This allows non-recursive write access to the `$TEMP` folder.", - "type": "string", - "enum": [ - "fs:allow-temp-write" - ] - }, - { - "description": "fs:allow-temp-write-recursive -> This allows full recusrive write access to the complete `$TEMP` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-temp-write-recursive" - ] - }, - { - "description": "fs:allow-template-meta -> This allows read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-template-meta" - ] - }, - { - "description": "fs:allow-template-meta-recursive -> This allows read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-template-meta-recursive" - ] - }, - { - "description": "fs:allow-template-read -> This allows non-recursive read access to the `$TEMPLATE` folder.", - "type": "string", - "enum": [ - "fs:allow-template-read" - ] - }, - { - "description": "fs:allow-template-read-recursive -> This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-template-read-recursive" - ] - }, - { - "description": "fs:allow-template-write -> This allows non-recursive write access to the `$TEMPLATE` folder.", - "type": "string", - "enum": [ - "fs:allow-template-write" - ] - }, - { - "description": "fs:allow-template-write-recursive -> This allows full recusrive write access to the complete `$TEMPLATE` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-template-write-recursive" - ] - }, - { - "description": "fs:allow-video-meta -> This allows read access to metadata of the `$VIDEO` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-video-meta" - ] - }, - { - "description": "fs:allow-video-meta-recursive -> This allows read access to metadata of the `$VIDEO` folder, including file listing and statistics.", - "type": "string", - "enum": [ - "fs:allow-video-meta-recursive" - ] - }, - { - "description": "fs:allow-video-read -> This allows non-recursive read access to the `$VIDEO` folder.", - "type": "string", - "enum": [ - "fs:allow-video-read" - ] - }, - { - "description": "fs:allow-video-read-recursive -> This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-video-read-recursive" - ] - }, - { - "description": "fs:allow-video-write -> This allows non-recursive write access to the `$VIDEO` folder.", - "type": "string", - "enum": [ - "fs:allow-video-write" - ] - }, - { - "description": "fs:allow-video-write-recursive -> This allows full recusrive write access to the complete `$VIDEO` folder, files and subdirectories.", - "type": "string", - "enum": [ - "fs:allow-video-write-recursive" - ] - }, - { - "description": "fs:deny-default -> This denies access to dangerous Tauri relevant files and folders by default.", - "type": "string", - "enum": [ - "fs:deny-default" - ] - }, - { - "description": "fs:default -> # Tauri `fs` default permissions\n\nThis configuration file defines the default permissions granted\nto the filesystem.\n\n### Granted Permissions\n\nThis default permission set enables all read-related commands and\nallows access to the `$APP` folder and sub directories created in it.\nThe location of the `$APP` folder depends on the operating system,\nwhere the application is run.\n\nIn general the `$APP` folder needs to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\n### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\nOn Windows the webview data folder access is denied.\n\n", - "type": "string", - "enum": [ - "fs:default" - ] - }, - { - "description": "fs:allow-copy-file -> Enables the copy_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-copy-file" - ] - }, - { - "description": "fs:allow-create -> Enables the create command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-create" - ] - }, - { - "description": "fs:allow-exists -> Enables the exists command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-exists" - ] - }, - { - "description": "fs:allow-fstat -> Enables the fstat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-fstat" - ] - }, - { - "description": "fs:allow-ftruncate -> Enables the ftruncate command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-ftruncate" - ] - }, - { - "description": "fs:allow-lstat -> Enables the lstat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-lstat" - ] - }, - { - "description": "fs:allow-mkdir -> Enables the mkdir command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-mkdir" - ] - }, - { - "description": "fs:allow-open -> Enables the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-open" - ] - }, - { - "description": "fs:allow-read -> Enables the read command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read" - ] - }, - { - "description": "fs:allow-read-dir -> Enables the read_dir command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-dir" - ] - }, - { - "description": "fs:allow-read-file -> Enables the read_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-file" - ] - }, - { - "description": "fs:allow-read-text-file -> Enables the read_text_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-text-file" - ] - }, - { - "description": "fs:allow-read-text-file-lines -> Enables the read_text_file_lines command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-text-file-lines" - ] - }, - { - "description": "fs:allow-read-text-file-lines-next -> Enables the read_text_file_lines_next command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-read-text-file-lines-next" - ] - }, - { - "description": "fs:allow-remove -> Enables the remove command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-remove" - ] - }, - { - "description": "fs:allow-rename -> Enables the rename command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-rename" - ] - }, - { - "description": "fs:allow-seek -> Enables the seek command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-seek" - ] - }, - { - "description": "fs:allow-stat -> Enables the stat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-stat" - ] - }, - { - "description": "fs:allow-truncate -> Enables the truncate command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-truncate" - ] - }, - { - "description": "fs:allow-unwatch -> Enables the unwatch command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-unwatch" - ] - }, - { - "description": "fs:allow-watch -> Enables the watch command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-watch" - ] - }, - { - "description": "fs:allow-write -> Enables the write command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-write" - ] - }, - { - "description": "fs:allow-write-file -> Enables the write_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-write-file" - ] - }, - { - "description": "fs:allow-write-text-file -> Enables the write_text_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:allow-write-text-file" - ] - }, - { - "description": "fs:deny-copy-file -> Denies the copy_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-copy-file" - ] - }, - { - "description": "fs:deny-create -> Denies the create command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-create" - ] - }, - { - "description": "fs:deny-exists -> Denies the exists command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-exists" - ] - }, - { - "description": "fs:deny-fstat -> Denies the fstat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-fstat" - ] - }, - { - "description": "fs:deny-ftruncate -> Denies the ftruncate command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-ftruncate" - ] - }, - { - "description": "fs:deny-lstat -> Denies the lstat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-lstat" - ] - }, - { - "description": "fs:deny-mkdir -> Denies the mkdir command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-mkdir" - ] - }, - { - "description": "fs:deny-open -> Denies the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-open" - ] - }, - { - "description": "fs:deny-read -> Denies the read command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read" - ] - }, - { - "description": "fs:deny-read-dir -> Denies the read_dir command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-dir" - ] - }, - { - "description": "fs:deny-read-file -> Denies the read_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-file" - ] - }, - { - "description": "fs:deny-read-text-file -> Denies the read_text_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-text-file" - ] - }, - { - "description": "fs:deny-read-text-file-lines -> Denies the read_text_file_lines command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-text-file-lines" - ] - }, - { - "description": "fs:deny-read-text-file-lines-next -> Denies the read_text_file_lines_next command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-read-text-file-lines-next" - ] - }, - { - "description": "fs:deny-remove -> Denies the remove command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-remove" - ] - }, - { - "description": "fs:deny-rename -> Denies the rename command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-rename" - ] - }, - { - "description": "fs:deny-seek -> Denies the seek command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-seek" - ] - }, - { - "description": "fs:deny-stat -> Denies the stat command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-stat" - ] - }, - { - "description": "fs:deny-truncate -> Denies the truncate command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-truncate" - ] - }, - { - "description": "fs:deny-unwatch -> Denies the unwatch command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-unwatch" - ] - }, - { - "description": "fs:deny-watch -> Denies the watch command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-watch" - ] - }, - { - "description": "fs:deny-webview-data-linux -> This denies read access to the\n`$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.", - "type": "string", - "enum": [ - "fs:deny-webview-data-linux" - ] - }, - { - "description": "fs:deny-webview-data-windows -> This denies read access to the\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.", - "type": "string", - "enum": [ - "fs:deny-webview-data-windows" - ] - }, - { - "description": "fs:deny-write -> Denies the write command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-write" - ] - }, - { - "description": "fs:deny-write-file -> Denies the write_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-write-file" - ] - }, - { - "description": "fs:deny-write-text-file -> Denies the write_text_file command without any pre-configured scope.", - "type": "string", - "enum": [ - "fs:deny-write-text-file" - ] - }, - { - "description": "fs:read-all -> This enables all read related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:read-all" - ] - }, - { - "description": "fs:read-dirs -> This enables directory read and file metadata related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:read-dirs" - ] - }, - { - "description": "fs:read-files -> This enables file read related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:read-files" - ] - }, - { - "description": "fs:read-meta -> This enables all index or metadata related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:read-meta" - ] - }, - { - "description": "fs:scope -> An empty permission you can use to modify the global scope.", - "type": "string", - "enum": [ - "fs:scope" - ] - }, - { - "description": "fs:scope-app -> This scope permits access to all files and list content of top level directories in the `$APP`folder.", - "type": "string", - "enum": [ - "fs:scope-app" - ] - }, - { - "description": "fs:scope-app-index -> This scope permits to list all files and folders in the `$APP`folder.", - "type": "string", - "enum": [ - "fs:scope-app-index" - ] - }, - { - "description": "fs:scope-app-recursive -> This scope recursive access to the complete `$APP` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-app-recursive" - ] - }, - { - "description": "fs:scope-appcache -> This scope permits access to all files and list content of top level directories in the `$APPCACHE`folder.", - "type": "string", - "enum": [ - "fs:scope-appcache" - ] - }, - { - "description": "fs:scope-appcache-index -> This scope permits to list all files and folders in the `$APPCACHE`folder.", - "type": "string", - "enum": [ - "fs:scope-appcache-index" - ] - }, - { - "description": "fs:scope-appcache-recursive -> This scope recursive access to the complete `$APPCACHE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-appcache-recursive" - ] - }, - { - "description": "fs:scope-appconfig -> This scope permits access to all files and list content of top level directories in the `$APPCONFIG`folder.", - "type": "string", - "enum": [ - "fs:scope-appconfig" - ] - }, - { - "description": "fs:scope-appconfig-index -> This scope permits to list all files and folders in the `$APPCONFIG`folder.", - "type": "string", - "enum": [ - "fs:scope-appconfig-index" - ] - }, - { - "description": "fs:scope-appconfig-recursive -> This scope recursive access to the complete `$APPCONFIG` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-appconfig-recursive" - ] - }, - { - "description": "fs:scope-appdata -> This scope permits access to all files and list content of top level directories in the `$APPDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-appdata" - ] - }, - { - "description": "fs:scope-appdata-index -> This scope permits to list all files and folders in the `$APPDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-appdata-index" - ] - }, - { - "description": "fs:scope-appdata-recursive -> This scope recursive access to the complete `$APPDATA` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-appdata-recursive" - ] - }, - { - "description": "fs:scope-applocaldata -> This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-applocaldata" - ] - }, - { - "description": "fs:scope-applocaldata-index -> This scope permits to list all files and folders in the `$APPLOCALDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-applocaldata-index" - ] - }, - { - "description": "fs:scope-applocaldata-recursive -> This scope recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-applocaldata-recursive" - ] - }, - { - "description": "fs:scope-applog -> This scope permits access to all files and list content of top level directories in the `$APPLOG`folder.", - "type": "string", - "enum": [ - "fs:scope-applog" - ] - }, - { - "description": "fs:scope-applog-index -> This scope permits to list all files and folders in the `$APPLOG`folder.", - "type": "string", - "enum": [ - "fs:scope-applog-index" - ] - }, - { - "description": "fs:scope-applog-recursive -> This scope recursive access to the complete `$APPLOG` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-applog-recursive" - ] - }, - { - "description": "fs:scope-audio -> This scope permits access to all files and list content of top level directories in the `$AUDIO`folder.", - "type": "string", - "enum": [ - "fs:scope-audio" - ] - }, - { - "description": "fs:scope-audio-index -> This scope permits to list all files and folders in the `$AUDIO`folder.", - "type": "string", - "enum": [ - "fs:scope-audio-index" - ] - }, - { - "description": "fs:scope-audio-recursive -> This scope recursive access to the complete `$AUDIO` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-audio-recursive" - ] - }, - { - "description": "fs:scope-cache -> This scope permits access to all files and list content of top level directories in the `$CACHE`folder.", - "type": "string", - "enum": [ - "fs:scope-cache" - ] - }, - { - "description": "fs:scope-cache-index -> This scope permits to list all files and folders in the `$CACHE`folder.", - "type": "string", - "enum": [ - "fs:scope-cache-index" - ] - }, - { - "description": "fs:scope-cache-recursive -> This scope recursive access to the complete `$CACHE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-cache-recursive" - ] - }, - { - "description": "fs:scope-config -> This scope permits access to all files and list content of top level directories in the `$CONFIG`folder.", - "type": "string", - "enum": [ - "fs:scope-config" - ] - }, - { - "description": "fs:scope-config-index -> This scope permits to list all files and folders in the `$CONFIG`folder.", - "type": "string", - "enum": [ - "fs:scope-config-index" - ] - }, - { - "description": "fs:scope-config-recursive -> This scope recursive access to the complete `$CONFIG` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-config-recursive" - ] - }, - { - "description": "fs:scope-data -> This scope permits access to all files and list content of top level directories in the `$DATA`folder.", - "type": "string", - "enum": [ - "fs:scope-data" - ] - }, - { - "description": "fs:scope-data-index -> This scope permits to list all files and folders in the `$DATA`folder.", - "type": "string", - "enum": [ - "fs:scope-data-index" - ] - }, - { - "description": "fs:scope-data-recursive -> This scope recursive access to the complete `$DATA` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-data-recursive" - ] - }, - { - "description": "fs:scope-desktop -> This scope permits access to all files and list content of top level directories in the `$DESKTOP`folder.", - "type": "string", - "enum": [ - "fs:scope-desktop" - ] - }, - { - "description": "fs:scope-desktop-index -> This scope permits to list all files and folders in the `$DESKTOP`folder.", - "type": "string", - "enum": [ - "fs:scope-desktop-index" - ] - }, - { - "description": "fs:scope-desktop-recursive -> This scope recursive access to the complete `$DESKTOP` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-desktop-recursive" - ] - }, - { - "description": "fs:scope-document -> This scope permits access to all files and list content of top level directories in the `$DOCUMENT`folder.", - "type": "string", - "enum": [ - "fs:scope-document" - ] - }, - { - "description": "fs:scope-document-index -> This scope permits to list all files and folders in the `$DOCUMENT`folder.", - "type": "string", - "enum": [ - "fs:scope-document-index" - ] - }, - { - "description": "fs:scope-document-recursive -> This scope recursive access to the complete `$DOCUMENT` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-document-recursive" - ] - }, - { - "description": "fs:scope-download -> This scope permits access to all files and list content of top level directories in the `$DOWNLOAD`folder.", - "type": "string", - "enum": [ - "fs:scope-download" - ] - }, - { - "description": "fs:scope-download-index -> This scope permits to list all files and folders in the `$DOWNLOAD`folder.", - "type": "string", - "enum": [ - "fs:scope-download-index" - ] - }, - { - "description": "fs:scope-download-recursive -> This scope recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-download-recursive" - ] - }, - { - "description": "fs:scope-exe -> This scope permits access to all files and list content of top level directories in the `$EXE`folder.", - "type": "string", - "enum": [ - "fs:scope-exe" - ] - }, - { - "description": "fs:scope-exe-index -> This scope permits to list all files and folders in the `$EXE`folder.", - "type": "string", - "enum": [ - "fs:scope-exe-index" - ] - }, - { - "description": "fs:scope-exe-recursive -> This scope recursive access to the complete `$EXE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-exe-recursive" - ] - }, - { - "description": "fs:scope-font -> This scope permits access to all files and list content of top level directories in the `$FONT`folder.", - "type": "string", - "enum": [ - "fs:scope-font" - ] - }, - { - "description": "fs:scope-font-index -> This scope permits to list all files and folders in the `$FONT`folder.", - "type": "string", - "enum": [ - "fs:scope-font-index" - ] - }, - { - "description": "fs:scope-font-recursive -> This scope recursive access to the complete `$FONT` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-font-recursive" - ] - }, - { - "description": "fs:scope-home -> This scope permits access to all files and list content of top level directories in the `$HOME`folder.", - "type": "string", - "enum": [ - "fs:scope-home" - ] - }, - { - "description": "fs:scope-home-index -> This scope permits to list all files and folders in the `$HOME`folder.", - "type": "string", - "enum": [ - "fs:scope-home-index" - ] - }, - { - "description": "fs:scope-home-recursive -> This scope recursive access to the complete `$HOME` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-home-recursive" - ] - }, - { - "description": "fs:scope-localdata -> This scope permits access to all files and list content of top level directories in the `$LOCALDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-localdata" - ] - }, - { - "description": "fs:scope-localdata-index -> This scope permits to list all files and folders in the `$LOCALDATA`folder.", - "type": "string", - "enum": [ - "fs:scope-localdata-index" - ] - }, - { - "description": "fs:scope-localdata-recursive -> This scope recursive access to the complete `$LOCALDATA` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-localdata-recursive" - ] - }, - { - "description": "fs:scope-log -> This scope permits access to all files and list content of top level directories in the `$LOG`folder.", - "type": "string", - "enum": [ - "fs:scope-log" - ] - }, - { - "description": "fs:scope-log-index -> This scope permits to list all files and folders in the `$LOG`folder.", - "type": "string", - "enum": [ - "fs:scope-log-index" - ] - }, - { - "description": "fs:scope-log-recursive -> This scope recursive access to the complete `$LOG` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-log-recursive" - ] - }, - { - "description": "fs:scope-picture -> This scope permits access to all files and list content of top level directories in the `$PICTURE`folder.", - "type": "string", - "enum": [ - "fs:scope-picture" - ] - }, - { - "description": "fs:scope-picture-index -> This scope permits to list all files and folders in the `$PICTURE`folder.", - "type": "string", - "enum": [ - "fs:scope-picture-index" - ] - }, - { - "description": "fs:scope-picture-recursive -> This scope recursive access to the complete `$PICTURE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-picture-recursive" - ] - }, - { - "description": "fs:scope-public -> This scope permits access to all files and list content of top level directories in the `$PUBLIC`folder.", - "type": "string", - "enum": [ - "fs:scope-public" - ] - }, - { - "description": "fs:scope-public-index -> This scope permits to list all files and folders in the `$PUBLIC`folder.", - "type": "string", - "enum": [ - "fs:scope-public-index" - ] - }, - { - "description": "fs:scope-public-recursive -> This scope recursive access to the complete `$PUBLIC` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-public-recursive" - ] - }, - { - "description": "fs:scope-resource -> This scope permits access to all files and list content of top level directories in the `$RESOURCE`folder.", - "type": "string", - "enum": [ - "fs:scope-resource" - ] - }, - { - "description": "fs:scope-resource-index -> This scope permits to list all files and folders in the `$RESOURCE`folder.", - "type": "string", - "enum": [ - "fs:scope-resource-index" - ] - }, - { - "description": "fs:scope-resource-recursive -> This scope recursive access to the complete `$RESOURCE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-resource-recursive" - ] - }, - { - "description": "fs:scope-runtime -> This scope permits access to all files and list content of top level directories in the `$RUNTIME`folder.", - "type": "string", - "enum": [ - "fs:scope-runtime" - ] - }, - { - "description": "fs:scope-runtime-index -> This scope permits to list all files and folders in the `$RUNTIME`folder.", - "type": "string", - "enum": [ - "fs:scope-runtime-index" - ] - }, - { - "description": "fs:scope-runtime-recursive -> This scope recursive access to the complete `$RUNTIME` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-runtime-recursive" - ] - }, - { - "description": "fs:scope-temp -> This scope permits access to all files and list content of top level directories in the `$TEMP`folder.", - "type": "string", - "enum": [ - "fs:scope-temp" - ] - }, - { - "description": "fs:scope-temp-index -> This scope permits to list all files and folders in the `$TEMP`folder.", - "type": "string", - "enum": [ - "fs:scope-temp-index" - ] - }, - { - "description": "fs:scope-temp-recursive -> This scope recursive access to the complete `$TEMP` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-temp-recursive" - ] - }, - { - "description": "fs:scope-template -> This scope permits access to all files and list content of top level directories in the `$TEMPLATE`folder.", - "type": "string", - "enum": [ - "fs:scope-template" - ] - }, - { - "description": "fs:scope-template-index -> This scope permits to list all files and folders in the `$TEMPLATE`folder.", - "type": "string", - "enum": [ - "fs:scope-template-index" - ] - }, - { - "description": "fs:scope-template-recursive -> This scope recursive access to the complete `$TEMPLATE` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-template-recursive" - ] - }, - { - "description": "fs:scope-video -> This scope permits access to all files and list content of top level directories in the `$VIDEO`folder.", - "type": "string", - "enum": [ - "fs:scope-video" - ] - }, - { - "description": "fs:scope-video-index -> This scope permits to list all files and folders in the `$VIDEO`folder.", - "type": "string", - "enum": [ - "fs:scope-video-index" - ] - }, - { - "description": "fs:scope-video-recursive -> This scope recursive access to the complete `$VIDEO` folder, including sub directories and files.", - "type": "string", - "enum": [ - "fs:scope-video-recursive" - ] - }, - { - "description": "fs:write-all -> This enables all write related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:write-all" - ] - }, - { - "description": "fs:write-files -> This enables all file write related commands without any pre-configured accessible paths.", - "type": "string", - "enum": [ - "fs:write-files" - ] - }, - { - "description": "http:default -> Allows all fetch operations", - "type": "string", - "enum": [ - "http:default" - ] - }, - { - "description": "http:allow-fetch -> Enables the fetch command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:allow-fetch" - ] - }, - { - "description": "http:allow-fetch-cancel -> Enables the fetch_cancel command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:allow-fetch-cancel" - ] - }, - { - "description": "http:allow-fetch-read-body -> Enables the fetch_read_body command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:allow-fetch-read-body" - ] - }, - { - "description": "http:allow-fetch-send -> Enables the fetch_send command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:allow-fetch-send" - ] - }, - { - "description": "http:deny-fetch -> Denies the fetch command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:deny-fetch" - ] - }, - { - "description": "http:deny-fetch-cancel -> Denies the fetch_cancel command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:deny-fetch-cancel" - ] - }, - { - "description": "http:deny-fetch-read-body -> Denies the fetch_read_body command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:deny-fetch-read-body" - ] - }, - { - "description": "http:deny-fetch-send -> Denies the fetch_send command without any pre-configured scope.", - "type": "string", - "enum": [ - "http:deny-fetch-send" - ] - }, - { - "description": "log:default -> Allows the log command", - "type": "string", - "enum": [ - "log:default" - ] - }, - { - "description": "log:allow-log -> Enables the log command without any pre-configured scope.", - "type": "string", - "enum": [ - "log:allow-log" - ] - }, - { - "description": "log:deny-log -> Denies the log command without any pre-configured scope.", - "type": "string", - "enum": [ - "log:deny-log" - ] - }, - { - "description": "menu:default -> Default permissions for the plugin.", - "type": "string", - "enum": [ - "menu:default" - ] - }, - { - "description": "menu:allow-append -> Enables the append command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-append" - ] - }, - { - "description": "menu:allow-create-default -> Enables the create_default command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-create-default" - ] - }, - { - "description": "menu:allow-get -> Enables the get command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-get" - ] - }, - { - "description": "menu:allow-insert -> Enables the insert command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-insert" - ] - }, - { - "description": "menu:allow-is-checked -> Enables the is_checked command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-is-checked" - ] - }, - { - "description": "menu:allow-is-enabled -> Enables the is_enabled command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-is-enabled" - ] - }, - { - "description": "menu:allow-items -> Enables the items command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-items" - ] - }, - { - "description": "menu:allow-new -> Enables the new command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-new" - ] - }, - { - "description": "menu:allow-popup -> Enables the popup command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-popup" - ] - }, - { - "description": "menu:allow-prepend -> Enables the prepend command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-prepend" - ] - }, - { - "description": "menu:allow-remove -> Enables the remove command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-remove" - ] - }, - { - "description": "menu:allow-remove-at -> Enables the remove_at command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-remove-at" - ] - }, - { - "description": "menu:allow-set-accelerator -> Enables the set_accelerator command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-accelerator" - ] - }, - { - "description": "menu:allow-set-as-app-menu -> Enables the set_as_app_menu command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-as-app-menu" - ] - }, - { - "description": "menu:allow-set-as-help-menu-for-nsapp -> Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-as-help-menu-for-nsapp" - ] - }, - { - "description": "menu:allow-set-as-window-menu -> Enables the set_as_window_menu command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-as-window-menu" - ] - }, - { - "description": "menu:allow-set-as-windows-menu-for-nsapp -> Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-as-windows-menu-for-nsapp" - ] - }, - { - "description": "menu:allow-set-checked -> Enables the set_checked command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-checked" - ] - }, - { - "description": "menu:allow-set-enabled -> Enables the set_enabled command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-enabled" - ] - }, - { - "description": "menu:allow-set-icon -> Enables the set_icon command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-icon" - ] - }, - { - "description": "menu:allow-set-text -> Enables the set_text command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-set-text" - ] - }, - { - "description": "menu:allow-text -> Enables the text command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:allow-text" - ] - }, - { - "description": "menu:deny-append -> Denies the append command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-append" - ] - }, - { - "description": "menu:deny-create-default -> Denies the create_default command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-create-default" - ] - }, - { - "description": "menu:deny-get -> Denies the get command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-get" - ] - }, - { - "description": "menu:deny-insert -> Denies the insert command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-insert" - ] - }, - { - "description": "menu:deny-is-checked -> Denies the is_checked command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-is-checked" - ] - }, - { - "description": "menu:deny-is-enabled -> Denies the is_enabled command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-is-enabled" - ] - }, - { - "description": "menu:deny-items -> Denies the items command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-items" - ] - }, - { - "description": "menu:deny-new -> Denies the new command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-new" - ] - }, - { - "description": "menu:deny-popup -> Denies the popup command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-popup" - ] - }, - { - "description": "menu:deny-prepend -> Denies the prepend command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-prepend" - ] - }, - { - "description": "menu:deny-remove -> Denies the remove command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-remove" - ] - }, - { - "description": "menu:deny-remove-at -> Denies the remove_at command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-remove-at" - ] - }, - { - "description": "menu:deny-set-accelerator -> Denies the set_accelerator command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-accelerator" - ] - }, - { - "description": "menu:deny-set-as-app-menu -> Denies the set_as_app_menu command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-as-app-menu" - ] - }, - { - "description": "menu:deny-set-as-help-menu-for-nsapp -> Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-as-help-menu-for-nsapp" - ] - }, - { - "description": "menu:deny-set-as-window-menu -> Denies the set_as_window_menu command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-as-window-menu" - ] - }, - { - "description": "menu:deny-set-as-windows-menu-for-nsapp -> Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-as-windows-menu-for-nsapp" - ] - }, - { - "description": "menu:deny-set-checked -> Denies the set_checked command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-checked" - ] - }, - { - "description": "menu:deny-set-enabled -> Denies the set_enabled command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-enabled" - ] - }, - { - "description": "menu:deny-set-icon -> Denies the set_icon command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-icon" - ] - }, - { - "description": "menu:deny-set-text -> Denies the set_text command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-set-text" - ] - }, - { - "description": "menu:deny-text -> Denies the text command without any pre-configured scope.", - "type": "string", - "enum": [ - "menu:deny-text" - ] - }, - { - "description": "nfc:allow-is-available -> Enables the is_available command without any pre-configured scope.", - "type": "string", - "enum": [ - "nfc:allow-is-available" - ] - }, - { - "description": "nfc:allow-scan -> Enables the scan command without any pre-configured scope.", - "type": "string", - "enum": [ - "nfc:allow-scan" - ] - }, - { - "description": "nfc:allow-write -> Enables the write command without any pre-configured scope.", - "type": "string", - "enum": [ - "nfc:allow-write" - ] - }, - { - "description": "nfc:deny-is-available -> Denies the is_available command without any pre-configured scope.", - "type": "string", - "enum": [ - "nfc:deny-is-available" - ] - }, - { - "description": "nfc:deny-scan -> Denies the scan command without any pre-configured scope.", - "type": "string", - "enum": [ - "nfc:deny-scan" - ] - }, - { - "description": "nfc:deny-write -> Denies the write command without any pre-configured scope.", - "type": "string", - "enum": [ - "nfc:deny-write" - ] - }, - { - "description": "notification:default -> Allows requesting permission, checking permission state and sending notifications", - "type": "string", - "enum": [ - "notification:default" - ] - }, - { - "description": "notification:allow-is-permission-granted -> Enables the is_permission_granted command without any pre-configured scope.", - "type": "string", - "enum": [ - "notification:allow-is-permission-granted" - ] - }, - { - "description": "notification:allow-notify -> Enables the notify command without any pre-configured scope.", - "type": "string", - "enum": [ - "notification:allow-notify" - ] - }, - { - "description": "notification:allow-request-permission -> Enables the request_permission command without any pre-configured scope.", - "type": "string", - "enum": [ - "notification:allow-request-permission" - ] - }, - { - "description": "notification:deny-is-permission-granted -> Denies the is_permission_granted command without any pre-configured scope.", - "type": "string", - "enum": [ - "notification:deny-is-permission-granted" - ] - }, - { - "description": "notification:deny-notify -> Denies the notify command without any pre-configured scope.", - "type": "string", - "enum": [ - "notification:deny-notify" - ] - }, - { - "description": "notification:deny-request-permission -> Denies the request_permission command without any pre-configured scope.", - "type": "string", - "enum": [ - "notification:deny-request-permission" - ] - }, - { - "description": "os:allow-arch -> Enables the arch command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:allow-arch" - ] - }, - { - "description": "os:allow-exe-extension -> Enables the exe_extension command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:allow-exe-extension" - ] - }, - { - "description": "os:allow-family -> Enables the family command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:allow-family" - ] - }, - { - "description": "os:allow-hostname -> Enables the hostname command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:allow-hostname" - ] - }, - { - "description": "os:allow-locale -> Enables the locale command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:allow-locale" - ] - }, - { - "description": "os:allow-os-type -> Enables the os_type command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:allow-os-type" - ] - }, - { - "description": "os:allow-platform -> Enables the platform command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:allow-platform" - ] - }, - { - "description": "os:allow-version -> Enables the version command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:allow-version" - ] - }, - { - "description": "os:deny-arch -> Denies the arch command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:deny-arch" - ] - }, - { - "description": "os:deny-exe-extension -> Denies the exe_extension command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:deny-exe-extension" - ] - }, - { - "description": "os:deny-family -> Denies the family command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:deny-family" - ] - }, - { - "description": "os:deny-hostname -> Denies the hostname command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:deny-hostname" - ] - }, - { - "description": "os:deny-locale -> Denies the locale command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:deny-locale" - ] - }, - { - "description": "os:deny-os-type -> Denies the os_type command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:deny-os-type" - ] - }, - { - "description": "os:deny-platform -> Denies the platform command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:deny-platform" - ] - }, - { - "description": "os:deny-version -> Denies the version command without any pre-configured scope.", - "type": "string", - "enum": [ - "os:deny-version" - ] - }, - { - "description": "path:default -> Default permissions for the plugin.", - "type": "string", - "enum": [ - "path:default" - ] - }, - { - "description": "path:allow-basename -> Enables the basename command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:allow-basename" - ] - }, - { - "description": "path:allow-dirname -> Enables the dirname command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:allow-dirname" - ] - }, - { - "description": "path:allow-extname -> Enables the extname command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:allow-extname" - ] - }, - { - "description": "path:allow-is-absolute -> Enables the is_absolute command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:allow-is-absolute" - ] - }, - { - "description": "path:allow-join -> Enables the join command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:allow-join" - ] - }, - { - "description": "path:allow-normalize -> Enables the normalize command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:allow-normalize" - ] - }, - { - "description": "path:allow-resolve -> Enables the resolve command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:allow-resolve" - ] - }, - { - "description": "path:allow-resolve-directory -> Enables the resolve_directory command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:allow-resolve-directory" - ] - }, - { - "description": "path:deny-basename -> Denies the basename command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:deny-basename" - ] - }, - { - "description": "path:deny-dirname -> Denies the dirname command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:deny-dirname" - ] - }, - { - "description": "path:deny-extname -> Denies the extname command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:deny-extname" - ] - }, - { - "description": "path:deny-is-absolute -> Denies the is_absolute command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:deny-is-absolute" - ] - }, - { - "description": "path:deny-join -> Denies the join command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:deny-join" - ] - }, - { - "description": "path:deny-normalize -> Denies the normalize command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:deny-normalize" - ] - }, - { - "description": "path:deny-resolve -> Denies the resolve command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:deny-resolve" - ] - }, - { - "description": "path:deny-resolve-directory -> Denies the resolve_directory command without any pre-configured scope.", - "type": "string", - "enum": [ - "path:deny-resolve-directory" - ] - }, - { - "description": "process:allow-exit -> Enables the exit command without any pre-configured scope.", - "type": "string", - "enum": [ - "process:allow-exit" - ] - }, - { - "description": "process:allow-restart -> Enables the restart command without any pre-configured scope.", - "type": "string", - "enum": [ - "process:allow-restart" - ] - }, - { - "description": "process:deny-exit -> Denies the exit command without any pre-configured scope.", - "type": "string", - "enum": [ - "process:deny-exit" - ] - }, - { - "description": "process:deny-restart -> Denies the restart command without any pre-configured scope.", - "type": "string", - "enum": [ - "process:deny-restart" - ] - }, - { - "description": "resources:default -> Default permissions for the plugin.", - "type": "string", - "enum": [ - "resources:default" - ] - }, - { - "description": "resources:allow-close -> Enables the close command without any pre-configured scope.", - "type": "string", - "enum": [ - "resources:allow-close" - ] - }, - { - "description": "resources:deny-close -> Denies the close command without any pre-configured scope.", - "type": "string", - "enum": [ - "resources:deny-close" - ] - }, - { - "description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:allow-execute" - ] - }, - { - "description": "shell:allow-kill -> Enables the kill command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:allow-kill" - ] - }, - { - "description": "shell:allow-open -> Enables the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:allow-open" - ] - }, - { - "description": "shell:allow-stdin-write -> Enables the stdin_write command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:allow-stdin-write" - ] - }, - { - "description": "shell:deny-execute -> Denies the execute command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:deny-execute" - ] - }, - { - "description": "shell:deny-kill -> Denies the kill command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:deny-kill" - ] - }, - { - "description": "shell:deny-open -> Denies the open command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:deny-open" - ] - }, - { - "description": "shell:deny-stdin-write -> Denies the stdin_write command without any pre-configured scope.", - "type": "string", - "enum": [ - "shell:deny-stdin-write" - ] - }, - { - "description": "tray:default -> Default permissions for the plugin.", - "type": "string", - "enum": [ - "tray:default" - ] - }, - { - "description": "tray:allow-new -> Enables the new command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-new" - ] - }, - { - "description": "tray:allow-set-icon -> Enables the set_icon command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-set-icon" - ] - }, - { - "description": "tray:allow-set-icon-as-template -> Enables the set_icon_as_template command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-set-icon-as-template" - ] - }, - { - "description": "tray:allow-set-menu -> Enables the set_menu command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-set-menu" - ] - }, - { - "description": "tray:allow-set-show-menu-on-left-click -> Enables the set_show_menu_on_left_click command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-set-show-menu-on-left-click" - ] - }, - { - "description": "tray:allow-set-temp-dir-path -> Enables the set_temp_dir_path command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-set-temp-dir-path" - ] - }, - { - "description": "tray:allow-set-title -> Enables the set_title command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-set-title" - ] - }, - { - "description": "tray:allow-set-tooltip -> Enables the set_tooltip command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-set-tooltip" - ] - }, - { - "description": "tray:allow-set-visible -> Enables the set_visible command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:allow-set-visible" - ] - }, - { - "description": "tray:deny-new -> Denies the new command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-new" - ] - }, - { - "description": "tray:deny-set-icon -> Denies the set_icon command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-set-icon" - ] - }, - { - "description": "tray:deny-set-icon-as-template -> Denies the set_icon_as_template command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-set-icon-as-template" - ] - }, - { - "description": "tray:deny-set-menu -> Denies the set_menu command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-set-menu" - ] - }, - { - "description": "tray:deny-set-show-menu-on-left-click -> Denies the set_show_menu_on_left_click command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-set-show-menu-on-left-click" - ] - }, - { - "description": "tray:deny-set-temp-dir-path -> Denies the set_temp_dir_path command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-set-temp-dir-path" - ] - }, - { - "description": "tray:deny-set-title -> Denies the set_title command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-set-title" - ] - }, - { - "description": "tray:deny-set-tooltip -> Denies the set_tooltip command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-set-tooltip" - ] - }, - { - "description": "tray:deny-set-visible -> Denies the set_visible command without any pre-configured scope.", - "type": "string", - "enum": [ - "tray:deny-set-visible" - ] - }, - { - "description": "webview:default -> Default permissions for the plugin.", - "type": "string", - "enum": [ - "webview:default" - ] - }, - { - "description": "webview:allow-create-webview -> Enables the create_webview command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-create-webview" - ] - }, - { - "description": "webview:allow-create-webview-window -> Enables the create_webview_window command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-create-webview-window" - ] - }, - { - "description": "webview:allow-internal-toggle-devtools -> Enables the internal_toggle_devtools command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-internal-toggle-devtools" - ] - }, - { - "description": "webview:allow-print -> Enables the print command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-print" - ] - }, - { - "description": "webview:allow-set-webview-focus -> Enables the set_webview_focus command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-set-webview-focus" - ] - }, - { - "description": "webview:allow-set-webview-position -> Enables the set_webview_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-set-webview-position" - ] - }, - { - "description": "webview:allow-set-webview-size -> Enables the set_webview_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-set-webview-size" - ] - }, - { - "description": "webview:allow-webview-close -> Enables the webview_close command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-webview-close" - ] - }, - { - "description": "webview:allow-webview-position -> Enables the webview_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-webview-position" - ] - }, - { - "description": "webview:allow-webview-size -> Enables the webview_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:allow-webview-size" - ] - }, - { - "description": "webview:deny-create-webview -> Denies the create_webview command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-create-webview" - ] - }, - { - "description": "webview:deny-create-webview-window -> Denies the create_webview_window command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-create-webview-window" - ] - }, - { - "description": "webview:deny-internal-toggle-devtools -> Denies the internal_toggle_devtools command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-internal-toggle-devtools" - ] - }, - { - "description": "webview:deny-print -> Denies the print command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-print" - ] - }, - { - "description": "webview:deny-set-webview-focus -> Denies the set_webview_focus command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-set-webview-focus" - ] - }, - { - "description": "webview:deny-set-webview-position -> Denies the set_webview_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-set-webview-position" - ] - }, - { - "description": "webview:deny-set-webview-size -> Denies the set_webview_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-set-webview-size" - ] - }, - { - "description": "webview:deny-webview-close -> Denies the webview_close command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-webview-close" - ] - }, - { - "description": "webview:deny-webview-position -> Denies the webview_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-webview-position" - ] - }, - { - "description": "webview:deny-webview-size -> Denies the webview_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "webview:deny-webview-size" - ] - }, - { - "description": "window:default -> Default permissions for the plugin.", - "type": "string", - "enum": [ - "window:default" - ] - }, - { - "description": "window:allow-available-monitors -> Enables the available_monitors command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-available-monitors" - ] - }, - { - "description": "window:allow-center -> Enables the center command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-center" - ] - }, - { - "description": "window:allow-close -> Enables the close command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-close" - ] - }, - { - "description": "window:allow-create -> Enables the create command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-create" - ] - }, - { - "description": "window:allow-current-monitor -> Enables the current_monitor command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-current-monitor" - ] - }, - { - "description": "window:allow-destroy -> Enables the destroy command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-destroy" - ] - }, - { - "description": "window:allow-hide -> Enables the hide command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-hide" - ] - }, - { - "description": "window:allow-inner-position -> Enables the inner_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-inner-position" - ] - }, - { - "description": "window:allow-inner-size -> Enables the inner_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-inner-size" - ] - }, - { - "description": "window:allow-internal-toggle-maximize -> Enables the internal_toggle_maximize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-internal-toggle-maximize" - ] - }, - { - "description": "window:allow-is-closable -> Enables the is_closable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-closable" - ] - }, - { - "description": "window:allow-is-decorated -> Enables the is_decorated command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-decorated" - ] - }, - { - "description": "window:allow-is-focused -> Enables the is_focused command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-focused" - ] - }, - { - "description": "window:allow-is-fullscreen -> Enables the is_fullscreen command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-fullscreen" - ] - }, - { - "description": "window:allow-is-maximizable -> Enables the is_maximizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-maximizable" - ] - }, - { - "description": "window:allow-is-maximized -> Enables the is_maximized command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-maximized" - ] - }, - { - "description": "window:allow-is-minimizable -> Enables the is_minimizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-minimizable" - ] - }, - { - "description": "window:allow-is-minimized -> Enables the is_minimized command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-minimized" - ] - }, - { - "description": "window:allow-is-resizable -> Enables the is_resizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-resizable" - ] - }, - { - "description": "window:allow-is-visible -> Enables the is_visible command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-is-visible" - ] - }, - { - "description": "window:allow-maximize -> Enables the maximize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-maximize" - ] - }, - { - "description": "window:allow-minimize -> Enables the minimize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-minimize" - ] - }, - { - "description": "window:allow-outer-position -> Enables the outer_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-outer-position" - ] - }, - { - "description": "window:allow-outer-size -> Enables the outer_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-outer-size" - ] - }, - { - "description": "window:allow-primary-monitor -> Enables the primary_monitor command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-primary-monitor" - ] - }, - { - "description": "window:allow-request-user-attention -> Enables the request_user_attention command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-request-user-attention" - ] - }, - { - "description": "window:allow-scale-factor -> Enables the scale_factor command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-scale-factor" - ] - }, - { - "description": "window:allow-set-always-on-bottom -> Enables the set_always_on_bottom command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-always-on-bottom" - ] - }, - { - "description": "window:allow-set-always-on-top -> Enables the set_always_on_top command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-always-on-top" - ] - }, - { - "description": "window:allow-set-closable -> Enables the set_closable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-closable" - ] - }, - { - "description": "window:allow-set-content-protected -> Enables the set_content_protected command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-content-protected" - ] - }, - { - "description": "window:allow-set-cursor-grab -> Enables the set_cursor_grab command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-cursor-grab" - ] - }, - { - "description": "window:allow-set-cursor-icon -> Enables the set_cursor_icon command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-cursor-icon" - ] - }, - { - "description": "window:allow-set-cursor-position -> Enables the set_cursor_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-cursor-position" - ] - }, - { - "description": "window:allow-set-cursor-visible -> Enables the set_cursor_visible command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-cursor-visible" - ] - }, - { - "description": "window:allow-set-decorations -> Enables the set_decorations command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-decorations" - ] - }, - { - "description": "window:allow-set-effects -> Enables the set_effects command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-effects" - ] - }, - { - "description": "window:allow-set-focus -> Enables the set_focus command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-focus" - ] - }, - { - "description": "window:allow-set-fullscreen -> Enables the set_fullscreen command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-fullscreen" - ] - }, - { - "description": "window:allow-set-icon -> Enables the set_icon command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-icon" - ] - }, - { - "description": "window:allow-set-ignore-cursor-events -> Enables the set_ignore_cursor_events command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-ignore-cursor-events" - ] - }, - { - "description": "window:allow-set-max-size -> Enables the set_max_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-max-size" - ] - }, - { - "description": "window:allow-set-maximizable -> Enables the set_maximizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-maximizable" - ] - }, - { - "description": "window:allow-set-min-size -> Enables the set_min_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-min-size" - ] - }, - { - "description": "window:allow-set-minimizable -> Enables the set_minimizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-minimizable" - ] - }, - { - "description": "window:allow-set-position -> Enables the set_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-position" - ] - }, - { - "description": "window:allow-set-progress-bar -> Enables the set_progress_bar command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-progress-bar" - ] - }, - { - "description": "window:allow-set-resizable -> Enables the set_resizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-resizable" - ] - }, - { - "description": "window:allow-set-shadow -> Enables the set_shadow command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-shadow" - ] - }, - { - "description": "window:allow-set-size -> Enables the set_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-size" - ] - }, - { - "description": "window:allow-set-skip-taskbar -> Enables the set_skip_taskbar command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-skip-taskbar" - ] - }, - { - "description": "window:allow-set-title -> Enables the set_title command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-title" - ] - }, - { - "description": "window:allow-set-visible-on-all-workspaces -> Enables the set_visible_on_all_workspaces command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-set-visible-on-all-workspaces" - ] - }, - { - "description": "window:allow-show -> Enables the show command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-show" - ] - }, - { - "description": "window:allow-start-dragging -> Enables the start_dragging command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-start-dragging" - ] - }, - { - "description": "window:allow-theme -> Enables the theme command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-theme" - ] - }, - { - "description": "window:allow-title -> Enables the title command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-title" - ] - }, - { - "description": "window:allow-toggle-maximize -> Enables the toggle_maximize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-toggle-maximize" - ] - }, - { - "description": "window:allow-unmaximize -> Enables the unmaximize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-unmaximize" - ] - }, - { - "description": "window:allow-unminimize -> Enables the unminimize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:allow-unminimize" - ] - }, - { - "description": "window:deny-available-monitors -> Denies the available_monitors command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-available-monitors" - ] - }, - { - "description": "window:deny-center -> Denies the center command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-center" - ] - }, - { - "description": "window:deny-close -> Denies the close command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-close" - ] - }, - { - "description": "window:deny-create -> Denies the create command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-create" - ] - }, - { - "description": "window:deny-current-monitor -> Denies the current_monitor command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-current-monitor" - ] - }, - { - "description": "window:deny-destroy -> Denies the destroy command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-destroy" - ] - }, - { - "description": "window:deny-hide -> Denies the hide command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-hide" - ] - }, - { - "description": "window:deny-inner-position -> Denies the inner_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-inner-position" - ] - }, - { - "description": "window:deny-inner-size -> Denies the inner_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-inner-size" - ] - }, - { - "description": "window:deny-internal-toggle-maximize -> Denies the internal_toggle_maximize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-internal-toggle-maximize" - ] - }, - { - "description": "window:deny-is-closable -> Denies the is_closable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-closable" - ] - }, - { - "description": "window:deny-is-decorated -> Denies the is_decorated command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-decorated" - ] - }, - { - "description": "window:deny-is-focused -> Denies the is_focused command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-focused" - ] - }, - { - "description": "window:deny-is-fullscreen -> Denies the is_fullscreen command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-fullscreen" - ] - }, - { - "description": "window:deny-is-maximizable -> Denies the is_maximizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-maximizable" - ] - }, - { - "description": "window:deny-is-maximized -> Denies the is_maximized command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-maximized" - ] - }, - { - "description": "window:deny-is-minimizable -> Denies the is_minimizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-minimizable" - ] - }, - { - "description": "window:deny-is-minimized -> Denies the is_minimized command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-minimized" - ] - }, - { - "description": "window:deny-is-resizable -> Denies the is_resizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-resizable" - ] - }, - { - "description": "window:deny-is-visible -> Denies the is_visible command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-is-visible" - ] - }, - { - "description": "window:deny-maximize -> Denies the maximize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-maximize" - ] - }, - { - "description": "window:deny-minimize -> Denies the minimize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-minimize" - ] - }, - { - "description": "window:deny-outer-position -> Denies the outer_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-outer-position" - ] - }, - { - "description": "window:deny-outer-size -> Denies the outer_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-outer-size" - ] - }, - { - "description": "window:deny-primary-monitor -> Denies the primary_monitor command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-primary-monitor" - ] - }, - { - "description": "window:deny-request-user-attention -> Denies the request_user_attention command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-request-user-attention" - ] - }, - { - "description": "window:deny-scale-factor -> Denies the scale_factor command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-scale-factor" - ] - }, - { - "description": "window:deny-set-always-on-bottom -> Denies the set_always_on_bottom command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-always-on-bottom" - ] - }, - { - "description": "window:deny-set-always-on-top -> Denies the set_always_on_top command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-always-on-top" - ] - }, - { - "description": "window:deny-set-closable -> Denies the set_closable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-closable" - ] - }, - { - "description": "window:deny-set-content-protected -> Denies the set_content_protected command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-content-protected" - ] - }, - { - "description": "window:deny-set-cursor-grab -> Denies the set_cursor_grab command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-cursor-grab" - ] - }, - { - "description": "window:deny-set-cursor-icon -> Denies the set_cursor_icon command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-cursor-icon" - ] - }, - { - "description": "window:deny-set-cursor-position -> Denies the set_cursor_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-cursor-position" - ] - }, - { - "description": "window:deny-set-cursor-visible -> Denies the set_cursor_visible command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-cursor-visible" - ] - }, - { - "description": "window:deny-set-decorations -> Denies the set_decorations command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-decorations" - ] - }, - { - "description": "window:deny-set-effects -> Denies the set_effects command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-effects" - ] - }, - { - "description": "window:deny-set-focus -> Denies the set_focus command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-focus" - ] - }, - { - "description": "window:deny-set-fullscreen -> Denies the set_fullscreen command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-fullscreen" - ] - }, - { - "description": "window:deny-set-icon -> Denies the set_icon command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-icon" - ] - }, - { - "description": "window:deny-set-ignore-cursor-events -> Denies the set_ignore_cursor_events command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-ignore-cursor-events" - ] - }, - { - "description": "window:deny-set-max-size -> Denies the set_max_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-max-size" - ] - }, - { - "description": "window:deny-set-maximizable -> Denies the set_maximizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-maximizable" - ] - }, - { - "description": "window:deny-set-min-size -> Denies the set_min_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-min-size" - ] - }, - { - "description": "window:deny-set-minimizable -> Denies the set_minimizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-minimizable" - ] - }, - { - "description": "window:deny-set-position -> Denies the set_position command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-position" - ] - }, - { - "description": "window:deny-set-progress-bar -> Denies the set_progress_bar command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-progress-bar" - ] - }, - { - "description": "window:deny-set-resizable -> Denies the set_resizable command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-resizable" - ] - }, - { - "description": "window:deny-set-shadow -> Denies the set_shadow command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-shadow" - ] - }, - { - "description": "window:deny-set-size -> Denies the set_size command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-size" - ] - }, - { - "description": "window:deny-set-skip-taskbar -> Denies the set_skip_taskbar command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-skip-taskbar" - ] - }, - { - "description": "window:deny-set-title -> Denies the set_title command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-title" - ] - }, - { - "description": "window:deny-set-visible-on-all-workspaces -> Denies the set_visible_on_all_workspaces command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-set-visible-on-all-workspaces" - ] - }, - { - "description": "window:deny-show -> Denies the show command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-show" - ] - }, - { - "description": "window:deny-start-dragging -> Denies the start_dragging command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-start-dragging" - ] - }, - { - "description": "window:deny-theme -> Denies the theme command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-theme" - ] - }, - { - "description": "window:deny-title -> Denies the title command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-title" - ] - }, - { - "description": "window:deny-toggle-maximize -> Denies the toggle_maximize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-toggle-maximize" - ] - }, - { - "description": "window:deny-unmaximize -> Denies the unmaximize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-unmaximize" - ] - }, - { - "description": "window:deny-unminimize -> Denies the unminimize command without any pre-configured scope.", - "type": "string", - "enum": [ - "window:deny-unminimize" - ] - } - ] - }, - "Value": { - "description": "All supported ACL values.", - "anyOf": [ - { - "description": "Represents a null JSON value.", - "type": "null" - }, - { - "description": "Represents a [`bool`].", - "type": "boolean" - }, - { - "description": "Represents a valid ACL [`Number`].", - "allOf": [ - { - "$ref": "#/definitions/Number" - } - ] - }, - { - "description": "Represents a [`String`].", - "type": "string" - }, - { - "description": "Represents a list of other [`Value`]s.", - "type": "array", - "items": { - "$ref": "#/definitions/Value" - } - }, - { - "description": "Represents a map of [`String`] keys to [`Value`]s.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Value" - } - } - ] - }, - "Number": { - "description": "A valid ACL number.", - "anyOf": [ - { - "description": "Represents an [`i64`].", - "type": "integer", - "format": "int64" - }, - { - "description": "Represents a [`f64`].", - "type": "number", - "format": "double" - } - ] - }, - "Target": { - "description": "Platform target.", - "oneOf": [ - { - "description": "MacOS.", - "type": "string", - "enum": [ - "macOS" - ] - }, - { - "description": "Windows.", - "type": "string", - "enum": [ - "windows" - ] - }, - { - "description": "Linux.", - "type": "string", - "enum": [ - "linux" - ] - }, - { - "description": "Android.", - "type": "string", - "enum": [ - "android" - ] - }, - { - "description": "iOS.", - "type": "string", - "enum": [ - "iOS" - ] - } - ] - }, - "ShellAllowedArg": { - "description": "A command argument allowed to be executed by the webview API.", - "anyOf": [ - { - "description": "A non-configurable argument that is passed to the command in the order it was specified.", - "type": "string" - }, - { - "description": "A variable that is set while calling the command from the webview API.", - "type": "object", - "required": [ - "validator" - ], - "properties": { - "validator": { - "description": "[regex] validator to require passed values to conform to an expected input.\n\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\n\n[regex]: https://docs.rs/regex/latest/regex/#syntax", - "type": "string" - } - }, - "additionalProperties": false - } - ] - }, - "ShellAllowedArgs": { - "description": "A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration.", - "anyOf": [ - { - "description": "Use a simple boolean to allow all or disable all arguments to this command configuration.", - "type": "boolean" - }, - { - "description": "A specific set of [`ShellAllowedArg`] that are valid to call for the command configuration.", - "type": "array", - "items": { - "$ref": "#/definitions/ShellAllowedArg" - } - } - ] - } - } -} \ No newline at end of file diff --git a/examples/api/src-tauri/src/lib.rs b/examples/api/src-tauri/src/lib.rs index b40290bd..701f6731 100644 --- a/examples/api/src-tauri/src/lib.rs +++ b/examples/api/src-tauri/src/lib.rs @@ -7,7 +7,10 @@ mod cmd; mod tray; use serde::Serialize; -use tauri::{webview::WebviewWindowBuilder, App, AppHandle, Manager, RunEvent, WebviewUrl}; +use tauri::{ + webview::{PageLoadEvent, WebviewWindowBuilder}, + App, AppHandle, Emitter, Listener, RunEvent, WebviewUrl, +}; #[derive(Clone, Serialize)] struct Reply { @@ -34,6 +37,7 @@ pub fn run() { .plugin(tauri_plugin_os::init()) .plugin(tauri_plugin_process::init()) .plugin(tauri_plugin_shell::init()) + .plugin(tauri_plugin_store::Builder::default().build()) .setup(move |app| { #[cfg(desktop)] { @@ -41,6 +45,8 @@ pub fn run() { app.handle().plugin(tauri_plugin_cli::init())?; app.handle() .plugin(tauri_plugin_global_shortcut::Builder::new().build())?; + app.handle() + .plugin(tauri_plugin_window_state::Builder::new().build())?; app.handle() .plugin(tauri_plugin_updater::Builder::new().build())?; } @@ -49,6 +55,8 @@ pub fn run() { app.handle().plugin(tauri_plugin_barcode_scanner::init())?; app.handle().plugin(tauri_plugin_nfc::init())?; app.handle().plugin(tauri_plugin_biometric::init())?; + app.handle().plugin(tauri_plugin_geolocation::init())?; + app.handle().plugin(tauri_plugin_haptics::init())?; } let mut webview_window_builder = @@ -60,7 +68,7 @@ pub fn run() { .title("Tauri API Validation") .inner_size(1000., 800.) .min_inner_size(600., 400.) - .content_protected(true); + .visible(false); } #[cfg(target_os = "windows")] @@ -107,18 +115,20 @@ pub fn run() { Ok(()) }) - .on_page_load(|webview, _| { - let webview_ = webview.clone(); - webview.listen("js-event", move |event| { - println!("got js-event with message '{:?}'", event.payload()); - let reply = Reply { - data: "something else".to_string(), - }; - - webview_ - .emit("rust-event", Some(reply)) - .expect("failed to emit"); - }); + .on_page_load(|webview, payload| { + if payload.event() == PageLoadEvent::Finished { + let webview_ = webview.clone(); + webview.listen("js-event", move |event| { + println!("got js-event with message '{:?}'", event.payload()); + let reply = Reply { + data: "something else".to_string(), + }; + + webview_ + .emit("rust-event", Some(reply)) + .expect("failed to emit"); + }); + } }); #[cfg(target_os = "macos")] @@ -132,7 +142,7 @@ pub fn run() { cmd::log_operation, cmd::perform_request, ]) - .build(tauri::tauri_build_context!()) + .build(tauri::generate_context!()) .expect("error while building tauri application"); #[cfg(target_os = "macos")] @@ -140,10 +150,12 @@ pub fn run() { app.run(move |_app_handle, _event| { #[cfg(desktop)] - if let RunEvent::ExitRequested { api, .. } = &_event { - // Keep the event loop running even if all windows are closed - // This allow us to catch system tray events when there is no window - api.prevent_exit(); + if let RunEvent::ExitRequested { code, api, .. } = &_event { + if code.is_none() { + // Keep the event loop running even if all windows are closed + // This allow us to catch system tray events when there is no window + api.prevent_exit(); + } } }) } diff --git a/examples/api/src-tauri/src/tray.rs b/examples/api/src-tauri/src/tray.rs index 470764f8..bf3ba5d6 100644 --- a/examples/api/src-tauri/src/tray.rs +++ b/examples/api/src-tauri/src/tray.rs @@ -5,7 +5,7 @@ use std::sync::atomic::{AtomicBool, Ordering}; use tauri::{ menu::{Menu, MenuItem}, - tray::{ClickType, TrayIconBuilder}, + tray::{MouseButton, MouseButtonState, TrayIconBuilder, TrayIconEvent}, Manager, Runtime, WebviewUrl, WebviewWindowBuilder, }; @@ -79,11 +79,15 @@ pub fn create_tray(app: &tauri::AppHandle) -> tauri::Result<()> { } i @ "icon-1" | i @ "icon-2" => { if let Some(tray) = app.tray_by_id("tray-1") { - let _ = tray.set_icon(Some(tauri::Icon::Raw(if i == "icon-1" { - include_bytes!("../icons/icon.ico").to_vec() + let _ = tray.set_icon(Some(if i == "icon-1" { + tauri::image::Image::from_bytes(include_bytes!("../icons/icon.ico")) + .unwrap() } else { - include_bytes!("../icons/tray_icon_with_transparency.png").to_vec() - }))); + tauri::image::Image::from_bytes(include_bytes!( + "../icons/tray_icon_with_transparency.png" + )) + .unwrap() + })); } } "switch-menu" => { @@ -103,7 +107,12 @@ pub fn create_tray(app: &tauri::AppHandle) -> tauri::Result<()> { _ => {} }) .on_tray_icon_event(|tray, event| { - if event.click_type == ClickType::Left { + if let TrayIconEvent::Click { + button_state: MouseButtonState::Down, + button: MouseButton::Left, + .. + } = event + { let app = tray.app_handle(); if let Some(window) = app.get_webview_window("main") { let _ = window.show(); diff --git a/examples/api/src-tauri/tauri.conf.json b/examples/api/src-tauri/tauri.conf.json index ec3190ef..00b095be 100644 --- a/examples/api/src-tauri/tauri.conf.json +++ b/examples/api/src-tauri/tauri.conf.json @@ -1,13 +1,13 @@ { - "$schema": "../node_modules/@tauri-apps/cli/schema.json", + "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", "productName": "Tauri API", "version": "2.0.0", "identifier": "com.tauri.api", "build": { "devUrl": "http://localhost:5173", "frontendDist": "../dist", - "beforeDevCommand": "yarn dev", - "beforeBuildCommand": "yarn build" + "beforeDevCommand": "pnpm dev", + "beforeBuildCommand": "pnpm build" }, "app": { "withGlobalTauri": true, @@ -100,6 +100,9 @@ } } } + }, + "iOS": { + "minimumSystemVersion": "14.0" } } } diff --git a/examples/api/src/App.svelte b/examples/api/src/App.svelte index 117afa22..ea626fa2 100644 --- a/examples/api/src/App.svelte +++ b/examples/api/src/App.svelte @@ -1,197 +1,208 @@ @@ -326,7 +335,7 @@ children:items-center children:justify-center" > @@ -344,7 +353,7 @@
@@ -387,7 +396,7 @@ bg-darkPrimaryLighter transition-colors-250 overflow-hidden grid select-none px-2" > open("https://tauri.app/")} + on:click={() => open('https://tauri.app/')} class="self-center p-7 cursor-pointer" src="tauri_logo.png" alt="Tauri logo" @@ -443,8 +452,8 @@ href="##" class="nv {selected === view ? 'nv_selected' : ''}" on:click={() => { - select(view); - isSideBarOpen = false; + select(view) + isSideBarOpen = false }} >
@@ -492,7 +501,10 @@
-
+
{#each $messages as r} {@html r.html} {/each} diff --git a/examples/api/src/app.css b/examples/api/src/app.css index 6987e423..6e8ae62d 100644 --- a/examples/api/src/app.css +++ b/examples/api/src/app.css @@ -5,7 +5,7 @@ * { box-sizing: border-box; - font-family: "Rubik", sans-serif; + font-family: 'Rubik', sans-serif; } ::-webkit-scrollbar { diff --git a/examples/api/src/lib/utils.js b/examples/api/src/lib/utils.js new file mode 100644 index 00000000..a5ddc058 --- /dev/null +++ b/examples/api/src/lib/utils.js @@ -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) +} diff --git a/examples/api/src/main.js b/examples/api/src/main.js index f9785b74..f31a3eb8 100644 --- a/examples/api/src/main.js +++ b/examples/api/src/main.js @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import "uno.css"; -import "./app.css"; -import App from "./App.svelte"; +import 'uno.css' +import './app.css' +import App from './App.svelte' const app = new App({ - target: document.querySelector("#app"), -}); + target: document.querySelector('#app') +}) -export default app; +export default app diff --git a/examples/api/src/views/Clipboard.svelte b/examples/api/src/views/Clipboard.svelte index f571b2ee..f16a7d71 100644 --- a/examples/api/src/views/Clipboard.svelte +++ b/examples/api/src/views/Clipboard.svelte @@ -1,23 +1,59 @@ @@ -27,6 +63,7 @@ placeholder="Text to write to the clipboard" bind:value={text} /> - + +
diff --git a/examples/api/src/views/Communication.svelte b/examples/api/src/views/Communication.svelte index a9f4826f..f34dcd3e 100644 --- a/examples/api/src/views/Communication.svelte +++ b/examples/api/src/views/Communication.svelte @@ -1,15 +1,15 @@ diff --git a/examples/api/src/views/Dialog.svelte b/examples/api/src/views/Dialog.svelte index 3e594c90..462eecff 100644 --- a/examples/api/src/views/Dialog.svelte +++ b/examples/api/src/views/Dialog.svelte @@ -23,11 +23,7 @@ async function prompt() { confirm("Do you want to do something?") - .then((res) => - onMessage( - res ? "Yes" : "No" - ) - ) + .then((res) => onMessage(res ? "Yes" : "No")) .catch(onMessage); } @@ -67,14 +63,15 @@ if (Array.isArray(res)) { onMessage(res); } else { - var pathToRead = typeof res === "string" ? res : res.path; + var pathToRead = res; var isFile = pathToRead.match(/\S+\.\S+$/g); readFile(pathToRead) .then(function (response) { if (isFile) { if ( pathToRead.includes(".png") || - pathToRead.includes(".jpg") + pathToRead.includes(".jpg") || + pathToRead.includes(".jpeg") ) { arrayBufferToBase64( new Uint8Array(response), @@ -144,5 +141,7 @@ >Open save dialog - + diff --git a/examples/api/src/views/FileSystem.svelte b/examples/api/src/views/FileSystem.svelte index dce83663..f7222ef8 100644 --- a/examples/api/src/views/FileSystem.svelte +++ b/examples/api/src/views/FileSystem.svelte @@ -1,6 +1,7 @@ + + diff --git a/examples/api/src/views/Http.svelte b/examples/api/src/views/Http.svelte index 842816b8..e1848803 100644 --- a/examples/api/src/views/Http.svelte +++ b/examples/api/src/views/Http.svelte @@ -53,7 +53,7 @@ const form = new FormData(); form.append("foo", foo); form.append("bar", bar); - const response = await tauriFetch("http://localhost:3003", { + const response = await tauriFetch("http://localhost:3003/tauri", { method: "POST", body: form, }); diff --git a/examples/api/src/views/Shell.svelte b/examples/api/src/views/Shell.svelte index 5f5e2d25..faaa8c4c 100644 --- a/examples/api/src/views/Shell.svelte +++ b/examples/api/src/views/Shell.svelte @@ -59,7 +59,7 @@ } function writeToStdin() { - child.write(stdin).catch(onMessage); + child.write(`${stdin}\n`).catch(onMessage); } diff --git a/examples/api/src/views/Shortcuts.svelte b/examples/api/src/views/Shortcuts.svelte index cdcc9066..41d0271d 100644 --- a/examples/api/src/views/Shortcuts.svelte +++ b/examples/api/src/views/Shortcuts.svelte @@ -1,9 +1,8 @@ + +
+
+
+ Key: + +
+ +
+ Value: + +
+ +
+ + + + +
+
+ +
+ {#each Object.entries(cache) as [k, v]} +
{k} = {v}
+ {/each} +
+
diff --git a/examples/api/src/views/Updater.svelte b/examples/api/src/views/Updater.svelte index 808e5868..819c65e0 100644 --- a/examples/api/src/views/Updater.svelte +++ b/examples/api/src/views/Updater.svelte @@ -12,8 +12,8 @@ isChecking = true; try { const update = await check(); - onMessage(`Should update: ${update.response.available}`); - onMessage(update.response); + onMessage(`Should update: ${update.available}`); + onMessage(update); newUpdate = update; } catch (e) { diff --git a/examples/api/unocss.config.js b/examples/api/unocss.config.js index 44d926cd..d2069a49 100644 --- a/examples/api/unocss.config.js +++ b/examples/api/unocss.config.js @@ -2,43 +2,43 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { defineConfig, presetIcons, presetUno, presetWebFonts } from "unocss"; -import extractorSvelte from "@unocss/extractor-svelte"; +import { defineConfig, presetIcons, presetUno, presetWebFonts } from 'unocss' +import extractorSvelte from '@unocss/extractor-svelte' export default defineConfig({ theme: { colors: { - primary: "#FFFFFF", - primaryLighter: "#e9ecef", - darkPrimary: "#1B1B1D", - darkPrimaryLighter: "#242526", - primaryText: "#1C1E21", - darkPrimaryText: "#E3E3E3", - secondaryText: "#858A91", - darkSecondaryText: "#C2C5CA", - accent: "#3578E5", - accentDark: "#306cce", - accentDarker: "#2d66c3", - accentDarkest: "#2554a0", - accentLight: "#538ce9", - accentLighter: "#72a1ed", - accentLightest: "#9abcf2", - accentText: "#FFFFFF", - darkAccent: "#67d6ed", - darkAccentDark: "#49cee9", - darkAccentDarker: "#39cae8", - darkAccentDarkest: "#19b5d5", - darkAccentLight: "#85def1", - darkAccentLighter: "#95e2f2", - darkAccentLightest: "#c2eff8", - darkAccentText: "#1C1E21", - code: "#d6d8da", - codeDark: "#282a2e", - hoverOverlay: "rgba(0,0,0,.05)", - hoverOverlayDarker: "rgba(0,0,0,.1)", - darkHoverOverlay: "hsla(0,0%,100%,.05)", - darkHoverOverlayDarker: "hsla(0,0%,100%,.1)", - }, + primary: '#FFFFFF', + primaryLighter: '#e9ecef', + darkPrimary: '#1B1B1D', + darkPrimaryLighter: '#242526', + primaryText: '#1C1E21', + darkPrimaryText: '#E3E3E3', + secondaryText: '#858A91', + darkSecondaryText: '#C2C5CA', + accent: '#3578E5', + accentDark: '#306cce', + accentDarker: '#2d66c3', + accentDarkest: '#2554a0', + accentLight: '#538ce9', + accentLighter: '#72a1ed', + accentLightest: '#9abcf2', + accentText: '#FFFFFF', + darkAccent: '#67d6ed', + darkAccentDark: '#49cee9', + darkAccentDarker: '#39cae8', + darkAccentDarkest: '#19b5d5', + darkAccentLight: '#85def1', + darkAccentLighter: '#95e2f2', + darkAccentLightest: '#c2eff8', + darkAccentText: '#1C1E21', + code: '#d6d8da', + codeDark: '#282a2e', + hoverOverlay: 'rgba(0,0,0,.05)', + hoverOverlayDarker: 'rgba(0,0,0,.1)', + darkHoverOverlay: 'hsla(0,0%,100%,.05)', + darkHoverOverlayDarker: 'hsla(0,0%,100%,.1)' + } }, preflights: [ { @@ -54,7 +54,7 @@ export default defineConfig({ code { font-size: ${theme.fontSize.xs[0]}; font-family: ${theme.fontFamily.mono}; - border-radius: ${theme.borderRadius["DEFAULT"]}; + border-radius: ${theme.borderRadius['DEFAULT']}; background-color: ${theme.colors.code}; } @@ -66,8 +66,8 @@ export default defineConfig({ .dark code { background-color: ${theme.colors.codeDark}; } - `, - }, + ` + } ], shortcuts: { btn: `select-none outline-none shadow-md p-2 rd-1 text-primaryText border-none font-400 dark:font-600 @@ -81,20 +81,20 @@ export default defineConfig({ note: `decoration-none flex-inline items-center relative p-2 rd-1 border-l-4 border-accent dark:border-darkAccent bg-accent/10 dark:bg-darkAccent/10`, - "note-red": - "note bg-red-700/10 dark:bg-red-700/10 after:bg-red-700 dark:after:bg-red-700", + 'note-red': + 'note bg-red-700/10 dark:bg-red-700/10 after:bg-red-700 dark:after:bg-red-700', input: - "h-10 flex items-center outline-none border-none p-2 rd-1 shadow-md bg-primaryLighter dark:bg-darkPrimaryLighter text-primaryText dark:text-darkPrimaryText", + 'h-10 flex items-center outline-none border-none p-2 rd-1 shadow-md bg-primaryLighter dark:bg-darkPrimaryLighter text-primaryText dark:text-darkPrimaryText' }, presets: [ presetUno(), presetIcons(), presetWebFonts({ fonts: { - sans: "Rubik", - mono: ["Fira Code", "Fira Mono:400,700"], - }, - }), + sans: 'Rubik', + mono: ['Fira Code', 'Fira Mono:400,700'] + } + }) ], - extractors: [extractorSvelte], -}); + extractors: [extractorSvelte] +}) diff --git a/examples/api/vite.config.js b/examples/api/vite.config.js index e86960b4..f7d87db8 100644 --- a/examples/api/vite.config.js +++ b/examples/api/vite.config.js @@ -2,19 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { defineConfig } from "vite"; -import Unocss from "unocss/vite"; -import { svelte } from "@sveltejs/vite-plugin-svelte"; -import { internalIpV4 } from "internal-ip"; -import process from "process"; +import { defineConfig } from 'vite' +import Unocss from 'unocss/vite' +import { svelte } from '@sveltejs/vite-plugin-svelte' +import process from 'process' + +const host = process.env.TAURI_DEV_HOST // https://vitejs.dev/config/ export default defineConfig(async () => { - const host = - process.env.TAURI_ENV_PLATFORM === "android" || - process.env.TAURI_ENV_PLATFORM === "ios" - ? await internalIpV4() - : "localhost"; return { plugins: [Unocss(), svelte()], build: { @@ -22,22 +18,17 @@ export default defineConfig(async () => { output: { entryFileNames: `assets/[name].js`, chunkFileNames: `assets/[name].js`, - assetFileNames: `assets/[name].[ext]`, - }, - }, + assetFileNames: `assets/[name].[ext]` + } + } }, server: { - host: "0.0.0.0", + host: host || false, port: 5173, strictPort: true, - hmr: { - protocol: "ws", - host, - port: 5183, - }, fs: { - allow: [".", "../../tooling/api/dist"], - }, - }, - }; -}); + allow: ['.', '../../tooling/api/dist'] + } + } + } +}) diff --git a/package.json b/package.json index 90d7d6de..3daae86c 100644 --- a/package.json +++ b/package.json @@ -1,44 +1,35 @@ { "name": "plugins-workspace", "private": true, - "license": "MIT or APACHE-2.0", + "license": "MIT OR Apache-2.0", "type": "module", "scripts": { "build": "pnpm run -r --parallel --filter !plugins-workspace --filter !\"./plugins/*/examples/**\" --filter !\"./examples/*\" build", "lint": "eslint .", - "format": "prettier --write \"./**/*.{cjs,mjs,js,jsx,mts,ts,tsx,html,css,json}\" --ignore-path .prettierignore", - "format-check": "prettier --check \"./**/*.{cjs,mjs,js,jsx,mts,ts,tsx,html,css,json}\" --ignore-path .prettierignore" + "format": "prettier --write .", + "format:check": "prettier --check ." }, "devDependencies": { - "@rollup/plugin-node-resolve": "15.2.3", + "@eslint/js": "9.13.0", + "@rollup/plugin-node-resolve": "15.3.0", "@rollup/plugin-terser": "0.4.4", "@rollup/plugin-typescript": "11.1.6", - "@typescript-eslint/eslint-plugin": "6.20.0", - "@typescript-eslint/parser": "6.20.0", - "covector": "^0.10.2", - "eslint": "8.56.0", + "@types/eslint__js": "8.42.3", + "covector": "^0.12.3", + "eslint": "9.13.0", "eslint-config-prettier": "9.1.0", - "eslint-config-standard-with-typescript": "43.0.1", - "eslint-plugin-import": "2.29.1", - "eslint-plugin-n": "16.6.2", - "eslint-plugin-promise": "6.1.1", - "eslint-plugin-security": "2.1.0", - "prettier": "3.2.2", - "rollup": "4.9.6", - "typescript": "5.3.3" + "eslint-plugin-security": "3.0.1", + "prettier": "3.3.3", + "rollup": "4.22.4", + "tslib": "2.7.0", + "typescript": "5.6.3", + "typescript-eslint": "8.10.0" }, "resolutions": { "semver": ">=7.5.2", "optionator": ">=0.9.3" }, "engines": { - "pnpm": ">=7.33.1" - }, - "pnpm": { - "auditConfig": { - "ignoreCves": [ - "CVE-2023-46115" - ] - } + "pnpm": "^9.0.0" } } diff --git a/plugins/authenticator/.gitignore b/plugins/authenticator/.gitignore deleted file mode 100644 index b512c09d..00000000 --- a/plugins/authenticator/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/plugins/authenticator/CHANGELOG.md b/plugins/authenticator/CHANGELOG.md deleted file mode 100644 index 84b71e6f..00000000 --- a/plugins/authenticator/CHANGELOG.md +++ /dev/null @@ -1,44 +0,0 @@ -# Changelog - -## \[2.0.0-beta.1] - -- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - -## \[2.0.0-beta.0] - -- [`d198c01`](https://github.com/tauri-apps/plugins-workspace/commit/d198c014863ee260cb0de88a14b7fc4356ef7474)([#862](https://github.com/tauri-apps/plugins-workspace/pull/862)) Update to tauri beta. - -## \[2.0.0-alpha.5] - -- [`387c2f9`](https://github.com/tauri-apps/plugins-workspace/commit/387c2f9e0ce4c75c07ffa3fd76391a25b58f5daf)([#802](https://github.com/tauri-apps/plugins-workspace/pull/802)) Update to @tauri-apps/api v2.0.0-alpha.13. - -## \[2.0.0-alpha.4] - -- [`387c2f9`](https://github.com/tauri-apps/plugins-workspace/commit/387c2f9e0ce4c75c07ffa3fd76391a25b58f5daf)([#802](https://github.com/tauri-apps/plugins-workspace/pull/802)) Update to @tauri-apps/api v2.0.0-alpha.12. - -## \[2.0.0-alpha.3] - -- [`e438e0a`](https://github.com/tauri-apps/plugins-workspace/commit/e438e0a62d4b430a5159f05f13ecd397dd891a0d)([#676](https://github.com/tauri-apps/plugins-workspace/pull/676)) Update to @tauri-apps/api v2.0.0-alpha.11. - -## \[2.0.0-alpha.2] - -- [`5c13736`](https://github.com/tauri-apps/plugins-workspace/commit/5c137365c60790e8d4037d449e8237aa3fffdab0)([#673](https://github.com/tauri-apps/plugins-workspace/pull/673)) Update to @tauri-apps/api v2.0.0-alpha.9. - -## \[2.0.0-alpha.2] - -- [`4e2cef9`](https://github.com/tauri-apps/plugins-workspace/commit/4e2cef9b702bbbb9cf4ee17de50791cb21f1b2a4)([#593](https://github.com/tauri-apps/plugins-workspace/pull/593)) Update to alpha.12. - -## \[2.0.0-alpha.1] - -- [`d74fc0a`](https://github.com/tauri-apps/plugins-workspace/commit/d74fc0a097996e90a37be8f57d50b7d1f6ca616f)([#555](https://github.com/tauri-apps/plugins-workspace/pull/555)) Update 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! - 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! - ae67\`]\(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! diff --git a/plugins/authenticator/Cargo.toml b/plugins/authenticator/Cargo.toml deleted file mode 100644 index 9963b63e..00000000 --- a/plugins/authenticator/Cargo.toml +++ /dev/null @@ -1,37 +0,0 @@ -[package] -name = "tauri-plugin-authenticator" -version = "2.0.0-beta.1" -description = "Use hardware security-keys in your Tauri App." -authors = { workspace = true } -license = { workspace = true } -edition = { workspace = true } -rust-version = { workspace = true } -links = "tauri-plugin-authenticator" - -[package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] - -[build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } - -[dependencies] -serde = { workspace = true } -serde_json = { workspace = true } -tauri = { workspace = true } -log = { workspace = true } -thiserror = { workspace = true } - -[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies] -authenticator = "0.3.1" -once_cell = "1" -sha2 = "0.10" -base64 = "0.21" -chrono = "0.4" -bytes = "1" -byteorder = "1" -openssl = "0.10" - -[dev-dependencies] -rand = "0.8" -rusty-fork = "0.3" diff --git a/plugins/authenticator/README.md b/plugins/authenticator/README.md deleted file mode 100644 index 13c75a5f..00000000 --- a/plugins/authenticator/README.md +++ /dev/null @@ -1,143 +0,0 @@ -![plugin-authenticator](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/authenticator/banner.png) - -Use hardware security-keys in your Tauri App. - -- Supported platforms: Windows, Linux, FreeBSD, NetBSD, OpenBSD, and macOS. - -## Install - -_This plugin requires a Rust version of at least **1.75**_ - -There are three general methods of installation that we can recommend. - -1. Use crates.io and npm (easiest and requires you to trust that our publishing pipeline worked) -2. Pull sources directly from Github using git tags / revision hashes (most secure) -3. Git submodule install this repo in your tauri project and then use the file protocol to ingest the source (most secure, but inconvenient to use) - -Install the authenticator plugin by adding the following lines to your `Cargo.toml` file: - -`src-tauri/Cargo.toml` - -```toml -# you can add the dependencies on the `[dependencies]` section if you do not target mobile -[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies] -tauri-plugin-authenticator = "2.0.0-beta" -# alternatively with Git: -tauri-plugin-authenticator = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } -``` - -You can install the JavaScript Guest bindings using your preferred JavaScript package manager: - -> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. - -```sh -pnpm add @tauri-apps/plugin-authenticator -# or -npm add @tauri-apps/plugin-authenticator -# or -yarn add @tauri-apps/plugin-authenticator -``` - -Alternatively with Git: - -```sh -pnpm add https://github.com/tauri-apps/tauri-plugin-authenticator#v2 -# or -npm add https://github.com/tauri-apps/tauri-plugin-authenticator#v2 -# or -yarn add https://github.com/tauri-apps/tauri-plugin-authenticator#v2 -``` - -## Usage - -First, you need to register the authenticator plugin with Tauri: - -`src-tauri/src/main.rs` - -```rust -fn main() { - tauri::Builder::default() - .setup(|app| { - #[cfg(desktop)] - app.handle().plugin(tauri_plugin_authenticator::init())?; - Ok(()) - }) - .run(tauri::generate_context!()) - .expect("error while running tauri application"); -} -``` - -Afterwards, all the plugin's APIs are available through the JavaScript guest bindings: - -```javascript -import { Authenticator } from "@tauri-apps/plugin-authenticator"; - -const auth = new Authenticator(); -auth.init(); // initialize transports - -// generate a 32-bytes long random challenge -const arr = new Uint32Array(32); -window.crypto.getRandomValues(arr); -const b64 = btoa(String.fromCharCode.apply(null, arr)); -// web-safe base64 -const challenge = b64.replace(/\+/g, "-").replace(/\//g, "_"); - -const domain = "https://tauri.app"; - -// attempt to register with the security key -const json = await auth.register(challenge, domain); -const registerResult = JSON.parse(json); - -// verify the registration was successful -const r2 = await auth.verifyRegistration( - challenge, - app, - registerResult.registerData, - registerResult.clientData, -); -const j2 = JSON.parse(r2); - -// sign some data -const json = await auth.sign(challenge, app, keyHandle); -const signData = JSON.parse(json); - -// verify the signature again -const counter = await auth.verifySignature( - challenge, - app, - signData.signData, - clientData, - keyHandle, - pubkey, -); - -if (counter && counter > 0) { - console.log("SUCCESS!"); -} -``` - -## Contributing - -PRs accepted. Please make sure to read the Contributing Guide before making a pull request. - -## Partners - - - - - - - -
- - CrabNebula - -
- -For the complete list of sponsors please visit our [website](https://tauri.app#sponsors) and [Open Collective](https://opencollective.com/tauri). - -## License - -Code: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy. - -MIT or MIT/Apache 2.0 where applicable. diff --git a/plugins/authenticator/banner.png b/plugins/authenticator/banner.png deleted file mode 100644 index 405dc601..00000000 Binary files a/plugins/authenticator/banner.png and /dev/null differ diff --git a/plugins/authenticator/build.rs b/plugins/authenticator/build.rs deleted file mode 100644 index 993df57a..00000000 --- a/plugins/authenticator/build.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -const COMMANDS: &[&str] = &[ - "init_auth", - "register", - "verify_registration", - "sign", - "verify_signature", -]; - -fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); -} diff --git a/plugins/authenticator/guest-js/index.ts b/plugins/authenticator/guest-js/index.ts deleted file mode 100644 index b1446eea..00000000 --- a/plugins/authenticator/guest-js/index.ts +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -import { invoke } from "@tauri-apps/api/core"; - -export class Authenticator { - async init(): Promise { - return await invoke("plugin:authenticator|init_auth"); - } - - async register(challenge: string, application: string): Promise { - return await invoke("plugin:authenticator|register", { - timeout: 10000, - challenge, - application, - }); - } - - async verifyRegistration( - challenge: string, - application: string, - registerData: string, - clientData: string, - ): Promise { - return await invoke("plugin:authenticator|verify_registration", { - challenge, - application, - registerData, - clientData, - }); - } - - async sign( - challenge: string, - application: string, - keyHandle: string, - ): Promise { - return await invoke("plugin:authenticator|sign", { - timeout: 10000, - challenge, - application, - keyHandle, - }); - } - - async verifySignature( - challenge: string, - application: string, - signData: string, - clientData: string, - keyHandle: string, - pubkey: string, - ): Promise { - return await invoke("plugin:authenticator|verify_signature", { - challenge, - application, - signData, - clientData, - keyHandle, - pubkey, - }); - } -} diff --git a/plugins/authenticator/permissions/autogenerated/commands/init_auth.toml b/plugins/authenticator/permissions/autogenerated/commands/init_auth.toml deleted file mode 100644 index 4781773e..00000000 --- a/plugins/authenticator/permissions/autogenerated/commands/init_auth.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-init-auth" -description = "Enables the init_auth command without any pre-configured scope." -commands.allow = ["init_auth"] - -[[permission]] -identifier = "deny-init-auth" -description = "Denies the init_auth command without any pre-configured scope." -commands.deny = ["init_auth"] diff --git a/plugins/authenticator/permissions/autogenerated/commands/sign.toml b/plugins/authenticator/permissions/autogenerated/commands/sign.toml deleted file mode 100644 index f8b6a778..00000000 --- a/plugins/authenticator/permissions/autogenerated/commands/sign.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-sign" -description = "Enables the sign command without any pre-configured scope." -commands.allow = ["sign"] - -[[permission]] -identifier = "deny-sign" -description = "Denies the sign command without any pre-configured scope." -commands.deny = ["sign"] diff --git a/plugins/authenticator/permissions/autogenerated/commands/verify_registration.toml b/plugins/authenticator/permissions/autogenerated/commands/verify_registration.toml deleted file mode 100644 index f6b15d58..00000000 --- a/plugins/authenticator/permissions/autogenerated/commands/verify_registration.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-verify-registration" -description = "Enables the verify_registration command without any pre-configured scope." -commands.allow = ["verify_registration"] - -[[permission]] -identifier = "deny-verify-registration" -description = "Denies the verify_registration command without any pre-configured scope." -commands.deny = ["verify_registration"] diff --git a/plugins/authenticator/permissions/autogenerated/commands/verify_signature.toml b/plugins/authenticator/permissions/autogenerated/commands/verify_signature.toml deleted file mode 100644 index 90b24095..00000000 --- a/plugins/authenticator/permissions/autogenerated/commands/verify_signature.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-verify-signature" -description = "Enables the verify_signature command without any pre-configured scope." -commands.allow = ["verify_signature"] - -[[permission]] -identifier = "deny-verify-signature" -description = "Denies the verify_signature command without any pre-configured scope." -commands.deny = ["verify_signature"] diff --git a/plugins/authenticator/permissions/autogenerated/reference.md b/plugins/authenticator/permissions/autogenerated/reference.md deleted file mode 100644 index 8e3cbb52..00000000 --- a/plugins/authenticator/permissions/autogenerated/reference.md +++ /dev/null @@ -1,42 +0,0 @@ -# Permissions - -## allow-init-auth - -Enables the init_auth command without any pre-configured scope. - -## deny-init-auth - -Denies the init_auth command without any pre-configured scope. - -## allow-register - -Enables the register command without any pre-configured scope. - -## deny-register - -Denies the register command without any pre-configured scope. - -## allow-sign - -Enables the sign command without any pre-configured scope. - -## deny-sign - -Denies the sign command without any pre-configured scope. - -## allow-verify-registration - -Enables the verify_registration command without any pre-configured scope. - -## deny-verify-registration - -Denies the verify_registration command without any pre-configured scope. - -## allow-verify-signature - -Enables the verify_signature command without any pre-configured scope. - -## deny-verify-signature - -Denies the verify_signature command without any pre-configured scope. - diff --git a/plugins/authenticator/src/api-iife.js b/plugins/authenticator/src/api-iife.js deleted file mode 100644 index 5a3ceb7d..00000000 --- a/plugins/authenticator/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_AUTHENTICATOR__=function(t){"use strict";async function i(t,i={},a){return window.__TAURI_INTERNALS__.invoke(t,i,a)}"function"==typeof SuppressedError&&SuppressedError;return t.Authenticator=class{async init(){return await i("plugin:authenticator|init_auth")}async register(t,a){return await i("plugin:authenticator|register",{timeout:1e4,challenge:t,application:a})}async verifyRegistration(t,a,e,n){return await i("plugin:authenticator|verify_registration",{challenge:t,application:a,registerData:e,clientData:n})}async sign(t,a,e){return await i("plugin:authenticator|sign",{timeout:1e4,challenge:t,application:a,keyHandle:e})}async verifySignature(t,a,e,n,r,u){return await i("plugin:authenticator|verify_signature",{challenge:t,application:a,signData:e,clientData:n,keyHandle:r,pubkey:u})}},t}({});Object.defineProperty(window.__TAURI__,"authenticator",{value:__TAURI_PLUGIN_AUTHENTICATOR__})} diff --git a/plugins/authenticator/src/auth.rs b/plugins/authenticator/src/auth.rs deleted file mode 100644 index 34bc332b..00000000 --- a/plugins/authenticator/src/auth.rs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -use authenticator::{ - authenticatorservice::AuthenticatorService, statecallback::StateCallback, - AuthenticatorTransports, KeyHandle, RegisterFlags, SignFlags, StatusUpdate, -}; -use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; -use once_cell::sync::Lazy; -use serde::Serialize; -use sha2::{Digest, Sha256}; -use std::io; -use std::sync::mpsc::channel; -use std::{convert::Into, sync::Mutex}; - -static MANAGER: Lazy> = Lazy::new(|| { - let manager = AuthenticatorService::new().expect("The auth service should initialize safely"); - Mutex::new(manager) -}); - -pub fn init_usb() { - let mut manager = MANAGER.lock().unwrap(); - // theres also "add_detected_transports()" in the docs? - manager.add_u2f_usb_hid_platform_transports(); -} - -#[derive(Serialize, Clone)] -#[serde(rename_all = "camelCase")] -pub struct Registration { - pub key_handle: String, - pub pubkey: String, - pub register_data: String, - pub client_data: String, -} - -pub fn register(application: String, timeout: u64, challenge: String) -> crate::Result { - let (chall_bytes, app_bytes, client_data_string) = - format_client_data(application.as_str(), challenge.as_str()); - - // log the status rx? - let (status_tx, _status_rx) = channel::(); - - let mut manager = MANAGER.lock().unwrap(); - - let (register_tx, register_rx) = channel(); - let callback = StateCallback::new(Box::new(move |rv| { - register_tx.send(rv).unwrap(); - })); - - let res = manager.register( - RegisterFlags::empty(), - timeout, - chall_bytes, - app_bytes, - vec![], - status_tx, - callback, - ); - - match res { - Ok(_r) => { - let register_result = register_rx - .recv() - .expect("Problem receiving, unable to continue"); - - if let Err(e) = register_result { - return Err(e.into()); - } - - let (register_data, device_info) = register_result.unwrap(); // error already has been checked - - // println!("Register result: {}", base64::encode(®ister_data)); - println!("Device info: {}", &device_info); - - let (key_handle, public_key) = - _u2f_get_key_handle_and_public_key_from_register_response(®ister_data).unwrap(); - let key_handle_base64 = URL_SAFE_NO_PAD.encode(key_handle); - let public_key_base64 = URL_SAFE_NO_PAD.encode(public_key); - let register_data_base64 = URL_SAFE_NO_PAD.encode(®ister_data); - println!("Key Handle: {}", &key_handle_base64); - println!("Public Key: {}", &public_key_base64); - - // Ok(base64::encode(®ister_data)) - // Ok(key_handle_base64) - let res = serde_json::to_string(&Registration { - key_handle: key_handle_base64, - pubkey: public_key_base64, - register_data: register_data_base64, - client_data: client_data_string, - })?; - Ok(res) - } - Err(e) => Err(e.into()), - } -} - -#[derive(Serialize, Clone)] -#[serde(rename_all = "camelCase")] -pub struct Signature { - pub key_handle: String, - pub sign_data: String, -} - -pub fn sign( - application: String, - timeout: u64, - challenge: String, - key_handle: String, -) -> crate::Result { - let credential = match URL_SAFE_NO_PAD.decode(key_handle) { - Ok(v) => v, - Err(e) => { - return Err(e.into()); - } - }; - let key_handle = KeyHandle { - credential, - transports: AuthenticatorTransports::empty(), - }; - - let (chall_bytes, app_bytes, _) = format_client_data(application.as_str(), challenge.as_str()); - - let (sign_tx, sign_rx) = channel(); - let callback = StateCallback::new(Box::new(move |rv| { - sign_tx.send(rv).unwrap(); - })); - - // log the status rx? - let (status_tx, _status_rx) = channel::(); - - let mut manager = MANAGER.lock().unwrap(); - - let res = manager.sign( - SignFlags::empty(), - timeout, - chall_bytes, - vec![app_bytes], - vec![key_handle], - status_tx, - callback, - ); - match res { - Ok(_v) => { - let sign_result = sign_rx - .recv() - .expect("Problem receiving, unable to continue"); - - if let Err(e) = sign_result { - return Err(e.into()); - } - - let (_, handle_used, sign_data, device_info) = sign_result.unwrap(); - - let sig = URL_SAFE_NO_PAD.encode(sign_data); - - println!("Sign result: {sig}"); - println!("Key handle used: {}", URL_SAFE_NO_PAD.encode(&handle_used)); - println!("Device info: {}", &device_info); - println!("Done."); - - let res = serde_json::to_string(&Signature { - sign_data: sig, - key_handle: URL_SAFE_NO_PAD.encode(&handle_used), - })?; - Ok(res) - } - Err(e) => Err(e.into()), - } -} - -fn format_client_data(application: &str, challenge: &str) -> (Vec, Vec, String) { - let d = - format!(r#"{{"challenge": "{challenge}", "version": "U2F_V2", "appId": "{application}"}}"#); - let mut challenge = Sha256::new(); - challenge.update(d.as_bytes()); - let chall_bytes = challenge.finalize().to_vec(); - - let mut app = Sha256::new(); - app.update(application.as_bytes()); - let app_bytes = app.finalize().to_vec(); - - (chall_bytes, app_bytes, d) -} - -fn _u2f_get_key_handle_and_public_key_from_register_response( - register_response: &[u8], -) -> io::Result<(Vec, Vec)> { - if register_response[0] != 0x05 { - return Err(io::Error::new( - io::ErrorKind::InvalidData, - "Reserved byte not set correctly", - )); - } - - // 1: reserved - // 65: public key - // 1: key handle length - // key handle - // x.509 cert - // sig - - let key_handle_len = register_response[66] as usize; - let mut public_key = register_response.to_owned(); - let mut key_handle = public_key.split_off(67); - let _attestation = key_handle.split_off(key_handle_len); - - // remove fist (reserved) and last (handle len) bytes - let pk: Vec = public_key[1..public_key.len() - 1].to_vec(); - - Ok((key_handle, pk)) -} diff --git a/plugins/authenticator/src/lib.rs b/plugins/authenticator/src/lib.rs deleted file mode 100644 index b9979b7f..00000000 --- a/plugins/authenticator/src/lib.rs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/authenticator/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/authenticator) -//! -//! Use hardware security-keys in your Tauri App. -//! -//! - Supported platforms: Windows, Linux, FreeBSD, NetBSD, OpenBSD, and macOS. - -#![doc( - html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png", - html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png" -)] -#![cfg(not(any(target_os = "android", target_os = "ios")))] - -mod auth; -mod error; -mod u2f; -mod u2f_crate; - -use tauri::{ - plugin::{Builder as PluginBuilder, TauriPlugin}, - Runtime, -}; - -pub use error::Error; -type Result = std::result::Result; - -#[tauri::command] -fn init_auth() { - auth::init_usb(); -} - -#[tauri::command] -fn register(timeout: u64, challenge: String, application: String) -> crate::Result { - auth::register(application, timeout, challenge) -} - -#[tauri::command] -fn verify_registration( - challenge: String, - application: String, - register_data: String, - client_data: String, -) -> crate::Result { - u2f::verify_registration(application, challenge, register_data, client_data) -} - -#[tauri::command] -fn sign( - timeout: u64, - challenge: String, - application: String, - key_handle: String, -) -> crate::Result { - auth::sign(application, timeout, challenge, key_handle) -} - -#[tauri::command] -fn verify_signature( - challenge: String, - application: String, - sign_data: String, - client_data: String, - key_handle: String, - pubkey: String, -) -> crate::Result { - u2f::verify_signature( - application, - challenge, - sign_data, - client_data, - key_handle, - pubkey, - ) -} - -pub fn init() -> TauriPlugin { - PluginBuilder::new("authenticator") - .js_init_script(include_str!("api-iife.js").to_string()) - .invoke_handler(tauri::generate_handler![ - init_auth, - register, - verify_registration, - sign, - verify_signature - ]) - .build() -} diff --git a/plugins/authenticator/src/u2f.rs b/plugins/authenticator/src/u2f.rs deleted file mode 100644 index 9e246094..00000000 --- a/plugins/authenticator/src/u2f.rs +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -use crate::u2f_crate::messages::*; -use crate::u2f_crate::protocol::*; -use crate::u2f_crate::register::*; -use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; -use chrono::prelude::*; -use serde::Serialize; -use std::convert::Into; - -static VERSION: &str = "U2F_V2"; - -pub fn make_challenge(app_id: &str, challenge_bytes: Vec) -> Challenge { - let utc: DateTime = Utc::now(); - Challenge { - challenge: URL_SAFE_NO_PAD.encode(challenge_bytes), - timestamp: format!("{utc:?}"), - app_id: app_id.to_string(), - } -} - -#[derive(Serialize, Clone)] -#[serde(rename_all = "camelCase")] -pub struct RegistrationVerification { - pub key_handle: String, - pub pubkey: String, - pub device_name: Option, -} - -pub fn verify_registration( - app_id: String, - challenge: String, - register_data: String, - client_data: String, -) -> crate::Result { - let challenge_bytes = URL_SAFE_NO_PAD.decode(challenge)?; - let challenge = make_challenge(&app_id, challenge_bytes); - let client_data_bytes: Vec = client_data.as_bytes().into(); - let client_data_base64 = URL_SAFE_NO_PAD.encode(client_data_bytes); - let client = U2f::new(app_id); - match client.register_response( - challenge, - RegisterResponse { - registration_data: register_data, - client_data: client_data_base64, - version: VERSION.to_string(), - }, - ) { - Ok(v) => { - let rv = RegistrationVerification { - key_handle: URL_SAFE_NO_PAD.encode(&v.key_handle), - pubkey: URL_SAFE_NO_PAD.encode(&v.pub_key), - device_name: v.device_name, - }; - Ok(serde_json::to_string(&rv)?) - } - Err(e) => Err(e.into()), - } -} - -#[derive(Serialize, Clone)] -#[serde(rename_all = "camelCase")] -pub struct SignatureVerification { - pub counter: u8, -} - -pub fn verify_signature( - app_id: String, - challenge: String, - sign_data: String, - client_data: String, - key_handle: String, - pub_key: String, -) -> crate::Result { - let challenge_bytes = URL_SAFE_NO_PAD.decode(challenge)?; - let chal = make_challenge(&app_id, challenge_bytes); - let client_data_bytes: Vec = client_data.as_bytes().into(); - let client_data_base64 = URL_SAFE_NO_PAD.encode(client_data_bytes); - let key_handle_bytes = URL_SAFE_NO_PAD.decode(&key_handle)?; - let pubkey_bytes = URL_SAFE_NO_PAD.decode(pub_key)?; - let client = U2f::new(app_id); - let mut _counter: u32 = 0; - match client.sign_response( - chal, - Registration { - // here only needs pubkey and keyhandle - key_handle: key_handle_bytes, - pub_key: pubkey_bytes, - attestation_cert: None, - device_name: None, - }, - SignResponse { - // here needs client data and sig data and key_handle - signature_data: sign_data, - client_data: client_data_base64, - key_handle, - }, - _counter, - ) { - Ok(v) => Ok(v), - Err(e) => Err(e.into()), - } -} diff --git a/plugins/authenticator/src/u2f_crate/LICENSE b/plugins/authenticator/src/u2f_crate/LICENSE deleted file mode 100644 index d26d5f6c..00000000 --- a/plugins/authenticator/src/u2f_crate/LICENSE +++ /dev/null @@ -1,8 +0,0 @@ -Copyright (c) 2017 - -Licensed under either of - - * Apache License, Version 2.0, (http://www.apache.org/licenses/LICENSE-2.0) - * MIT license (http://opensource.org/licenses/MIT) - -at your option. \ No newline at end of file diff --git a/plugins/authenticator/src/u2f_crate/authorization.rs b/plugins/authenticator/src/u2f_crate/authorization.rs deleted file mode 100644 index 0e667ea6..00000000 --- a/plugins/authenticator/src/u2f_crate/authorization.rs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2021 Flavio Oliveira -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -use bytes::{Buf, BufMut}; -use openssl::sha::sha256; -use serde::Serialize; -use std::io::Cursor; - -use crate::u2f_crate::u2ferror::U2fError; - -/// The `Result` type used in this crate. -type Result = ::std::result::Result; - -#[derive(Serialize, Clone)] -#[serde(rename_all = "camelCase")] -pub struct Authorization { - pub counter: u32, - pub user_presence: bool, -} - -pub fn parse_sign_response( - app_id: String, - client_data: Vec, - public_key: Vec, - sign_data: Vec, -) -> Result { - if sign_data.len() <= 5 { - return Err(U2fError::InvalidSignatureData); - } - - let user_presence_flag = &sign_data[0]; - let counter = &sign_data[1..=4]; - let signature = &sign_data[5..]; - - // Let's build the msg to verify the signature - let app_id_hash = sha256(&app_id.into_bytes()); - let client_data_hash = sha256(&client_data[..]); - - let mut msg = vec![]; - msg.put(app_id_hash.as_ref()); - msg.put_u8(*user_presence_flag); - msg.put(counter); - msg.put(client_data_hash.as_ref()); - - let public_key = super::crypto::NISTP256Key::from_bytes(&public_key)?; - - // The signature is to be verified by the relying party using the public key obtained during registration. - let verified = public_key.verify_signature(signature, msg.as_ref())?; - if !verified { - return Err(U2fError::BadSignature); - } - - let authorization = Authorization { - counter: get_counter(counter), - user_presence: true, - }; - - Ok(authorization) -} - -fn get_counter(counter: &[u8]) -> u32 { - let mut buf = Cursor::new(counter); - buf.get_u32() -} diff --git a/plugins/authenticator/src/u2f_crate/crypto.rs b/plugins/authenticator/src/u2f_crate/crypto.rs deleted file mode 100644 index ddcdf1b6..00000000 --- a/plugins/authenticator/src/u2f_crate/crypto.rs +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2021 Flavio Oliveira -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -//! Cryptographic operation wrapper for Webauthn. This module exists to -//! allow ease of auditing, safe operation wrappers for the webauthn library, -//! and cryptographic provider abstraction. This module currently uses OpenSSL -//! as the cryptographic primitive provider. - -// Source can be found here: https://github.com/Firstyear/webauthn-rs/blob/master/src/crypto.rs - -#![allow(non_camel_case_types)] - -use openssl::{bn, ec, hash, nid, sign, x509}; -use std::convert::TryFrom; - -// use super::constants::*; -use crate::u2f_crate::u2ferror::U2fError; -use openssl::pkey::Public; - -// use super::proto::*; - -// Why OpenSSL over another rust crate? -// - Well, the openssl crate allows us to reconstruct a public key from the -// x/y group coords, where most others want a pkcs formatted structure. As -// a result, it's easiest to use openssl as it gives us exactly what we need -// for these operations, and despite it's many challenges as a library, it -// has resources and investment into it's maintenance, so we can a least -// assert a higher level of confidence in it that . - -// Object({Integer(-3): Bytes([48, 185, 178, 204, 113, 186, 105, 138, 190, 33, 160, 46, 131, 253, 100, 177, 91, 243, 126, 128, 245, 119, 209, 59, 186, 41, 215, 196, 24, 222, 46, 102]), Integer(-2): Bytes([158, 212, 171, 234, 165, 197, 86, 55, 141, 122, 253, 6, 92, 242, 242, 114, 158, 221, 238, 163, 127, 214, 120, 157, 145, 226, 232, 250, 144, 150, 218, 138]), Integer(-1): U64(1), Integer(1): U64(2), Integer(3): I64(-7)}) -// - -/// An X509PublicKey. This is what is otherwise known as a public certificate -/// which comprises a public key and other signed metadata related to the issuer -/// of the key. -pub struct X509PublicKey { - pubk: x509::X509, -} - -impl std::fmt::Debug for X509PublicKey { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - write!(f, "X509PublicKey") - } -} - -impl TryFrom<&[u8]> for X509PublicKey { - type Error = U2fError; - - // Must be DER bytes. If you have PEM, base64decode first! - fn try_from(d: &[u8]) -> Result { - let pubk = x509::X509::from_der(d)?; - Ok(X509PublicKey { pubk }) - } -} - -impl X509PublicKey { - pub(crate) fn common_name(&self) -> Option { - let cert = &self.pubk; - - let subject = cert.subject_name(); - let common = subject - .entries_by_nid(openssl::nid::Nid::COMMONNAME) - .next() - .map(|b| b.data().as_slice()); - - if let Some(common) = common { - std::str::from_utf8(common).ok().map(|s| s.to_string()) - } else { - None - } - } - - pub(crate) fn is_secp256r1(&self) -> Result { - // Can we get the public key? - let pk = self.pubk.public_key()?; - - let ec_key = pk.ec_key()?; - - ec_key.check_key()?; - - let ec_grpref = ec_key.group(); - - let ec_curve = ec_grpref.curve_name().ok_or(U2fError::OpenSSLNoCurveName)?; - - Ok(ec_curve == nid::Nid::X9_62_PRIME256V1) - } - - pub(crate) fn verify_signature( - &self, - signature: &[u8], - verification_data: &[u8], - ) -> Result { - let pkey = self.pubk.public_key()?; - - // TODO: Should this determine the hash type from the x509 cert? Or other? - let mut verifier = sign::Verifier::new(hash::MessageDigest::sha256(), &pkey)?; - verifier.update(verification_data)?; - Ok(verifier.verify(signature)?) - } -} - -pub struct NISTP256Key { - /// The key's public X coordinate. - pub x: [u8; 32], - /// The key's public Y coordinate. - pub y: [u8; 32], -} - -impl NISTP256Key { - pub fn from_bytes(public_key_bytes: &[u8]) -> Result { - if public_key_bytes.len() != 65 { - return Err(U2fError::InvalidPublicKey); - } - - if public_key_bytes[0] != 0x04 { - return Err(U2fError::InvalidPublicKey); - } - - let mut x: [u8; 32] = Default::default(); - x.copy_from_slice(&public_key_bytes[1..=32]); - - let mut y: [u8; 32] = Default::default(); - y.copy_from_slice(&public_key_bytes[33..=64]); - - Ok(NISTP256Key { x, y }) - } - - fn get_key(&self) -> Result, U2fError> { - let ec_group = ec::EcGroup::from_curve_name(openssl::nid::Nid::X9_62_PRIME256V1)?; - - let xbn = bn::BigNum::from_slice(&self.x)?; - let ybn = bn::BigNum::from_slice(&self.y)?; - - let ec_key = openssl::ec::EcKey::from_public_key_affine_coordinates(&ec_group, &xbn, &ybn)?; - - // Validate the key is sound. IIRC this actually checks the values - // are correctly on the curve as specified - ec_key.check_key()?; - - Ok(ec_key) - } - - pub fn verify_signature( - &self, - signature: &[u8], - verification_data: &[u8], - ) -> Result { - let pkey = self.get_key()?; - - let signature = openssl::ecdsa::EcdsaSig::from_der(signature)?; - let hash = openssl::sha::sha256(verification_data); - - Ok(signature.verify(hash.as_ref(), &pkey)?) - } -} diff --git a/plugins/authenticator/src/u2f_crate/messages.rs b/plugins/authenticator/src/u2f_crate/messages.rs deleted file mode 100644 index be22f965..00000000 --- a/plugins/authenticator/src/u2f_crate/messages.rs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2021 Flavio Oliveira -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -// As defined by FIDO U2F Javascript API. -// https://fidoalliance.org/specs/fido-u2f-v1.0-nfc-bt-amendment-20150514/fido-u2f-javascript-api.html#registration - -use serde::{Deserialize, Serialize}; - -#[derive(Serialize)] -#[serde(rename_all = "camelCase")] -pub struct U2fRegisterRequest { - pub app_id: String, - pub register_requests: Vec, - pub registered_keys: Vec, -} - -#[derive(Serialize)] -pub struct RegisterRequest { - pub version: String, - pub challenge: String, -} - -#[derive(Serialize)] -#[serde(rename_all = "camelCase")] -pub struct RegisteredKey { - pub version: String, - pub key_handle: Option, - pub app_id: String, -} - -#[derive(Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct RegisterResponse { - pub registration_data: String, - pub version: String, - pub client_data: String, -} - -#[derive(Serialize)] -#[serde(rename_all = "camelCase")] -pub struct U2fSignRequest { - pub app_id: String, - pub challenge: String, - pub registered_keys: Vec, -} - -#[derive(Clone, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct SignResponse { - pub key_handle: String, - pub signature_data: String, - pub client_data: String, -} diff --git a/plugins/authenticator/src/u2f_crate/mod.rs b/plugins/authenticator/src/u2f_crate/mod.rs deleted file mode 100644 index ab2a1e0c..00000000 --- a/plugins/authenticator/src/u2f_crate/mod.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2021 Flavio Oliveira -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -mod util; - -pub mod authorization; -mod crypto; -pub mod messages; -pub mod protocol; -pub mod register; -pub mod u2ferror; diff --git a/plugins/authenticator/src/u2f_crate/protocol.rs b/plugins/authenticator/src/u2f_crate/protocol.rs deleted file mode 100644 index 94ebce6f..00000000 --- a/plugins/authenticator/src/u2f_crate/protocol.rs +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright 2021 Flavio Oliveira -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -use crate::u2f_crate::authorization::*; -use crate::u2f_crate::messages::*; -use crate::u2f_crate::register::*; -use crate::u2f_crate::u2ferror::U2fError; -use crate::u2f_crate::util::*; - -use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; -use chrono::prelude::*; -use chrono::Duration; -use serde::{Deserialize, Serialize}; - -type Result = ::std::result::Result; - -#[derive(Clone)] -pub struct U2f { - app_id: String, -} - -#[derive(Deserialize, Serialize, Clone)] -#[serde(rename_all = "camelCase")] -pub struct Challenge { - pub app_id: String, - pub challenge: String, - pub timestamp: String, -} - -impl Challenge { - // Not used in this plugin. - #[allow(dead_code)] - pub fn new() -> Self { - Challenge { - app_id: String::new(), - challenge: String::new(), - timestamp: String::new(), - } - } -} - -impl U2f { - // The app ID is a string used to uniquely identify an U2F app - pub fn new(app_id: String) -> Self { - U2f { app_id } - } - - // Not used in this plugin. - #[allow(dead_code)] - pub fn generate_challenge(&self) -> Result { - let utc: DateTime = Utc::now(); - - let challenge_bytes = generate_challenge(32)?; - let challenge = Challenge { - challenge: URL_SAFE_NO_PAD.encode(challenge_bytes), - timestamp: format!("{:?}", utc), - app_id: self.app_id.clone(), - }; - - Ok(challenge.clone()) - } - - // Not used in this plugin. - #[allow(dead_code)] - pub fn request( - &self, - challenge: Challenge, - registrations: Vec, - ) -> Result { - let u2f_request = U2fRegisterRequest { - app_id: self.app_id.clone(), - register_requests: self.register_request(challenge), - registered_keys: self.registered_keys(registrations), - }; - - Ok(u2f_request) - } - - fn register_request(&self, challenge: Challenge) -> Vec { - let mut requests: Vec = vec![]; - - let request = RegisterRequest { - version: U2F_V2.into(), - challenge: challenge.challenge, - }; - requests.push(request); - - requests - } - - pub fn register_response( - &self, - challenge: Challenge, - response: RegisterResponse, - ) -> Result { - if expiration(challenge.timestamp) > Duration::seconds(300) { - return Err(U2fError::ChallengeExpired); - } - - let registration_data: Vec = URL_SAFE_NO_PAD - .decode(&response.registration_data[..]) - .unwrap(); - let client_data: Vec = URL_SAFE_NO_PAD.decode(&response.client_data[..]).unwrap(); - - parse_registration(challenge.app_id, client_data, registration_data) - } - - fn registered_keys(&self, registrations: Vec) -> Vec { - let mut keys: Vec = vec![]; - - for registration in registrations { - keys.push(get_registered_key( - self.app_id.clone(), - registration.key_handle, - )); - } - - keys - } - - // Not used in this plugin. - #[allow(dead_code)] - pub fn sign_request( - &self, - challenge: Challenge, - registrations: Vec, - ) -> U2fSignRequest { - let mut keys: Vec = vec![]; - - for registration in registrations { - keys.push(get_registered_key( - self.app_id.clone(), - registration.key_handle, - )); - } - - let signed_request = U2fSignRequest { - app_id: self.app_id.clone(), - challenge: URL_SAFE_NO_PAD.encode(challenge.challenge.as_bytes()), - registered_keys: keys, - }; - - signed_request - } - - pub fn sign_response( - &self, - challenge: Challenge, - reg: Registration, - sign_resp: SignResponse, - counter: u32, - ) -> Result { - if expiration(challenge.timestamp) > Duration::seconds(300) { - return Err(U2fError::ChallengeExpired); - } - - if sign_resp.key_handle != get_encoded(®.key_handle[..]) { - return Err(U2fError::WrongKeyHandler); - } - - let client_data: Vec = URL_SAFE_NO_PAD - .decode(&sign_resp.client_data[..]) - .map_err(|_e| U2fError::InvalidClientData)?; - let sign_data: Vec = URL_SAFE_NO_PAD - .decode(&sign_resp.signature_data[..]) - .map_err(|_e| U2fError::InvalidSignatureData)?; - - let public_key = reg.pub_key; - - let auth = parse_sign_response( - self.app_id.clone(), - client_data.clone(), - public_key, - sign_data.clone(), - ); - - match auth { - Ok(ref res) => { - // CounterTooLow is raised when the counter value received from the device is - // lower than last stored counter value. - if res.counter < counter { - Err(U2fError::CounterTooLow) - } else { - Ok(res.counter) - } - } - Err(e) => Err(e), - } - } -} diff --git a/plugins/authenticator/src/u2f_crate/register.rs b/plugins/authenticator/src/u2f_crate/register.rs deleted file mode 100644 index 6b47817d..00000000 --- a/plugins/authenticator/src/u2f_crate/register.rs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2021 Flavio Oliveira -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -use byteorder::{BigEndian, ByteOrder}; -use bytes::{BufMut, Bytes}; -use openssl::sha::sha256; -use serde::Serialize; - -use crate::u2f_crate::messages::RegisteredKey; -use crate::u2f_crate::u2ferror::U2fError; -use crate::u2f_crate::util::*; -use std::convert::TryFrom; - -/// The `Result` type used in this crate. -type Result = ::std::result::Result; - -// Single enrolment or pairing between an application and a token. -#[derive(Serialize, Clone)] -#[serde(rename_all = "camelCase")] -pub struct Registration { - pub key_handle: Vec, - pub pub_key: Vec, - - // AttestationCert can be null for Authenticate requests. - pub attestation_cert: Option>, - pub device_name: Option, -} - -pub fn parse_registration( - app_id: String, - client_data: Vec, - registration_data: Vec, -) -> Result { - let reserved_byte = registration_data[0]; - if reserved_byte != 0x05 { - return Err(U2fError::InvalidReservedByte); - } - - let mut mem = Bytes::from(registration_data); - - //Start parsing ... advance the reserved byte. - let _ = mem.split_to(1); - - // P-256 NIST elliptic curve - let public_key = mem.split_to(65); - - // Key Handle - let key_handle_size = mem.split_to(1); - let key_len = BigEndian::read_uint(&key_handle_size[..], 1); - let key_handle = mem.split_to(key_len as usize); - - // The certificate length needs to be inferred by parsing. - let cert_len = asn_length(mem.clone()).unwrap(); - let attestation_certificate = mem.split_to(cert_len); - - // Remaining data corresponds to the signature - let signature = mem; - - // Let's build the msg to verify the signature - let app_id_hash = sha256(&app_id.into_bytes()); - let client_data_hash = sha256(&client_data[..]); - - let mut msg = vec![0x00]; // A byte reserved for future use [1 byte] with the value 0x00 - msg.put(app_id_hash.as_ref()); - msg.put(client_data_hash.as_ref()); - msg.put(key_handle.clone()); - msg.put(public_key.clone()); - - // The signature is to be verified by the relying party using the public key certified - // in the attestation certificate. - let cerificate_public_key = - super::crypto::X509PublicKey::try_from(&attestation_certificate[..])?; - - if !(cerificate_public_key.is_secp256r1()?) { - return Err(U2fError::BadCertificate); - } - - let verified = cerificate_public_key.verify_signature(&signature[..], &msg[..])?; - - if !verified { - return Err(U2fError::BadCertificate); - } - - let registration = Registration { - key_handle: key_handle[..].to_vec(), - pub_key: public_key[..].to_vec(), - attestation_cert: Some(attestation_certificate[..].to_vec()), - device_name: cerificate_public_key.common_name(), - }; - - Ok(registration) -} - -pub fn get_registered_key(app_id: String, key_handle: Vec) -> RegisteredKey { - RegisteredKey { - app_id, - version: U2F_V2.into(), - key_handle: Some(get_encoded(key_handle.as_slice())), - } -} diff --git a/plugins/authenticator/src/u2f_crate/u2ferror.rs b/plugins/authenticator/src/u2f_crate/u2ferror.rs deleted file mode 100644 index 377af9d8..00000000 --- a/plugins/authenticator/src/u2f_crate/u2ferror.rs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2021 Flavio Oliveira -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -use thiserror::Error; - -#[derive(Debug, Error)] -pub enum U2fError { - #[error("ASM1 Decoder error")] - Asm1DecoderError, - #[error("Not able to verify signature")] - BadSignature, - #[error("Not able to generate random bytes")] - RandomSecureBytesError, - #[error("Invalid Reserved Byte")] - InvalidReservedByte, - #[error("Challenge Expired")] - ChallengeExpired, - #[error("Wrong Key Handler")] - WrongKeyHandler, - #[error("Invalid Client Data")] - InvalidClientData, - #[error("Invalid Signature Data")] - InvalidSignatureData, - #[error("Invalid User Presence Byte")] - InvalidUserPresenceByte, - #[error("Failed to parse certificate")] - BadCertificate, - #[error("Not Trusted Anchor")] - NotTrustedAnchor, - #[error("Counter too low")] - CounterTooLow, - #[error("Invalid public key")] - OpenSSLNoCurveName, - #[error("OpenSSL no curve name")] - InvalidPublicKey, - #[error(transparent)] - OpenSSLError(#[from] openssl::error::ErrorStack), -} diff --git a/plugins/authenticator/src/u2f_crate/util.rs b/plugins/authenticator/src/u2f_crate/util.rs deleted file mode 100644 index 6a7e3fbd..00000000 --- a/plugins/authenticator/src/u2f_crate/util.rs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2021 Flavio Oliveira -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -use crate::u2f_crate::u2ferror::U2fError; -use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; -use bytes::Bytes; -use chrono::prelude::*; -use chrono::Duration; -use openssl::rand; - -/// The `Result` type used in this crate. -type Result = ::std::result::Result; - -pub const U2F_V2: &str = "U2F_V2"; - -// Generates a challenge from a secure, random source. -pub fn generate_challenge(size: usize) -> Result> { - let mut bytes: Vec = vec![0; size]; - rand::rand_bytes(&mut bytes).map_err(|_e| U2fError::RandomSecureBytesError)?; - Ok(bytes) -} - -pub fn expiration(timestamp: String) -> Duration { - let now: DateTime = Utc::now(); - - let ts = timestamp.parse::>(); - - now.signed_duration_since(ts.unwrap()) -} - -// Decode initial bytes of buffer as ASN and return the length of the encoded structure. -// http://en.wikipedia.org/wiki/X.690 -pub fn asn_length(mem: Bytes) -> Result { - let buffer: &[u8] = &mem[..]; - - if mem.len() < 2 || buffer[0] != 0x30 { - // Type - return Err(U2fError::Asm1DecoderError); - } - - let len = buffer[1]; // Len - if len & 0x80 == 0 { - return Ok((len & 0x7f) as usize); - } - - let numbem_of_bytes = len & 0x7f; - if numbem_of_bytes == 0 { - return Err(U2fError::Asm1DecoderError); - } - - let mut length: usize = 0; - for num in 0..numbem_of_bytes { - length = length * 0x100 + (buffer[(2 + num) as usize] as usize); - } - - length += numbem_of_bytes as usize; - - Ok(length + 2) // Add the 2 initial bytes: type and length. -} - -pub fn get_encoded(data: &[u8]) -> String { - let encoded: String = URL_SAFE_NO_PAD.encode(data); - - encoded.trim_end_matches('=').to_string() -} diff --git a/plugins/autostart/.gitignore b/plugins/autostart/.gitignore deleted file mode 100644 index b512c09d..00000000 --- a/plugins/autostart/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/plugins/autostart/CHANGELOG.md b/plugins/autostart/CHANGELOG.md index 84b71e6f..cd26fad7 100644 --- a/plugins/autostart/CHANGELOG.md +++ b/plugins/autostart/CHANGELOG.md @@ -1,5 +1,58 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.8] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.7] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.6] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[2.0.0-beta.4] + +- [`a233919`](https://github.com/tauri-apps/plugins-workspace/commit/a2339195aa940bff86d76375fd05087595bf06ce)([#1118](https://github.com/tauri-apps/plugins-workspace/pull/1118)) Fix LaunchAgent-based autostart for macOS. + +## \[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] + +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -41,4 +94,5 @@ - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ae67\`]\(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! + com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/autostart/Cargo.toml b/plugins/autostart/Cargo.toml index f9c4fc86..77f555e6 100644 --- a/plugins/autostart/Cargo.toml +++ b/plugins/autostart/Cargo.toml @@ -1,19 +1,27 @@ [package] name = "tauri-plugin-autostart" -version = "2.0.0-beta.1" +version = "2.0.1" description = "Automatically launch your application at startup." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-autostart" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "none", notes = "" } +ios = { level = "none", notes = "" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } diff --git a/plugins/autostart/README.md b/plugins/autostart/README.md index 01f385ab..0a1415db 100644 --- a/plugins/autostart/README.md +++ b/plugins/autostart/README.md @@ -1,10 +1,18 @@ ![plugin-autostart](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/autostart/banner.png) -Automatically launch your application at startup. Supports Windows, Mac (via AppleScript or Launch Agent), and Linux. +Automatically launch your application at startup. + +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | x | +| iOS | x | ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-autostart = "2.0.0-beta" +tauri-plugin-autostart = "2.0.0" # alternatively with Git: tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -62,13 +70,13 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { enable, isEnabled, disable } from "@tauri-apps/plugin-autostart"; +import { enable, isEnabled, disable } from '@tauri-apps/plugin-autostart' -await enable(); +await enable() -console.log(`registered for autostart? ${await isEnabled()}`); +console.log(`registered for autostart? ${await isEnabled()}`) -disable(); +disable() ``` ## Contributing diff --git a/plugins/autostart/SECURITY.md b/plugins/autostart/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/autostart/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/autostart/src/api-iife.js b/plugins/autostart/api-iife.js similarity index 100% rename from plugins/autostart/src/api-iife.js rename to plugins/autostart/api-iife.js diff --git a/plugins/autostart/build.rs b/plugins/autostart/build.rs index 2b27eff0..1460469b 100644 --- a/plugins/autostart/build.rs +++ b/plugins/autostart/build.rs @@ -5,5 +5,7 @@ const COMMANDS: &[&str] = &["enable", "disable", "is_enabled"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/autostart/guest-js/index.ts b/plugins/autostart/guest-js/index.ts index 81471b74..fca8344f 100644 --- a/plugins/autostart/guest-js/index.ts +++ b/plugins/autostart/guest-js/index.ts @@ -2,16 +2,16 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { invoke } from "@tauri-apps/api/core"; +import { invoke } from '@tauri-apps/api/core' export async function isEnabled(): Promise { - return await invoke("plugin:autostart|is_enabled"); + return await invoke('plugin:autostart|is_enabled') } export async function enable(): Promise { - await invoke("plugin:autostart|enable"); + await invoke('plugin:autostart|enable') } export async function disable(): Promise { - await invoke("plugin:autostart|disable"); + await invoke('plugin:autostart|disable') } diff --git a/plugins/autostart/package.json b/plugins/autostart/package.json index ad33dd84..9ea68630 100644 --- a/plugins/autostart/package.json +++ b/plugins/autostart/package.json @@ -1,10 +1,11 @@ { "name": "@tauri-apps/plugin-autostart", - "version": "2.0.0-beta.1", - "license": "MIT or APACHE-2.0", + "version": "2.0.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -23,6 +24,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/autostart/permissions/autogenerated/reference.md b/plugins/autostart/permissions/autogenerated/reference.md index e129ae02..6e40fdb7 100644 --- a/plugins/autostart/permissions/autogenerated/reference.md +++ b/plugins/autostart/permissions/autogenerated/reference.md @@ -1,26 +1,104 @@ -# Permissions +## Default Permission -## allow-disable +This permission set configures if your +application can enable or disable auto +starting the application on boot. + +#### Granted Permissions + +It allows all to check, enable and +disable the automatic start on boot. + + + +- `allow-enable` +- `allow-disable` +- `allow-is-enabled` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`autostart:allow-disable` + + Enables the disable command without any pre-configured scope. -## deny-disable +
+ +`autostart:deny-disable` + + Denies the disable command without any pre-configured scope. -## allow-enable +
+ +`autostart:allow-enable` + + Enables the enable command without any pre-configured scope. -## deny-enable +
+ +`autostart:deny-enable` + + Denies the enable command without any pre-configured scope. -## allow-is-enabled +
+ +`autostart:allow-is-enabled` + + Enables the is_enabled command without any pre-configured scope. -## deny-is-enabled +
+ +`autostart:deny-is-enabled` + + Denies the is_enabled command without any pre-configured scope. +
diff --git a/plugins/autostart/permissions/default.toml b/plugins/autostart/permissions/default.toml new file mode 100644 index 00000000..a2ac766f --- /dev/null +++ b/plugins/autostart/permissions/default.toml @@ -0,0 +1,15 @@ +"$schema" = "schemas/schema.json" +[default] +description = """ +This permission set configures if your +application can enable or disable auto +starting the application on boot. + +#### Granted Permissions + +It allows all to check, enable and +disable the automatic start on boot. + +""" + +permissions = ["allow-enable", "allow-disable", "allow-is-enabled"] diff --git a/plugins/autostart/permissions/schemas/schema.json b/plugins/autostart/permissions/schemas/schema.json index f0c890dd..59c81f52 100644 --- a/plugins/autostart/permissions/schemas/schema.json +++ b/plugins/autostart/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,50 +251,83 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-disable -> Enables the disable command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-disable" + "macOS" ] }, { - "description": "deny-disable -> Denies the disable command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-disable" + "windows" ] }, { - "description": "allow-enable -> Enables the enable command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-enable" + "linux" ] }, { - "description": "deny-enable -> Denies the enable command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-enable" + "android" ] }, { - "description": "allow-is-enabled -> Enables the is_enabled command without any pre-configured scope.", + "description": "iOS.", "type": "string", "enum": [ - "allow-is-enabled" + "iOS" ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the disable command without any pre-configured scope.", + "type": "string", + "const": "allow-disable" }, { - "description": "deny-is-enabled -> Denies the is_enabled command without any pre-configured scope.", + "description": "Denies the disable command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-is-enabled" - ] + "const": "deny-disable" + }, + { + "description": "Enables the enable command without any pre-configured scope.", + "type": "string", + "const": "allow-enable" + }, + { + "description": "Denies the enable command without any pre-configured scope.", + "type": "string", + "const": "deny-enable" + }, + { + "description": "Enables the is_enabled command without any pre-configured scope.", + "type": "string", + "const": "allow-is-enabled" + }, + { + "description": "Denies the is_enabled command without any pre-configured scope.", + "type": "string", + "const": "deny-is-enabled" + }, + { + "description": "This permission set configures if your\napplication can enable or disable auto\nstarting the application on boot.\n\n#### Granted Permissions\n\nIt allows all to check, enable and\ndisable the automatic start on boot.\n\n", + "type": "string", + "const": "default" } ] } diff --git a/plugins/autostart/rollup.config.js b/plugins/autostart/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/autostart/rollup.config.js +++ b/plugins/autostart/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/autostart/src/lib.rs b/plugins/autostart/src/lib.rs index b4338208..bd3866b3 100644 --- a/plugins/autostart/src/lib.rs +++ b/plugins/autostart/src/lib.rs @@ -107,7 +107,6 @@ pub fn init( args: Option>, ) -> TauriPlugin { Builder::new("autostart") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![enable, disable, is_enabled]) .setup(move |app, _api| { let mut builder = AutoLaunchBuilder::new(); @@ -130,11 +129,12 @@ pub fn init( // exe path to not break it. let exe_path = current_exe.canonicalize()?.display().to_string(); let parts: Vec<&str> = exe_path.split(".app/").collect(); - let app_path = if parts.len() == 2 { - format!("{}.app", parts.first().unwrap()) - } else { - exe_path - }; + let app_path = + if parts.len() == 2 && matches!(macos_launcher, MacosLauncher::AppleScript) { + format!("{}.app", parts.first().unwrap()) + } else { + exe_path + }; info!("auto_start path {}", &app_path); builder.set_app_path(&app_path); } diff --git a/plugins/barcode-scanner/CHANGELOG.md b/plugins/barcode-scanner/CHANGELOG.md index 01a59b61..447499bc 100644 --- a/plugins/barcode-scanner/CHANGELOG.md +++ b/plugins/barcode-scanner/CHANGELOG.md @@ -1,5 +1,80 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.2] + +- [`79d6e19c`](https://github.com/tauri-apps/plugins-workspace/commit/79d6e19c4b38bae0cab29eb88df379e2237d9aac) ([#1777](https://github.com/tauri-apps/plugins-workspace/pull/1777)) Fixed an issue which caused checkPermission and requestPermission to be mixed up. + +## \[2.0.0-rc.4] + +- [`713c54ef`](https://github.com/tauri-apps/plugins-workspace/commit/713c54ef8365d36afd84585dcabed2fbb751223d) ([#1749](https://github.com/tauri-apps/plugins-workspace/pull/1749) by [@olivierlemasle](https://github.com/tauri-apps/plugins-workspace/../../olivierlemasle)) Remove unused Android dependencies. +- [`8c3a6a25`](https://github.com/tauri-apps/plugins-workspace/commit/8c3a6a253d7029d370659d2102f91a458745d345) ([#1758](https://github.com/tauri-apps/plugins-workspace/pull/1758) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Validate missing `NSCameraUsageDescription` Info.plist value. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Use `PermissionState` from the `tauri` crate, which now also includes a "prompt with rationale" variant for Android (returned when your app must explain to the user why it needs the permission). +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.2] + +- [`b9147758`](https://github.com/tauri-apps/plugins-workspace/commit/b914775898c2bee7ceb20bd17ee595005cd17a64) ([#1679](https://github.com/tauri-apps/plugins-workspace/pull/1679) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Explicitly set a minimum macOS version for the Swift package. + +## \[2.0.0-rc.1] + +- [`2c00c029`](https://github.com/tauri-apps/plugins-workspace/commit/2c00c0292c9127b81567de46691e8c0f73557261) ([#1630](https://github.com/tauri-apps/plugins-workspace/pull/1630) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fixed an issue that caused multi-word IIFE names to not be formatted correctly. For example the `barcode-scanner` was defined as `window.__TAURI_PLUGIN_CLIPBOARDMANAGER__` instead of `window.__TAURI_PLUGIN_CLIPBOARD_MANAGER__`. + +### changes + +- [`6b079cfd`](https://github.com/tauri-apps/plugins-workspace/commit/6b079cfdd107c94abc2c7300f6af00bac3ff4040) ([#1649](https://github.com/tauri-apps/plugins-workspace/pull/1649) by [@ahqsoftwares](https://github.com/tauri-apps/plugins-workspace/../../ahqsoftwares)) Remove targetSdk from build.kts files as it is deprecated and will be removed from DSL v9.0 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.8] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.7] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.6] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[2.0.0-beta.4] + +- [`326df688`](https://github.com/tauri-apps/plugins-workspace/commit/326df6883998d416fc0837583ed972854628bb52)([#1236](https://github.com/tauri-apps/plugins-workspace/pull/1236)) Fixes command argument parsing on iOS. + +## \[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] + +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -28,4 +103,9 @@ ## \[2.0.0-alpha.0] - [`454428c`](https://github.com/tauri-apps/plugins-workspace/commit/454428cd50ce4962f0bad8e355aebc68af8cc61f)([#536](https://github.com/tauri-apps/plugins-workspace/pull/536)) Initial release. -commit/454428cd50ce4962f0bad8e355aebc68af8cc61f)([#536](https://github.com/tauri-apps/plugins-workspace/pull/536)) Initial release. + commit/454428cd50ce4962f0bad8e355aebc68af8cc61f)([#536](https://github.com/tauri-apps/plugins-workspace/pull/536)) Initial release. + 36]\(https://github.com/tauri-apps/plugins-workspace/pull/536)) Initial release. + commit/454428cd50ce4962f0bad8e355aebc68af8cc61f)([#536](https://github.com/tauri-apps/plugins-workspace/pull/536)) Initial release. + . + commit/454428cd50ce4962f0bad8e355aebc68af8cc61f)([#536](https://github.com/tauri-apps/plugins-workspace/pull/536)) Initial release. + github.com/tauri-apps/plugins-workspace/pull/536)) Initial release. diff --git a/plugins/barcode-scanner/Cargo.toml b/plugins/barcode-scanner/Cargo.toml index 81f8e4f1..8fabe711 100644 --- a/plugins/barcode-scanner/Cargo.toml +++ b/plugins/barcode-scanner/Cargo.toml @@ -1,20 +1,29 @@ [package] name = "tauri-plugin-barcode-scanner" -version = "2.0.0-beta.1" +version = "2.0.1" description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-barcode-scanner" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] -targets = [ "x86_64-linux-android" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] +targets = ["x86_64-linux-android"] + +[package.metadata.platforms.support] +windows = { level = "none", notes = "" } +linux = { level = "none", notes = "" } +macos = { level = "none", notes = "" } +android = { level = "full", notes = "" } +ios = { level = "full", notes = "" } + [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -22,3 +31,6 @@ serde_json = { workspace = true } tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } + +[target.'cfg(target_os = "ios")'.dependencies] +tauri = { workspace = true, features = ["wry"] } diff --git a/plugins/barcode-scanner/README.md b/plugins/barcode-scanner/README.md index 1a7d59e6..eba7ca9e 100644 --- a/plugins/barcode-scanner/README.md +++ b/plugins/barcode-scanner/README.md @@ -1,7 +1,15 @@ -![Barcode Scanner](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/scanner/banner.png) +![Barcode Scanner](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/barcode-scanner/banner.png) Allows your mobile application to use the camera to scan QR codes, EAN-13 and other kinds of barcodes. +| Platform | Supported | +| -------- | --------- | +| Linux | x | +| Windows | x | +| macOS | x | +| Android | ✓ | +| iOS | ✓ | + ## Install _This plugin requires a Rust version of at least **1.64**_ @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-barcode-scanner = "2.0.0-beta" +tauri-plugin-barcode-scanner = "2.0.0" # alternatively with Git: tauri-plugin-barcode-scanner = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -60,12 +68,12 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { scan } from "@tauri-apps/plugin-barcode-scanner"; +import { scan } from '@tauri-apps/plugin-barcode-scanner' // `windowed: true` actually sets the webview to transparent // instead of opening a separate view for the camera // make sure your user interface is ready to show what is underneath with a transparent element -scan({ windowed: true, formats: [""] }) +scan({ windowed: true, formats: [''] }) ``` ## Contributing diff --git a/plugins/barcode-scanner/SECURITY.md b/plugins/barcode-scanner/SECURITY.md index 36a863c6..135504ec 100644 --- a/plugins/barcode-scanner/SECURITY.md +++ b/plugins/barcode-scanner/SECURITY.md @@ -54,7 +54,6 @@ The camera has two modes. The first one is where the user can see the background The second mode allows the developer to assist the user and add a transparent overlay to the image, providing hints or additional information (like a link preview). The overlay could be made non-transparent by the application frontend and as long as the app is open (and in some cases) it could read QR codes in range of the camera lense. - #### Out Of Scope - Exploits in the operating system QR code parsing functionality diff --git a/plugins/barcode-scanner/android/build.gradle.kts b/plugins/barcode-scanner/android/build.gradle.kts index 8b060f64..f3ecd6c7 100644 --- a/plugins/barcode-scanner/android/build.gradle.kts +++ b/plugins/barcode-scanner/android/build.gradle.kts @@ -5,11 +5,10 @@ plugins { android { namespace = "app.tauri.barcodescanner" - compileSdk = 32 + compileSdk = 34 defaultConfig { - minSdk = 24 - targetSdk = 32 + minSdk = 24 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -48,9 +47,5 @@ dependencies { testImplementation("junit:junit:4.13.2") androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") - implementation("com.journeyapps:zxing-android-embedded:4.3.0") { - isTransitive = false - } - implementation("com.google.zxing:core:3.3.0") implementation(project(":tauri-android")) } diff --git a/plugins/barcode-scanner/android/src/main/AndroidManifest.xml b/plugins/barcode-scanner/android/src/main/AndroidManifest.xml index b4050b4f..750a724b 100644 --- a/plugins/barcode-scanner/android/src/main/AndroidManifest.xml +++ b/plugins/barcode-scanner/android/src/main/AndroidManifest.xml @@ -2,10 +2,8 @@ xmlns:tools="http://schemas.android.com/tools" android:hardwareAccelerated="true"> - - - - - + + + diff --git a/plugins/barcode-scanner/android/src/main/java/BarcodeScannerPlugin.kt b/plugins/barcode-scanner/android/src/main/java/BarcodeScannerPlugin.kt index 4728bad0..ef2eeb34 100644 --- a/plugins/barcode-scanner/android/src/main/java/BarcodeScannerPlugin.kt +++ b/plugins/barcode-scanner/android/src/main/java/BarcodeScannerPlugin.kt @@ -42,7 +42,6 @@ import app.tauri.annotation.Permission import app.tauri.annotation.PermissionCallback import app.tauri.annotation.TauriPlugin import app.tauri.plugin.Invoke -import app.tauri.plugin.JSArray import app.tauri.plugin.JSObject import app.tauri.plugin.Plugin import com.google.common.util.concurrent.ListenableFuture @@ -50,7 +49,6 @@ import com.google.mlkit.vision.barcode.BarcodeScannerOptions import com.google.mlkit.vision.barcode.BarcodeScanning import com.google.mlkit.vision.barcode.common.Barcode import com.google.mlkit.vision.common.InputImage -import org.json.JSONException import java.util.Collections import java.util.concurrent.ExecutionException diff --git a/plugins/barcode-scanner/android/src/main/java/GraphicOverlay.kt b/plugins/barcode-scanner/android/src/main/java/GraphicOverlay.kt index 76817540..1b1d3b2c 100644 --- a/plugins/barcode-scanner/android/src/main/java/GraphicOverlay.kt +++ b/plugins/barcode-scanner/android/src/main/java/GraphicOverlay.kt @@ -91,22 +91,10 @@ class GraphicOverlay: View { return } - val zLowerBoundInScreenPixel: Float - val zUpperBoundInScreenPixel: Float - if (rescaleZForVisualization) { - zLowerBoundInScreenPixel = (-0.001f).coerceAtMost(scale(zMin)) - zUpperBoundInScreenPixel = 0.001f.coerceAtLeast(scale(zMax)) - } else { - val defaultRangeFactor = 1f - zLowerBoundInScreenPixel = -defaultRangeFactor * canvas.width - zUpperBoundInScreenPixel = defaultRangeFactor * canvas.width - } val zInScreenPixel = scale(zInImagePixel) if (zInScreenPixel < 0) { - val v = (zInScreenPixel / zLowerBoundInScreenPixel * 255).toInt() paint.setARGB(0, 0, 255, 0) } else { - val v = (zInScreenPixel / zUpperBoundInScreenPixel * 255).toInt() paint.setARGB(0, 0, 255, 0) } } @@ -180,7 +168,7 @@ class GraphicOverlay: View { needUpdateTransformation = false } - override fun onDraw(canvas: Canvas?) { + override fun onDraw(canvas: Canvas) { super.onDraw(canvas) synchronized(lock) { updateTransformationIfNeeded() diff --git a/plugins/barcode-scanner/api-iife.js b/plugins/barcode-scanner/api-iife.js new file mode 100644 index 00000000..620b59a7 --- /dev/null +++ b/plugins/barcode-scanner/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_BARCODE_SCANNER__=function(n){"use strict";async function e(n,e={},r){return window.__TAURI_INTERNALS__.invoke(n,e,r)}var r;return"function"==typeof SuppressedError&&SuppressedError,n.Format=void 0,(r=n.Format||(n.Format={})).QRCode="QR_CODE",r.UPC_A="UPC_A",r.UPC_E="UPC_E",r.EAN8="EAN_8",r.EAN13="EAN_13",r.Code39="CODE_39",r.Code93="CODE_93",r.Code128="CODE_128",r.Codabar="CODABAR",r.ITF="ITF",r.Aztec="AZTEC",r.DataMatrix="DATA_MATRIX",r.PDF417="PDF_417",n.cancel=async function(){await e("plugin:barcode-scanner|cancel")},n.checkPermissions=async function(){return await async function(n){return e(`plugin:${n}|check_permissions`)}("barcode-scanner").then((n=>n.camera))},n.openAppSettings=async function(){await e("plugin:barcode-scanner|open_app_settings")},n.requestPermissions=async function(){return await async function(n){return e(`plugin:${n}|request_permissions`)}("barcode-scanner").then((n=>n.camera))},n.scan=async function(n){return await e("plugin:barcode-scanner|scan",{...n})},n}({});Object.defineProperty(window.__TAURI__,"barcodeScanner",{value:__TAURI_PLUGIN_BARCODE_SCANNER__})} diff --git a/plugins/barcode-scanner/build.rs b/plugins/barcode-scanner/build.rs index 9239a404..25896b57 100644 --- a/plugins/barcode-scanner/build.rs +++ b/plugins/barcode-scanner/build.rs @@ -12,15 +12,14 @@ const COMMANDS: &[&str] = &[ ]; fn main() { - if let Err(error) = tauri_plugin::Builder::new(COMMANDS) + let result = tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .android_path("android") .ios_path("ios") - .try_build() - { - println!("{error:#}"); - // when building documentation for Android the plugin build result is irrelevant to the crate itself - if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) { - std::process::exit(1); - } + .try_build(); + + // when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build + if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) { + result.unwrap(); } } diff --git a/plugins/barcode-scanner/guest-js/index.ts b/plugins/barcode-scanner/guest-js/index.ts index 8e964420..2f2361be 100644 --- a/plugins/barcode-scanner/guest-js/index.ts +++ b/plugins/barcode-scanner/guest-js/index.ts @@ -2,36 +2,40 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { invoke } from "@tauri-apps/api/core"; +import { + invoke, + requestPermissions as requestPermissions_, + checkPermissions as checkPermissions_ +} from '@tauri-apps/api/core' -export type PermissionState = "granted" | "denied" | "prompt"; +export type { PermissionState } from '@tauri-apps/api/core' export enum Format { - QRCode = "QR_CODE", - UPC_A = "UPC_A", - UPC_E = "UPC_E", - EAN8 = "EAN_8", - EAN13 = "EAN_13", - Code39 = "CODE_39", - Code93 = "CODE_93", - Code128 = "CODE_128", - Codabar = "CODABAR", - ITF = "ITF", - Aztec = "AZTEC", - DataMatrix = "DATA_MATRIX", - PDF417 = "PDF_417", + QRCode = 'QR_CODE', + UPC_A = 'UPC_A', + UPC_E = 'UPC_E', + EAN8 = 'EAN_8', + EAN13 = 'EAN_13', + Code39 = 'CODE_39', + Code93 = 'CODE_93', + Code128 = 'CODE_128', + Codabar = 'CODABAR', + ITF = 'ITF', + Aztec = 'AZTEC', + DataMatrix = 'DATA_MATRIX', + PDF417 = 'PDF_417' } export interface ScanOptions { - cameraDirection?: "back" | "front"; - formats?: Format[]; - windowed?: boolean; + cameraDirection?: 'back' | 'front' + formats?: Format[] + windowed?: boolean } export interface Scanned { - content: string; - format: Format; - bounds: unknown; + content: string + format: Format + bounds: unknown } /** @@ -39,37 +43,37 @@ export interface Scanned { * @param options */ export async function scan(options?: ScanOptions): Promise { - return await invoke("plugin:barcode-scanner|scan", { ...options }); + return await invoke('plugin:barcode-scanner|scan', { ...options }) } /** * Cancel the current scan process. */ export async function cancel(): Promise { - return await invoke("plugin:barcode-scanner|cancel"); + await invoke('plugin:barcode-scanner|cancel') } /** * Get permission state. */ export async function checkPermissions(): Promise { - return await invoke<{ camera: PermissionState }>( - "plugin:barcode-scanner|check_permissions", - ).then((r) => r.camera); + return await checkPermissions_<{ camera: PermissionState }>( + 'barcode-scanner' + ).then((r) => r.camera) } /** * Request permissions to use the camera. */ export async function requestPermissions(): Promise { - return await invoke<{ camera: PermissionState }>( - "plugin:barcode-scanner|request_permissions", - ).then((r) => r.camera); + return await requestPermissions_<{ camera: PermissionState }>( + 'barcode-scanner' + ).then((r) => r.camera) } /** * Open application settings. Useful if permission was denied and the user must manually enable it. */ export async function openAppSettings(): Promise { - return await invoke("plugin:barcode-scanner|open_app_settings"); + await invoke('plugin:barcode-scanner|open_app_settings') } diff --git a/plugins/barcode-scanner/ios/Package.swift b/plugins/barcode-scanner/ios/Package.swift index aafb41c3..cf39b812 100644 --- a/plugins/barcode-scanner/ios/Package.swift +++ b/plugins/barcode-scanner/ios/Package.swift @@ -10,7 +10,8 @@ import PackageDescription let package = Package( name: "tauri-plugin-barcode-scanner", platforms: [ - .iOS(.v13) + .macOS(.v10_13), + .iOS(.v13), ], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. diff --git a/plugins/barcode-scanner/ios/Sources/BarcodeScannerPlugin.swift b/plugins/barcode-scanner/ios/Sources/BarcodeScannerPlugin.swift index 7a329e37..cde8d680 100644 --- a/plugins/barcode-scanner/ios/Sources/BarcodeScannerPlugin.swift +++ b/plugins/barcode-scanner/ios/Sources/BarcodeScannerPlugin.swift @@ -8,9 +8,9 @@ import UIKit import WebKit struct ScanOptions: Decodable { - var formats: [SupportedFormat] = [] - let windowed: Bool? - let cameraDirection: String? + var formats: [SupportedFormat]? + var windowed: Bool? + var cameraDirection: String? } enum SupportedFormat: String, CaseIterable, Decodable { @@ -241,7 +241,7 @@ class BarcodeScannerPlugin: Plugin, AVCaptureMetadataOutputObjectsDelegate { private func runScanner(_ invoke: Invoke, args: ScanOptions) { scanFormats = [AVMetadataObject.ObjectType]() - args.formats.forEach { format in + (args.formats ?? []).forEach { format in scanFormats.append(format.value) } @@ -262,6 +262,13 @@ class BarcodeScannerPlugin: Plugin, AVCaptureMetadataOutputObjectsDelegate { self.invoke = invoke + let entry = Bundle.main.infoDictionary?["NSCameraUsageDescription"] as? String + + if entry == nil || entry?.count == 0 { + invoke.reject("NSCameraUsageDescription is not in the app Info.plist") + return + } + var iOS14min: Bool = false if #available(iOS 14.0, *) { iOS14min = true } if !iOS14min && self.getPermissionState() != "granted" { diff --git a/plugins/barcode-scanner/package.json b/plugins/barcode-scanner/package.json index e1fe29bd..b90be3d7 100644 --- a/plugins/barcode-scanner/package.json +++ b/plugins/barcode-scanner/package.json @@ -1,11 +1,12 @@ { "name": "@tauri-apps/plugin-barcode-scanner", - "version": "2.0.0-beta.1", + "version": "2.0.0", "description": "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS", - "license": "MIT or APACHE-2.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -24,6 +25,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/barcode-scanner/permissions/autogenerated/reference.md b/plugins/barcode-scanner/permissions/autogenerated/reference.md index d20ff148..50cbcf99 100644 --- a/plugins/barcode-scanner/permissions/autogenerated/reference.md +++ b/plugins/barcode-scanner/permissions/autogenerated/reference.md @@ -1,50 +1,183 @@ -# Permissions +## Default Permission -## allow-cancel +This permission set configures which +barcode scanning features are by default exposed. + +#### Granted Permissions + +It allows all barcode related features. + + + +- `allow-cancel` +- `allow-check-permissions` +- `allow-open-app-settings` +- `allow-request-permissions` +- `allow-scan` +- `allow-vibrate` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`barcode-scanner:allow-cancel` + + Enables the cancel command without any pre-configured scope. -## deny-cancel +
+ +`barcode-scanner:deny-cancel` + + Denies the cancel command without any pre-configured scope. -## allow-check-permissions +
+ +`barcode-scanner:allow-check-permissions` + + Enables the check_permissions command without any pre-configured scope. -## deny-check-permissions +
+ +`barcode-scanner:deny-check-permissions` + + Denies the check_permissions command without any pre-configured scope. -## allow-open-app-settings +
+ +`barcode-scanner:allow-open-app-settings` + + Enables the open_app_settings command without any pre-configured scope. -## deny-open-app-settings +
+ +`barcode-scanner:deny-open-app-settings` + + Denies the open_app_settings command without any pre-configured scope. -## allow-request-permissions +
+ +`barcode-scanner:allow-request-permissions` + + Enables the request_permissions command without any pre-configured scope. -## deny-request-permissions +
+ +`barcode-scanner:deny-request-permissions` + + Denies the request_permissions command without any pre-configured scope. -## allow-scan +
+ +`barcode-scanner:allow-scan` + + Enables the scan command without any pre-configured scope. -## deny-scan +
+ +`barcode-scanner:deny-scan` + + Denies the scan command without any pre-configured scope. -## allow-vibrate +
+ +`barcode-scanner:allow-vibrate` + + Enables the vibrate command without any pre-configured scope. -## deny-vibrate +
+ +`barcode-scanner:deny-vibrate` + + Denies the vibrate command without any pre-configured scope. +
diff --git a/plugins/barcode-scanner/permissions/default.toml b/plugins/barcode-scanner/permissions/default.toml new file mode 100644 index 00000000..3b5a2dfd --- /dev/null +++ b/plugins/barcode-scanner/permissions/default.toml @@ -0,0 +1,20 @@ +"$schema" = "schemas/schema.json" +[default] +description = """ +This permission set configures which +barcode scanning features are by default exposed. + +#### Granted Permissions + +It allows all barcode related features. + +""" + +permissions = [ + "allow-cancel", + "allow-check-permissions", + "allow-open-app-settings", + "allow-request-permissions", + "allow-scan", + "allow-vibrate", +] diff --git a/plugins/barcode-scanner/permissions/schemas/schema.json b/plugins/barcode-scanner/permissions/schemas/schema.json index 18338010..f41214b4 100644 --- a/plugins/barcode-scanner/permissions/schemas/schema.json +++ b/plugins/barcode-scanner/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,92 +251,113 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-cancel -> Enables the cancel command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-cancel" + "macOS" ] }, { - "description": "deny-cancel -> Denies the cancel command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-cancel" + "windows" ] }, { - "description": "allow-check-permissions -> Enables the check_permissions command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-check-permissions" + "linux" ] }, { - "description": "deny-check-permissions -> Denies the check_permissions command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-check-permissions" + "android" ] }, { - "description": "allow-open-app-settings -> Enables the open_app_settings command without any pre-configured scope.", + "description": "iOS.", "type": "string", "enum": [ - "allow-open-app-settings" + "iOS" ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the cancel command without any pre-configured scope.", + "type": "string", + "const": "allow-cancel" }, { - "description": "deny-open-app-settings -> Denies the open_app_settings command without any pre-configured scope.", + "description": "Denies the cancel command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-open-app-settings" - ] + "const": "deny-cancel" }, { - "description": "allow-request-permissions -> Enables the request_permissions command without any pre-configured scope.", + "description": "Enables the check_permissions command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-request-permissions" - ] + "const": "allow-check-permissions" }, { - "description": "deny-request-permissions -> Denies the request_permissions command without any pre-configured scope.", + "description": "Denies the check_permissions command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-request-permissions" - ] + "const": "deny-check-permissions" }, { - "description": "allow-scan -> Enables the scan command without any pre-configured scope.", + "description": "Enables the open_app_settings command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-scan" - ] + "const": "allow-open-app-settings" }, { - "description": "deny-scan -> Denies the scan command without any pre-configured scope.", + "description": "Denies the open_app_settings command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-scan" - ] + "const": "deny-open-app-settings" }, { - "description": "allow-vibrate -> Enables the vibrate command without any pre-configured scope.", + "description": "Enables the request_permissions command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-vibrate" - ] + "const": "allow-request-permissions" }, { - "description": "deny-vibrate -> Denies the vibrate command without any pre-configured scope.", + "description": "Denies the request_permissions command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-vibrate" - ] + "const": "deny-request-permissions" + }, + { + "description": "Enables the scan command without any pre-configured scope.", + "type": "string", + "const": "allow-scan" + }, + { + "description": "Denies the scan command without any pre-configured scope.", + "type": "string", + "const": "deny-scan" + }, + { + "description": "Enables the vibrate command without any pre-configured scope.", + "type": "string", + "const": "allow-vibrate" + }, + { + "description": "Denies the vibrate command without any pre-configured scope.", + "type": "string", + "const": "deny-vibrate" + }, + { + "description": "This permission set configures which\nbarcode scanning features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all barcode related features.\n\n", + "type": "string", + "const": "default" } ] } diff --git a/plugins/barcode-scanner/rollup.config.js b/plugins/barcode-scanner/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/barcode-scanner/rollup.config.js +++ b/plugins/barcode-scanner/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/barcode-scanner/src/api-iife.js b/plugins/barcode-scanner/src/api-iife.js deleted file mode 100644 index 77c9d45c..00000000 --- a/plugins/barcode-scanner/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_BARCODESCANNER__=function(n){"use strict";async function e(n,e={},r){return window.__TAURI_INTERNALS__.invoke(n,e,r)}var r;return"function"==typeof SuppressedError&&SuppressedError,n.Format=void 0,(r=n.Format||(n.Format={})).QRCode="QR_CODE",r.UPC_A="UPC_A",r.UPC_E="UPC_E",r.EAN8="EAN_8",r.EAN13="EAN_13",r.Code39="CODE_39",r.Code93="CODE_93",r.Code128="CODE_128",r.Codabar="CODABAR",r.ITF="ITF",r.Aztec="AZTEC",r.DataMatrix="DATA_MATRIX",r.PDF417="PDF_417",n.cancel=async function(){return await e("plugin:barcode-scanner|cancel")},n.checkPermissions=async function(){return await e("plugin:barcode-scanner|check_permissions").then((n=>n.camera))},n.openAppSettings=async function(){return await e("plugin:barcode-scanner|open_app_settings")},n.requestPermissions=async function(){return await e("plugin:barcode-scanner|request_permissions").then((n=>n.camera))},n.scan=async function(n){return await e("plugin:barcode-scanner|scan",{...n})},n}({});Object.defineProperty(window.__TAURI__,"barcodeScanner",{value:__TAURI_PLUGIN_BARCODESCANNER__})} diff --git a/plugins/barcode-scanner/src/lib.rs b/plugins/barcode-scanner/src/lib.rs index 1b6fcff4..2f2e7ee9 100644 --- a/plugins/barcode-scanner/src/lib.rs +++ b/plugins/barcode-scanner/src/lib.rs @@ -27,7 +27,7 @@ pub struct BarcodeScanner(PluginHandle); impl BarcodeScanner {} -/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the barcode scanner APIs. +/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the barcode scanner APIs. pub trait BarcodeScannerExt { fn barcode_scanner(&self) -> &BarcodeScanner; } diff --git a/plugins/biometric/CHANGELOG.md b/plugins/biometric/CHANGELOG.md index 67aa19f9..1eac8a95 100644 --- a/plugins/biometric/CHANGELOG.md +++ b/plugins/biometric/CHANGELOG.md @@ -1,5 +1,64 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.2] + +- [`b9147758`](https://github.com/tauri-apps/plugins-workspace/commit/b914775898c2bee7ceb20bd17ee595005cd17a64) ([#1679](https://github.com/tauri-apps/plugins-workspace/pull/1679) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Explicitly set a minimum macOS version for the Swift package. + +## \[2.0.0-rc.1] + +### changes + +- [`6b079cfd`](https://github.com/tauri-apps/plugins-workspace/commit/6b079cfdd107c94abc2c7300f6af00bac3ff4040) ([#1649](https://github.com/tauri-apps/plugins-workspace/pull/1649) by [@ahqsoftwares](https://github.com/tauri-apps/plugins-workspace/../../ahqsoftwares)) Remove targetSdk from build.kts files as it is deprecated and will be removed from DSL v9.0 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.8] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.7] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.6] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[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] + +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -12,4 +71,14 @@ - [`8df28a9`](https://github.com/tauri-apps/plugins-workspace/commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release. - [`8df28a9`](https://github.com/tauri-apps/plugins-workspace/commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release. -commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release. + commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release. + 29]\(https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release. + commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release. + . + commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release. + itial release. + 29]\(https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release. + commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release. + . + commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release. + ithub.com/tauri-apps/plugins-workspace/pull/829)) Initial release. diff --git a/plugins/biometric/Cargo.toml b/plugins/biometric/Cargo.toml index c1699fd4..816c5ef1 100644 --- a/plugins/biometric/Cargo.toml +++ b/plugins/biometric/Cargo.toml @@ -1,18 +1,28 @@ [package] name = "tauri-plugin-biometric" -version = "2.0.0-beta.1" +version = "2.0.1" description = "Prompt the user for biometric authentication on Android and iOS." edition = { workspace = true } authors = { workspace = true } license = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-biometric" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] +targets = ["x86_64-linux-android"] + +[package.metadata.platforms.support] +windows = { level = "none", notes = "" } +linux = { level = "none", notes = "" } +macos = { level = "none", notes = "" } +android = { level = "full", notes = "" } +ios = { level = "full", notes = "" } + [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } diff --git a/plugins/biometric/README.md b/plugins/biometric/README.md index 459441eb..2028595d 100644 --- a/plugins/biometric/README.md +++ b/plugins/biometric/README.md @@ -2,6 +2,14 @@ Prompt the user for biometric authentication on Android and iOS. +| Platform | Supported | +| -------- | --------- | +| Linux | x | +| Windows | x | +| macOS | x | +| Android | ✓ | +| iOS | ✓ | + ## Install _This plugin requires a Rust version of at least **1.65**_ @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-biometric = "2.0.0-beta" +tauri-plugin-biometric = "2.0.0" # alternatively with Git: tauri-plugin-biometric = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -62,8 +70,8 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { authenticate } from "@tauri-apps/plugin-biometric"; -await authenticate('Open your wallet'); +import { authenticate } from '@tauri-apps/plugin-biometric' +await authenticate('Open your wallet') ``` ## Contributing diff --git a/plugins/biometric/SECURITY.md b/plugins/biometric/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/biometric/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/biometric/android/build.gradle.kts b/plugins/biometric/android/build.gradle.kts index 81d4f70e..d8833662 100644 --- a/plugins/biometric/android/build.gradle.kts +++ b/plugins/biometric/android/build.gradle.kts @@ -5,11 +5,10 @@ plugins { android { namespace = "app.tauri.biometric" - compileSdk = 32 + compileSdk = 34 defaultConfig { - minSdk = 24 - targetSdk = 32 + minSdk = 24 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") diff --git a/plugins/biometric/android/src/main/java/BiometricPlugin.kt b/plugins/biometric/android/src/main/java/BiometricPlugin.kt index 11e3ddf5..b3436fd4 100644 --- a/plugins/biometric/android/src/main/java/BiometricPlugin.kt +++ b/plugins/biometric/android/src/main/java/BiometricPlugin.kt @@ -115,6 +115,7 @@ class BiometricPlugin(private val activity: Activity): Plugin(activity) { val biometryResult = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { manager.canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_WEAK) } else { + @Suppress("DEPRECATION") manager.canAuthenticate() } val ret = JSObject() diff --git a/plugins/biometric/api-iife.js b/plugins/biometric/api-iife.js new file mode 100644 index 00000000..3da2296b --- /dev/null +++ b/plugins/biometric/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_BIOMETRIC__=function(e){"use strict";async function i(e,i={},t){return window.__TAURI_INTERNALS__.invoke(e,i,t)}var t;return"function"==typeof SuppressedError&&SuppressedError,e.BiometryType=void 0,(t=e.BiometryType||(e.BiometryType={}))[t.None=0]="None",t[t.TouchID=1]="TouchID",t[t.FaceID=2]="FaceID",t[t.Iris=3]="Iris",e.authenticate=async function(e,t){await i("plugin:biometric|authenticate",{reason:e,...t})},e.checkStatus=async function(){return await i("plugin:biometric|status")},e}({});Object.defineProperty(window.__TAURI__,"biometric",{value:__TAURI_PLUGIN_BIOMETRIC__})} diff --git a/plugins/biometric/build.rs b/plugins/biometric/build.rs index 3df01ac9..070986b2 100644 --- a/plugins/biometric/build.rs +++ b/plugins/biometric/build.rs @@ -5,8 +5,14 @@ const COMMANDS: &[&str] = &["authenticate", "status"]; fn main() { - tauri_plugin::Builder::new(COMMANDS) + let result = tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .android_path("android") .ios_path("ios") - .build(); + .try_build(); + + // when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build + if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) { + result.unwrap(); + } } diff --git a/plugins/biometric/guest-js/index.ts b/plugins/biometric/guest-js/index.ts index 16ab3807..5c3eb8df 100644 --- a/plugins/biometric/guest-js/index.ts +++ b/plugins/biometric/guest-js/index.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { invoke } from "@tauri-apps/api/core"; +import { invoke } from '@tauri-apps/api/core' export enum BiometryType { None = 0, @@ -11,39 +11,39 @@ export enum BiometryType { // Apple FaceID or Android face authentication FaceID = 2, // Android iris authentication - Iris = 3, + Iris = 3 } export interface Status { - isAvailable: boolean; - biometryType: BiometryType; - error?: string; + isAvailable: boolean + biometryType: BiometryType + error?: string errorCode?: - | "appCancel" - | "authenticationFailed" - | "invalidContext" - | "notInteractive" - | "passcodeNotSet" - | "systemCancel" - | "userCancel" - | "userFallback" - | "biometryLockout" - | "biometryNotAvailable" - | "biometryNotEnrolled"; + | 'appCancel' + | 'authenticationFailed' + | 'invalidContext' + | 'notInteractive' + | 'passcodeNotSet' + | 'systemCancel' + | 'userCancel' + | 'userFallback' + | 'biometryLockout' + | 'biometryNotAvailable' + | 'biometryNotEnrolled' } export interface AuthOptions { - allowDeviceCredential?: boolean; - cancelTitle?: string; + allowDeviceCredential?: boolean + cancelTitle?: string // iOS options - fallbackTitle?: string; + fallbackTitle?: string // android options - title?: string; - subtitle?: string; - confirmationRequired?: boolean; - maxAttemps?: number; + title?: string + subtitle?: string + confirmationRequired?: boolean + maxAttemps?: number } /** @@ -51,7 +51,7 @@ export interface AuthOptions { * @returns a promise resolving to an object containing all the information about the status of the biometry. */ export async function checkStatus(): Promise { - return invoke("plugin:biometric|status"); + return await invoke('plugin:biometric|status') } /** @@ -68,10 +68,10 @@ export async function checkStatus(): Promise { */ export async function authenticate( reason: string, - options?: AuthOptions, + options?: AuthOptions ): Promise { - return invoke("plugin:biometric|authenticate", { + await invoke('plugin:biometric|authenticate', { reason, - ...options, - }); + ...options + }) } diff --git a/plugins/biometric/ios/Package.swift b/plugins/biometric/ios/Package.swift index 34c9f87e..7860f476 100644 --- a/plugins/biometric/ios/Package.swift +++ b/plugins/biometric/ios/Package.swift @@ -8,7 +8,8 @@ import PackageDescription let package = Package( name: "tauri-plugin-biometric", platforms: [ - .iOS(.v13) + .macOS(.v10_13), + .iOS(.v13), ], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. diff --git a/plugins/biometric/ios/Sources/BiometricPlugin.swift b/plugins/biometric/ios/Sources/BiometricPlugin.swift index 7e3e8bbd..3c9a192a 100644 --- a/plugins/biometric/ios/Sources/BiometricPlugin.swift +++ b/plugins/biometric/ios/Sources/BiometricPlugin.swift @@ -25,8 +25,8 @@ class BiometricStatus { struct AuthOptions: Decodable { let reason: String var allowDeviceCredential: Bool? - let fallbackTitle: String? - let cancelTitle: String? + var fallbackTitle: String? + var cancelTitle: String? } class BiometricPlugin: Plugin { diff --git a/plugins/biometric/package.json b/plugins/biometric/package.json index 82578b0a..5d0cd5c0 100644 --- a/plugins/biometric/package.json +++ b/plugins/biometric/package.json @@ -1,10 +1,11 @@ { "name": "@tauri-apps/plugin-biometric", - "version": "2.0.0-beta.1", - "license": "MIT or APACHE-2.0", + "version": "2.0.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -23,10 +24,7 @@ "README.md", "LICENSE" ], - "devDependencies": { - "tslib": "2.6.0" - }, "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/biometric/permissions/autogenerated/reference.md b/plugins/biometric/permissions/autogenerated/reference.md index ef091dfa..37a9fa07 100644 --- a/plugins/biometric/permissions/autogenerated/reference.md +++ b/plugins/biometric/permissions/autogenerated/reference.md @@ -1,18 +1,75 @@ -# Permissions +## Default Permission -## allow-authenticate +This permission set configures which +biometric features are by default exposed. + +#### Granted Permissions + +It allows acccess to all biometric commands. + + + +- `allow-authenticate` +- `allow-status` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`biometric:allow-authenticate` + + Enables the authenticate command without any pre-configured scope. -## deny-authenticate +
+ +`biometric:deny-authenticate` + + Denies the authenticate command without any pre-configured scope. -## allow-status +
+ +`biometric:allow-status` + + Enables the status command without any pre-configured scope. -## deny-status +
+ +`biometric:deny-status` + + Denies the status command without any pre-configured scope. +
diff --git a/plugins/biometric/permissions/default.toml b/plugins/biometric/permissions/default.toml new file mode 100644 index 00000000..651990ef --- /dev/null +++ b/plugins/biometric/permissions/default.toml @@ -0,0 +1,13 @@ +"$schema" = "schemas/schema.json" +[default] +description = """ +This permission set configures which +biometric features are by default exposed. + +#### Granted Permissions + +It allows acccess to all biometric commands. + +""" + +permissions = ["allow-authenticate", "allow-status"] diff --git a/plugins/biometric/permissions/schemas/schema.json b/plugins/biometric/permissions/schemas/schema.json index d54ce3a5..cc4d04d5 100644 --- a/plugins/biometric/permissions/schemas/schema.json +++ b/plugins/biometric/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,36 +251,73 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-authenticate -> Enables the authenticate command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-authenticate" + "macOS" ] }, { - "description": "deny-authenticate -> Denies the authenticate command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-authenticate" + "windows" ] }, { - "description": "allow-status -> Enables the status command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-status" + "linux" ] }, { - "description": "deny-status -> Denies the status command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-status" + "android" ] + }, + { + "description": "iOS.", + "type": "string", + "enum": [ + "iOS" + ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the authenticate command without any pre-configured scope.", + "type": "string", + "const": "allow-authenticate" + }, + { + "description": "Denies the authenticate command without any pre-configured scope.", + "type": "string", + "const": "deny-authenticate" + }, + { + "description": "Enables the status command without any pre-configured scope.", + "type": "string", + "const": "allow-status" + }, + { + "description": "Denies the status command without any pre-configured scope.", + "type": "string", + "const": "deny-status" + }, + { + "description": "This permission set configures which\nbiometric features are by default exposed.\n\n#### Granted Permissions\n\nIt allows acccess to all biometric commands.\n\n", + "type": "string", + "const": "default" } ] } diff --git a/plugins/biometric/rollup.config.js b/plugins/biometric/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/biometric/rollup.config.js +++ b/plugins/biometric/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/biometric/src/api-iife.js b/plugins/biometric/src/api-iife.js deleted file mode 100644 index 450585b5..00000000 --- a/plugins/biometric/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_BIOMETRIC__=function(e){"use strict";async function n(e,n={},r){return window.__TAURI_INTERNALS__.invoke(e,n,r)}var r;return"function"==typeof SuppressedError&&SuppressedError,e.BiometryType=void 0,(r=e.BiometryType||(e.BiometryType={}))[r.None=0]="None",r[r.TouchID=1]="TouchID",r[r.FaceID=2]="FaceID",r[r.Iris=3]="Iris",e.authenticate=async function(e,r){return n("plugin:biometric|authenticate",{reason:e,...r})},e.checkStatus=async function(){return n("plugin:biometric|status")},e}({});Object.defineProperty(window.__TAURI__,"biometric",{value:__TAURI_PLUGIN_BIOMETRIC__})} diff --git a/plugins/biometric/src/lib.rs b/plugins/biometric/src/lib.rs index 8b0d472d..f79a104d 100644 --- a/plugins/biometric/src/lib.rs +++ b/plugins/biometric/src/lib.rs @@ -45,7 +45,7 @@ impl Biometric { } } -/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the biometric APIs. +/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the biometric APIs. pub trait BiometricExt { fn biometric(&self) -> &Biometric; } @@ -59,7 +59,6 @@ impl> crate::BiometricExt for T { /// Initializes the plugin. pub fn init() -> TauriPlugin { Builder::new("biometric") - .js_init_script(include_str!("api-iife.js").to_string()) .setup(|app, api| { #[cfg(target_os = "android")] let handle = api.register_android_plugin(PLUGIN_IDENTIFIER, "BiometricPlugin")?; diff --git a/plugins/biometric/src/models.rs b/plugins/biometric/src/models.rs index e4fceedc..49c84300 100644 --- a/plugins/biometric/src/models.rs +++ b/plugins/biometric/src/models.rs @@ -7,16 +7,17 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Default, Serialize)] #[serde(rename_all = "camelCase")] pub struct AuthOptions { + /// Enables authentication using the device's password. This feature is available on both Android and iOS. pub allow_device_credential: bool, - /// iOS only. - pub fallback_title: Option, - /// iOS only. + /// Label for the Cancel button. This feature is available on both Android and iOS. pub cancel_title: Option, - /// Android only. + /// Specifies the text displayed on the fallback button if biometric authentication fails. This feature is available iOS only. + pub fallback_title: Option, + /// Title indicating the purpose of biometric verification. This feature is available Android only. pub title: Option, - /// Android only. + /// SubTitle providing contextual information of biometric verification. This feature is available Android only. pub subtitle: Option, - /// Android only. + /// Specifies whether additional user confirmation is required, such as pressing a button after successful biometric authentication. This feature is available Android only. pub confirmation_required: Option, } diff --git a/plugins/cli/CHANGELOG.md b/plugins/cli/CHANGELOG.md index 84b71e6f..879c20b6 100644 --- a/plugins/cli/CHANGELOG.md +++ b/plugins/cli/CHANGELOG.md @@ -1,5 +1,58 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.2] + +- [`68579934`](https://github.com/tauri-apps/plugins-workspace/commit/68579934c93f6ed2edbc97474560d6a8a00e8f70) ([#1856](https://github.com/tauri-apps/plugins-workspace/pull/1856) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Expose `Matches`, `SubcommandMatches` and `ArgData` structs. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.8] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.7] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.6] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[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] + +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -41,4 +94,5 @@ - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ae67\`]\(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! + om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/cli/Cargo.toml b/plugins/cli/Cargo.toml index 478d6b47..b4db6991 100644 --- a/plugins/cli/Cargo.toml +++ b/plugins/cli/Cargo.toml @@ -1,19 +1,28 @@ [package] name = "tauri-plugin-cli" -version = "2.0.0-beta.1" +version = "2.0.1" description = "Parse arguments from your Tauri application's command line interface." edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-cli" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "none", notes = "" } +ios = { level = "none", notes = "" } + [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -21,4 +30,4 @@ serde_json = { workspace = true } tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } -clap = { version = "4", features = [ "string" ] } +clap = { version = "4", features = ["string"] } diff --git a/plugins/cli/README.md b/plugins/cli/README.md index c58a6f31..05d5bd35 100644 --- a/plugins/cli/README.md +++ b/plugins/cli/README.md @@ -2,11 +2,17 @@ Parse arguments from your Command Line Interface. -- Supported platforms: Windows, Linux and macOS. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | x | +| iOS | x | ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -21,7 +27,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml # you can add the dependencies on the `[dependencies]` section if you do not target mobile [target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies] -tauri-plugin-cli = "2.0.0-beta" +tauri-plugin-cli = "2.0.0" # alternatively with Git: tauri-plugin-cli = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -67,16 +73,16 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { getMatches } from "@tauri-apps/plugin-cli"; -const matches = await getMatches(); -if (matches.subcommand?.name === "run") { +import { getMatches } from '@tauri-apps/plugin-cli' +const matches = await getMatches() +if (matches.subcommand?.name === 'run') { // `./your-app run $ARGS` was executed - const args = matches.subcommand?.matches.args; - if ("debug" in args) { + const args = matches.subcommand?.matches.args + if ('debug' in args) { // `./your-app run --debug` was executed } } else { - const args = matches.args; + const args = matches.args // `./your-app $ARGS` was executed } ``` diff --git a/plugins/cli/SECURITY.md b/plugins/cli/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/cli/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/cli/src/api-iife.js b/plugins/cli/api-iife.js similarity index 100% rename from plugins/cli/src/api-iife.js rename to plugins/cli/api-iife.js diff --git a/plugins/cli/build.rs b/plugins/cli/build.rs index 15ff656f..50d88849 100644 --- a/plugins/cli/build.rs +++ b/plugins/cli/build.rs @@ -5,5 +5,7 @@ const COMMANDS: &[&str] = &["cli_matches"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/cli/guest-js/index.ts b/plugins/cli/guest-js/index.ts index 0ab7868e..7a7f4acf 100644 --- a/plugins/cli/guest-js/index.ts +++ b/plugins/cli/guest-js/index.ts @@ -8,7 +8,7 @@ * @module */ -import { invoke } from "@tauri-apps/api/core"; +import { invoke } from '@tauri-apps/api/core' /** * @since 2.0.0 @@ -19,27 +19,27 @@ interface ArgMatch { * boolean if flag * string[] or null if takes multiple values */ - value: string | boolean | string[] | null; + value: string | boolean | string[] | null /** * Number of occurrences */ - occurrences: number; + occurrences: number } /** * @since 2.0.0 */ interface SubcommandMatch { - name: string; - matches: CliMatches; + name: string + matches: CliMatches } /** * @since 2.0.0 */ interface CliMatches { - args: Record; - subcommand: SubcommandMatch | null; + args: Record + subcommand: SubcommandMatch | null } /** @@ -64,9 +64,9 @@ interface CliMatches { * @since 2.0.0 */ async function getMatches(): Promise { - return await invoke("plugin:cli|cli_matches"); + return await invoke('plugin:cli|cli_matches') } -export type { ArgMatch, SubcommandMatch, CliMatches }; +export type { ArgMatch, SubcommandMatch, CliMatches } -export { getMatches }; +export { getMatches } diff --git a/plugins/cli/package.json b/plugins/cli/package.json index be8cebba..481082bb 100644 --- a/plugins/cli/package.json +++ b/plugins/cli/package.json @@ -1,10 +1,11 @@ { "name": "@tauri-apps/plugin-cli", - "version": "2.0.0-beta.1", - "license": "MIT or APACHE-2.0", + "version": "2.0.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -23,6 +24,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/cli/permissions/autogenerated/reference.md b/plugins/cli/permissions/autogenerated/reference.md index 0f231dc3..a920b749 100644 --- a/plugins/cli/permissions/autogenerated/reference.md +++ b/plugins/cli/permissions/autogenerated/reference.md @@ -1,14 +1,41 @@ -# Permissions +## Default Permission -## allow-cli-matches +Allows reading the CLI matches + +- `allow-cli-matches` + +## Permission Table + + + + + + + + + + + + -Denies the cli_matches command without any pre-configured scope. + + + + +
IdentifierDescription
+ +`cli:allow-cli-matches` + + Enables the cli_matches command without any pre-configured scope. -## deny-cli-matches +
-## default +`cli:deny-cli-matches` -Allows reading the CLI matches + + +Denies the cli_matches command without any pre-configured scope. +
diff --git a/plugins/cli/permissions/schemas/schema.json b/plugins/cli/permissions/schemas/schema.json index 0a6c3b50..b376890e 100644 --- a/plugins/cli/permissions/schemas/schema.json +++ b/plugins/cli/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,29 +251,63 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-cli-matches -> Enables the cli_matches command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-cli-matches" + "macOS" ] }, { - "description": "deny-cli-matches -> Denies the cli_matches command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-cli-matches" + "windows" ] }, { - "description": "default -> Allows reading the CLI matches", + "description": "Linux.", "type": "string", "enum": [ - "default" + "linux" ] + }, + { + "description": "Android.", + "type": "string", + "enum": [ + "android" + ] + }, + { + "description": "iOS.", + "type": "string", + "enum": [ + "iOS" + ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the cli_matches command without any pre-configured scope.", + "type": "string", + "const": "allow-cli-matches" + }, + { + "description": "Denies the cli_matches command without any pre-configured scope.", + "type": "string", + "const": "deny-cli-matches" + }, + { + "description": "Allows reading the CLI matches", + "type": "string", + "const": "default" } ] } diff --git a/plugins/cli/rollup.config.js b/plugins/cli/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/cli/rollup.config.js +++ b/plugins/cli/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/cli/src/error.rs b/plugins/cli/src/error.rs index b4bd2872..2b5e1602 100644 --- a/plugins/cli/src/error.rs +++ b/plugins/cli/src/error.rs @@ -18,3 +18,5 @@ impl Serialize for Error { serializer.serialize_str(self.to_string().as_ref()) } } + +pub type Result = std::result::Result; diff --git a/plugins/cli/src/lib.rs b/plugins/cli/src/lib.rs index c666874c..38f64f83 100644 --- a/plugins/cli/src/lib.rs +++ b/plugins/cli/src/lib.rs @@ -23,8 +23,9 @@ mod error; mod parser; use config::{Arg, Config}; -pub use error::Error; -type Result = std::result::Result; + +pub use error::{Error, Result}; +pub use parser::{ArgData, Matches, SubcommandMatches}; pub struct Cli(PluginApi); @@ -51,7 +52,6 @@ fn cli_matches(_app: AppHandle, cli: State<'_, Cli>) -> Result pub fn init() -> TauriPlugin { Builder::new("cli") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![cli_matches]) .setup(|app, api| { app.manage(Cli(api)); diff --git a/plugins/clipboard-manager/CHANGELOG.md b/plugins/clipboard-manager/CHANGELOG.md index 46f2509a..68dee776 100644 --- a/plugins/clipboard-manager/CHANGELOG.md +++ b/plugins/clipboard-manager/CHANGELOG.md @@ -1,5 +1,77 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.2] + +- [`341a5320`](https://github.com/tauri-apps/plugins-workspace/commit/341a5320c33d3c7b041abf7eb0ab7ad8009e6c3f) ([#1771](https://github.com/tauri-apps/plugins-workspace/pull/1771)) Fix warnings and clear implementation on Android below SDK 28. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.2] + +- [`b9147758`](https://github.com/tauri-apps/plugins-workspace/commit/b914775898c2bee7ceb20bd17ee595005cd17a64) ([#1679](https://github.com/tauri-apps/plugins-workspace/pull/1679) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Explicitly set a minimum macOS version for the Swift package. + +## \[2.0.0-rc.1] + +- [`2c00c029`](https://github.com/tauri-apps/plugins-workspace/commit/2c00c0292c9127b81567de46691e8c0f73557261) ([#1630](https://github.com/tauri-apps/plugins-workspace/pull/1630) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fixed an issue that caused multi-word IIFE names to not be formatted correctly. For example the `barcode-scanner` was defined as `window.__TAURI_PLUGIN_CLIPBOARDMANAGER__` instead of `window.__TAURI_PLUGIN_CLIPBOARD_MANAGER__`. + +### changes + +- [`6b079cfd`](https://github.com/tauri-apps/plugins-workspace/commit/6b079cfdd107c94abc2c7300f6af00bac3ff4040) ([#1649](https://github.com/tauri-apps/plugins-workspace/pull/1649) by [@ahqsoftwares](https://github.com/tauri-apps/plugins-workspace/../../ahqsoftwares)) Remove targetSdk from build.kts files as it is deprecated and will be removed from DSL v9.0 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.1.0-beta.6] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.1.0-beta.5] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.1.0-beta.4] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.1.0-beta.3] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.1.0-beta.2] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.1.0-beta.1] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[2.1.0-beta.1] + +- [`27b258c`](https://github.com/tauri-apps/plugins-workspace/commit/27b258cf31ae5557c99ae66537fb9196368d4d8b)([#1185](https://github.com/tauri-apps/plugins-workspace/pull/1185)) Expose `Clipboard` struct +- [`e3d41f4`](https://github.com/tauri-apps/plugins-workspace/commit/e3d41f4011bd3ea3ce281bb38bbe31d3709f8e0f)([#1191](https://github.com/tauri-apps/plugins-workspace/pull/1191)) Internally use the webview scoped resources table instead of the app one, so other webviews can't access other webviews resources. +- [`e3d41f4`](https://github.com/tauri-apps/plugins-workspace/commit/e3d41f4011bd3ea3ce281bb38bbe31d3709f8e0f)([#1191](https://github.com/tauri-apps/plugins-workspace/pull/1191)) Update for tauri 2.0.0-beta.15. + +## \[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] + +- [`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. +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -41,4 +113,33 @@ ## \[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! + 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! + 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + hub.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! + 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + 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! + 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! + ps/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! + om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/clipboard-manager/Cargo.toml b/plugins/clipboard-manager/Cargo.toml index cd032ac1..3c086574 100644 --- a/plugins/clipboard-manager/Cargo.toml +++ b/plugins/clipboard-manager/Cargo.toml @@ -1,20 +1,29 @@ [package] name = "tauri-plugin-clipboard-manager" -version = "2.0.0-beta.1" +version = "2.0.1" description = "Read and write to the system clipboard." edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-clipboard-manager" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] -targets = [ "x86_64-unknown-linux-gnu", "x86_64-linux-android" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] +targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "partial", notes = "Only plain-text content support" } +ios = { level = "partial", notes = "Only plain-text content support" } + [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -23,5 +32,9 @@ tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } +[target.'cfg(target_os = "ios")'.dependencies] +tauri = { workspace = true, features = ["wry"] } + [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" +image = "0.25" diff --git a/plugins/clipboard-manager/README.md b/plugins/clipboard-manager/README.md index cd7f5216..daec970d 100644 --- a/plugins/clipboard-manager/README.md +++ b/plugins/clipboard-manager/README.md @@ -2,9 +2,17 @@ Read and write to the system clipboard. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ✓ | +| iOS | ✓ | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-clipboard-manager = "2.0.0-beta" +tauri-plugin-clipboard-manager = "2.0.0" # alternatively with Git: tauri-plugin-clipboard-manager = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -60,9 +68,15 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { writeText, readText, writeHtml, readHtml, clear } from "@tauri-apps/plugin-clipboard-manager"; -await writeText("Tauri is awesome!"); -assert(await readText(), "Tauri is awesome!"); +import { + writeText, + readText, + writeHtml, + readHtml, + clear +} from '@tauri-apps/plugin-clipboard-manager' +await writeText('Tauri is awesome!') +assert(await readText(), 'Tauri is awesome!') ``` ## Contributing diff --git a/plugins/clipboard-manager/SECURITY.md b/plugins/clipboard-manager/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/clipboard-manager/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/clipboard-manager/android/build.gradle.kts b/plugins/clipboard-manager/android/build.gradle.kts index b3caf13e..b12a7482 100644 --- a/plugins/clipboard-manager/android/build.gradle.kts +++ b/plugins/clipboard-manager/android/build.gradle.kts @@ -5,11 +5,10 @@ plugins { android { namespace = "app.tauri.clipboard" - compileSdk = 32 + compileSdk = 34 defaultConfig { - minSdk = 24 - targetSdk = 32 + minSdk = 24 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") diff --git a/plugins/clipboard-manager/android/src/main/java/ClipboardPlugin.kt b/plugins/clipboard-manager/android/src/main/java/ClipboardPlugin.kt index 432e337e..ebb931b4 100644 --- a/plugins/clipboard-manager/android/src/main/java/ClipboardPlugin.kt +++ b/plugins/clipboard-manager/android/src/main/java/ClipboardPlugin.kt @@ -4,12 +4,12 @@ package app.tauri.clipboard -import android.R.attr.value import android.app.Activity import android.content.ClipData import android.content.ClipDescription import android.content.ClipboardManager import android.content.Context +import android.os.Build import app.tauri.annotation.Command import app.tauri.annotation.InvokeArg import app.tauri.annotation.TauriPlugin @@ -59,7 +59,9 @@ internal class ReadClipDataSerializer @JvmOverloads constructor(t: Class {} + else -> { + throw Exception("unimplemented ReadClipData") + } } jgen.writeEndObject() @@ -87,17 +89,17 @@ class ClipboardPlugin(private val activity: Activity) : Plugin(activity) { @Command @Suppress("MoveVariableDeclarationIntoWhen") - fun write(invoke: Invoke) { + fun writeText(invoke: Invoke) { val args = invoke.parseArgs(WriteOptions::class.java) val clipData = when (args) { is WriteOptions.PlainText -> { ClipData.newPlainText(args.label, args.text) - } - else -> { - invoke.reject("unimplemented clip data") + } else -> { + invoke.reject("unimplemented WriteOptions") return } + } manager.setPrimaryClip(clipData) @@ -106,7 +108,7 @@ class ClipboardPlugin(private val activity: Activity) : Plugin(activity) { } @Command - fun read(invoke: Invoke) { + fun readText(invoke: Invoke) { val data = if (manager.hasPrimaryClip()) { if (manager.primaryClipDescription?.hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN) == true) { val item: ClipData.Item = manager.primaryClip!!.getItemAt(0) @@ -125,4 +127,16 @@ class ClipboardPlugin(private val activity: Activity) : Plugin(activity) { invoke.resolveObject(data) } + + @Command + fun clear(invoke: Invoke) { + if (manager.hasPrimaryClip()) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + manager.clearPrimaryClip() + } else { + manager.setPrimaryClip(ClipData.newPlainText("", "")) + } + } + invoke.resolve() + } } diff --git a/plugins/clipboard-manager/api-iife.js b/plugins/clipboard-manager/api-iife.js new file mode 100644 index 00000000..7750e01d --- /dev/null +++ b/plugins/clipboard-manager/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARD_MANAGER__=function(e){"use strict";var t;async function r(e,t={},r){return window.__TAURI_INTERNALS__.invoke(e,t,r)}"function"==typeof SuppressedError&&SuppressedError;class n{get rid(){return function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}(this,t,"f")}constructor(e){t.set(this,void 0),function(e,t,r,n,a){if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");t.set(e,r)}(this,t,e)}async close(){return r("plugin:resources|close",{rid:this.rid})}}t=new WeakMap;class a extends n{constructor(e){super(e)}static async new(e,t,n){return r("plugin:image|new",{rgba:i(e),width:t,height:n}).then((e=>new a(e)))}static async fromBytes(e){return r("plugin:image|from_bytes",{bytes:i(e)}).then((e=>new a(e)))}static async fromPath(e){return r("plugin:image|from_path",{path:e}).then((e=>new a(e)))}async rgba(){return r("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return r("plugin:image|size",{rid:this.rid})}}function i(e){return null==e?null:"string"==typeof e?e:e instanceof a?e.rid:e}return e.clear=async function(){await r("plugin:clipboard-manager|clear")},e.readImage=async function(){return await r("plugin:clipboard-manager|read_image").then((e=>new a(e)))},e.readText=async function(){return await r("plugin:clipboard-manager|read_text")},e.writeHtml=async function(e,t){await r("plugin:clipboard-manager|write_html",{html:e,altHtml:t})},e.writeImage=async function(e){await r("plugin:clipboard-manager|write_image",{image:i(e)})},e.writeText=async function(e,t){await r("plugin:clipboard-manager|write_text",{label:t?.label,text:e})},e}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARD_MANAGER__})} diff --git a/plugins/clipboard-manager/build.rs b/plugins/clipboard-manager/build.rs index 758d64f3..9bbeddfc 100644 --- a/plugins/clipboard-manager/build.rs +++ b/plugins/clipboard-manager/build.rs @@ -2,18 +2,24 @@ // SPDX-License-Identifier: Apache-2.0 // 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() { - if let Err(error) = tauri_plugin::Builder::new(COMMANDS) + let result = tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .android_path("android") .ios_path("ios") - .try_build() - { - println!("{error:#}"); - // when building documentation for Android the plugin build result is irrelevant to the crate itself - if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) { - std::process::exit(1); - } + .try_build(); + + // when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build + if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) { + result.unwrap(); } } diff --git a/plugins/clipboard-manager/guest-js/index.ts b/plugins/clipboard-manager/guest-js/index.ts index c812ad53..f7f31842 100644 --- a/plugins/clipboard-manager/guest-js/index.ts +++ b/plugins/clipboard-manager/guest-js/index.ts @@ -8,9 +8,8 @@ * @module */ -import { invoke } from "@tauri-apps/api/core"; - -type ClipResponse = Record<"plainText", { text: string }>; +import { invoke } from '@tauri-apps/api/core' +import { Image, transformImage } from '@tauri-apps/api/image' /** * Writes plain text to the clipboard. @@ -27,16 +26,12 @@ type ClipResponse = Record<"plainText", { text: string }>; */ async function writeText( text: string, - opts?: { label?: string }, + opts?: { label?: string } ): Promise { - return invoke("plugin:clipboard-manager|write", { - data: { - plainText: { - label: opts?.label, - text, - }, - }, - }); + await invoke('plugin:clipboard-manager|write_text', { + label: opts?.label, + text + }) } /** @@ -49,12 +44,70 @@ async function writeText( * @since 2.0.0 */ async function readText(): Promise { - const kind: ClipResponse = await invoke("plugin:clipboard-manager|read"); - return kind.plainText.text; + return await invoke('plugin:clipboard-manager|read_text') +} + +/** + * Writes image buffer to the clipboard. + * + * #### Platform-specific + * + * - **Android / iOS:** Not supported. + * + * @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 { + await invoke('plugin:clipboard-manager|write_image', { + image: transformImage(image) + }) +} + +/** + * Gets the clipboard content as Uint8Array image. + * + * #### Platform-specific + * + * - **Android / iOS:** Not supported. + * + * @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 { + return await invoke('plugin:clipboard-manager|read_image').then( + (rid) => new Image(rid) + ) } /** - * Writes HTML or fallbacks to write provided plain text to the clipboard. + * * Writes HTML or fallbacks to write provided plain text to the clipboard. + * + * #### Platform-specific + * + * - **Android / iOS:** Not supported. + * * @example * ```typescript * import { writeHtml, readHtml } from '@tauri-apps/plugin-clipboard-manager'; @@ -68,18 +121,19 @@ async function readText(): Promise { * @since 2.0.0 */ async function writeHtml(html: string, altHtml?: string): Promise { - return invoke("plugin:clipboard-manager|write_html", { - data: { - html: { - html, - altHtml, - }, - }, - }); + await invoke('plugin:clipboard-manager|write_html', { + html, + altHtml + }) } /** * Clears the clipboard. + * + * #### Platform-specific + * + * - **Android:** Only supported on SDK 28+. For older releases we write an empty string to the clipboard instead. + * * @example * ```typescript * import { clear } from '@tauri-apps/plugin-clipboard-manager'; @@ -88,8 +142,7 @@ async function writeHtml(html: string, altHtml?: string): Promise { * @since 2.0.0 */ async function clear(): Promise { - await invoke("plugin:clipboard-manager|clear"); - return; + await invoke('plugin:clipboard-manager|clear') } -export { writeText, readText, writeHtml, clear }; +export { writeText, readText, writeHtml, clear, readImage, writeImage } diff --git a/plugins/clipboard-manager/ios/Package.swift b/plugins/clipboard-manager/ios/Package.swift index f6200857..6da5303e 100644 --- a/plugins/clipboard-manager/ios/Package.swift +++ b/plugins/clipboard-manager/ios/Package.swift @@ -6,28 +6,29 @@ import PackageDescription let package = Package( - name: "tauri-plugin-clipboard-manager", - platforms: [ - .iOS(.v13), - ], - products: [ - // Products define the executables and libraries a package produces, and make them visible to other packages. - .library( - name: "tauri-plugin-clipboard-manager", - type: .static, - targets: ["tauri-plugin-clipboard-manager"]), - ], - dependencies: [ - .package(name: "Tauri", path: "../.tauri/tauri-api") - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages this package depends on. - .target( - name: "tauri-plugin-clipboard-manager", - dependencies: [ - .byName(name: "Tauri") - ], - path: "Sources") - ] + name: "tauri-plugin-clipboard-manager", + platforms: [ + .macOS(.v10_13), + .iOS(.v13), + ], + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "tauri-plugin-clipboard-manager", + type: .static, + targets: ["tauri-plugin-clipboard-manager"]) + ], + dependencies: [ + .package(name: "Tauri", path: "../.tauri/tauri-api") + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "tauri-plugin-clipboard-manager", + dependencies: [ + .byName(name: "Tauri") + ], + path: "Sources") + ] ) diff --git a/plugins/clipboard-manager/ios/Sources/ClipboardPlugin.swift b/plugins/clipboard-manager/ios/Sources/ClipboardPlugin.swift index 30729d53..cb4fc9b2 100644 --- a/plugins/clipboard-manager/ios/Sources/ClipboardPlugin.swift +++ b/plugins/clipboard-manager/ios/Sources/ClipboardPlugin.swift @@ -16,7 +16,7 @@ enum ReadClipData: Codable { } 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 clipboard = UIPasteboard.general 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 if let text = clipboard.string { invoke.resolve(ReadClipData.plainText(text: text)) @@ -38,6 +38,12 @@ class ClipboardPlugin: Plugin { invoke.reject("Clipboard is empty") } } + + @objc public func clear(_ invoke: Invoke) throws { + let clipboard = UIPasteboard.general + clipboard.items = [] + invoke.resolve() + } } @_cdecl("init_plugin_clipboard") diff --git a/plugins/clipboard-manager/package.json b/plugins/clipboard-manager/package.json index 038613cc..f4897994 100644 --- a/plugins/clipboard-manager/package.json +++ b/plugins/clipboard-manager/package.json @@ -1,10 +1,11 @@ { "name": "@tauri-apps/plugin-clipboard-manager", - "version": "2.0.0-beta.1", - "license": "MIT or APACHE-2.0", + "version": "2.0.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -23,6 +24,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/clipboard-manager/permissions/autogenerated/commands/clear.toml b/plugins/clipboard-manager/permissions/autogenerated/commands/clear.toml new file mode 100644 index 00000000..83de1819 --- /dev/null +++ b/plugins/clipboard-manager/permissions/autogenerated/commands/clear.toml @@ -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"] diff --git a/plugins/clipboard-manager/permissions/autogenerated/commands/read.toml b/plugins/clipboard-manager/permissions/autogenerated/commands/read.toml deleted file mode 100644 index 20fa10c6..00000000 --- a/plugins/clipboard-manager/permissions/autogenerated/commands/read.toml +++ /dev/null @@ -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"] diff --git a/plugins/clipboard-manager/permissions/autogenerated/commands/read_image.toml b/plugins/clipboard-manager/permissions/autogenerated/commands/read_image.toml new file mode 100644 index 00000000..cfed86db --- /dev/null +++ b/plugins/clipboard-manager/permissions/autogenerated/commands/read_image.toml @@ -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"] diff --git a/plugins/clipboard-manager/permissions/autogenerated/commands/read_text.toml b/plugins/clipboard-manager/permissions/autogenerated/commands/read_text.toml new file mode 100644 index 00000000..29844892 --- /dev/null +++ b/plugins/clipboard-manager/permissions/autogenerated/commands/read_text.toml @@ -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"] diff --git a/plugins/clipboard-manager/permissions/autogenerated/commands/write.toml b/plugins/clipboard-manager/permissions/autogenerated/commands/write.toml deleted file mode 100644 index 73d1d387..00000000 --- a/plugins/clipboard-manager/permissions/autogenerated/commands/write.toml +++ /dev/null @@ -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"] diff --git a/plugins/clipboard-manager/permissions/autogenerated/commands/write_html.toml b/plugins/clipboard-manager/permissions/autogenerated/commands/write_html.toml new file mode 100644 index 00000000..5e292808 --- /dev/null +++ b/plugins/clipboard-manager/permissions/autogenerated/commands/write_html.toml @@ -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"] diff --git a/plugins/clipboard-manager/permissions/autogenerated/commands/write_image.toml b/plugins/clipboard-manager/permissions/autogenerated/commands/write_image.toml new file mode 100644 index 00000000..12e8e235 --- /dev/null +++ b/plugins/clipboard-manager/permissions/autogenerated/commands/write_image.toml @@ -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"] diff --git a/plugins/clipboard-manager/permissions/autogenerated/commands/write_text.toml b/plugins/clipboard-manager/permissions/autogenerated/commands/write_text.toml new file mode 100644 index 00000000..ebff875a --- /dev/null +++ b/plugins/clipboard-manager/permissions/autogenerated/commands/write_text.toml @@ -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"] diff --git a/plugins/clipboard-manager/permissions/autogenerated/reference.md b/plugins/clipboard-manager/permissions/autogenerated/reference.md index 02d3e533..6b8bf14f 100644 --- a/plugins/clipboard-manager/permissions/autogenerated/reference.md +++ b/plugins/clipboard-manager/permissions/autogenerated/reference.md @@ -1,18 +1,175 @@ -# Permissions +## Default Permission -## allow-read +No features are enabled by default, as we believe +the clipboard can be inherently dangerous and it is +application specific if read and/or write access is needed. -Enables the read command without any pre-configured scope. +Clipboard interaction needs to be explicitly enabled. -## deny-read -Denies the read command without any pre-configured scope. -## allow-write +## Permission Table -Enables the write command without any pre-configured scope. + + + + + -## deny-write -Denies the write command without any pre-configured scope. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+`clipboard-manager:allow-clear` + + + +Enables the clear command without any pre-configured scope. + +
+ +`clipboard-manager:deny-clear` + + + +Denies the clear command without any pre-configured scope. + +
+ +`clipboard-manager:allow-read-image` + + + +Enables the read_image command without any pre-configured scope. + +
+ +`clipboard-manager:deny-read-image` + + + +Denies the read_image command without any pre-configured scope. + +
+ +`clipboard-manager:allow-read-text` + + + +Enables the read_text command without any pre-configured scope. + +
+ +`clipboard-manager:deny-read-text` + + + +Denies the read_text command without any pre-configured scope. + +
+ +`clipboard-manager:allow-write-html` + + + +Enables the write_html command without any pre-configured scope. + +
+ +`clipboard-manager:deny-write-html` + + + +Denies the write_html command without any pre-configured scope. + +
+ +`clipboard-manager:allow-write-image` + + + +Enables the write_image command without any pre-configured scope. + +
+ +`clipboard-manager:deny-write-image` + + + +Denies the write_image command without any pre-configured scope. + +
+ +`clipboard-manager:allow-write-text` + + + +Enables the write_text command without any pre-configured scope. + +
+ +`clipboard-manager:deny-write-text` + + + +Denies the write_text command without any pre-configured scope. + +
diff --git a/plugins/clipboard-manager/permissions/default.toml b/plugins/clipboard-manager/permissions/default.toml new file mode 100644 index 00000000..d6f65195 --- /dev/null +++ b/plugins/clipboard-manager/permissions/default.toml @@ -0,0 +1,11 @@ +"$schema" = "schemas/schema.json" +[default] +description = """ +No features are enabled by default, as we believe +the clipboard can be inherently dangerous and it is +application specific if read and/or write access is needed. + +Clipboard interaction needs to be explicitly enabled. +""" + +permissions = [] diff --git a/plugins/clipboard-manager/permissions/schemas/schema.json b/plugins/clipboard-manager/permissions/schemas/schema.json index 130874a1..c2763492 100644 --- a/plugins/clipboard-manager/permissions/schemas/schema.json +++ b/plugins/clipboard-manager/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,38 +251,115 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-read -> Enables the read command without any pre-configured scope.", + "description": "MacOS.", + "type": "string", + "enum": [ + "macOS" + ] + }, + { + "description": "Windows.", "type": "string", "enum": [ - "allow-read" + "windows" ] }, { - "description": "deny-read -> Denies the read command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "deny-read" + "linux" ] }, { - "description": "allow-write -> Enables the write command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "allow-write" + "android" ] }, { - "description": "deny-write -> Denies the write command without any pre-configured scope.", + "description": "iOS.", "type": "string", "enum": [ - "deny-write" + "iOS" ] } ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the clear command without any pre-configured scope.", + "type": "string", + "const": "allow-clear" + }, + { + "description": "Denies the clear command without any pre-configured scope.", + "type": "string", + "const": "deny-clear" + }, + { + "description": "Enables the read_image command without any pre-configured scope.", + "type": "string", + "const": "allow-read-image" + }, + { + "description": "Denies the read_image command without any pre-configured scope.", + "type": "string", + "const": "deny-read-image" + }, + { + "description": "Enables the read_text command without any pre-configured scope.", + "type": "string", + "const": "allow-read-text" + }, + { + "description": "Denies the read_text command without any pre-configured scope.", + "type": "string", + "const": "deny-read-text" + }, + { + "description": "Enables the write_html command without any pre-configured scope.", + "type": "string", + "const": "allow-write-html" + }, + { + "description": "Denies the write_html command without any pre-configured scope.", + "type": "string", + "const": "deny-write-html" + }, + { + "description": "Enables the write_image command without any pre-configured scope.", + "type": "string", + "const": "allow-write-image" + }, + { + "description": "Denies the write_image command without any pre-configured scope.", + "type": "string", + "const": "deny-write-image" + }, + { + "description": "Enables the write_text command without any pre-configured scope.", + "type": "string", + "const": "allow-write-text" + }, + { + "description": "Denies the write_text command without any pre-configured scope.", + "type": "string", + "const": "deny-write-text" + }, + { + "description": "No features are enabled by default, as we believe\nthe clipboard can be inherently dangerous and it is \napplication specific if read and/or write access is needed.\n\nClipboard interaction needs to be explicitly enabled.\n", + "type": "string", + "const": "default" + } + ] } } } \ No newline at end of file diff --git a/plugins/clipboard-manager/rollup.config.js b/plugins/clipboard-manager/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/clipboard-manager/rollup.config.js +++ b/plugins/clipboard-manager/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/clipboard-manager/src/api-iife.js b/plugins/clipboard-manager/src/api-iife.js deleted file mode 100644 index bbf9cff6..00000000 --- a/plugins/clipboard-manager/src/api-iife.js +++ /dev/null @@ -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__})} diff --git a/plugins/clipboard-manager/src/commands.rs b/plugins/clipboard-manager/src/commands.rs index d7fb0688..a8dd94ac 100644 --- a/plugins/clipboard-manager/src/commands.rs +++ b/plugins/clipboard-manager/src/commands.rs @@ -2,34 +2,73 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use tauri::{command, AppHandle, Runtime, State}; +use tauri::{command, image::JsImage, AppHandle, Manager, ResourceId, Runtime, State, Webview}; -use crate::{ClipKind, Clipboard, ClipboardContents, Result}; +use crate::{Clipboard, Result}; #[command] -pub(crate) async fn write( +#[cfg(desktop)] +pub(crate) async fn write_text( _app: AppHandle, clipboard: State<'_, Clipboard>, - data: ClipKind, + text: &str, + #[allow(unused)] label: Option, ) -> Result<()> { - clipboard.write(data) + clipboard.write_text(text) } #[command] -pub(crate) async fn read( +#[cfg(not(desktop))] +pub(crate) async fn write_text( _app: AppHandle, clipboard: State<'_, Clipboard>, -) -> Result { - clipboard.read() + text: &str, + #[allow(unused)] label: Option<&str>, +) -> Result<()> { + match label { + Some(label) => clipboard.write_text_with_label(text, label), + None => clipboard.write_text(text), + } +} + +#[command] +pub(crate) async fn read_text( + _app: AppHandle, + clipboard: State<'_, Clipboard>, +) -> Result { + clipboard.read_text() +} + +#[command] +pub(crate) async fn write_image( + webview: Webview, + clipboard: State<'_, Clipboard>, + image: JsImage, +) -> Result<()> { + let resources_table = webview.resources_table(); + let image = image.into_img(&resources_table)?; + clipboard.write_image(&image) +} + +#[command] +pub(crate) async fn read_image( + webview: Webview, + clipboard: State<'_, Clipboard>, +) -> Result { + let image = clipboard.read_image()?.to_owned(); + let mut resources_table = webview.resources_table(); + let rid = resources_table.add(image); + Ok(rid) } #[command] pub(crate) async fn write_html( _app: AppHandle, clipboard: State<'_, Clipboard>, - data: ClipKind, + html: &str, + alt_text: Option<&str>, ) -> Result<()> { - clipboard.write_html(data) + clipboard.write_html(html, alt_text) } #[command] diff --git a/plugins/clipboard-manager/src/desktop.rs b/plugins/clipboard-manager/src/desktop.rs index acf63c80..bb8ba318 100644 --- a/plugins/clipboard-manager/src/desktop.rs +++ b/plugins/clipboard-manager/src/desktop.rs @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT +use arboard::ImageData; +use image::ImageEncoder; use serde::de::DeserializeOwned; -use tauri::{plugin::PluginApi, AppHandle, Runtime}; +use tauri::{image::Image, plugin::PluginApi, AppHandle, Runtime}; -use crate::models::*; - -use std::sync::Mutex; +use std::{borrow::Cow, sync::Mutex}; pub fn init( app: &AppHandle, @@ -27,37 +27,50 @@ pub struct Clipboard { } impl Clipboard { - pub fn write(&self, kind: ClipKind) -> crate::Result<()> { - match kind { - ClipKind::PlainText { text, .. } => match &self.clipboard { - Ok(clipboard) => clipboard.lock().unwrap().set_text(text).map_err(Into::into), - Err(e) => Err(crate::Error::Clipboard(e.to_string())), - }, - _ => Err(crate::Error::Clipboard("Invalid clip kind!".to_string())), + pub fn write_text<'a, T: Into>>(&self, text: T) -> crate::Result<()> { + match &self.clipboard { + Ok(clipboard) => clipboard.lock().unwrap().set_text(text).map_err(Into::into), + Err(e) => Err(crate::Error::Clipboard(e.to_string())), + } + } + + pub fn write_image(&self, image: &Image<'_>) -> crate::Result<()> { + match &self.clipboard { + Ok(clipboard) => 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())), } } - pub fn read(&self) -> crate::Result { + pub fn read_text(&self) -> crate::Result { match &self.clipboard { Ok(clipboard) => { let text = clipboard.lock().unwrap().get_text()?; - Ok(ClipboardContents::PlainText { text }) + Ok(text) } Err(e) => Err(crate::Error::Clipboard(e.to_string())), } } - pub fn write_html(&self, kind: ClipKind) -> crate::Result<()> { - match kind { - ClipKind::Html { html, alt_html, .. } => match &self.clipboard { - Ok(clipboard) => clipboard - .lock() - .unwrap() - .set_html(html, alt_html) - .map_err(Into::into), - Err(e) => Err(crate::Error::Clipboard(e.to_string())), - }, - _ => Err(crate::Error::Clipboard("Invalid clip kind!".to_string())), + pub fn write_html<'a, T: Into>>( + &self, + html: T, + alt_text: Option, + ) -> crate::Result<()> { + match &self.clipboard { + Ok(clipboard) => clipboard + .lock() + .unwrap() + .set_html(html, alt_text) + .map_err(Into::into), + Err(e) => Err(crate::Error::Clipboard(e.to_string())), } } @@ -67,4 +80,24 @@ impl Clipboard { Err(e) => Err(crate::Error::Clipboard(e.to_string())), } } + + pub fn read_image(&self) -> crate::Result> { + match &self.clipboard { + Ok(clipboard) => { + let image = clipboard.lock().unwrap().get_image()?; + + let mut buffer: Vec = Vec::new(); + image::codecs::png::PngEncoder::new(&mut buffer).write_image( + &image.bytes, + image.width as u32, + image.height as u32, + image::ExtendedColorType::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())), + } + } } diff --git a/plugins/clipboard-manager/src/error.rs b/plugins/clipboard-manager/src/error.rs index 03da585b..7e36a11b 100644 --- a/plugins/clipboard-manager/src/error.rs +++ b/plugins/clipboard-manager/src/error.rs @@ -13,6 +13,11 @@ pub enum Error { PluginInvoke(#[from] tauri::plugin::mobile::PluginInvokeError), #[error("{0}")] Clipboard(String), + #[error(transparent)] + Tauri(#[from] tauri::Error), + #[cfg(desktop)] + #[error("invalid image: {0}")] + Image(#[from] image::ImageError), } impl Serialize for Error { diff --git a/plugins/clipboard-manager/src/lib.rs b/plugins/clipboard-manager/src/lib.rs index bbfe5918..3924d7f1 100644 --- a/plugins/clipboard-manager/src/lib.rs +++ b/plugins/clipboard-manager/src/lib.rs @@ -16,8 +16,6 @@ use tauri::{ Manager, Runtime, }; -pub use models::*; - #[cfg(desktop)] mod desktop; #[cfg(mobile)] @@ -25,16 +23,15 @@ mod mobile; mod commands; mod error; -mod models; pub use error::{Error, Result}; #[cfg(desktop)] -use desktop::Clipboard; +pub use desktop::Clipboard; #[cfg(mobile)] -use mobile::Clipboard; +pub use mobile::Clipboard; -/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the clipboard APIs. +/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the clipboard APIs. pub trait ClipboardExt { fn clipboard(&self) -> &Clipboard; } @@ -48,13 +45,12 @@ impl> crate::ClipboardExt for T { /// Initializes the plugin. pub fn init() -> TauriPlugin { Builder::new("clipboard-manager") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![ - commands::write, - commands::read, - #[cfg(desktop)] + commands::write_text, + commands::read_text, + commands::read_image, + commands::write_image, commands::write_html, - #[cfg(desktop)] commands::clear ]) .setup(|app, api| { diff --git a/plugins/clipboard-manager/src/mobile.rs b/plugins/clipboard-manager/src/mobile.rs index 8ba8c809..72d5f6e0 100644 --- a/plugins/clipboard-manager/src/mobile.rs +++ b/plugins/clipboard-manager/src/mobile.rs @@ -3,12 +3,14 @@ // SPDX-License-Identifier: MIT use serde::de::DeserializeOwned; +use serde::{Deserialize, Serialize}; use tauri::{ + image::Image, plugin::{PluginApi, PluginHandle}, AppHandle, Runtime, }; -use crate::models::*; +use std::borrow::Cow; #[cfg(target_os = "android")] const PLUGIN_IDENTIFIER: &str = "app.tauri.clipboard"; @@ -32,24 +34,76 @@ pub fn init( pub struct Clipboard(PluginHandle); impl Clipboard { - pub fn write(&self, kind: ClipKind) -> crate::Result<()> { - self.0.run_mobile_plugin("write", kind).map_err(Into::into) + pub fn write_text<'a, T: Into>>(&self, text: T) -> crate::Result<()> { + let text = text.into().to_string(); + self.0 + .run_mobile_plugin("writeText", ClipKind::PlainText { text, label: None }) + .map_err(Into::into) } - pub fn read(&self) -> crate::Result { - self.0.run_mobile_plugin("read", ()).map_err(Into::into) + pub fn write_text_with_label<'a, T: Into>>( + &self, + text: T, + label: T, + ) -> crate::Result<()> { + let text = text.into().to_string(); + let label = label.into().to_string(); + self.0 + .run_mobile_plugin( + "writeText", + ClipKind::PlainText { + text, + label: Some(label), + }, + ) + .map_err(Into::into) } - // Treat HTML as unsupported on mobile until tested - pub fn write_html(&self, _kind: ClipKind) -> crate::Result<()> { + pub fn write_image(&self, _image: &Image<'_>) -> crate::Result<()> { Err(crate::Error::Clipboard( "Unsupported on this platform".to_string(), )) } - pub fn clear(&self) -> crate::Result<()> { + pub fn read_text(&self) -> crate::Result { + self.0 + .run_mobile_plugin("readText", ()) + .map(|c| match c { + ClipboardContents::PlainText { text } => text, + }) + .map_err(Into::into) + } + + pub fn read_image(&self) -> crate::Result> { Err(crate::Error::Clipboard( "Unsupported on this platform".to_string(), )) } + + // Treat HTML as unsupported on mobile until tested + pub fn write_html<'a, T: Into>>( + &self, + _html: T, + _alt_text: Option, + ) -> crate::Result<()> { + Err(crate::Error::Clipboard( + "Unsupported on this platform".to_string(), + )) + } + + pub fn clear(&self) -> crate::Result<()> { + self.0.run_mobile_plugin("clear", ()).map_err(Into::into) + } +} + +#[derive(Debug, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +enum ClipKind { + PlainText { label: Option, text: String }, +} + +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +enum ClipboardContents { + PlainText { text: String }, } diff --git a/plugins/clipboard-manager/src/models.rs b/plugins/clipboard-manager/src/models.rs deleted file mode 100644 index bb8c9b54..00000000 --- a/plugins/clipboard-manager/src/models.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -use serde::{Deserialize, Serialize}; - -#[derive(Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub enum ClipKind { - PlainText { - label: Option, - text: String, - }, - Html { - html: String, - alt_html: Option, - }, -} - -#[derive(Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub enum ClipboardContents { - PlainText { text: String }, -} diff --git a/plugins/deep-link/.test-server/.well-known/apple-app-site-association b/plugins/deep-link/.test-server/.well-known/apple-app-site-association new file mode 100644 index 00000000..da5d0a77 --- /dev/null +++ b/plugins/deep-link/.test-server/.well-known/apple-app-site-association @@ -0,0 +1,17 @@ +{ + "applinks": { + "details": [ + { + "appIDs": [ + "Q93MBH6S2F.com.tauri.deep-link-example" + ], + "components": [ + { + "/": "/open/*", + "comment": "Matches any URL whose path starts with /open/" + } + ] + } + ] + } +} diff --git a/plugins/deep-link/.test-server/server.js b/plugins/deep-link/.test-server/server.js new file mode 100644 index 00000000..0e2fec50 --- /dev/null +++ b/plugins/deep-link/.test-server/server.js @@ -0,0 +1,27 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import http from 'http' +import fs from 'fs' + +const hostname = 'localhost' +const port = 8080 + +const server = http.createServer(function (req, res) { + console.log(req.url) + if (req.url == '/.well-known/apple-app-site-association') { + const association = fs.readFileSync( + '.well-known/apple-app-site-association' + ) + res.writeHead(200, { 'Content-Type': 'application/json' }) + res.end(association) + } else { + res.writeHead(404) + res.end('404 NOT FOUND') + } +}) + +server.listen(port, hostname, () => { + console.log('Server started on port', port) +}) diff --git a/plugins/deep-link/CHANGELOG.md b/plugins/deep-link/CHANGELOG.md index 3f711d80..2f2da36d 100644 --- a/plugins/deep-link/CHANGELOG.md +++ b/plugins/deep-link/CHANGELOG.md @@ -1,5 +1,93 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.7] + +- [`3168e176`](https://github.com/tauri-apps/plugins-workspace/commit/3168e176031a61215be542595ba90ca51f8f2d97) ([#1806](https://github.com/tauri-apps/plugins-workspace/pull/1806) by [@auggiebennett](https://github.com/tauri-apps/plugins-workspace/../../auggiebennett)) Fix fails to start when having spaces in the main binary path on Windows + +## \[2.0.0-rc.6] + +- [`6f3f6679`](https://github.com/tauri-apps/plugins-workspace/commit/6f3f66794a87ef9d1c16667c425d5ad7091a9c2f) ([#1780](https://github.com/tauri-apps/plugins-workspace/pull/1780)) Added `DeepLink::on_open_url` function to match the JavaScript API implementation, + which wraps the `deep-link://new-url` event and also send the current deep link if there's any. + +## \[2.0.0-rc.5] + +- [`984110a9`](https://github.com/tauri-apps/plugins-workspace/commit/984110a978774712bad4d746ed06134d54debcd0) ([#1770](https://github.com/tauri-apps/plugins-workspace/pull/1770) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Emit the `deep-link://new-url` event on Linux and Windows when the app is executed with a deep link CLI argument, + matching the iOS and macOS behavior. + +## \[2.0.0-rc.2] + +- [`64a6240f`](https://github.com/tauri-apps/plugins-workspace/commit/64a6240f79fcd52267c8d721b727ae695055d7ff) ([#1759](https://github.com/tauri-apps/plugins-workspace/pull/1759) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Implement `get_current` on Linux and Windows. + +## \[2.0.0-rc.3] + +- [`4654591d`](https://github.com/tauri-apps/plugins-workspace/commit/4654591d820403d6fa1a007fd55bb0d85947a6cc) ([#1732](https://github.com/tauri-apps/plugins-workspace/pull/1732) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Allow empty configuration values. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.1] + +- [`2c00c029`](https://github.com/tauri-apps/plugins-workspace/commit/2c00c0292c9127b81567de46691e8c0f73557261) ([#1630](https://github.com/tauri-apps/plugins-workspace/pull/1630) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fixed an issue that caused multi-word IIFE names to not be formatted correctly. For example the `barcode-scanner` was defined as `window.__TAURI_PLUGIN_CLIPBOARDMANAGER__` instead of `window.__TAURI_PLUGIN_CLIPBOARD_MANAGER__`. +- [`5d170a54`](https://github.com/tauri-apps/plugins-workspace/commit/5d170a5444982dcc14135f6f1fc3e5da359f0eb0) ([#1671](https://github.com/tauri-apps/plugins-workspace/pull/1671) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.3. + +### changes + +- [`6b079cfd`](https://github.com/tauri-apps/plugins-workspace/commit/6b079cfdd107c94abc2c7300f6af00bac3ff4040) ([#1649](https://github.com/tauri-apps/plugins-workspace/pull/1649) by [@ahqsoftwares](https://github.com/tauri-apps/plugins-workspace/../../ahqsoftwares)) Remove targetSdk from build.kts files as it is deprecated and will be removed from DSL v9.0 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.10] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.9] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.8] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.7] + +- [`0b008882`](https://github.com/tauri-apps/plugins-workspace/commit/0b0088821e50e33825f7d573b1c826cfeb38dda0) ([#1404](https://github.com/tauri-apps/plugins-workspace/pull/1404) by [@simonhyll](https://github.com/tauri-apps/plugins-workspace/../../simonhyll)) Fixed a typo in the `deep-link` js bindings causing `isRegistered` to not work. + +## \[2.0.0-beta.6] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.5] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.4] + +- [`021d23be`](https://github.com/tauri-apps/plugins-workspace/commit/021d23bef330de4ce001993e0ef2c7ab7815f044)([#916](https://github.com/tauri-apps/plugins-workspace/pull/916)) Added desktop support. + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[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] + +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -36,4 +124,12 @@ - [`eccd6f9`](https://github.com/tauri-apps/plugins-workspace/commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release. - [`eccd6f9`](https://github.com/tauri-apps/plugins-workspace/commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release. -commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release. + commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release. + om/tauri-apps/plugins-workspace/commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release. + +- [`eccd6f9`](https://github.com/tauri-apps/plugins-workspace/commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release. + commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release. + ithub.com/tauri-apps/plugins-workspace/pull/504)) Initial release. + ]\(https://github.com/tauri-apps/plugins-workspace/commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release. + commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release. + ithub.com/tauri-apps/plugins-workspace/pull/504)) Initial release. diff --git a/plugins/deep-link/Cargo.toml b/plugins/deep-link/Cargo.toml index 95c49557..db5c0247 100644 --- a/plugins/deep-link/Cargo.toml +++ b/plugins/deep-link/Cargo.toml @@ -1,27 +1,45 @@ [package] name = "tauri-plugin-deep-link" -version = "2.0.0-beta.1" +version = "2.0.1" description = "Set your Tauri application as the default handler for an URL" authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-deep-link" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] -targets = [ "x86_64-linux-android" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] +targets = ["x86_64-linux-android"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "partial", notes = "Runtime deep link registration is not supported" } +android = { level = "partial", notes = "Runtime deep link registration is not supported" } +ios = { level = "partial", notes = "Runtime deep link registration is not supported" } [build-dependencies] serde = { workspace = true } serde_json = { workspace = true } -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-utils = { workspace = true } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } serde_json = { workspace = true } tauri = { workspace = true } +tauri-utils = { workspace = true } log = { workspace = true } thiserror = { workspace = true } url = { workspace = true } + +[target."cfg(windows)".dependencies] +dunce = "1" +windows-registry = "0.3" +windows-result = "0.2" + +[target."cfg(target_os = \"linux\")".dependencies] +rust-ini = "0.21" diff --git a/plugins/deep-link/README.md b/plugins/deep-link/README.md index d014040c..77fae2c8 100644 --- a/plugins/deep-link/README.md +++ b/plugins/deep-link/README.md @@ -2,9 +2,17 @@ Set your Tauri application as the default handler for an URL. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ✓ | +| iOS | ✓ | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-deep-link = "2.0.0-beta" +tauri-plugin-deep-link = "2.0.0" # alternatively with Git: tauri-plugin-deep-link = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -63,7 +71,7 @@ For [app links](https://developer.android.com/training/app-links#android-app-lin ] ``` -Where `$APP_BUNDLE_ID` is the value defined on `tauri.conf.json > tauri > bundle > identifier` with `-` replaced with `_` and `$CERT_FINGERPRINT` is a list of SHA256 fingerprints of your app's signing certificates, see [verify android applinks](https://developer.android.com/training/app-links/verify-android-applinks#web-assoc) for more information. +Where `$APP_BUNDLE_ID` is the value defined on `tauri.conf.json > identifier` with `-` replaced with `_` and `$CERT_FINGERPRINT` is a list of SHA256 fingerprints of your app's signing certificates, see [verify android applinks](https://developer.android.com/training/app-links/verify-android-applinks#web-assoc) for more information. ### iOS @@ -87,22 +95,35 @@ For [universal links](https://developer.apple.com/documentation/xcode/allowing-a } ``` -Where `$DEVELOPMENT_TEAM_ID` is the value defined on `tauri.conf.json > tauri > bundle > iOS > developmentTeam` or the `TAURI_APPLE_DEVELOPMENT_TEAM` environment variable and `$APP_BUNDLE_ID` is the value defined on `tauri.conf.json > tauri > bundle > identifier`. See [applinks.details](https://developer.apple.com/documentation/bundleresources/applinks/details) for more information. +Where `$DEVELOPMENT_TEAM_ID` is the value defined on `tauri.conf.json > bundle > iOS > developmentTeam` or the `APPLE_DEVELOPMENT_TEAM` environment variable and `$APP_BUNDLE_ID` is the value defined on `tauri.conf.json > identifier`. See [applinks.details](https://developer.apple.com/documentation/bundleresources/applinks/details) for more information. + +To verify if your domain has been properly configured to expose the app associations, you can run the following command: + +```sh +curl -v https://app-site-association.cdn-apple.com/a/v1/ +``` + +**The apple-app-site-association file must be served over HTTPS and the response must include the `Content-Type: application/json` header.** + +To quickly open an app link on the iOS simulator you can execute `xcrun simctl openurl booted `. See [supporting associated domains](https://developer.apple.com/documentation/xcode/supporting-associated-domains?language=objc) for more information. ## Configuration -Under `tauri.conf.json > plugins > deep-link`, configure the domains you want to associate with your application: +Under `tauri.conf.json > plugins > deep-link`, configure the domains (mobile) and schemes (desktop) you want to associate with your application: ```json { "plugins": { "deep-link": { - "domains": [ + "mobile": [ { "host": "your.website.com", "pathPrefix": ["/open"] }, { "host": "another.site.br" } - ] + ], + "desktop": { + "schemes": ["something", "my-tauri-app"] + } } } } @@ -126,12 +147,14 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { onOpenUrl } from "@tauri-apps/plugin-deep-link"; +import { onOpenUrl } from '@tauri-apps/plugin-deep-link' await onOpenUrl((urls) => { - console.log('deep link:', urls); -}); + console.log('deep link:', urls) +}) ``` +Note that the Plugin will only emit events on macOS, iOS and Android. On Windows and Linux the OS will spawn a new instance of your app with the URL as a CLI argument. If you want your app to behave on Windows & Linux similar to the other platforms you can use the [single-instance](../single-instance/) plugin with the `deep-link` feature enabled. + ## Contributing PRs accepted. Please make sure to read the Contributing Guide before making a pull request. diff --git a/plugins/deep-link/SECURITY.md b/plugins/deep-link/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/deep-link/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/deep-link/android/build.gradle.kts b/plugins/deep-link/android/build.gradle.kts index 97bb133e..671ee8b7 100644 --- a/plugins/deep-link/android/build.gradle.kts +++ b/plugins/deep-link/android/build.gradle.kts @@ -5,11 +5,10 @@ plugins { android { namespace = "app.tauri.deep_link" - compileSdk = 32 + compileSdk = 34 defaultConfig { - minSdk = 24 - targetSdk = 32 + minSdk = 24 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") diff --git a/plugins/deep-link/android/src/main/java/DeepLinkPlugin.kt b/plugins/deep-link/android/src/main/java/DeepLinkPlugin.kt index 58bc70c7..db4e79af 100644 --- a/plugins/deep-link/android/src/main/java/DeepLinkPlugin.kt +++ b/plugins/deep-link/android/src/main/java/DeepLinkPlugin.kt @@ -40,6 +40,8 @@ class DeepLinkPlugin(private val activity: Activity): Plugin(activity) { invoke.resolve(ret) } + // This command should not be added to the `build.rs` and exposed as it is only + // used internally from the rust backend. @Command fun setEventHandler(invoke: Invoke) { val args = invoke.parseArgs(SetEventHandlerArgs::class.java) diff --git a/plugins/deep-link/api-iife.js b/plugins/deep-link/api-iife.js new file mode 100644 index 00000000..eba7152f --- /dev/null +++ b/plugins/deep-link/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_DEEP_LINK__=function(e){"use strict";function n(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}async function r(e,n={},r){return window.__TAURI_INTERNALS__.invoke(e,n,r)}var t;async function i(e,t,i){const a={kind:"Any"};return r("plugin:event|listen",{event:e,target:a,handler:n(t)}).then((n=>async()=>async function(e,n){await r("plugin:event|unlisten",{event:e,eventId:n})}(e,n)))}async function a(){return await r("plugin:deep-link|get_current")}return"function"==typeof SuppressedError&&SuppressedError,function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_CREATED="tauri://window-created",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG_ENTER="tauri://drag-enter",e.DRAG_OVER="tauri://drag-over",e.DRAG_DROP="tauri://drag-drop",e.DRAG_LEAVE="tauri://drag-leave"}(t||(t={})),e.getCurrent=a,e.isRegistered=async function(e){return await r("plugin:deep-link|is_registered",{protocol:e})},e.onOpenUrl=async function(e){const n=await a();return n&&e(n),await i("deep-link://new-url",(n=>{e(n.payload)}))},e.register=async function(e){return await r("plugin:deep-link|register",{protocol:e})},e.unregister=async function(e){return await r("plugin:deep-link|unregister",{protocol:e})},e}({});Object.defineProperty(window.__TAURI__,"deepLink",{value:__TAURI_PLUGIN_DEEP_LINK__})} diff --git a/plugins/deep-link/build.rs b/plugins/deep-link/build.rs index bffa4675..4bb909cb 100644 --- a/plugins/deep-link/build.rs +++ b/plugins/deep-link/build.rs @@ -6,7 +6,7 @@ mod config; use config::{AssociatedDomain, Config}; -const COMMANDS: &[&str] = &["get_current"]; +const COMMANDS: &[&str] = &["get_current", "register", "unregister", "is_registered"]; // TODO: Consider using activity-alias in case users may have multiple activities in their app. // TODO: Do we want to support the other path* configs too? @@ -32,14 +32,14 @@ fn intent_filter(domain: &AssociatedDomain) -> String { } fn main() { - if let Err(error) = tauri_plugin::Builder::new(COMMANDS) + let result = tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .android_path("android") - .try_build() - { - println!("{error:#}"); - if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) { - std::process::exit(1); - } + .try_build(); + + // when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build + if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) { + result.unwrap(); } if let Some(config) = tauri_plugin::plugin_config::("deep-link") { @@ -47,7 +47,7 @@ fn main() { "DEEP LINK PLUGIN", "activity", config - .domains + .mobile .iter() .map(intent_filter) .collect::>() @@ -61,7 +61,7 @@ fn main() { entitlements.insert( "com.apple.developer.associated-domains".into(), config - .domains + .mobile .into_iter() .map(|d| format!("applinks:{}", d.host).into()) .collect::>() diff --git a/plugins/deep-link/examples/app/.gitignore b/plugins/deep-link/examples/app/.gitignore index a547bf36..c9b61864 100644 --- a/plugins/deep-link/examples/app/.gitignore +++ b/plugins/deep-link/examples/app/.gitignore @@ -8,7 +8,6 @@ pnpm-debug.log* lerna-debug.log* node_modules -dist dist-ssr *.local @@ -22,3 +21,5 @@ dist-ssr *.njsproj *.sln *.sw? + +dist/ diff --git a/plugins/deep-link/examples/app/CHANGELOG.md b/plugins/deep-link/examples/app/CHANGELOG.md index 7277d85a..ba903aea 100644 --- a/plugins/deep-link/examples/app/CHANGELOG.md +++ b/plugins/deep-link/examples/app/CHANGELOG.md @@ -1,5 +1,85 @@ # Changelog +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +### Dependencies + +- Upgraded to `deep-link-js@2.0.0` + +## \[2.0.0-rc.1] + +### Dependencies + +- Upgraded to `deep-link-js@2.0.0-rc.2` + +## \[2.0.0-rc.0] + +### Dependencies + +- Upgraded to `deep-link-js@2.0.0-rc.1` + +## \[2.0.0-beta.11] + +### Dependencies + +- Upgraded to `deep-link-js@2.0.0-rc.0` + +## \[2.0.0-beta.10] + +### Dependencies + +- Upgraded to `deep-link-js@2.0.0-beta.10` + +## \[2.0.0-beta.9] + +### Dependencies + +- Upgraded to `deep-link-js@2.0.0-beta.9` + +## \[2.0.0-beta.8] + +### Dependencies + +- Upgraded to `deep-link-js@2.0.0-beta.8` + +## \[2.0.0-beta.7] + +### Dependencies + +- Upgraded to `deep-link-js@2.0.0-beta.7` + +## \[2.0.0-beta.6] + +### Dependencies + +- Upgraded to `deep-link-js@2.0.0-beta.6` + +## \[2.0.0-beta.5] + +### Dependencies + +- Upgraded to `deep-link-js@2.0.0-beta.5` + +## \[2.0.0-beta.4] + +### Dependencies + +- Upgraded to `deep-link-js@2.0.0-beta.4` + +## \[2.0.0-beta.3] + +### Dependencies + +- Upgraded to `deep-link-js@2.0.0-beta.3` + +## \[2.0.0-beta.2] + +### Dependencies + +- Upgraded to `deep-link-js@2.0.0-beta.2` + ## \[2.0.0-beta.1] ### Dependencies diff --git a/plugins/deep-link/examples/app/package.json b/plugins/deep-link/examples/app/package.json index d9d4ea34..5b9e8efc 100644 --- a/plugins/deep-link/examples/app/package.json +++ b/plugins/deep-link/examples/app/package.json @@ -1,7 +1,7 @@ { "name": "deep-link-example", "private": true, - "version": "2.0.0-beta.1", + "version": "2.0.0", "type": "module", "scripts": { "dev": "vite", @@ -10,13 +10,12 @@ "tauri": "tauri" }, "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2", - "@tauri-apps/plugin-deep-link": "2.0.0-beta.1" + "@tauri-apps/api": "2.0.2", + "@tauri-apps/plugin-deep-link": "2.0.0" }, "devDependencies": { - "@tauri-apps/cli": "2.0.0-beta.3", - "internal-ip": "^8.0.0", + "@tauri-apps/cli": "2.0.3", "typescript": "^5.2.2", - "vite": "^5.0.12" + "vite": "^5.4.7" } } diff --git a/plugins/deep-link/examples/app/src-tauri/Cargo.toml b/plugins/deep-link/examples/app/src-tauri/Cargo.toml index 9d1eb501..11e7c41f 100644 --- a/plugins/deep-link/examples/app/src-tauri/Cargo.toml +++ b/plugins/deep-link/examples/app/src-tauri/Cargo.toml @@ -6,7 +6,7 @@ authors = ["you"] license = "" repository = "" edition = "2021" -rust-version = "1.75" +rust-version = "1.77.2" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -19,11 +19,16 @@ tauri-build = { workspace = true } [dependencies] serde = { workspace = true } serde_json = { workspace = true } -tauri = { workspace = true } +tauri = { workspace = true, features = ["wry", "compression"] } tauri-plugin-deep-link = { path = "../../../" } +tauri-plugin-log = { path = "../../../../log" } +tauri-plugin-single-instance = { path = "../../../../single-instance", features = [ + "deep-link", +] } +log = "0.4" [features] # this feature is used for production builds or when `devUrl` points to the filesystem and the built-in dev server is disabled. # If you use cargo directly instead of tauri's cli you can use this feature flag to switch between tauri's `dev` and `build` modes. # DO NOT REMOVE!! -custom-protocol = [ "tauri/custom-protocol" ] +prod = ["tauri/custom-protocol"] diff --git a/plugins/deep-link/examples/app/src-tauri/capabilities/app.json b/plugins/deep-link/examples/app/src-tauri/capabilities/app.json new file mode 100644 index 00000000..a4bc7b4c --- /dev/null +++ b/plugins/deep-link/examples/app/src-tauri/capabilities/app.json @@ -0,0 +1,11 @@ +{ + "$schema": "../gen/schemas/desktop-schema.json", + "identifier": "run-app-base", + "description": "Base permissions to run the app", + "windows": ["main"], + "permissions": [ + "core:default", + "deep-link:allow-get-current", + "deep-link:default" + ] +} diff --git a/plugins/deep-link/examples/app/src-tauri/gen/android/app/.gitignore b/plugins/deep-link/examples/app/src-tauri/gen/android/app/.gitignore index 6d888c10..1efb55bd 100644 --- a/plugins/deep-link/examples/app/src-tauri/gen/android/app/.gitignore +++ b/plugins/deep-link/examples/app/src-tauri/gen/android/app/.gitignore @@ -2,4 +2,5 @@ /src/main/jniLibs/**/*.so /src/main/assets/tauri.conf.json /tauri.build.gradle.kts -/proguard-tauri.pro \ No newline at end of file +/proguard-tauri.pro +/tauri.properties \ No newline at end of file diff --git a/plugins/deep-link/examples/app/src-tauri/gen/android/app/build.gradle.kts b/plugins/deep-link/examples/app/src-tauri/gen/android/app/build.gradle.kts index f26cb2a5..f434bbfb 100644 --- a/plugins/deep-link/examples/app/src-tauri/gen/android/app/build.gradle.kts +++ b/plugins/deep-link/examples/app/src-tauri/gen/android/app/build.gradle.kts @@ -1,19 +1,28 @@ +import java.util.Properties + plugins { id("com.android.application") id("org.jetbrains.kotlin.android") id("rust") } +val tauriProperties = Properties().apply { + val propFile = file("tauri.properties") + if (propFile.exists()) { + propFile.inputStream().use { load(it) } + } +} + android { - compileSdk = 33 + compileSdk = 34 namespace = "com.tauri.deep_link_example" defaultConfig { manifestPlaceholders["usesCleartextTraffic"] = "false" applicationId = "com.tauri.deep_link_example" minSdk = 24 - targetSdk = 33 - versionCode = 1 - versionName = "1.0" + targetSdk = 34 + versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt() + versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0") } buildTypes { getByName("debug") { @@ -39,6 +48,9 @@ android { kotlinOptions { jvmTarget = "1.8" } + buildFeatures { + buildConfig = true + } } rust { @@ -54,4 +66,4 @@ dependencies { androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0") } -apply(from = "tauri.build.gradle.kts") +apply(from = "tauri.build.gradle.kts") \ No newline at end of file diff --git a/plugins/deep-link/examples/app/src-tauri/gen/android/app/src/main/AndroidManifest.xml b/plugins/deep-link/examples/app/src-tauri/gen/android/app/src/main/AndroidManifest.xml index 68c05a37..05265e32 100644 --- a/plugins/deep-link/examples/app/src-tauri/gen/android/app/src/main/AndroidManifest.xml +++ b/plugins/deep-link/examples/app/src-tauri/gen/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,10 @@ + + + + + + diff --git a/plugins/deep-link/examples/app/src-tauri/gen/android/build.gradle.kts b/plugins/deep-link/examples/app/src-tauri/gen/android/build.gradle.kts index 5ce764e3..c5ef452a 100644 --- a/plugins/deep-link/examples/app/src-tauri/gen/android/build.gradle.kts +++ b/plugins/deep-link/examples/app/src-tauri/gen/android/build.gradle.kts @@ -4,8 +4,8 @@ buildscript { mavenCentral() } dependencies { - classpath("com.android.tools.build:gradle:8.0.0") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21") + classpath("com.android.tools.build:gradle:8.5.1") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25") } } diff --git a/plugins/deep-link/examples/app/src-tauri/gen/android/buildSrc/build.gradle.kts b/plugins/deep-link/examples/app/src-tauri/gen/android/buildSrc/build.gradle.kts index 099feff7..39e90b05 100644 --- a/plugins/deep-link/examples/app/src-tauri/gen/android/buildSrc/build.gradle.kts +++ b/plugins/deep-link/examples/app/src-tauri/gen/android/buildSrc/build.gradle.kts @@ -18,6 +18,6 @@ repositories { dependencies { compileOnly(gradleApi()) - implementation("com.android.tools.build:gradle:8.0.0") + implementation("com.android.tools.build:gradle:8.5.1") } diff --git a/plugins/deep-link/examples/app/src-tauri/gen/android/buildSrc/src/main/java/com/tauri/deep_link_example/kotlin/BuildTask.kt b/plugins/deep-link/examples/app/src-tauri/gen/android/buildSrc/src/main/java/com/tauri/deep_link_example/kotlin/BuildTask.kt index b9e83018..f9874825 100644 --- a/plugins/deep-link/examples/app/src-tauri/gen/android/buildSrc/src/main/java/com/tauri/deep_link_example/kotlin/BuildTask.kt +++ b/plugins/deep-link/examples/app/src-tauri/gen/android/buildSrc/src/main/java/com/tauri/deep_link_example/kotlin/BuildTask.kt @@ -1,7 +1,3 @@ -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - import java.io.File import org.apache.tools.ant.taskdefs.condition.Os import org.gradle.api.DefaultTask diff --git a/plugins/deep-link/examples/app/src-tauri/gen/android/buildSrc/src/main/java/com/tauri/deep_link_example/kotlin/RustPlugin.kt b/plugins/deep-link/examples/app/src-tauri/gen/android/buildSrc/src/main/java/com/tauri/deep_link_example/kotlin/RustPlugin.kt index cad2d877..4aa7fcaf 100644 --- a/plugins/deep-link/examples/app/src-tauri/gen/android/buildSrc/src/main/java/com/tauri/deep_link_example/kotlin/RustPlugin.kt +++ b/plugins/deep-link/examples/app/src-tauri/gen/android/buildSrc/src/main/java/com/tauri/deep_link_example/kotlin/RustPlugin.kt @@ -1,7 +1,3 @@ -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - import com.android.build.api.dsl.ApplicationExtension import org.gradle.api.DefaultTask import org.gradle.api.Plugin diff --git a/plugins/deep-link/examples/app/src-tauri/gen/android/gradle.properties b/plugins/deep-link/examples/app/src-tauri/gen/android/gradle.properties index 022338b7..2a7ec695 100644 --- a/plugins/deep-link/examples/app/src-tauri/gen/android/gradle.properties +++ b/plugins/deep-link/examples/app/src-tauri/gen/android/gradle.properties @@ -21,5 +21,4 @@ kotlin.code.style=official # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true -android.defaults.buildfeatures.buildconfig=true android.nonFinalResIds=false \ No newline at end of file diff --git a/plugins/deep-link/examples/app/src-tauri/gen/android/gradle/wrapper/gradle-wrapper.properties b/plugins/deep-link/examples/app/src-tauri/gen/android/gradle/wrapper/gradle-wrapper.properties index 40a43506..0df10d55 100644 --- a/plugins/deep-link/examples/app/src-tauri/gen/android/gradle/wrapper/gradle-wrapper.properties +++ b/plugins/deep-link/examples/app/src-tauri/gen/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Tue May 10 19:22:52 CST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/plugins/deep-link/examples/app/src-tauri/gen/android/gradlew.bat b/plugins/deep-link/examples/app/src-tauri/gen/android/gradlew.bat index ac1b06f9..107acd32 100644 --- a/plugins/deep-link/examples/app/src-tauri/gen/android/gradlew.bat +++ b/plugins/deep-link/examples/app/src-tauri/gen/android/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png index f8b128e3..a6ac2a8c 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png index 6bbd9e3c..2869541f 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png index 6bbd9e3c..2869541f 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png index f702cc04..cf265a45 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png index c5e92f78..29c9746c 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png index 1c607d5c..a4e68c8d 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png index 1c607d5c..a4e68c8d 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png index 60e93a6a..e4adcbce 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png index 6bbd9e3c..2869541f 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png index 819410f9..a414e65b 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png index 819410f9..a414e65b 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png index e00ae5a6..a0807e5d 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png index f5301f37..704c9291 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-512x512@2x.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-512x512@2x.png deleted file mode 100644 index 5e9add73..00000000 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-512x512@2x.png and /dev/null differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png index e00ae5a6..a0807e5d 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png index 3546ca10..2a9fbc26 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png index d8367101..2cdf1848 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png index 29925f2a..4723e4b4 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png index dfd22619..f26fee45 100644 Binary files a/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png and b/plugins/deep-link/examples/app/src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png differ diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/ExportOptions.plist b/plugins/deep-link/examples/app/src-tauri/gen/apple/ExportOptions.plist index b69cf1de..0428a171 100644 --- a/plugins/deep-link/examples/app/src-tauri/gen/apple/ExportOptions.plist +++ b/plugins/deep-link/examples/app/src-tauri/gen/apple/ExportOptions.plist @@ -3,6 +3,6 @@ method - development + debugging diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/LaunchScreen.storyboard b/plugins/deep-link/examples/app/src-tauri/gen/apple/LaunchScreen.storyboard new file mode 100644 index 00000000..dd79351e --- /dev/null +++ b/plugins/deep-link/examples/app/src-tauri/gen/apple/LaunchScreen.storyboard @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/deep-link-example.xcodeproj/project.pbxproj b/plugins/deep-link/examples/app/src-tauri/gen/apple/deep-link-example.xcodeproj/project.pbxproj index c2e4090c..450bd847 100644 --- a/plugins/deep-link/examples/app/src-tauri/gen/apple/deep-link-example.xcodeproj/project.pbxproj +++ b/plugins/deep-link/examples/app/src-tauri/gen/apple/deep-link-example.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 56; objects = { /* Begin PBXBuildFile section */ @@ -17,26 +17,28 @@ D01EC573029B7BEC701F6012 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BDF5DBBA740DA7D86791DEC /* WebKit.framework */; }; D4D232DBB85C5C1594FACC3D /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = D99665C1C3247732C6BF25F4 /* main.mm */; }; D7A9EBD47413746EDE96BDF8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B18865218362A4BE07527DBD /* CoreGraphics.framework */; }; - FBB3FE3EDDEAF717E61F2AD4 /* libdeep_link_example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DCAEEC42BAB5E4A4757C89C2 /* libdeep_link_example.a */; }; + E26F7FA923DA1EABEE42B63A /* libapp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 403FB4BAE59F74EE98EF1EC6 /* libapp.a */; }; + E6992F2651B864B15ED14925 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1846ADCEDC2C208E1037ADC6 /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 1846ADCEDC2C208E1037ADC6 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; 1C21C8B4A18EC7D0B5808C10 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = System/Library/Frameworks/MetalKit.framework; sourceTree = SDKROOT; }; - 1CAAFA750FD735A285DC1238 /* deep-link-example_iOS.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = "deep-link-example_iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 1CAAFA750FD735A285DC1238 /* deep-link-example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "deep-link-example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 2F316D1CD78DD2E070DA5C17 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 3DD32303BEC377C10162CF69 /* bindings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bindings.h; sourceTree = ""; }; + 403FB4BAE59F74EE98EF1EC6 /* libapp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libapp.a; sourceTree = ""; }; 486CAFD81CB14F9A2DF72FDF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 4A33212233BFAA738F6A46FC /* lib.rs */ = {isa = PBXFileReference; path = lib.rs; sourceTree = ""; }; + 4A33212233BFAA738F6A46FC /* lib.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = lib.rs; sourceTree = ""; }; 4BDECB1ED2EEEB5A6A8B8372 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 6BDF5DBBA740DA7D86791DEC /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; 8AB0099573FE8BF1DC82CDBA /* deep-link-example_iOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "deep-link-example_iOS.entitlements"; sourceTree = ""; }; 9435FC7E183EA6260CE76637 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - AEA78299D25FEC31E2988090 /* main.rs */ = {isa = PBXFileReference; path = main.rs; sourceTree = ""; }; + AEA78299D25FEC31E2988090 /* main.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = main.rs; sourceTree = ""; }; B005488D1B56B657AB52E28C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; B18865218362A4BE07527DBD /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; BF7ECB9AB55B71692A21D5F7 /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; path = assets; sourceTree = SOURCE_ROOT; }; D99665C1C3247732C6BF25F4 /* main.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = ""; }; - DCAEEC42BAB5E4A4757C89C2 /* libdeep_link_example.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libdeep_link_example.a; sourceTree = ""; }; ED2B1BC06DFE0498ECDEEE51 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ @@ -45,7 +47,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - FBB3FE3EDDEAF717E61F2AD4 /* libdeep_link_example.a in Frameworks */, + E26F7FA923DA1EABEE42B63A /* libapp.a in Frameworks */, D7A9EBD47413746EDE96BDF8 /* CoreGraphics.framework in Frameworks */, 017AE826151E36372534A964 /* Metal.framework in Frameworks */, BC36958BBBA7FE61066213D7 /* MetalKit.framework in Frameworks */, @@ -81,6 +83,7 @@ children = ( BF7ECB9AB55B71692A21D5F7 /* assets */, 486CAFD81CB14F9A2DF72FDF /* Assets.xcassets */, + 1846ADCEDC2C208E1037ADC6 /* LaunchScreen.storyboard */, 7D12035C470ED9DAF55A709E /* deep-link-example_iOS */, 84EADC52DA26583ACE816A6D /* Externals */, 146BAF1D709F8A0FE5B07709 /* Sources */, @@ -94,7 +97,7 @@ isa = PBXGroup; children = ( B18865218362A4BE07527DBD /* CoreGraphics.framework */, - DCAEEC42BAB5E4A4757C89C2 /* libdeep_link_example.a */, + 403FB4BAE59F74EE98EF1EC6 /* libapp.a */, ED2B1BC06DFE0498ECDEEE51 /* Metal.framework */, 1C21C8B4A18EC7D0B5808C10 /* MetalKit.framework */, 9435FC7E183EA6260CE76637 /* QuartzCore.framework */, @@ -142,7 +145,7 @@ F9EEBB3248B74B1D6CDA4D84 /* Products */ = { isa = PBXGroup; children = ( - 1CAAFA750FD735A285DC1238 /* deep-link-example_iOS.app */, + 1CAAFA750FD735A285DC1238 /* deep-link-example.app */, ); name = Products; sourceTree = ""; @@ -165,7 +168,7 @@ ); name = "deep-link-example_iOS"; productName = "deep-link-example_iOS"; - productReference = 1CAAFA750FD735A285DC1238 /* deep-link-example_iOS.app */; + productReference = 1CAAFA750FD735A285DC1238 /* deep-link-example.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -174,15 +177,11 @@ BCB4BA6E81088C5B470E3436 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1200; - TargetAttributes = { - A1C635908C823A89928264CD = { - DevelopmentTeam = Q93MBH6S2F; - }; - }; + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1430; }; buildConfigurationList = 8FCB58B8ADB9F9CB9ECE01FA /* Build configuration list for PBXProject "deep-link-example" */; - compatibilityVersion = "Xcode 11.0"; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( @@ -204,6 +203,7 @@ buildActionMask = 2147483647; files = ( 65A8D948440EDAA7F62BA1F4 /* Assets.xcassets in Resources */, + E6992F2651B864B15ED14925 /* LaunchScreen.storyboard in Resources */, C384FB77F116B05F8E642CA8 /* assets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -225,8 +225,9 @@ outputFileListPaths = ( ); outputPaths = ( - "$(SRCROOT)/target/aarch64-apple-ios/${CONFIGURATION}/deps/libdeep_link_example.a", - "$(SRCROOT)/target/x86_64-apple-ios/${CONFIGURATION}/deps/libdeep_link_example.a", + "$(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a", + "$(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a", + "$(SRCROOT)/Externals/arm64-sim/${CONFIGURATION}/libapp.a", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -320,8 +321,11 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = "deep-link-example_iOS/deep-link-example_iOS.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = Q93MBH6S2F; ENABLE_BITCODE = NO; + "EXCLUDED_ARCHS[sdk=iphoneos*]" = "arm64-sim x86_64"; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\".\"", @@ -331,10 +335,28 @@ "$(inherited)", "@executable_path/Frameworks", ); - "LIBRARY_SEARCH_PATHS[arch=arm64-sim]" = "$(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"; - "LIBRARY_SEARCH_PATHS[arch=arm64]" = "$(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"; - "LIBRARY_SEARCH_PATHS[arch=x86_64]" = "$(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"; - PRODUCT_BUNDLE_IDENTIFIER = "com.tauri.deep-link-example"; + "LIBRARY_SEARCH_PATHS[arch=arm64-sim]" = ( + "$(inherited)", + "$(PROJECT_DIR)/Externals/arm64-sim/$(CONFIGURATION)", + "$(SDKROOT)/usr/lib/swift", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)", + ); + "LIBRARY_SEARCH_PATHS[arch=arm64]" = ( + "$(inherited)", + "$(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION)", + "$(SDKROOT)/usr/lib/swift", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)", + ); + "LIBRARY_SEARCH_PATHS[arch=x86_64]" = ( + "$(inherited)", + "$(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION)", + "$(SDKROOT)/usr/lib/swift", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.tauri.deep-link-example; PRODUCT_NAME = "deep-link-example"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -409,8 +431,11 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = "deep-link-example_iOS/deep-link-example_iOS.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = Q93MBH6S2F; ENABLE_BITCODE = NO; + "EXCLUDED_ARCHS[sdk=iphoneos*]" = "arm64-sim x86_64"; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\".\"", @@ -420,10 +445,28 @@ "$(inherited)", "@executable_path/Frameworks", ); - "LIBRARY_SEARCH_PATHS[arch=arm64-sim]" = "$(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"; - "LIBRARY_SEARCH_PATHS[arch=arm64]" = "$(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"; - "LIBRARY_SEARCH_PATHS[arch=x86_64]" = "$(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"; - PRODUCT_BUNDLE_IDENTIFIER = "com.tauri.deep-link-example"; + "LIBRARY_SEARCH_PATHS[arch=arm64-sim]" = ( + "$(inherited)", + "$(PROJECT_DIR)/Externals/arm64-sim/$(CONFIGURATION)", + "$(SDKROOT)/usr/lib/swift", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)", + ); + "LIBRARY_SEARCH_PATHS[arch=arm64]" = ( + "$(inherited)", + "$(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION)", + "$(SDKROOT)/usr/lib/swift", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)", + ); + "LIBRARY_SEARCH_PATHS[arch=x86_64]" = ( + "$(inherited)", + "$(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION)", + "$(SDKROOT)/usr/lib/swift", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.tauri.deep-link-example; PRODUCT_NAME = "deep-link-example"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/deep-link-example.xcodeproj/xcshareddata/xcschemes/deep-link-example_iOS.xcscheme b/plugins/deep-link/examples/app/src-tauri/gen/apple/deep-link-example.xcodeproj/xcshareddata/xcschemes/deep-link-example_iOS.xcscheme index 7c19e933..a8fbc97e 100644 --- a/plugins/deep-link/examples/app/src-tauri/gen/apple/deep-link-example.xcodeproj/xcshareddata/xcschemes/deep-link-example_iOS.xcscheme +++ b/plugins/deep-link/examples/app/src-tauri/gen/apple/deep-link-example.xcodeproj/xcshareddata/xcschemes/deep-link-example_iOS.xcscheme @@ -1,6 +1,6 @@ CFBundleShortVersionString 0.0.0 CFBundleVersion - 0.0.0 + 0.1.0 LSRequiresIPhoneOS UILaunchStoryboardName @@ -41,4 +41,4 @@ UIInterfaceOrientationLandscapeRight - + \ No newline at end of file diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/project.yml b/plugins/deep-link/examples/app/src-tauri/gen/apple/project.yml index d369b8dc..c924ca77 100644 --- a/plugins/deep-link/examples/app/src-tauri/gen/apple/project.yml +++ b/plugins/deep-link/examples/app/src-tauri/gen/apple/project.yml @@ -4,7 +4,7 @@ name: deep-link-example options: - bundleIdPrefix: com.tauri + bundleIdPrefix: com.tauri.deep-link-example deploymentTarget: iOS: 13.0 fileGroups: [../../src] @@ -40,6 +40,7 @@ targets: - path: assets buildPhase: resources type: folder + - path: LaunchScreen.storyboard info: path: deep-link-example_iOS/Info.plist properties: @@ -68,13 +69,15 @@ targets: ENABLE_BITCODE: false ARCHS: [arm64, arm64-sim] VALID_ARCHS: arm64 arm64-sim - LIBRARY_SEARCH_PATHS[arch=x86_64]: $(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) - LIBRARY_SEARCH_PATHS[arch=arm64]: $(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) - LIBRARY_SEARCH_PATHS[arch=arm64-sim]: $(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) + LIBRARY_SEARCH_PATHS[arch=x86_64]: $(inherited) $(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) + LIBRARY_SEARCH_PATHS[arch=arm64]: $(inherited) $(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) + LIBRARY_SEARCH_PATHS[arch=arm64-sim]: $(inherited) $(PROJECT_DIR)/Externals/arm64-sim/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES: true + EXCLUDED_ARCHS[sdk=iphonesimulator*]: arm64 + EXCLUDED_ARCHS[sdk=iphoneos*]: arm64-sim x86_64 groups: [app] dependencies: - - framework: libdeep_link_example.a + - framework: libapp.a embed: false - sdk: CoreGraphics.framework - sdk: Metal.framework @@ -88,5 +91,6 @@ targets: name: Build Rust Code basedOnDependencyAnalysis: false outputFiles: - - $(SRCROOT)/target/aarch64-apple-ios/${CONFIGURATION}/deps/libdeep_link_example.a - - $(SRCROOT)/target/x86_64-apple-ios/${CONFIGURATION}/deps/libdeep_link_example.a + - $(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a + - $(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a + - $(SRCROOT)/Externals/arm64-sim/${CONFIGURATION}/libapp.a diff --git a/plugins/deep-link/examples/app/src-tauri/server.js b/plugins/deep-link/examples/app/src-tauri/server.js index c8686631..24a6ac6f 100644 --- a/plugins/deep-link/examples/app/src-tauri/server.js +++ b/plugins/deep-link/examples/app/src-tauri/server.js @@ -2,30 +2,30 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import http from "http"; -import fs from "fs"; -import path from "path"; -import * as url from "url"; -const __dirname = url.fileURLToPath(new URL(".", import.meta.url)); +import http from 'http' +import fs from 'fs' +import path from 'path' +import * as url from 'url' +const __dirname = url.fileURLToPath(new URL('.', import.meta.url)) -const port = 8125; +const port = 8125 http .createServer(function (request, response) { - if (request.url === "/.well-known/apple-app-site-association") { + if (request.url === '/.well-known/apple-app-site-association') { // eslint-disable-next-line fs.readFile( - path.resolve(__dirname, "apple-app-site-association"), + path.resolve(__dirname, 'apple-app-site-association'), function (_error, content) { - response.writeHead(200); - response.end(content, "utf-8"); - }, - ); + response.writeHead(200) + response.end(content, 'utf-8') + } + ) } else { - response.writeHead(404); - response.end(); + response.writeHead(404) + response.end() } }) - .listen(port); + .listen(port) -console.log(`Server running at http://127.0.0.1:${port}/`); +console.log(`Server running at http://127.0.0.1:${port}/`) diff --git a/plugins/deep-link/examples/app/src-tauri/src/lib.rs b/plugins/deep-link/examples/app/src-tauri/src/lib.rs index 5fcb3b23..f85527d9 100644 --- a/plugins/deep-link/examples/app/src-tauri/src/lib.rs +++ b/plugins/deep-link/examples/app/src-tauri/src/lib.rs @@ -2,20 +2,45 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT +use tauri_plugin_deep_link::DeepLinkExt; + // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command #[tauri::command] fn greet(name: &str) -> String { - format!("Hello, {}! You've been greeted from Rust!", name) + format!("Hello, {name}! You've been greeted from Rust!") } #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { - tauri::Builder::default() + #[allow(unused_mut)] + let mut builder = tauri::Builder::default(); + + #[cfg(desktop)] + { + builder = builder.plugin(tauri_plugin_single_instance::init(|_app, argv, _cwd| { + println!("single instance triggered: {argv:?}"); + })); + } + + builder .plugin(tauri_plugin_deep_link::init()) + .plugin( + tauri_plugin_log::Builder::default() + .level(log::LevelFilter::Info) + .build(), + ) .setup(|app| { - app.listen("deep-link://new-url", |url| { - dbg!(url); + // ensure deep links are registered on the system + // this is useful because AppImages requires additional setup to be available in the system + // and calling register() makes the deep links immediately available - without any user input + // additionally, we manually register on Windows on debug builds for development + #[cfg(any(target_os = "linux", all(debug_assertions, windows)))] + app.deep_link().register_all()?; + + app.deep_link().on_open_url(|event| { + dbg!(event.urls()); }); + Ok(()) }) .invoke_handler(tauri::generate_handler![greet]) diff --git a/plugins/deep-link/examples/app/src-tauri/tauri.conf.json b/plugins/deep-link/examples/app/src-tauri/tauri.conf.json index bec5fb76..ac1c292b 100644 --- a/plugins/deep-link/examples/app/src-tauri/tauri.conf.json +++ b/plugins/deep-link/examples/app/src-tauri/tauri.conf.json @@ -1,6 +1,6 @@ { "productName": "deep-link-example", - "version": "0.0.0", + "version": "0.1.0", "identifier": "com.tauri.deep-link-example", "build": { "devUrl": "http://localhost:1420", @@ -28,7 +28,7 @@ "hello": "world" }, "deep-link": { - "domains": [ + "mobile": [ { "host": "fabianlars.de", "pathPrefix": ["/intent"] @@ -36,7 +36,10 @@ { "host": "tauri.app" } - ] + ], + "desktop": { + "schemes": ["fabianlars", "my-tauri-app"] + } } }, "bundle": { diff --git a/plugins/deep-link/examples/app/src/main.ts b/plugins/deep-link/examples/app/src/main.ts index f87a6afd..550e0aaa 100644 --- a/plugins/deep-link/examples/app/src/main.ts +++ b/plugins/deep-link/examples/app/src/main.ts @@ -4,35 +4,35 @@ import { onOpenUrl, - getCurrent as getCurrentDeepLinkUrls, -} from "@tauri-apps/plugin-deep-link"; + getCurrent as getCurrentDeepLinkUrls +} from '@tauri-apps/plugin-deep-link' function handler(urls: string[]) { - console.log(urls); + console.log(urls) // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const updateIntentEl = document.querySelector("#event-intent")!; - updateIntentEl.textContent = JSON.stringify(urls); + const updateIntentEl = document.querySelector('#event-intent')! + updateIntentEl.textContent = JSON.stringify(urls) } -window.addEventListener("DOMContentLoaded", () => { - onOpenUrl(handler); +window.addEventListener('DOMContentLoaded', () => { + onOpenUrl(handler) - document.querySelector("#intent-form")?.addEventListener("submit", (e) => { - e.preventDefault(); + document.querySelector('#intent-form')?.addEventListener('submit', (e) => { + e.preventDefault() getCurrentDeepLinkUrls() .then((res) => { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const updateIntentEl = document.querySelector("#update-intent")!; - updateIntentEl.textContent = res ? JSON.stringify(res) : "none"; + const updateIntentEl = document.querySelector('#update-intent')! + updateIntentEl.textContent = res ? JSON.stringify(res) : 'none' }) - .catch(console.error); - }); + .catch(console.error) + }) getCurrentDeepLinkUrls() .then((res) => { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const initialIntentEl = document.querySelector("#initial-intent")!; - initialIntentEl.textContent = res ? JSON.stringify(res) : "none"; + const initialIntentEl = document.querySelector('#initial-intent')! + initialIntentEl.textContent = res ? JSON.stringify(res) : 'none' }) - .catch(console.error); -}); + .catch(console.error) +}) diff --git a/plugins/deep-link/examples/app/tsconfig.json b/plugins/deep-link/examples/app/tsconfig.json index 43d4bc70..c0f337a2 100644 --- a/plugins/deep-link/examples/app/tsconfig.json +++ b/plugins/deep-link/examples/app/tsconfig.json @@ -3,7 +3,7 @@ "target": "ESNext", "module": "ESNext", "lib": ["ESNext", "DOM"], - "moduleResolution": "Node", + "moduleResolution": "bundler", "strict": true, "sourceMap": true, "resolveJsonModule": true, diff --git a/plugins/deep-link/examples/app/vite.config.ts b/plugins/deep-link/examples/app/vite.config.ts index 4bf452bc..b54dc99a 100644 --- a/plugins/deep-link/examples/app/vite.config.ts +++ b/plugins/deep-link/examples/app/vite.config.ts @@ -2,40 +2,37 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { defineConfig } from "vite"; -import { internalIpV4 } from "internal-ip"; +import { defineConfig } from 'vite' -const mobile = - process.env.TAURI_PLATFORM === "android" || - process.env.TAURI_PLATFORM === "ios"; +const host = process.env.TAURI_DEV_HOST // https://vitejs.dev/config/ -export default defineConfig(async () => ({ +export default defineConfig({ // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build` // prevent vite from obscuring rust errors clearScreen: false, // tauri expects a fixed port, fail if that port is not available server: { - host: mobile ? "0.0.0.0" : false, + host: host || false, port: 1420, - hmr: mobile + hmr: host ? { - protocol: "ws", - host: await internalIpV4(), - port: 1421, + protocol: 'ws', + host, + port: 1421 } : undefined, - strictPort: true, + strictPort: true }, // to make use of `TAURI_DEBUG` and other env variables // https://tauri.studio/v1/api/config#buildconfig.beforedevcommand - envPrefix: ["VITE_", "TAURI_"], + envPrefix: ['VITE_', 'TAURI_'], build: { // Tauri supports es2021 - target: process.env.TAURI_PLATFORM == "windows" ? "chrome105" : "safari13", + target: process.env.TAURI_PLATFORM == 'windows' ? 'chrome105' : 'safari13', // don't minify for debug builds - minify: !process.env.TAURI_DEBUG ? "esbuild" : false, + minify: !process.env.TAURI_DEBUG ? 'esbuild' : false, // produce sourcemaps for debug builds - sourcemap: !!process.env.TAURI_DEBUG, - }, -})); + sourcemap: !!process.env.TAURI_DEBUG + } +}) diff --git a/plugins/deep-link/guest-js/index.ts b/plugins/deep-link/guest-js/index.ts index c855ffcf..49afbab7 100644 --- a/plugins/deep-link/guest-js/index.ts +++ b/plugins/deep-link/guest-js/index.ts @@ -2,24 +2,109 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { invoke } from "@tauri-apps/api/core"; -import { UnlistenFn, listen } from "@tauri-apps/api/event"; +import { invoke } from '@tauri-apps/api/core' +import { type UnlistenFn, listen } from '@tauri-apps/api/event' +/** + * Get the current URLs that triggered the deep link. Use this on app load to check whether your app was started via a deep link. + * + * @example + * ```typescript + * import { getCurrent } from '@tauri-apps/plugin-deep-link'; + * const urls = await getCurrent(); + * ``` + * + * #### - **Windows / Linux**: This function reads the command line arguments and checks if there's only one value, which must be an URL with scheme matching one of the configured values. + * Note that you must manually check the arguments when registering deep link schemes dynamically with [`Self::register`]. + * Additionally, the deep link might have been provided as a CLI argument so you should check if its format matches what you expect.. + * + * @since 2.0.0 + */ export async function getCurrent(): Promise { - return await invoke("plugin:deep-link|get_current"); + return await invoke('plugin:deep-link|get_current') +} + +/** + * Register the app as the default handler for the specified protocol. + * + * @param protocol The name of the protocol without `://`. For example, if you want your app to handle `tauri://` links, call this method with `tauri` as the protocol. + * + * @example + * ```typescript + * import { register } from '@tauri-apps/plugin-deep-link'; + * await register("my-scheme"); + * ``` + * + * #### - **macOS / Android / iOS**: Unsupported. + * + * @since 2.0.0 + */ +export async function register(protocol: string): Promise { + return await invoke('plugin:deep-link|register', { protocol }) +} + +/** + * Unregister the app as the default handler for the specified protocol. + * + * @param protocol The name of the protocol without `://`. + * + * @example + * ```typescript + * import { unregister } from '@tauri-apps/plugin-deep-link'; + * await unregister("my-scheme"); + * ``` + * + * #### - **macOS / Linux / Android / iOS**: Unsupported. + * + * @since 2.0.0 + */ +export async function unregister(protocol: string): Promise { + return await invoke('plugin:deep-link|unregister', { protocol }) +} - // return await invoke("plugin:deep-link|get_current"); +/** + * Check whether the app is the default handler for the specified protocol. + * + * @param protocol The name of the protocol without `://`. + * + * @example + * ```typescript + * import { isRegistered } from '@tauri-apps/plugin-deep-link'; + * await isRegistered("my-scheme"); + * ``` + * + * #### - **macOS / Android / iOS**: Unsupported, always returns `true`. + * + * @since 2.0.0 + */ +export async function isRegistered(protocol: string): Promise { + return await invoke('plugin:deep-link|is_registered', { protocol }) } +/** + * Helper function for the `deep-link://new-url` event to run a function each time the protocol is triggered while the app is running. Use `getCurrent` on app load to check whether your app was started via a deep link. + * + * @param protocol The name of the protocol without `://`. + * + * @example + * ```typescript + * import { onOpenUrl } from '@tauri-apps/plugin-deep-link'; + * await onOpenUrl((urls) => { console.log(urls) }); + * ``` + * + * #### - **Windows / Linux**: Unsupported, the OS will spawn a new app instance passing the URL as a CLI argument. + * + * @since 2.0.0 + */ export async function onOpenUrl( - handler: (urls: string[]) => void, + handler: (urls: string[]) => void ): Promise { - const current = await getCurrent(); - if (current != null) { - handler(current); + const current = await getCurrent() + if (current) { + handler(current) } - return await listen("deep-link://new-url", (event) => - handler(event.payload), - ); + return await listen('deep-link://new-url', (event) => { + handler(event.payload) + }) } diff --git a/plugins/deep-link/package.json b/plugins/deep-link/package.json index f1e57422..c2ca9aa2 100644 --- a/plugins/deep-link/package.json +++ b/plugins/deep-link/package.json @@ -1,11 +1,12 @@ { "name": "@tauri-apps/plugin-deep-link", - "version": "2.0.0-beta.1", + "version": "2.0.0", "description": "Set your Tauri application as the default handler for an URL", - "license": "MIT or APACHE-2.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -24,6 +25,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/deep-link/permissions/autogenerated/commands/is_registered.toml b/plugins/deep-link/permissions/autogenerated/commands/is_registered.toml new file mode 100644 index 00000000..2dd73ace --- /dev/null +++ b/plugins/deep-link/permissions/autogenerated/commands/is_registered.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-is-registered" +description = "Enables the is_registered command without any pre-configured scope." +commands.allow = ["is_registered"] + +[[permission]] +identifier = "deny-is-registered" +description = "Denies the is_registered command without any pre-configured scope." +commands.deny = ["is_registered"] diff --git a/plugins/authenticator/permissions/autogenerated/commands/register.toml b/plugins/deep-link/permissions/autogenerated/commands/register.toml similarity index 100% rename from plugins/authenticator/permissions/autogenerated/commands/register.toml rename to plugins/deep-link/permissions/autogenerated/commands/register.toml diff --git a/plugins/deep-link/permissions/autogenerated/commands/unregister.toml b/plugins/deep-link/permissions/autogenerated/commands/unregister.toml new file mode 100644 index 00000000..5d33c97c --- /dev/null +++ b/plugins/deep-link/permissions/autogenerated/commands/unregister.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-unregister" +description = "Enables the unregister command without any pre-configured scope." +commands.allow = ["unregister"] + +[[permission]] +identifier = "deny-unregister" +description = "Denies the unregister command without any pre-configured scope." +commands.deny = ["unregister"] diff --git a/plugins/deep-link/permissions/autogenerated/reference.md b/plugins/deep-link/permissions/autogenerated/reference.md index d0791ef9..3b84f1c5 100644 --- a/plugins/deep-link/permissions/autogenerated/reference.md +++ b/plugins/deep-link/permissions/autogenerated/reference.md @@ -1,14 +1,119 @@ -# Permissions +## Default Permission + +Allows reading the opened deep link via the get_current command + +- `allow-get-current` + +## Permission Table + + + + + + -## allow-get-current + + + + + + + + + + -Allows reading the opened deep link via the get_current command + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`deep-link:allow-get-current` + + Enables the get_current command without any pre-configured scope. -## deny-get-current +
+ +`deep-link:deny-get-current` + + Denies the get_current command without any pre-configured scope. -## default +
+ +`deep-link:allow-is-registered` + + + +Enables the is_registered command without any pre-configured scope. + +
+ +`deep-link:deny-is-registered` + + + +Denies the is_registered command without any pre-configured scope. + +
+ +`deep-link:allow-register` + + + +Enables the register command without any pre-configured scope. + +
+ +`deep-link:deny-register` + + + +Denies the register command without any pre-configured scope. + +
+ +`deep-link:allow-unregister` + + + +Enables the unregister command without any pre-configured scope. + +
+ +`deep-link:deny-unregister` + + + +Denies the unregister command without any pre-configured scope. +
diff --git a/plugins/deep-link/permissions/schemas/schema.json b/plugins/deep-link/permissions/schemas/schema.json index 3880bf0d..7d887dc2 100644 --- a/plugins/deep-link/permissions/schemas/schema.json +++ b/plugins/deep-link/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,29 +251,93 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-get-current -> Enables the get_current command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-get-current" + "macOS" ] }, { - "description": "deny-get-current -> Denies the get_current command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-get-current" + "windows" ] }, { - "description": "default -> Allows reading the opened deep link via the get_current command", + "description": "Linux.", "type": "string", "enum": [ - "default" + "linux" ] + }, + { + "description": "Android.", + "type": "string", + "enum": [ + "android" + ] + }, + { + "description": "iOS.", + "type": "string", + "enum": [ + "iOS" + ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the get_current command without any pre-configured scope.", + "type": "string", + "const": "allow-get-current" + }, + { + "description": "Denies the get_current command without any pre-configured scope.", + "type": "string", + "const": "deny-get-current" + }, + { + "description": "Enables the is_registered command without any pre-configured scope.", + "type": "string", + "const": "allow-is-registered" + }, + { + "description": "Denies the is_registered command without any pre-configured scope.", + "type": "string", + "const": "deny-is-registered" + }, + { + "description": "Enables the register command without any pre-configured scope.", + "type": "string", + "const": "allow-register" + }, + { + "description": "Denies the register command without any pre-configured scope.", + "type": "string", + "const": "deny-register" + }, + { + "description": "Enables the unregister command without any pre-configured scope.", + "type": "string", + "const": "allow-unregister" + }, + { + "description": "Denies the unregister command without any pre-configured scope.", + "type": "string", + "const": "deny-unregister" + }, + { + "description": "Allows reading the opened deep link via the get_current command", + "type": "string", + "const": "default" } ] } diff --git a/plugins/deep-link/rollup.config.js b/plugins/deep-link/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/deep-link/rollup.config.js +++ b/plugins/deep-link/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/deep-link/src/api-iife.js b/plugins/deep-link/src/api-iife.js deleted file mode 100644 index 6a37d748..00000000 --- a/plugins/deep-link/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_DEEPLINK__=function(e){"use strict";function n(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}async function t(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}var r;async function _(e,r,_){const i="string"==typeof _?.target?{kind:"AnyLabel",label:_.target}:_?.target??{kind:"Any"};return t("plugin:event|listen",{event:e,target:i,handler:n(r)}).then((n=>async()=>async function(e,n){await t("plugin:event|unlisten",{event:e,eventId:n})}(e,n)))}async function i(){return await t("plugin:deep-link|get_current")}return"function"==typeof SuppressedError&&SuppressedError,function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WEBVIEW_CREATED="tauri://webview-created",e.WEBVIEW_FILE_DROP="tauri://file-drop",e.WEBVIEW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WEBVIEW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled"}(r||(r={})),e.getCurrent=i,e.onOpenUrl=async function(e){const n=await i();return null!=n&&e(n),await _("deep-link://new-url",(n=>e(n.payload)))},e}({});Object.defineProperty(window.__TAURI__,"deepLink",{value:__TAURI_PLUGIN_DEEPLINK__})} diff --git a/plugins/deep-link/src/commands.rs b/plugins/deep-link/src/commands.rs index 4b228e4c..078adfb1 100644 --- a/plugins/deep-link/src/commands.rs +++ b/plugins/deep-link/src/commands.rs @@ -14,3 +14,33 @@ pub(crate) async fn get_current( ) -> Result>> { deep_link.get_current() } + +#[command] +pub(crate) async fn register( + _app: AppHandle, + _window: Window, + deep_link: State<'_, DeepLink>, + protocol: String, +) -> Result<()> { + deep_link.register(protocol) +} + +#[command] +pub(crate) async fn unregister( + _app: AppHandle, + _window: Window, + deep_link: State<'_, DeepLink>, + protocol: String, +) -> Result<()> { + deep_link.unregister(protocol) +} + +#[command] +pub(crate) async fn is_registered( + _app: AppHandle, + _window: Window, + deep_link: State<'_, DeepLink>, + protocol: String, +) -> Result { + deep_link.is_registered(protocol) +} diff --git a/plugins/deep-link/src/config.rs b/plugins/deep-link/src/config.rs index 80f0a4c0..d7bad5b4 100644 --- a/plugins/deep-link/src/config.rs +++ b/plugins/deep-link/src/config.rs @@ -4,11 +4,10 @@ // This module is also imported in build.rs! -#![allow(dead_code)] - use serde::{Deserialize, Deserializer}; +use tauri_utils::config::DeepLinkProtocol; -#[derive(Deserialize)] +#[derive(Deserialize, Clone)] pub struct AssociatedDomain { #[serde(deserialize_with = "deserialize_associated_host")] pub host: String, @@ -30,7 +29,51 @@ where } } -#[derive(Deserialize)] +#[derive(Deserialize, Clone)] pub struct Config { - pub domains: Vec, + /// Mobile requires `https://` urls. + #[serde(default)] + pub mobile: Vec, + /// Desktop requires urls starting with `://`. + /// These urls are also active in dev mode on Android. + #[allow(unused)] // Used in tauri-bundler + #[serde(default)] + pub desktop: DesktopProtocol, +} + +#[derive(Deserialize, Clone)] +#[serde(untagged)] +#[allow(unused)] // Used in tauri-bundler +pub enum DesktopProtocol { + One(DeepLinkProtocol), + List(Vec), +} + +impl Default for DesktopProtocol { + fn default() -> Self { + Self::List(Vec::new()) + } +} + +impl DesktopProtocol { + #[allow(dead_code)] + pub fn contains_scheme(&self, scheme: &String) -> bool { + match self { + Self::One(protocol) => protocol.schemes.contains(scheme), + Self::List(protocols) => protocols + .iter() + .any(|protocol| protocol.schemes.contains(scheme)), + } + } + + #[allow(dead_code)] + pub fn schemes(&self) -> Vec { + match self { + Self::One(protocol) => protocol.schemes.clone(), + Self::List(protocols) => protocols + .iter() + .flat_map(|protocol| protocol.schemes.clone()) + .collect(), + } + } } diff --git a/plugins/deep-link/src/error.rs b/plugins/deep-link/src/error.rs index 339e763b..88c71e8a 100644 --- a/plugins/deep-link/src/error.rs +++ b/plugins/deep-link/src/error.rs @@ -8,8 +8,21 @@ pub type Result = std::result::Result; #[derive(Debug, thiserror::Error)] pub enum Error { + #[error("unsupported platform")] + UnsupportedPlatform, #[error(transparent)] Io(#[from] std::io::Error), + #[error(transparent)] + Tauri(#[from] tauri::Error), + #[cfg(target_os = "windows")] + #[error(transparent)] + Windows(#[from] windows_result::Error), + #[cfg(target_os = "linux")] + #[error(transparent)] + Ini(#[from] ini::Error), + #[cfg(target_os = "linux")] + #[error(transparent)] + ParseIni(#[from] ini::ParseError), #[cfg(mobile)] #[error(transparent)] PluginInvoke(#[from] tauri::plugin::mobile::PluginInvokeError), diff --git a/plugins/deep-link/src/lib.rs b/plugins/deep-link/src/lib.rs index 5fa4b907..25cdd317 100644 --- a/plugins/deep-link/src/lib.rs +++ b/plugins/deep-link/src/lib.rs @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use serde::de::DeserializeOwned; +use std::sync::Arc; + use tauri::{ plugin::{Builder, PluginApi, TauriPlugin}, - AppHandle, Manager, Runtime, + AppHandle, EventId, Listener, Manager, Runtime, }; mod commands; @@ -17,28 +18,37 @@ pub use error::{Error, Result}; #[cfg(target_os = "android")] const PLUGIN_IDENTIFIER: &str = "app.tauri.deep_link"; -fn init_deep_link( +fn init_deep_link( app: &AppHandle, - _api: PluginApi, + api: PluginApi>, ) -> crate::Result> { #[cfg(target_os = "android")] { - use tauri::ipc::{Channel, InvokeBody}; + let _api = api; + + use tauri::{ + ipc::{Channel, InvokeResponseBody}, + Emitter, + }; let handle = _api.register_android_plugin(PLUGIN_IDENTIFIER, "DeepLinkPlugin")?; + #[derive(serde::Deserialize)] + struct Event { + url: String, + } + let app_handle = app.clone(); handle.run_mobile_plugin::<()>( "setEventHandler", imp::EventHandler { handler: Channel::new(move |event| { - println!("got channel event: {:?}", &event); - let url = match event { - InvokeBody::Json(payload) => payload - .get("url") - .and_then(|v| v.as_str()) - .map(|s| s.to_owned()), + InvokeResponseBody::Json(payload) => { + serde_json::from_str::(&payload) + .ok() + .map(|payload| payload.url) + } _ => None, }; @@ -49,22 +59,38 @@ fn init_deep_link( }, )?; - return Ok(DeepLink(handle)); + return Ok(DeepLink { + app: app.clone(), + plugin_handle: handle, + }); } - #[cfg(not(target_os = "android"))] - Ok(DeepLink { + #[cfg(target_os = "ios")] + return Ok(DeepLink { app: app.clone(), current: Default::default(), - }) + config: api.config().clone(), + }); + + #[cfg(desktop)] + { + let args = std::env::args(); + let deep_link = DeepLink { + app: app.clone(), + current: Default::default(), + config: api.config().clone(), + }; + deep_link.handle_cli_arguments(args); + + Ok(deep_link) + } } #[cfg(target_os = "android")] mod imp { - use tauri::{plugin::PluginHandle, Runtime}; + use tauri::{ipc::Channel, plugin::PluginHandle, AppHandle, Runtime}; use serde::{Deserialize, Serialize}; - use tauri::ipc::Channel; #[derive(Serialize)] #[serde(rename_all = "camelCase")] @@ -79,42 +105,348 @@ mod imp { } /// Access to the deep-link APIs. - pub struct DeepLink(pub(crate) PluginHandle); + pub struct DeepLink { + pub(crate) app: AppHandle, + pub(crate) plugin_handle: PluginHandle, + } impl DeepLink { - /// Get the current URLs that triggered the deep link. + /// Get the current URLs that triggered the deep link. Use this on app load to check whether your app was started via a deep link. + /// + /// ## Platform-specific: + /// + /// - **Windows / Linux**: This function reads the command line arguments and checks if there's only one value, which must be an URL with scheme matching one of the configured values. + /// Note that you must manually check the arguments when registering deep link schemes dynamically with [`Self::register`]. + /// Additionally, the deep link might have been provided as a CLI argument so you should check if its format matches what you expect. pub fn get_current(&self) -> crate::Result>> { - self.0 + self.plugin_handle .run_mobile_plugin::("getCurrent", ()) .map(|v| v.url.map(|url| vec![url])) .map_err(Into::into) } + + /// Register the app as the default handler for the specified protocol. + /// + /// - `protocol`: The name of the protocol without `://`. For example, if you want your app to handle `tauri://` links, call this method with `tauri` as the protocol. + /// + /// ## Platform-specific: + /// + /// - **macOS / Android / iOS**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`). + pub fn register>(&self, _protocol: S) -> crate::Result<()> { + Err(crate::Error::UnsupportedPlatform) + } + + /// Unregister the app as the default handler for the specified protocol. + /// + /// - `protocol`: The name of the protocol without `://`. + /// + /// ## Platform-specific: + /// + /// - **Linux**: Can only unregister the scheme if it was initially registered with [`register`](`Self::register`). May not work on older distros. + /// - **macOS / Android / iOS**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`). + pub fn unregister>(&self, _protocol: S) -> crate::Result<()> { + Err(crate::Error::UnsupportedPlatform) + } + + /// Check whether the app is the default handler for the specified protocol. + /// + /// - `protocol`: The name of the protocol without `://`. + /// + /// ## Platform-specific: + /// + /// - **macOS / Android / iOS**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`). + pub fn is_registered>(&self, _protocol: S) -> crate::Result { + Err(crate::Error::UnsupportedPlatform) + } } } #[cfg(not(target_os = "android"))] mod imp { use std::sync::Mutex; + #[cfg(target_os = "linux")] + use std::{ + fs::{create_dir_all, File}, + io::Write, + process::Command, + }; + #[cfg(target_os = "linux")] + use tauri::Manager; use tauri::{AppHandle, Runtime}; + #[cfg(windows)] + use windows_registry::CURRENT_USER; /// Access to the deep-link APIs. pub struct DeepLink { - #[allow(dead_code)] pub(crate) app: AppHandle, pub(crate) current: Mutex>>, + pub(crate) config: Option, } impl DeepLink { - /// Get the current URLs that triggered the deep link. + /// Checks if the provided list of arguments (which should match [`std::env::args`]) + /// contains a deep link argument (for Linux and Windows). + /// + /// On Linux and Windows the deep links trigger a new app instance with the deep link URL as its only argument. + /// + /// This function does what it can to verify if the argument is actually a deep link, though it could also be a regular CLI argument. + /// To enhance its checks, we only match deep links against the schemes defined in the Tauri configuration + /// i.e. dynamic schemes WON'T be processed. + /// + /// This function updates the [`Self::get_current`] value and emits a `deep-link://new-url` event. + #[cfg(desktop)] + pub fn handle_cli_arguments, I: Iterator>(&self, mut args: I) { + use tauri::Emitter; + + let Some(config) = &self.config else { + return; + }; + + if cfg!(windows) || cfg!(target_os = "linux") { + args.next(); // bin name + let arg = args.next(); + + let maybe_deep_link = args.next().is_none(); // single argument + if !maybe_deep_link { + return; + } + + if let Some(url) = arg.and_then(|arg| arg.as_ref().parse::().ok()) { + if config.desktop.contains_scheme(&url.scheme().to_string()) { + let mut current = self.current.lock().unwrap(); + current.replace(vec![url.clone()]); + let _ = self.app.emit("deep-link://new-url", vec![url]); + } else if cfg!(debug_assertions) { + log::warn!("argument {url} does not match any configured deep link scheme; skipping it"); + } + } + } + } + + /// Get the current URLs that triggered the deep link. Use this on app load to check whether your app was started via a deep link. + /// + /// ## Platform-specific: + /// + /// - **Windows / Linux**: This function reads the command line arguments and checks if there's only one value, which must be an URL with scheme matching one of the configured values. + /// Note that you must manually check the arguments when registering deep link schemes dynamically with [`Self::register`]. + /// Additionally, the deep link might have been provided as a CLI argument so you should check if its format matches what you expect. pub fn get_current(&self) -> crate::Result>> { - Ok(self.current.lock().unwrap().clone()) + return Ok(self.current.lock().unwrap().clone()); + } + + /// Registers all schemes defined in the configuration file. + /// + /// This is useful to ensure the schemes are registered even if the user did not install the app properly + /// (e.g. an AppImage that was not properly registered with an AppImage launcher). + pub fn register_all(&self) -> crate::Result<()> { + let Some(config) = &self.config else { + return Ok(()); + }; + + for scheme in config.desktop.schemes() { + self.register(scheme)?; + } + + Ok(()) + } + + /// Register the app as the default handler for the specified protocol. + /// + /// - `protocol`: The name of the protocol without `://`. For example, if you want your app to handle `tauri://` links, call this method with `tauri` as the protocol. + /// + /// ## Platform-specific: + /// + /// - **macOS / Android / iOS**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`). + pub fn register>(&self, _protocol: S) -> crate::Result<()> { + #[cfg(windows)] + { + let key_base = format!("Software\\Classes\\{}", _protocol.as_ref()); + + let exe = dunce::simplified(&tauri::utils::platform::current_exe()?) + .display() + .to_string(); + + let key_reg = CURRENT_USER.create(&key_base)?; + key_reg.set_string( + "", + &format!("URL:{} protocol", self.app.config().identifier), + )?; + key_reg.set_string("URL Protocol", "")?; + + let icon_reg = CURRENT_USER.create(format!("{key_base}\\DefaultIcon"))?; + icon_reg.set_string("", &format!("{exe},0"))?; + + let cmd_reg = CURRENT_USER.create(format!("{key_base}\\shell\\open\\command"))?; + + cmd_reg.set_string("", &format!("\"{exe}\" \"%1\""))?; + + Ok(()) + } + + #[cfg(target_os = "linux")] + { + let bin = tauri::utils::platform::current_exe()?; + let file_name = format!( + "{}-handler.desktop", + bin.file_name().unwrap().to_string_lossy() + ); + let appimage = self.app.env().appimage; + let exec = appimage + .clone() + .unwrap_or_else(|| bin.into_os_string()) + .to_string_lossy() + .to_string(); + + let target = self.app.path().data_dir()?.join("applications"); + + create_dir_all(&target)?; + + let target_file = target.join(&file_name); + + let mime_type = format!("x-scheme-handler/{}", _protocol.as_ref()); + + if let Ok(mut desktop_file) = ini::Ini::load_from_file(&target_file) { + if let Some(section) = desktop_file.section_mut(Some("Desktop Entry")) { + let old_mimes = section.remove("MimeType"); + section.append( + "MimeType", + format!("{mime_type};{}", old_mimes.unwrap_or_default()), + ); + desktop_file.write_to_file(&target_file)?; + } + } else { + let mut file = File::create(target_file)?; + file.write_all( + format!( + include_str!("template.desktop"), + name = self + .app + .config() + .product_name + .clone() + .unwrap_or_else(|| file_name.clone()), + exec = exec, + mime_type = mime_type + ) + .as_bytes(), + )?; + } + + Command::new("update-desktop-database") + .arg(target) + .status()?; + + Command::new("xdg-mime") + .args(["default", &file_name, _protocol.as_ref()]) + .status()?; + + Ok(()) + } + + #[cfg(not(any(windows, target_os = "linux")))] + Err(crate::Error::UnsupportedPlatform) + } + + /// Unregister the app as the default handler for the specified protocol. + /// + /// - `protocol`: The name of the protocol without `://`. + /// + /// ## Platform-specific: + /// + /// - **Linux**: Can only unregister the scheme if it was initially registered with [`register`](`Self::register`). May not work on older distros. + /// - **macOS / Android / iOS**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`). + pub fn unregister>(&self, _protocol: S) -> crate::Result<()> { + #[cfg(windows)] + { + CURRENT_USER.remove_tree(format!("Software\\Classes\\{}", _protocol.as_ref()))?; + + Ok(()) + } + + #[cfg(target_os = "linux")] + { + let mimeapps_path = self.app.path().config_dir()?.join("mimeapps.list"); + let mut mimeapps = ini::Ini::load_from_file(&mimeapps_path)?; + + let file_name = format!( + "{}-handler.desktop", + tauri::utils::platform::current_exe()? + .file_name() + .unwrap() + .to_string_lossy() + ); + + if let Some(section) = mimeapps.section_mut(Some("Default Applications")) { + let scheme = format!("x-scheme-handler/{}", _protocol.as_ref()); + + if section.get(&scheme).unwrap_or_default() == file_name { + section.remove(scheme); + } + } + + mimeapps.write_to_file(mimeapps_path)?; + + Ok(()) + } + + #[cfg(not(any(windows, target_os = "linux")))] + Err(crate::Error::UnsupportedPlatform) + } + + /// Check whether the app is the default handler for the specified protocol. + /// + /// - `protocol`: The name of the protocol without `://`. + /// + /// ## Platform-specific: + /// + /// - **macOS / Android / iOS**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`). + pub fn is_registered>(&self, _protocol: S) -> crate::Result { + #[cfg(windows)] + { + let cmd_reg = CURRENT_USER.open(format!( + "Software\\Classes\\{}\\shell\\open\\command", + _protocol.as_ref() + ))?; + + let registered_cmd = cmd_reg.get_string("")?; + + let exe = dunce::simplified(&tauri::utils::platform::current_exe()?) + .display() + .to_string(); + + Ok(registered_cmd == format!("\"{exe}\" \"%1\"")) + } + #[cfg(target_os = "linux")] + { + let file_name = format!( + "{}-handler.desktop", + tauri::utils::platform::current_exe()? + .file_name() + .unwrap() + .to_string_lossy() + ); + + let output = Command::new("xdg-mime") + .args([ + "query", + "default", + &format!("x-scheme-handler/{}", _protocol.as_ref()), + ]) + .output()?; + + Ok(String::from_utf8_lossy(&output.stdout).contains(&file_name)) + } + + #[cfg(not(any(windows, target_os = "linux")))] + Err(crate::Error::UnsupportedPlatform) } } } pub use imp::DeepLink; +use url::Url; -/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the deep-link APIs. +/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the deep-link APIs. pub trait DeepLinkExt { fn deep_link(&self) -> &DeepLink; } @@ -125,11 +457,63 @@ impl> crate::DeepLinkExt for T { } } +/// Event that is triggered when the app was requested to open a new URL. +/// +/// Typed [`tauri::Event`]. +pub struct OpenUrlEvent { + id: EventId, + urls: Vec, +} + +impl OpenUrlEvent { + /// The event ID which can be used to stop listening to the event via [`tauri::Listener::unlisten`]. + pub fn id(&self) -> EventId { + self.id + } + + /// The event URLs. + pub fn urls(self) -> Vec { + self.urls + } +} + +impl DeepLink { + /// Handle a new deep link being triggered to open the app. + /// + /// To avoid race conditions, if the app was started with a deep link, + /// the closure gets immediately called with the deep link URL. + pub fn on_open_url(&self, f: F) -> EventId { + let f = Arc::new(f); + let f_ = f.clone(); + let event_id = self.app.listen("deep-link://new-url", move |event| { + if let Ok(urls) = serde_json::from_str(event.payload()) { + f(OpenUrlEvent { + id: event.id(), + urls, + }) + } + }); + + if let Ok(Some(current)) = self.get_current() { + f_(OpenUrlEvent { + id: event_id, + urls: current, + }) + } + + event_id + } +} + /// Initializes the plugin. pub fn init() -> TauriPlugin> { Builder::new("deep-link") - .js_init_script(include_str!("api-iife.js").to_string()) - .invoke_handler(tauri::generate_handler![commands::get_current]) + .invoke_handler(tauri::generate_handler![ + commands::get_current, + commands::register, + commands::unregister, + commands::is_registered + ]) .setup(|app, api| { app.manage(init_deep_link(app, api)?); Ok(()) @@ -137,6 +521,8 @@ pub fn init() -> TauriPlugin> { .on_event(|_app, _event| { #[cfg(any(target_os = "macos", target_os = "ios"))] if let tauri::RunEvent::Opened { urls } = _event { + use tauri::Emitter; + let _ = _app.emit("deep-link://new-url", urls); _app.state::>() .current diff --git a/plugins/deep-link/src/template.desktop b/plugins/deep-link/src/template.desktop new file mode 100644 index 00000000..0fb89abb --- /dev/null +++ b/plugins/deep-link/src/template.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name={name} +Exec={exec} %u +Terminal=false +MimeType={mime_type} +NoDisplay=true \ No newline at end of file diff --git a/plugins/dialog/.gitignore b/plugins/dialog/.gitignore deleted file mode 100644 index 24ae1280..00000000 --- a/plugins/dialog/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.tauri diff --git a/plugins/dialog/CHANGELOG.md b/plugins/dialog/CHANGELOG.md index 39b3bbf3..57c51092 100644 --- a/plugins/dialog/CHANGELOG.md +++ b/plugins/dialog/CHANGELOG.md @@ -1,5 +1,174 @@ # Changelog +## \[2.0.3] + +### Dependencies + +- Upgraded to `fs@2.0.3` + +## \[2.0.1] + +- [`2302c2db`](https://github.com/tauri-apps/plugins-workspace/commit/2302c2db1c49673e61dcbda8cdb01b2c57e9ba6f) ([#1910](https://github.com/tauri-apps/plugins-workspace/pull/1910) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Fix `ask` and `confirm` not using system button texts +- [`aee14ed4`](https://github.com/tauri-apps/plugins-workspace/commit/aee14ed4261cdedc4ed7cc2686f01f437859a5c7) ([#1892](https://github.com/tauri-apps/plugins-workspace/pull/1892) by [@nashaofu](https://github.com/tauri-apps/plugins-workspace/../../nashaofu)) Set `save` dialog mime type from the `filters` extensions on Android. + +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +### Dependencies + +- Upgraded to `fs@2.0.1` + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +### Dependencies + +- Upgraded to `fs@2.0.0` + +## \[2.0.0-rc.8] + +- [`6bf1bd8d`](https://github.com/tauri-apps/plugins-workspace/commit/6bf1bd8d44bb95618590aa066e638509b014e0f9) ([#1805](https://github.com/tauri-apps/plugins-workspace/pull/1805) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update rfd to 0.15 + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.6` + +### breaking + +- [`04459afb`](https://github.com/tauri-apps/plugins-workspace/commit/04459afbb67aafa5cd57e6a148c2beb0a8d3e04a) ([#1842](https://github.com/tauri-apps/plugins-workspace/pull/1842) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Changed `MessageDialogBuilder::ok_button_label` and `MessageDialogBuilder::cancel_button_label` to `MessageDialogBuilder::buttons` which takes an enum now + +## \[2.0.0-rc.7] + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.5` + +## \[2.0.0-rc.6] + +- [`2b898f07`](https://github.com/tauri-apps/plugins-workspace/commit/2b898f078688c57309ca17962bf02e665c406514) ([#1769](https://github.com/tauri-apps/plugins-workspace/pull/1769) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update Tauri scopes (asset protocol) when using the `open()` command to select directories. + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.4` + +## \[2.0.0-rc.5] + +- [`a2fe5551`](https://github.com/tauri-apps/plugins-workspace/commit/a2fe55512f908dd11c814ce021d164f01677572a) ([#1727](https://github.com/tauri-apps/plugins-workspace/pull/1727) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Add utility methods on `FilePath` and `SafeFilePath` enums which are: + + - `path` + - `simplified` + - `into_path` +- [`a2fe5551`](https://github.com/tauri-apps/plugins-workspace/commit/a2fe55512f908dd11c814ce021d164f01677572a) ([#1727](https://github.com/tauri-apps/plugins-workspace/pull/1727) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Implement `Serialize`, `Deserialize`, `From`, `TryFrom` and `FromStr` traits for `FilePath` and `SafeFilePath` enums. +- [`a2fe5551`](https://github.com/tauri-apps/plugins-workspace/commit/a2fe55512f908dd11c814ce021d164f01677572a) ([#1727](https://github.com/tauri-apps/plugins-workspace/pull/1727) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Mark `Error` enum as `#[non_exhuastive]`. +- [`a2fe5551`](https://github.com/tauri-apps/plugins-workspace/commit/a2fe55512f908dd11c814ce021d164f01677572a) ([#1727](https://github.com/tauri-apps/plugins-workspace/pull/1727) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Add `SafeFilePath` enum. + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.3` + +## \[2.0.0-rc.4] + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.2` + +### breaking + +- [`0cb99bda`](https://github.com/tauri-apps/plugins-workspace/commit/0cb99bdaf11b5a9bb66b80bdf40b085d87c3066d) ([#1706](https://github.com/tauri-apps/plugins-workspace/pull/1706) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) If no filters are specified, the file picker dialog now defaults to a file selection instead of photos. + +### feat + +- [`feb1e93f`](https://github.com/tauri-apps/plugins-workspace/commit/feb1e93fcb9a913c002daa29e3b709f24b97c664) ([#1707](https://github.com/tauri-apps/plugins-workspace/pull/1707) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Implement `save` API on iOS. + +## \[2.0.0-rc.1] + +- [`448846b8`](https://github.com/tauri-apps/plugins-workspace/commit/448846b834d23df6e7c5dc66c5dd9aa0cb01846d) ([#1658](https://github.com/tauri-apps/plugins-workspace/pull/1658) by [@mikoto2000](https://github.com/tauri-apps/plugins-workspace/../../mikoto2000)) The `open` function now returns a string representing either the file path or URI instead of an object. + To read the file data, use the `fs` APIs. +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.2] + +- [`b9147758`](https://github.com/tauri-apps/plugins-workspace/commit/b914775898c2bee7ceb20bd17ee595005cd17a64) ([#1679](https://github.com/tauri-apps/plugins-workspace/pull/1679) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Explicitly set a minimum macOS version for the Swift package. + +## \[2.0.0-rc.1] + +### feat + +- [`bc7eecf4`](https://github.com/tauri-apps/plugins-workspace/commit/bc7eecf4202e7d23b987440c1cbd2da0f68c8bef) ([#1657](https://github.com/tauri-apps/plugins-workspace/pull/1657) by [@mikoto2000](https://github.com/tauri-apps/plugins-workspace/../../mikoto2000)) Implement `save` API on Android. + +### changes + +- [`6b079cfd`](https://github.com/tauri-apps/plugins-workspace/commit/6b079cfdd107c94abc2c7300f6af00bac3ff4040) ([#1649](https://github.com/tauri-apps/plugins-workspace/pull/1649) by [@ahqsoftwares](https://github.com/tauri-apps/plugins-workspace/../../ahqsoftwares)) Remove targetSdk from build.kts files as it is deprecated and will be removed from DSL v9.0 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.8] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.7] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.6] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[2.0.0-beta.6] + +- [`326df688`](https://github.com/tauri-apps/plugins-workspace/commit/326df6883998d416fc0837583ed972854628bb52)([#1236](https://github.com/tauri-apps/plugins-workspace/pull/1236)) Fixes command argument parsing on iOS. + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.6` + +## \[2.0.0-beta.5] + +- [`bb51a41`](https://github.com/tauri-apps/plugins-workspace/commit/bb51a41d67ebf989e8aedf10c4b1a7f9514d1bdf)([#1168](https://github.com/tauri-apps/plugins-workspace/pull/1168)) **Breaking Change:** All apis that return paths to the frontend will now remove the `\\?\` UNC prefix on Windows. + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.5` + +## \[2.0.0-beta.4] + +- [`4cd8112`](https://github.com/tauri-apps/plugins-workspace/commit/4cd81126fdf25e1847546f8fdbd924aa4bfeabb5)([#1056](https://github.com/tauri-apps/plugins-workspace/pull/1056)) Fixed an issue where dialogs on android would return the Content URI instead of the file path + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.4` + +## \[2.0.0-beta.3] + +- [`35ea595`](https://github.com/tauri-apps/plugins-workspace/commit/35ea5956d060f0bdafd140f2541c607bb811805b)([#1073](https://github.com/tauri-apps/plugins-workspace/pull/1073)) Fixed an issue where the dialog apis panicked when they were called with no application windows open. +- [`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. + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.3` + +## \[2.0.0-beta.2] + +- [`aa25c91`](https://github.com/tauri-apps/plugins-workspace/commit/aa25c91bb01e957872fb2b606a3acaf2f2c4ef3a)([#978](https://github.com/tauri-apps/plugins-workspace/pull/978)) Allow configuring `canCreateDirectories` for open and save dialogs on macOS, if not configured, it will be set to `true` by default. +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -87,5 +256,48 @@ - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! pull/371)) First v2 alpha release! -kspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + kspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + pull/371)) First v2 alpha release! + 71]\(https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + pull/371)) First v2 alpha release! + kspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + pull/371)) First v2 alpha release! + lpha release! + pull/371)) First v2 alpha release! + 7ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + pull/371)) First v2 alpha release! + 71]\(https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + pull/371)) First v2 alpha release! + kspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + pull/371)) First v2 alpha release! + lpha release! + pull/371)) First v2 alpha release! + lpha release! + pull/371)) First v2 alpha release! + lpha release! + pull/371)) First v2 alpha release! + lpha release! + pull/371)) First v2 alpha release! + lpha release! + lpha release! + pull/371)) First v2 alpha release! + lpha release! + pull/371)) First v2 alpha release! + lpha release! + pull/371)) First v2 alpha release! + v2 alpha release! + lpha release! + pull/371)) First v2 alpha release! + lpha release! + pull/371)) First v2 alpha release! + lpha release! + pull/371)) First v2 alpha release! + lpha release! + lpha release! + pull/371)) First v2 alpha release! + lpha release! + pull/371)) First v2 alpha release! + lpha release! + pull/371)) First v2 alpha release! + lease! pull/371)) First v2 alpha release! diff --git a/plugins/dialog/Cargo.toml b/plugins/dialog/Cargo.toml index eb40f6a1..664416a7 100644 --- a/plugins/dialog/Cargo.toml +++ b/plugins/dialog/Cargo.toml @@ -1,20 +1,31 @@ [package] name = "tauri-plugin-dialog" -version = "2.0.0-beta.1" +version = "2.0.3" description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application." edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-dialog" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] -targets = [ "x86_64-unknown-linux-gnu", "x86_64-linux-android" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] +targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "partial", notes = "Does not support folder picker" } +ios = { level = "partial", notes = "Does not support folder picker" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } + +[dev-dependencies] +tauri = { workspace = true, features = ["wry"] } [dependencies] serde = { workspace = true } @@ -22,11 +33,16 @@ serde_json = { workspace = true } tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } -tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.1" } +url = { workspace = true } +tauri-plugin-fs = { path = "../fs", version = "2.0.3" } -[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] -glib = "0.16" +[target.'cfg(target_os = "ios")'.dependencies] +tauri = { workspace = true, features = ["wry"] } [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] -rfd = { version = "0.14", default-features = false, features = [ "tokio", "gtk3", "common-controls-v6" ] } +rfd = { version = "0.15", default-features = false, features = [ + "tokio", + "gtk3", + "common-controls-v6", +] } raw-window-handle = "0.6" diff --git a/plugins/dialog/README.md b/plugins/dialog/README.md index 0fbd529c..2259e35b 100644 --- a/plugins/dialog/README.md +++ b/plugins/dialog/README.md @@ -2,9 +2,17 @@ Native system dialogs for opening and saving files along with message dialogs. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ✓ | +| iOS | ✓ | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-dialog = "2.0.0-beta" +tauri-plugin-dialog = "2.0.0" # alternatively with Git: tauri-plugin-dialog = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` diff --git a/plugins/dialog/SECURITY.md b/plugins/dialog/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/dialog/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/dialog/android/build.gradle.kts b/plugins/dialog/android/build.gradle.kts index a205eab1..e824cff9 100644 --- a/plugins/dialog/android/build.gradle.kts +++ b/plugins/dialog/android/build.gradle.kts @@ -5,11 +5,10 @@ plugins { android { namespace = "app.tauri.dialog" - compileSdk = 32 + compileSdk = 34 defaultConfig { - minSdk = 24 - targetSdk = 32 + minSdk = 24 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") diff --git a/plugins/dialog/android/src/main/java/DialogPlugin.kt b/plugins/dialog/android/src/main/java/DialogPlugin.kt index 462e22bb..af0467d8 100644 --- a/plugins/dialog/android/src/main/java/DialogPlugin.kt +++ b/plugins/dialog/android/src/main/java/DialogPlugin.kt @@ -10,6 +10,7 @@ import android.content.Intent import android.net.Uri import android.os.Handler import android.os.Looper +import android.webkit.MimeTypeMap import androidx.activity.result.ActivityResult import app.tauri.Logger import app.tauri.annotation.ActivityCallback @@ -30,7 +31,6 @@ class Filter { class FilePickerOptions { lateinit var filters: Array var multiple: Boolean? = null - var readData: Boolean? = null } @InvokeArg @@ -41,6 +41,12 @@ class MessageOptions { var cancelButtonLabel: String? = null } +@InvokeArg +class SaveFileDialogOptions { + var fileName: String? = null + lateinit var filters: Array +} + @TauriPlugin class DialogPlugin(private val activity: Activity): Plugin(activity) { var filePickerOptions: FilePickerOptions? = null @@ -53,20 +59,7 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) { val intent = if (parsedTypes.isNotEmpty()) { val intent = Intent(Intent.ACTION_PICK) - intent.putExtra(Intent.EXTRA_MIME_TYPES, parsedTypes) - - var uniqueMimeType = true - var mimeKind: String? = null - for (mime in parsedTypes) { - val kind = mime.split("/")[0] - if (mimeKind == null) { - mimeKind = kind - } else if (mimeKind != kind) { - uniqueMimeType = false - } - } - - intent.type = if (uniqueMimeType) Intent.normalizeMimeType("$mimeKind/*") else "*/*" + setIntentMimeTypes(intent, parsedTypes) intent } else { val intent = Intent(Intent.ACTION_GET_CONTENT) @@ -90,7 +83,7 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) { try { when (result.resultCode) { Activity.RESULT_OK -> { - val callResult = createPickFilesResult(result.data, filePickerOptions?.readData ?: false) + val callResult = createPickFilesResult(result.data) invoke.resolve(callResult) } Activity.RESULT_CANCELED -> invoke.reject("File picker cancelled") @@ -103,61 +96,69 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) { } } - private fun createPickFilesResult(data: Intent?, readData: Boolean): JSObject { + private fun createPickFilesResult(data: Intent?): JSObject { val callResult = JSObject() - val filesResultList: MutableList = ArrayList() if (data == null) { - callResult.put("files", JSArray.from(filesResultList)) + callResult.put("files", null) return callResult } - val uris: MutableList = ArrayList() + val uris: MutableList = ArrayList() if (data.clipData == null) { val uri: Uri? = data.data - uris.add(uri) + uris.add(uri?.toString()) } else { for (i in 0 until data.clipData!!.itemCount) { val uri: Uri = data.clipData!!.getItemAt(i).uri - uris.add(uri) + uris.add(uri.toString()) } } - for (i in uris.indices) { - val uri = uris[i] ?: continue - val fileResult = JSObject() - if (readData) { - fileResult.put("base64Data", FilePickerUtils.getDataFromUri(activity, uri)) - } - val duration = FilePickerUtils.getDurationFromUri(activity, uri) - if (duration != null) { - fileResult.put("duration", duration) - } - val resolution = FilePickerUtils.getHeightAndWidthFromUri(activity, uri) - if (resolution != null) { - fileResult.put("height", resolution.height) - fileResult.put("width", resolution.width) - } - fileResult.put("mimeType", FilePickerUtils.getMimeTypeFromUri(activity, uri)) - val modifiedAt = FilePickerUtils.getModifiedAtFromUri(activity, uri) - if (modifiedAt != null) { - fileResult.put("modifiedAt", modifiedAt) - } - fileResult.put("name", FilePickerUtils.getNameFromUri(activity, uri)) - fileResult.put("path", FilePickerUtils.getPathFromUri(uri)) - fileResult.put("size", FilePickerUtils.getSizeFromUri(activity, uri)) - filesResultList.add(fileResult) - } - callResult.put("files", JSArray.from(filesResultList.toTypedArray())) + callResult.put("files", JSArray.from(uris.toTypedArray())) return callResult } private fun parseFiltersOption(filters: Array): Array { val mimeTypes = mutableListOf() for (filter in filters) { - for (mime in filter.extensions) { - mimeTypes.add(if (mime == "text/csv") "text/comma-separated-values" else mime) + for (ext in filter.extensions) { + if (ext.contains('/')) { + mimeTypes.add(if (ext == "text/csv") "text/comma-separated-values" else ext) + } else { + MimeTypeMap.getSingleton().getMimeTypeFromExtension(ext)?.let { + mimeTypes.add(it) + } + } } } return mimeTypes.toTypedArray() } + + private fun setIntentMimeTypes(intent: Intent, mimeTypes: Array) { + if (mimeTypes.isNotEmpty()) { + var uniqueMimeKind = true + var mimeKind: String? = null + for (mime in mimeTypes) { + val kind = mime.split("/")[0] + if (mimeKind == null) { + mimeKind = kind + } else if (mimeKind != kind) { + uniqueMimeKind = false + } + } + + if (uniqueMimeKind) { + if (mimeTypes.size > 1) { + intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes) + intent.type = Intent.normalizeMimeType("$mimeKind/*") + } else { + intent.type = mimeTypes[0] + } + } else { + intent.type = "*/*" + } + } else { + intent.type = "*/*" + } + } @Command fun showMessageDialog(invoke: Invoke) { @@ -204,4 +205,48 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) { dialog.show() } } + + @Command + fun saveFileDialog(invoke: Invoke) { + try { + val args = invoke.parseArgs(SaveFileDialogOptions::class.java) + val parsedTypes = parseFiltersOption(args.filters) + + val intent = Intent(Intent.ACTION_CREATE_DOCUMENT) + setIntentMimeTypes(intent, parsedTypes) + + intent.addCategory(Intent.CATEGORY_OPENABLE) + intent.putExtra(Intent.EXTRA_TITLE, args.fileName ?: "") + startActivityForResult(invoke, intent, "saveFileDialogResult") + } catch (ex: Exception) { + val message = ex.message ?: "Failed to pick save file" + Logger.error(message) + invoke.reject(message) + } + } + + @ActivityCallback + fun saveFileDialogResult(invoke: Invoke, result: ActivityResult) { + try { + when (result.resultCode) { + Activity.RESULT_OK -> { + val callResult = JSObject() + val intent: Intent? = result.data + if (intent != null) { + val uri = intent.data + if (uri != null) { + callResult.put("file", uri.toString()) + } + } + invoke.resolve(callResult) + } + Activity.RESULT_CANCELED -> invoke.reject("File picker cancelled") + else -> invoke.reject("Failed to pick files") + } + } catch (ex: java.lang.Exception) { + val message = ex.message ?: "Failed to read file pick result" + Logger.error(message) + invoke.reject(message) + } + } } \ No newline at end of file diff --git a/plugins/dialog/android/src/main/java/FilePickerUtils.kt b/plugins/dialog/android/src/main/java/FilePickerUtils.kt index 5f0854a1..7029d4c6 100644 --- a/plugins/dialog/android/src/main/java/FilePickerUtils.kt +++ b/plugins/dialog/android/src/main/java/FilePickerUtils.kt @@ -4,10 +4,15 @@ package app.tauri.dialog + +import android.content.ContentUris +import android.database.Cursor +import android.provider.MediaStore import android.content.Context import android.graphics.BitmapFactory import android.media.MediaMetadataRetriever import android.net.Uri +import android.os.Environment import android.provider.DocumentsContract import android.provider.OpenableColumns import android.util.Base64 @@ -21,8 +26,40 @@ class FilePickerUtils { class FileResolution(var height: Int, var width: Int) companion object { - fun getPathFromUri(uri: Uri): String { - return uri.toString() + fun getPathFromUri(context: Context, uri: Uri): String? { + if (DocumentsContract.isDocumentUri(context, uri)) { + if (isExternalStorageDocument(uri)) { + val docId = DocumentsContract.getDocumentId(uri) + val split = docId.split(":") + return if ("primary".equals(split[0], ignoreCase = true)) { + "${Environment.getExternalStorageDirectory()}/${split[1]}" + } else { + null + } + } else if (isDownloadsDocument(uri)) { + val id = DocumentsContract.getDocumentId(uri) + val contentUri = ContentUris.withAppendedId( + Uri.parse("content://downloads/public_downloads"), java.lang.Long.valueOf(id)) + return getDataColumn(context, contentUri, null, null) + } else if (isMediaDocument(uri)) { + val docId = DocumentsContract.getDocumentId(uri) + val split = docId.split(":") + val contentUri: Uri? = when (split[0]) { + "image" -> MediaStore.Images.Media.EXTERNAL_CONTENT_URI + "video" -> MediaStore.Video.Media.EXTERNAL_CONTENT_URI + "audio" -> MediaStore.Audio.Media.EXTERNAL_CONTENT_URI + else -> null + } + val selection = "_id=?" + val selectionArgs = arrayOf(split[1]) + return getDataColumn(context, contentUri, selection, selectionArgs) + } + } else if ("content".equals(uri.scheme, ignoreCase = true)) { + return getDataColumn(context, uri, null, null) + } else if ("file".equals(uri.scheme, ignoreCase = true)) { + return uri.path + } + return null } fun getNameFromUri(context: Context, uri: Uri): String? { @@ -36,7 +73,7 @@ class FilePickerUtils { displayName = cursor.getString(columnIdx) cursor.close() } - if (displayName == null || displayName.isEmpty()) { + if (displayName.isNullOrEmpty()) { displayName = uri.lastPathSegment } return displayName @@ -162,4 +199,32 @@ class FilePickerUtils { return os.toByteArray() } } -} \ No newline at end of file +} + +private fun getDataColumn(context: Context, uri: Uri?, selection: String?, selectionArgs: Array?): String? { + var cursor: Cursor? = null + val column = "_data" + val projection = arrayOf(column) + try { + cursor = context.contentResolver.query(uri!!, projection, selection, selectionArgs, null) + if (cursor != null && cursor.moveToFirst()) { + val columnIndex = cursor.getColumnIndexOrThrow(column) + return cursor.getString(columnIndex) + } + } finally { + cursor?.close() + } + return null +} + +private fun isExternalStorageDocument(uri: Uri): Boolean { + return "com.android.externalstorage.documents" == uri.authority +} + +private fun isDownloadsDocument(uri: Uri): Boolean { + return "com.android.providers.downloads.documents" == uri.authority +} + +private fun isMediaDocument(uri: Uri): Boolean { + return "com.android.providers.media.documents" == uri.authority +} diff --git a/plugins/dialog/api-iife.js b/plugins/dialog/api-iife.js new file mode 100644 index 00000000..c2e0870c --- /dev/null +++ b/plugins/dialog/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_DIALOG__=function(t){"use strict";async function n(t,n={},e){return window.__TAURI_INTERNALS__.invoke(t,n,e)}return"function"==typeof SuppressedError&&SuppressedError,t.ask=async function(t,e){const i="string"==typeof e?{title:e}:e;return await n("plugin:dialog|ask",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,yesButtonLabel:i?.okLabel?.toString(),noButtonLabel:i?.cancelLabel?.toString()})},t.confirm=async function(t,e){const i="string"==typeof e?{title:e}:e;return await n("plugin:dialog|confirm",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString(),cancelButtonLabel:i?.cancelLabel?.toString()})},t.message=async function(t,e){const i="string"==typeof e?{title:e}:e;await n("plugin:dialog|message",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString()})},t.open=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|open",{options:t})},t.save=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|save",{options:t})},t}({});Object.defineProperty(window.__TAURI__,"dialog",{value:__TAURI_PLUGIN_DIALOG__})} diff --git a/plugins/dialog/build.rs b/plugins/dialog/build.rs index d692f66d..4b3bb871 100644 --- a/plugins/dialog/build.rs +++ b/plugins/dialog/build.rs @@ -5,15 +5,14 @@ const COMMANDS: &[&str] = &["open", "save", "message", "ask", "confirm"]; fn main() { - if let Err(error) = tauri_plugin::Builder::new(COMMANDS) + let result = tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .android_path("android") .ios_path("ios") - .try_build() - { - println!("{error:#}"); - // when building documentation for Android the plugin build result is irrelevant to the crate itself - if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) { - std::process::exit(1); - } + .try_build(); + + // when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build + if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) { + result.unwrap(); } } diff --git a/plugins/dialog/guest-js/index.ts b/plugins/dialog/guest-js/index.ts index 5aa440a6..150be95a 100644 --- a/plugins/dialog/guest-js/index.ts +++ b/plugins/dialog/guest-js/index.ts @@ -2,19 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { invoke } from "@tauri-apps/api/core"; - -interface FileResponse { - base64Data?: string; - duration?: number; - height?: number; - width?: number; - mimeType?: string; - modifiedAt?: number; - name?: string; - path: string; - size: number; -} +import { invoke } from '@tauri-apps/api/core' /** * Extension filters for the file dialog. @@ -23,7 +11,7 @@ interface FileResponse { */ interface DialogFilter { /** Filter name. */ - name: string; + name: string /** * Extensions to filter, without a `.` prefix. * @example @@ -31,7 +19,7 @@ interface DialogFilter { * extensions: ['svg', 'png'] * ``` */ - extensions: string[]; + extensions: string[] } /** @@ -40,23 +28,30 @@ interface DialogFilter { * @since 2.0.0 */ interface OpenDialogOptions { - /** The title of the dialog window. */ - title?: string; + /** The title of the dialog window (desktop only). */ + title?: string /** The filters of the dialog. */ - filters?: DialogFilter[]; - /** Initial directory or file path. */ - defaultPath?: string; + filters?: DialogFilter[] + /** + * Initial directory or file path. + * If it's a directory path, the dialog interface will change to that folder. + * If it's not an existing directory, the file name will be set to the dialog's file name input and the dialog will be set to the parent folder. + * + * On mobile the file name is always used on the dialog's file name input. + * If not provided, Android uses `(invalid).txt` as default file name. + */ + defaultPath?: string /** Whether the dialog allows multiple selection or not. */ - multiple?: boolean; + multiple?: boolean /** Whether the dialog is a directory selection or not. */ - directory?: boolean; + directory?: boolean /** * If `directory` is true, indicates that it will be read recursively later. * Defines whether subdirectories will be allowed on the scope or not. */ - recursive?: boolean; + recursive?: boolean /** Whether to allow creating directories in the dialog. Enabled by default. **macOS Only** */ - canCreateDirectories?: boolean; + canCreateDirectories?: boolean } /** @@ -65,18 +60,21 @@ interface OpenDialogOptions { * @since 2.0.0 */ interface SaveDialogOptions { - /** The title of the dialog window. */ - title?: string; + /** The title of the dialog window (desktop only). */ + title?: string /** The filters of the dialog. */ - filters?: DialogFilter[]; + filters?: DialogFilter[] /** * Initial directory or file path. * If it's a directory path, the dialog interface will change to that folder. * If it's not an existing directory, the file name will be set to the dialog's file name input and the dialog will be set to the parent folder. + * + * On mobile the file name is always used on the dialog's file name input. + * If not provided, Android uses `(invalid).txt` as default file name. */ - defaultPath?: string; + defaultPath?: string /** Whether to allow creating directories in the dialog. Enabled by default. **macOS Only** */ - canCreateDirectories?: boolean; + canCreateDirectories?: boolean } /** @@ -84,31 +82,31 @@ interface SaveDialogOptions { */ interface MessageDialogOptions { /** The title of the dialog. Defaults to the app name. */ - title?: string; + title?: string /** The kind of the dialog. Defaults to `info`. */ - kind?: "info" | "warning" | "error"; + kind?: 'info' | 'warning' | 'error' /** The label of the confirm button. */ - okLabel?: string; + okLabel?: string } interface ConfirmDialogOptions { /** The title of the dialog. Defaults to the app name. */ - title?: string; + title?: string /** The kind of the dialog. Defaults to `info`. */ - kind?: "info" | "warning" | "error"; + kind?: 'info' | 'warning' | 'error' /** The label of the confirm button. */ - okLabel?: string; + okLabel?: string /** The label of the cancel button. */ - cancelLabel?: string; + cancelLabel?: string } -type OpenDialogReturn = T["directory"] extends true - ? T["multiple"] extends true +type OpenDialogReturn = T['directory'] extends true + ? T['multiple'] extends true + ? string[] | null + : string | null + : T['multiple'] extends true ? string[] | null : string | null - : T["multiple"] extends true - ? FileResponse[] | null - : FileResponse | null; /** * Open a file/directory selection dialog. @@ -163,13 +161,13 @@ type OpenDialogReturn = T["directory"] extends true * @since 2.0.0 */ async function open( - options: T = {} as T, + options: T = {} as T ): Promise> { - if (typeof options === "object") { - Object.freeze(options); + if (typeof options === 'object') { + Object.freeze(options) } - return invoke("plugin:dialog|open", { options }); + return await invoke('plugin:dialog|open', { options }) } /** @@ -197,11 +195,11 @@ async function open( * @since 2.0.0 */ async function save(options: SaveDialogOptions = {}): Promise { - if (typeof options === "object") { - Object.freeze(options); + if (typeof options === 'object') { + Object.freeze(options) } - return invoke("plugin:dialog|save", { options }); + return await invoke('plugin:dialog|save', { options }) } /** @@ -223,15 +221,15 @@ async function save(options: SaveDialogOptions = {}): Promise { */ async function message( message: string, - options?: string | MessageDialogOptions, + options?: string | MessageDialogOptions ): Promise { - const opts = typeof options === "string" ? { title: options } : options; - return invoke("plugin:dialog|message", { + const opts = typeof options === 'string' ? { title: options } : options + await invoke('plugin:dialog|message', { message: message.toString(), title: opts?.title?.toString(), kind: opts?.kind, - okButtonLabel: opts?.okLabel?.toString(), - }); + okButtonLabel: opts?.okLabel?.toString() + }) } /** @@ -252,16 +250,16 @@ async function message( */ async function ask( message: string, - options?: string | ConfirmDialogOptions, + options?: string | ConfirmDialogOptions ): Promise { - const opts = typeof options === "string" ? { title: options } : options; - return invoke("plugin:dialog|ask", { + const opts = typeof options === 'string' ? { title: options } : options + return await invoke('plugin:dialog|ask', { message: message.toString(), title: opts?.title?.toString(), kind: opts?.kind, - okButtonLabel: opts?.okLabel?.toString() ?? "Yes", - cancelButtonLabel: opts?.cancelLabel?.toString() ?? "No", - }); + yesButtonLabel: opts?.okLabel?.toString(), + noButtonLabel: opts?.cancelLabel?.toString() + }) } /** @@ -282,26 +280,25 @@ async function ask( */ async function confirm( message: string, - options?: string | ConfirmDialogOptions, + options?: string | ConfirmDialogOptions ): Promise { - const opts = typeof options === "string" ? { title: options } : options; - return invoke("plugin:dialog|confirm", { + const opts = typeof options === 'string' ? { title: options } : options + return await invoke('plugin:dialog|confirm', { message: message.toString(), title: opts?.title?.toString(), kind: opts?.kind, - okButtonLabel: opts?.okLabel?.toString() ?? "Ok", - cancelButtonLabel: opts?.cancelLabel?.toString() ?? "Cancel", - }); + okButtonLabel: opts?.okLabel?.toString(), + cancelButtonLabel: opts?.cancelLabel?.toString() + }) } export type { DialogFilter, - FileResponse, OpenDialogOptions, OpenDialogReturn, SaveDialogOptions, MessageDialogOptions, - ConfirmDialogOptions, -}; + ConfirmDialogOptions +} -export { open, save, message, ask, confirm }; +export { open, save, message, ask, confirm } diff --git a/plugins/dialog/guest-js/init.ts b/plugins/dialog/guest-js/init.ts index 35ac29c0..520a469a 100644 --- a/plugins/dialog/guest-js/init.ts +++ b/plugins/dialog/guest-js/init.ts @@ -2,17 +2,17 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { invoke } from "@tauri-apps/api/core"; +import { invoke } from '@tauri-apps/api/core' window.alert = function (message: string) { - invoke("plugin:dialog|message", { - message: message.toString(), - }); -}; + void invoke('plugin:dialog|message', { + message: message.toString() + }) +} // @ts-expect-error tauri does not have sync IPC :( -window.confirm = function (message: string) { - return invoke("plugin:dialog|confirm", { - message: message.toString(), - }); -}; +window.confirm = async function (message: string) { + return await invoke('plugin:dialog|confirm', { + message: message.toString() + }) +} diff --git a/plugins/dialog/ios/Package.swift b/plugins/dialog/ios/Package.swift index 45a58a43..f8983f14 100644 --- a/plugins/dialog/ios/Package.swift +++ b/plugins/dialog/ios/Package.swift @@ -6,28 +6,29 @@ import PackageDescription let package = Package( - name: "tauri-plugin-dialog", - platforms: [ - .iOS(.v13), - ], - products: [ - // Products define the executables and libraries a package produces, and make them visible to other packages. - .library( - name: "tauri-plugin-dialog", - type: .static, - targets: ["tauri-plugin-dialog"]), - ], - dependencies: [ - .package(name: "Tauri", path: "../.tauri/tauri-api") - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages this package depends on. - .target( - name: "tauri-plugin-dialog", - dependencies: [ - .byName(name: "Tauri") - ], - path: "Sources") - ] + name: "tauri-plugin-dialog", + platforms: [ + .macOS(.v10_13), + .iOS(.v13), + ], + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "tauri-plugin-dialog", + type: .static, + targets: ["tauri-plugin-dialog"]) + ], + dependencies: [ + .package(name: "Tauri", path: "../.tauri/tauri-api") + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "tauri-plugin-dialog", + dependencies: [ + .byName(name: "Tauri") + ], + path: "Sources") + ] ) diff --git a/plugins/dialog/ios/Sources/DialogPlugin.swift b/plugins/dialog/ios/Sources/DialogPlugin.swift index 40f51571..b3f7e7da 100644 --- a/plugins/dialog/ios/Sources/DialogPlugin.swift +++ b/plugins/dialog/ios/Sources/DialogPlugin.swift @@ -17,27 +17,31 @@ enum FilePickerEvent { } struct MessageDialogOptions: Decodable { - let title: String? + var title: String? let message: String - var okButtonLabel = "OK" - var cancelButtonLabel = "Cancel" + var okButtonLabel: String? + var cancelButtonLabel: String? } struct Filter: Decodable { - var extensions: [String] = [] + var extensions: [String]? } struct FilePickerOptions: Decodable { - var multiple = false - var readData = false - var filters: [Filter] = [] + var multiple: Bool? + var filters: [Filter]? + var defaultPath: String? +} + +struct SaveFileDialogOptions: Decodable { + var fileName: String? + var defaultPath: String? } class DialogPlugin: Plugin { var filePickerController: FilePickerController! - var pendingInvoke: Invoke? = nil - var pendingInvokeArgs: FilePickerOptions? = nil + var onFilePickerResult: ((FilePickerEvent) -> Void)? = nil override init() { super.init() @@ -47,9 +51,9 @@ class DialogPlugin: Plugin { @objc public func showFilePicker(_ invoke: Invoke) throws { let args = try invoke.parseArgs(FilePickerOptions.self) - let parsedTypes = parseFiltersOption(args.filters) + let parsedTypes = parseFiltersOption(args.filters ?? []) - var isMedia = true + var isMedia = !parsedTypes.isEmpty var uniqueMimeType: Bool? = nil var mimeKind: String? = nil if !parsedTypes.isEmpty { @@ -67,14 +71,22 @@ class DialogPlugin: Plugin { } } - pendingInvoke = invoke - pendingInvokeArgs = args + onFilePickerResult = { (event: FilePickerEvent) -> Void in + switch event { + case .selected(let urls): + invoke.resolve(["files": urls]) + case .cancelled: + invoke.resolve(["files": nil]) + case .error(let error): + invoke.reject(error) + } + } if uniqueMimeType == true || isMedia { DispatchQueue.main.async { if #available(iOS 14, *) { var configuration = PHPickerConfiguration(photoLibrary: PHPhotoLibrary.shared()) - configuration.selectionLimit = args.multiple ? 0 : 1 + configuration.selectionLimit = (args.multiple ?? false) ? 0 : 1 if uniqueMimeType == true { if mimeKind == "image" { @@ -105,14 +117,57 @@ class DialogPlugin: Plugin { let documentTypes = parsedTypes.isEmpty ? ["public.data"] : parsedTypes DispatchQueue.main.async { let picker = UIDocumentPickerViewController(documentTypes: documentTypes, in: .import) + if let defaultPath = args.defaultPath { + picker.directoryURL = URL(string: defaultPath) + } picker.delegate = self.filePickerController - picker.allowsMultipleSelection = args.multiple + picker.allowsMultipleSelection = args.multiple ?? false picker.modalPresentationStyle = .fullScreen self.presentViewController(picker) } } } + @objc public func saveFileDialog(_ invoke: Invoke) throws { + let args = try invoke.parseArgs(SaveFileDialogOptions.self) + + // The Tauri save dialog API prompts the user to select a path where a file must be saved + // This behavior maps to the operating system interfaces on all platforms except iOS, + // which only exposes a mechanism to "move file `srcPath` to a location defined by the user" + // + // so we have to work around it by creating an empty file matching the requested `args.fileName`, + // and using it as `srcPath` for the operation - returning the path the user selected + // so the app dev can write to it later - matching cross platform behavior as mentioned above + let fileManager = FileManager.default + let srcFolder = fileManager.urls(for: .documentDirectory, in: .userDomainMask).first! + let srcPath = srcFolder.appendingPathComponent(args.fileName ?? "file") + if !fileManager.fileExists(atPath: srcPath.path) { + // the file contents must be actually provided by the tauri dev after the path is resolved by the save API + try "".write(to: srcPath, atomically: true, encoding: .utf8) + } + + onFilePickerResult = { (event: FilePickerEvent) -> Void in + switch event { + case .selected(let urls): + invoke.resolve(["file": urls.first!]) + case .cancelled: + invoke.resolve(["file": nil]) + case .error(let error): + invoke.reject(error) + } + } + + DispatchQueue.main.async { + let picker = UIDocumentPickerViewController(url: srcPath, in: .exportToService) + if let defaultPath = args.defaultPath { + picker.directoryURL = URL(string: defaultPath) + } + picker.delegate = self.filePickerController + picker.modalPresentationStyle = .fullScreen + self.presentViewController(picker) + } + } + private func presentViewController(_ viewControllerToPresent: UIViewController) { self.manager.viewController?.present(viewControllerToPresent, animated: true, completion: nil) } @@ -120,7 +175,7 @@ class DialogPlugin: Plugin { private func parseFiltersOption(_ filters: [Filter]) -> [String] { var parsedTypes: [String] = [] for filter in filters { - for ext in filter.extensions { + for ext in filter.extensions ?? [] { guard let utType: String = UTTypeCreatePreferredIdentifierForTag( kUTTagClassMIMEType, ext as CFString, nil)?.takeRetainedValue() as String? @@ -134,60 +189,7 @@ class DialogPlugin: Plugin { } public func onFilePickerEvent(_ event: FilePickerEvent) { - switch event { - case .selected(let urls): - let readData = pendingInvokeArgs?.readData ?? false - do { - let filesResult = try urls.map { (url: URL) -> JSObject in - var file = JSObject() - - let mimeType = filePickerController.getMimeTypeFromUrl(url) - let isVideo = mimeType.hasPrefix("video") - let isImage = mimeType.hasPrefix("image") - - if readData { - file["data"] = try Data(contentsOf: url).base64EncodedString() - } - - if isVideo { - file["duration"] = filePickerController.getVideoDuration(url) - let (height, width) = filePickerController.getVideoDimensions(url) - if let height = height { - file["height"] = height - } - if let width = width { - file["width"] = width - } - } else if isImage { - let (height, width) = filePickerController.getImageDimensions(url) - if let height = height { - file["height"] = height - } - if let width = width { - file["width"] = width - } - } - - file["modifiedAt"] = filePickerController.getModifiedAtFromUrl(url) - file["mimeType"] = mimeType - file["name"] = url.lastPathComponent - file["path"] = url.absoluteString - file["size"] = try filePickerController.getSizeFromUrl(url) - return file - } - pendingInvoke?.resolve(["files": filesResult]) - } catch let error as NSError { - pendingInvoke?.reject(error.localizedDescription, error: error) - return - } - - pendingInvoke?.resolve(["files": urls]) - case .cancelled: - let files: JSArray = [] - pendingInvoke?.resolve(["files": files]) - case .error(let error): - pendingInvoke?.reject(error) - } + self.onFilePickerResult?(event) } @objc public func showMessageDialog(_ invoke: Invoke) throws { @@ -197,24 +199,36 @@ class DialogPlugin: Plugin { DispatchQueue.main.async { [] in let alert = UIAlertController( title: args.title, message: args.message, preferredStyle: UIAlertController.Style.alert) - alert.addAction( - UIAlertAction( - title: args.cancelButtonLabel, style: UIAlertAction.Style.default, - handler: { (_) -> Void in - invoke.resolve([ - "value": false, - "cancelled": false, - ]) - })) - alert.addAction( - UIAlertAction( - title: args.okButtonLabel, style: UIAlertAction.Style.default, - handler: { (_) -> Void in - invoke.resolve([ - "value": true, - "cancelled": false, - ]) - })) + + let cancelButtonLabel = args.cancelButtonLabel ?? "" + if !cancelButtonLabel.isEmpty { + alert.addAction( + UIAlertAction( + title: cancelButtonLabel, style: UIAlertAction.Style.default, + handler: { (_) -> Void in + Logger.error("cancel") + + invoke.resolve([ + "value": false, + "cancelled": false, + ]) + })) + } + + let okButtonLabel = args.okButtonLabel ?? (cancelButtonLabel.isEmpty ? "OK" : "") + if !okButtonLabel.isEmpty { + alert.addAction( + UIAlertAction( + title: okButtonLabel, style: UIAlertAction.Style.default, + handler: { (_) -> Void in + Logger.error("ok") + + invoke.resolve([ + "value": true, + "cancelled": false, + ]) + })) + } manager.viewController?.present(alert, animated: true, completion: nil) } diff --git a/plugins/dialog/package.json b/plugins/dialog/package.json index 76ec3b1e..27814aed 100644 --- a/plugins/dialog/package.json +++ b/plugins/dialog/package.json @@ -1,10 +1,11 @@ { "name": "@tauri-apps/plugin-dialog", - "version": "2.0.0-beta.1", - "license": "MIT or APACHE-2.0", + "version": "2.0.1", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -23,6 +24,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/dialog/permissions/autogenerated/reference.md b/plugins/dialog/permissions/autogenerated/reference.md index 9c000f9e..d93595d1 100644 --- a/plugins/dialog/permissions/autogenerated/reference.md +++ b/plugins/dialog/permissions/autogenerated/reference.md @@ -1,42 +1,157 @@ -# Permissions +## Default Permission -## allow-ask +This permission set configures the types of dialogs +available from the dialog plugin. + +#### Granted Permissions + +All dialog types are enabled. + + + + +- `allow-ask` +- `allow-confirm` +- `allow-message` +- `allow-save` +- `allow-open` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`dialog:allow-ask` + + Enables the ask command without any pre-configured scope. -## deny-ask +
+ +`dialog:deny-ask` + + Denies the ask command without any pre-configured scope. -## allow-confirm +
+ +`dialog:allow-confirm` + + Enables the confirm command without any pre-configured scope. -## deny-confirm +
+ +`dialog:deny-confirm` + + Denies the confirm command without any pre-configured scope. -## allow-message +
+ +`dialog:allow-message` + + Enables the message command without any pre-configured scope. -## deny-message +
+ +`dialog:deny-message` + + Denies the message command without any pre-configured scope. -## allow-open +
+ +`dialog:allow-open` + + Enables the open command without any pre-configured scope. -## deny-open +
+ +`dialog:deny-open` + + Denies the open command without any pre-configured scope. -## allow-save +
+ +`dialog:allow-save` + + Enables the save command without any pre-configured scope. -## deny-save +
+ +`dialog:deny-save` + + Denies the save command without any pre-configured scope. +
diff --git a/plugins/dialog/permissions/default.toml b/plugins/dialog/permissions/default.toml new file mode 100644 index 00000000..cc936d90 --- /dev/null +++ b/plugins/dialog/permissions/default.toml @@ -0,0 +1,20 @@ +"$schema" = "schemas/schema.json" + +[default] +description = """ +This permission set configures the types of dialogs +available from the dialog plugin. + +#### Granted Permissions + +All dialog types are enabled. + + +""" +permissions = [ + "allow-ask", + "allow-confirm", + "allow-message", + "allow-save", + "allow-open", +] diff --git a/plugins/dialog/permissions/schemas/schema.json b/plugins/dialog/permissions/schemas/schema.json index 6369cc71..ed8c0733 100644 --- a/plugins/dialog/permissions/schemas/schema.json +++ b/plugins/dialog/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,78 +251,103 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-ask -> Enables the ask command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-ask" + "macOS" ] }, { - "description": "deny-ask -> Denies the ask command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-ask" + "windows" ] }, { - "description": "allow-confirm -> Enables the confirm command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-confirm" + "linux" ] }, { - "description": "deny-confirm -> Denies the confirm command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-confirm" + "android" ] }, { - "description": "allow-message -> Enables the message command without any pre-configured scope.", + "description": "iOS.", "type": "string", "enum": [ - "allow-message" + "iOS" ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the ask command without any pre-configured scope.", + "type": "string", + "const": "allow-ask" }, { - "description": "deny-message -> Denies the message command without any pre-configured scope.", + "description": "Denies the ask command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-message" - ] + "const": "deny-ask" }, { - "description": "allow-open -> Enables the open command without any pre-configured scope.", + "description": "Enables the confirm command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-open" - ] + "const": "allow-confirm" }, { - "description": "deny-open -> Denies the open command without any pre-configured scope.", + "description": "Denies the confirm command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-open" - ] + "const": "deny-confirm" }, { - "description": "allow-save -> Enables the save command without any pre-configured scope.", + "description": "Enables the message command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-save" - ] + "const": "allow-message" }, { - "description": "deny-save -> Denies the save command without any pre-configured scope.", + "description": "Denies the message command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-save" - ] + "const": "deny-message" + }, + { + "description": "Enables the open command without any pre-configured scope.", + "type": "string", + "const": "allow-open" + }, + { + "description": "Denies the open command without any pre-configured scope.", + "type": "string", + "const": "deny-open" + }, + { + "description": "Enables the save command without any pre-configured scope.", + "type": "string", + "const": "allow-save" + }, + { + "description": "Denies the save command without any pre-configured scope.", + "type": "string", + "const": "deny-save" + }, + { + "description": "This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n", + "type": "string", + "const": "default" } ] } diff --git a/plugins/dialog/rollup.config.js b/plugins/dialog/rollup.config.js index 0aed70d6..a7dbd4f6 100644 --- a/plugins/dialog/rollup.config.js +++ b/plugins/dialog/rollup.config.js @@ -2,21 +2,21 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; -import { nodeResolve } from "@rollup/plugin-node-resolve"; -import typescript from "@rollup/plugin-typescript"; -import terser from "@rollup/plugin-terser"; +import { createConfig } from '../../shared/rollup.config.js' +import { nodeResolve } from '@rollup/plugin-node-resolve' +import typescript from '@rollup/plugin-typescript' +import terser from '@rollup/plugin-terser' export default createConfig({ additionalConfigs: { - input: "guest-js/init.ts", + input: 'guest-js/init.ts', output: { - file: "src/init-iife.js", - format: "iife", + file: 'src/init-iife.js', + format: 'iife' }, plugins: [typescript(), terser(), nodeResolve()], onwarn: (warning) => { - throw Object.assign(new Error(), warning); - }, - }, -}); + throw Object.assign(new Error(), warning) + } + } +}) diff --git a/plugins/dialog/src/api-iife.js b/plugins/dialog/src/api-iife.js deleted file mode 100644 index 7aa97582..00000000 --- a/plugins/dialog/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_DIALOG__=function(t){"use strict";async function n(t,n={},e){return window.__TAURI_INTERNALS__.invoke(t,n,e)}return"function"==typeof SuppressedError&&SuppressedError,t.ask=async function(t,e){const o="string"==typeof e?{title:e}:e;return n("plugin:dialog|ask",{message:t.toString(),title:o?.title?.toString(),kind:o?.kind,okButtonLabel:o?.okLabel?.toString()??"Yes",cancelButtonLabel:o?.cancelLabel?.toString()??"No"})},t.confirm=async function(t,e){const o="string"==typeof e?{title:e}:e;return n("plugin:dialog|confirm",{message:t.toString(),title:o?.title?.toString(),kind:o?.kind,okButtonLabel:o?.okLabel?.toString()??"Ok",cancelButtonLabel:o?.cancelLabel?.toString()??"Cancel"})},t.message=async function(t,e){const o="string"==typeof e?{title:e}:e;return n("plugin:dialog|message",{message:t.toString(),title:o?.title?.toString(),kind:o?.kind,okButtonLabel:o?.okLabel?.toString()})},t.open=async function(t={}){return"object"==typeof t&&Object.freeze(t),n("plugin:dialog|open",{options:t})},t.save=async function(t={}){return"object"==typeof t&&Object.freeze(t),n("plugin:dialog|save",{options:t})},t}({});Object.defineProperty(window.__TAURI__,"dialog",{value:__TAURI_PLUGIN_DIALOG__})} diff --git a/plugins/dialog/src/commands.rs b/plugins/dialog/src/commands.rs index f0dfb092..4129b7b6 100644 --- a/plugins/dialog/src/commands.rs +++ b/plugins/dialog/src/commands.rs @@ -8,17 +8,20 @@ use serde::{Deserialize, Serialize}; use tauri::{command, Manager, Runtime, State, Window}; use tauri_plugin_fs::FsExt; -use crate::{Dialog, FileDialogBuilder, FileResponse, MessageDialogKind, Result}; +use crate::{ + Dialog, FileDialogBuilder, FilePath, MessageDialogButtons, MessageDialogKind, Result, CANCEL, + NO, OK, YES, +}; #[derive(Serialize)] #[serde(untagged)] pub enum OpenResponse { #[cfg(desktop)] - Folders(Option>), + Folders(Option>), #[cfg(desktop)] - Folder(Option), - Files(Option>), - File(Option), + Folder(Option), + Files(Option>), + File(Option), } #[allow(dead_code)] @@ -71,6 +74,18 @@ pub struct SaveDialogOptions { can_create_directories: Option, } +#[cfg(mobile)] +fn set_default_path( + mut dialog_builder: FileDialogBuilder, + default_path: PathBuf, +) -> FileDialogBuilder { + if let Some(file_name) = default_path.file_name() { + dialog_builder = dialog_builder.set_file_name(file_name.to_string_lossy()); + } + dialog_builder +} + +#[cfg(desktop)] fn set_default_path( mut dialog_builder: FileDialogBuilder, default_path: PathBuf, @@ -120,52 +135,67 @@ pub(crate) async fn open( let res = if options.directory { #[cfg(desktop)] { + let tauri_scope = window.state::(); + if options.multiple { let folders = dialog_builder.blocking_pick_folders(); if let Some(folders) = &folders { for folder in folders { - if let Some(s) = window.try_fs_scope() { - s.allow_directory(folder, options.recursive); + if let Ok(path) = folder.clone().into_path() { + if let Some(s) = window.try_fs_scope() { + s.allow_directory(&path, options.recursive); + } + tauri_scope.allow_directory(&path, options.directory)?; } } } - OpenResponse::Folders(folders) + OpenResponse::Folders( + folders.map(|folders| folders.into_iter().map(|p| p.simplified()).collect()), + ) } else { let folder = dialog_builder.blocking_pick_folder(); - if let Some(path) = &folder { - if let Some(s) = window.try_fs_scope() { - s.allow_directory(path, options.recursive); + if let Some(folder) = &folder { + if let Ok(path) = folder.clone().into_path() { + if let Some(s) = window.try_fs_scope() { + s.allow_directory(&path, options.recursive); + } + tauri_scope.allow_directory(&path, options.directory)?; } } - OpenResponse::Folder(folder) + OpenResponse::Folder(folder.map(|p| p.simplified())) } } #[cfg(mobile)] return Err(crate::Error::FolderPickerNotImplemented); } else if options.multiple { + let tauri_scope = window.state::(); + let files = dialog_builder.blocking_pick_files(); if let Some(files) = &files { for file in files { - if let Some(s) = window.try_fs_scope() { - s.allow_file(&file.path); + if let Ok(path) = file.clone().into_path() { + if let Some(s) = window.try_fs_scope() { + s.allow_file(&path); + } + + tauri_scope.allow_file(&path)?; } - window - .state::() - .allow_file(&file.path)?; } } - OpenResponse::Files(files) + OpenResponse::Files(files.map(|files| files.into_iter().map(|f| f.simplified()).collect())) } else { + let tauri_scope = window.state::(); let file = dialog_builder.blocking_pick_file(); + if let Some(file) = &file { - if let Some(s) = window.try_fs_scope() { - s.allow_file(&file.path); + if let Ok(path) = file.clone().into_path() { + if let Some(s) = window.try_fs_scope() { + s.allow_file(&path); + } + tauri_scope.allow_file(&path)?; } - window - .state::() - .allow_file(&file.path)?; } - OpenResponse::File(file) + OpenResponse::File(file.map(|f| f.simplified())) }; Ok(res) } @@ -176,40 +206,39 @@ pub(crate) async fn save( window: Window, dialog: State<'_, Dialog>, options: SaveDialogOptions, -) -> Result> { - #[cfg(mobile)] - return Err(crate::Error::FileSaveDialogNotImplemented); +) -> Result> { + let mut dialog_builder = dialog.file(); #[cfg(desktop)] { - let mut dialog_builder = dialog.file(); - #[cfg(any(windows, target_os = "macos"))] - { - dialog_builder = dialog_builder.set_parent(&window); - } - if let Some(title) = options.title { - dialog_builder = dialog_builder.set_title(title); - } - if let Some(default_path) = options.default_path { - dialog_builder = set_default_path(dialog_builder, default_path); - } - if let Some(can) = options.can_create_directories { - dialog_builder = dialog_builder.set_can_create_directories(can); - } - for filter in options.filters { - let extensions: Vec<&str> = filter.extensions.iter().map(|s| &**s).collect(); - dialog_builder = dialog_builder.add_filter(filter.name, &extensions); - } + dialog_builder = dialog_builder.set_parent(&window); + } + if let Some(title) = options.title { + dialog_builder = dialog_builder.set_title(title); + } + if let Some(default_path) = options.default_path { + dialog_builder = set_default_path(dialog_builder, default_path); + } + if let Some(can) = options.can_create_directories { + dialog_builder = dialog_builder.set_can_create_directories(can); + } + for filter in options.filters { + let extensions: Vec<&str> = filter.extensions.iter().map(|s| &**s).collect(); + dialog_builder = dialog_builder.add_filter(filter.name, &extensions); + } + + let tauri_scope = window.state::(); - let path = dialog_builder.blocking_save_file(); - if let Some(p) = &path { + let path = dialog_builder.blocking_save_file(); + if let Some(p) = &path { + if let Ok(path) = p.clone().into_path() { if let Some(s) = window.try_fs_scope() { - s.allow_file(p); + s.allow_file(&path); } - window.state::().allow_file(p)?; + tauri_scope.allow_file(&path)?; } - - Ok(path) } + + Ok(path.map(|p| p.simplified())) } fn message_dialog( @@ -218,16 +247,17 @@ fn message_dialog( title: Option, message: String, kind: Option, - ok_button_label: Option, - cancel_button_label: Option, + buttons: MessageDialogButtons, ) -> bool { let mut builder = dialog.message(message); + builder = builder.buttons(buttons); + if let Some(title) = title { builder = builder.title(title); } - #[cfg(any(windows, target_os = "macos"))] + #[cfg(desktop)] { builder = builder.parent(&window); } @@ -236,14 +266,6 @@ fn message_dialog( builder = builder.kind(kind); } - if let Some(ok) = ok_button_label { - builder = builder.ok_button_label(ok); - } - - if let Some(cancel) = cancel_button_label { - builder = builder.cancel_button_label(cancel); - } - builder.blocking_show() } @@ -262,8 +284,11 @@ pub(crate) async fn message( title, message, kind, - ok_button_label, - None, + if let Some(ok_button_label) = ok_button_label { + MessageDialogButtons::OkCustom(ok_button_label) + } else { + MessageDialogButtons::Ok + }, )) } @@ -274,8 +299,8 @@ pub(crate) async fn ask( title: Option, message: String, kind: Option, - ok_button_label: Option, - cancel_button_label: Option, + yes_button_label: Option, + no_button_label: Option, ) -> Result { Ok(message_dialog( window, @@ -283,8 +308,16 @@ pub(crate) async fn ask( title, message, kind, - Some(ok_button_label.unwrap_or_else(|| "Yes".into())), - Some(cancel_button_label.unwrap_or_else(|| "No".into())), + if let Some(yes_button_label) = yes_button_label { + MessageDialogButtons::OkCancelCustom( + yes_button_label, + no_button_label.unwrap_or(NO.to_string()), + ) + } else if let Some(no_button_label) = no_button_label { + MessageDialogButtons::OkCancelCustom(YES.to_string(), no_button_label) + } else { + MessageDialogButtons::YesNo + }, )) } @@ -304,7 +337,15 @@ pub(crate) async fn confirm( title, message, kind, - Some(ok_button_label.unwrap_or_else(|| "Ok".into())), - Some(cancel_button_label.unwrap_or_else(|| "Cancel".into())), + if let Some(ok_button_label) = ok_button_label { + MessageDialogButtons::OkCancelCustom( + ok_button_label, + cancel_button_label.unwrap_or(CANCEL.to_string()), + ) + } else if let Some(cancel_button_label) = cancel_button_label { + MessageDialogButtons::OkCancelCustom(OK.to_string(), cancel_button_label) + } else { + MessageDialogButtons::OkCancel + }, )) } diff --git a/plugins/dialog/src/desktop.rs b/plugins/dialog/src/desktop.rs index 7843f3b5..d1a3e8b2 100644 --- a/plugins/dialog/src/desktop.rs +++ b/plugins/dialog/src/desktop.rs @@ -8,25 +8,12 @@ //! to give results back. This is particularly useful when running dialogs from the main thread. //! When using on asynchronous contexts such as async commands, the [`blocking`] APIs are recommended. -use std::path::PathBuf; - -use raw_window_handle::{HasWindowHandle, RawWindowHandle}; +use raw_window_handle::{HasDisplayHandle, HasWindowHandle, RawDisplayHandle, RawWindowHandle}; +use rfd::{AsyncFileDialog, AsyncMessageDialog}; use serde::de::DeserializeOwned; use tauri::{plugin::PluginApi, AppHandle, Runtime}; -use crate::{models::*, FileDialogBuilder, MessageDialogBuilder}; - -const OK: &str = "Ok"; - -#[cfg(target_os = "linux")] -type FileDialog = rfd::FileDialog; -#[cfg(not(target_os = "linux"))] -type FileDialog = rfd::AsyncFileDialog; - -#[cfg(target_os = "linux")] -type MessageDialog = rfd::MessageDialog; -#[cfg(not(target_os = "linux"))] -type MessageDialog = rfd::AsyncMessageDialog; +use crate::{models::*, FileDialogBuilder, FilePath, MessageDialogBuilder, OK}; pub fn init( app: &AppHandle, @@ -51,40 +38,6 @@ impl Dialog { } } -#[cfg(not(target_os = "linux"))] -macro_rules! run_dialog { - ($e:expr, $h: expr) => {{ - std::thread::spawn(move || $h(tauri::async_runtime::block_on($e))); - }}; -} - -#[cfg(target_os = "linux")] -macro_rules! run_dialog { - ($e:expr, $h: ident) => {{ - std::thread::spawn(move || { - let context = glib::MainContext::default(); - context.invoke_with_priority(glib::PRIORITY_HIGH, move || $h($e)); - }); - }}; -} - -#[cfg(not(target_os = "linux"))] -macro_rules! run_file_dialog { - ($e:expr, $h: ident) => {{ - std::thread::spawn(move || $h(tauri::async_runtime::block_on($e))); - }}; -} - -#[cfg(target_os = "linux")] -macro_rules! run_file_dialog { - ($e:expr, $h: ident) => {{ - std::thread::spawn(move || { - let context = glib::MainContext::default(); - context.invoke_with_priority(glib::PRIORITY_HIGH, move || $h($e)); - }); - }}; -} - impl From for rfd::MessageLevel { fn from(kind: MessageDialogKind) -> Self { match kind { @@ -95,19 +48,40 @@ impl From for rfd::MessageLevel { } } -struct WindowHandle(RawWindowHandle); +#[derive(Debug)] +pub(crate) struct WindowHandle { + window_handle: RawWindowHandle, + display_handle: RawDisplayHandle, +} + +impl WindowHandle { + pub(crate) fn new(window_handle: RawWindowHandle, display_handle: RawDisplayHandle) -> Self { + Self { + window_handle, + display_handle, + } + } +} impl HasWindowHandle for WindowHandle { fn window_handle( &self, ) -> Result, raw_window_handle::HandleError> { - Ok(unsafe { raw_window_handle::WindowHandle::borrow_raw(self.0) }) + Ok(unsafe { raw_window_handle::WindowHandle::borrow_raw(self.window_handle) }) } } -impl From> for FileDialog { +impl HasDisplayHandle for WindowHandle { + fn display_handle( + &self, + ) -> Result, raw_window_handle::HandleError> { + Ok(unsafe { raw_window_handle::DisplayHandle::borrow_raw(self.display_handle) }) + } +} + +impl From> for AsyncFileDialog { fn from(d: FileDialogBuilder) -> Self { - let mut builder = FileDialog::new(); + let mut builder = AsyncFileDialog::new(); if let Some(title) = d.title { builder = builder.set_title(title); @@ -124,7 +98,7 @@ impl From> for FileDialog { } #[cfg(desktop)] if let Some(parent) = d.parent { - builder = builder.set_parent(&WindowHandle(parent)); + builder = builder.set_parent(&parent); } builder = builder.set_can_create_directories(d.can_create_directories.unwrap_or(true)); @@ -133,78 +107,104 @@ impl From> for FileDialog { } } -impl From> for MessageDialog { +impl From for rfd::MessageButtons { + fn from(value: MessageDialogButtons) -> Self { + match value { + MessageDialogButtons::Ok => Self::Ok, + MessageDialogButtons::OkCancel => Self::OkCancel, + MessageDialogButtons::YesNo => Self::YesNo, + MessageDialogButtons::OkCustom(ok) => Self::OkCustom(ok), + MessageDialogButtons::OkCancelCustom(ok, cancel) => Self::OkCancelCustom(ok, cancel), + } + } +} + +impl From> for AsyncMessageDialog { fn from(d: MessageDialogBuilder) -> Self { - let mut dialog = MessageDialog::new() + let mut dialog = AsyncMessageDialog::new() .set_title(&d.title) .set_description(&d.message) - .set_level(d.kind.into()); - - let buttons = match (d.ok_button_label, d.cancel_button_label) { - (Some(ok), Some(cancel)) => Some(rfd::MessageButtons::OkCancelCustom(ok, cancel)), - (Some(ok), None) => Some(rfd::MessageButtons::OkCustom(ok)), - (None, Some(cancel)) => Some(rfd::MessageButtons::OkCancelCustom(OK.into(), cancel)), - (None, None) => None, - }; - if let Some(buttons) = buttons { - dialog = dialog.set_buttons(buttons); - } + .set_level(d.kind.into()) + .set_buttons(d.buttons.into()); if let Some(parent) = d.parent { - dialog = dialog.set_parent(&WindowHandle(parent)); + dialog = dialog.set_parent(&parent); } dialog } } -pub fn pick_file) + Send + 'static>( +pub fn pick_file) + Send + 'static>( dialog: FileDialogBuilder, f: F, ) { - #[cfg(not(target_os = "linux"))] - let f = |path: Option| f(path.map(|p| p.path().to_path_buf())); - run_file_dialog!(FileDialog::from(dialog).pick_file(), f) + let f = |path: Option| f(path.map(|p| p.path().to_path_buf().into())); + let handle = dialog.dialog.app_handle().to_owned(); + let _ = handle.run_on_main_thread(move || { + let dialog = AsyncFileDialog::from(dialog).pick_file(); + std::thread::spawn(move || f(tauri::async_runtime::block_on(dialog))); + }); } -pub fn pick_files>) + Send + 'static>( +pub fn pick_files>) + Send + 'static>( dialog: FileDialogBuilder, f: F, ) { - #[cfg(not(target_os = "linux"))] let f = |paths: Option>| { - f(paths.map(|list| list.into_iter().map(|p| p.path().to_path_buf()).collect())) + f(paths.map(|list| { + list.into_iter() + .map(|p| p.path().to_path_buf().into()) + .collect() + })) }; - run_file_dialog!(FileDialog::from(dialog).pick_files(), f) + let handle = dialog.dialog.app_handle().to_owned(); + let _ = handle.run_on_main_thread(move || { + let dialog = AsyncFileDialog::from(dialog).pick_files(); + std::thread::spawn(move || f(tauri::async_runtime::block_on(dialog))); + }); } -pub fn pick_folder) + Send + 'static>( +pub fn pick_folder) + Send + 'static>( dialog: FileDialogBuilder, f: F, ) { - #[cfg(not(target_os = "linux"))] - let f = |path: Option| f(path.map(|p| p.path().to_path_buf())); - run_file_dialog!(FileDialog::from(dialog).pick_folder(), f) + let f = |path: Option| f(path.map(|p| p.path().to_path_buf().into())); + let handle = dialog.dialog.app_handle().to_owned(); + let _ = handle.run_on_main_thread(move || { + let dialog = AsyncFileDialog::from(dialog).pick_folder(); + std::thread::spawn(move || f(tauri::async_runtime::block_on(dialog))); + }); } -pub fn pick_folders>) + Send + 'static>( +pub fn pick_folders>) + Send + 'static>( dialog: FileDialogBuilder, f: F, ) { - #[cfg(not(target_os = "linux"))] let f = |paths: Option>| { - f(paths.map(|list| list.into_iter().map(|p| p.path().to_path_buf()).collect())) + f(paths.map(|list| { + list.into_iter() + .map(|p| p.path().to_path_buf().into()) + .collect() + })) }; - run_file_dialog!(FileDialog::from(dialog).pick_folders(), f) + let handle = dialog.dialog.app_handle().to_owned(); + let _ = handle.run_on_main_thread(move || { + let dialog = AsyncFileDialog::from(dialog).pick_folders(); + std::thread::spawn(move || f(tauri::async_runtime::block_on(dialog))); + }); } -pub fn save_file) + Send + 'static>( +pub fn save_file) + Send + 'static>( dialog: FileDialogBuilder, f: F, ) { - #[cfg(not(target_os = "linux"))] - let f = |path: Option| f(path.map(|p| p.path().to_path_buf())); - run_file_dialog!(FileDialog::from(dialog).save_file(), f) + let f = |path: Option| f(path.map(|p| p.path().to_path_buf().into())); + let handle = dialog.dialog.app_handle().to_owned(); + let _ = handle.run_on_main_thread(move || { + let dialog = AsyncFileDialog::from(dialog).save_file(); + std::thread::spawn(move || f(tauri::async_runtime::block_on(dialog))); + }); } /// Shows a message dialog @@ -214,7 +214,11 @@ pub fn show_message_dialog( ) { use rfd::MessageDialogResult; - let ok_label = dialog.ok_button_label.clone(); + let ok_label = match &dialog.buttons { + MessageDialogButtons::OkCustom(ok) => Some(ok.clone()), + MessageDialogButtons::OkCancelCustom(ok, _) => Some(ok.clone()), + _ => None, + }; let f = move |res| { f(match res { MessageDialogResult::Ok | MessageDialogResult::Yes => true, @@ -223,5 +227,9 @@ pub fn show_message_dialog( }); }; - run_dialog!(MessageDialog::from(dialog).show(), f); + let handle = dialog.dialog.app_handle().to_owned(); + let _ = handle.run_on_main_thread(move || { + let dialog = AsyncMessageDialog::from(dialog).show(); + std::thread::spawn(move || f(tauri::async_runtime::block_on(dialog))); + }); } diff --git a/plugins/dialog/src/error.rs b/plugins/dialog/src/error.rs index 069cd55c..0c3ed5b8 100644 --- a/plugins/dialog/src/error.rs +++ b/plugins/dialog/src/error.rs @@ -7,6 +7,7 @@ use serde::{ser::Serializer, Serialize}; pub type Result = std::result::Result; #[derive(Debug, thiserror::Error)] +#[non_exhaustive] pub enum Error { #[error(transparent)] Tauri(#[from] tauri::Error), @@ -18,9 +19,6 @@ pub enum Error { #[cfg(mobile)] #[error("Folder picker is not implemented on mobile")] FolderPickerNotImplemented, - #[cfg(mobile)] - #[error("File save dialog is not implemented on mobile")] - FileSaveDialogNotImplemented, #[error(transparent)] Fs(#[from] tauri_plugin_fs::Error), } diff --git a/plugins/dialog/src/init-iife.js b/plugins/dialog/src/init-iife.js index f51830fd..bcdf3f56 100644 --- a/plugins/dialog/src/init-iife.js +++ b/plugins/dialog/src/init-iife.js @@ -1 +1 @@ -!function(){"use strict";async function n(n,i={},o){return window.__TAURI_INTERNALS__.invoke(n,i,o)}"function"==typeof SuppressedError&&SuppressedError,window.alert=function(i){n("plugin:dialog|message",{message:i.toString()})},window.confirm=function(i){return n("plugin:dialog|confirm",{message:i.toString()})}}(); +!function(){"use strict";async function n(n,i={},o){return window.__TAURI_INTERNALS__.invoke(n,i,o)}"function"==typeof SuppressedError&&SuppressedError,window.alert=function(i){n("plugin:dialog|message",{message:i.toString()})},window.confirm=async function(i){return await n("plugin:dialog|confirm",{message:i.toString()})}}(); diff --git a/plugins/dialog/src/lib.rs b/plugins/dialog/src/lib.rs index 0e9aa9db..3d7464d9 100644 --- a/plugins/dialog/src/lib.rs +++ b/plugins/dialog/src/lib.rs @@ -11,7 +11,7 @@ html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png" )] -use serde::{Deserialize, Serialize}; +use serde::Serialize; use tauri::{ plugin::{Builder, TauriPlugin}, Manager, Runtime, @@ -24,6 +24,7 @@ use std::{ pub use models::*; +pub use tauri_plugin_fs::FilePath; #[cfg(desktop)] mod desktop; #[cfg(mobile)] @@ -40,6 +41,11 @@ use desktop::*; #[cfg(mobile)] use mobile::*; +pub(crate) const OK: &str = "Ok"; +pub(crate) const CANCEL: &str = "Cancel"; +pub(crate) const YES: &str = "Yes"; +pub(crate) const NO: &str = "No"; + macro_rules! blocking_fn { ($self:ident, $fn:ident) => {{ let (tx, rx) = sync_channel(0); @@ -51,7 +57,7 @@ macro_rules! blocking_fn { }}; } -/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the dialog APIs. +/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the dialog APIs. pub trait DialogExt { fn dialog(&self) -> &Dialog; } @@ -63,6 +69,85 @@ impl> crate::DialogExt for T { } impl Dialog { + /// Create a new messaging dialog builder. + /// The dialog can optionally ask the user for confirmation or include an OK button. + /// + /// # Examples + /// + /// - Message dialog: + /// + /// ``` + /// use tauri_plugin_dialog::DialogExt; + /// + /// tauri::Builder::default() + /// .setup(|app| { + /// app + /// .dialog() + /// .message("Tauri is Awesome!") + /// .show(|_| { + /// println!("dialog closed"); + /// }); + /// Ok(()) + /// }); + /// ``` + /// + /// - Ask dialog: + /// + /// ``` + /// use tauri_plugin_dialog::{DialogExt, MessageDialogButtons}; + /// + /// tauri::Builder::default() + /// .setup(|app| { + /// app.dialog() + /// .message("Are you sure?") + /// .buttons(MessageDialogButtons::OkCancelCustom("Yes", "No")) + /// .show(|yes| { + /// println!("user said {}", if yes { "yes" } else { "no" }); + /// }); + /// Ok(()) + /// }); + /// ``` + /// + /// - Message dialog with OK button: + /// + /// ``` + /// use tauri_plugin_dialog::{DialogExt, MessageDialogButtons}; + /// + /// tauri::Builder::default() + /// .setup(|app| { + /// app.dialog() + /// .message("Job completed successfully") + /// .buttons(MessageDialogButtons::Ok) + /// .show(|_| { + /// println!("dialog closed"); + /// }); + /// Ok(()) + /// }); + /// ``` + /// + /// # `show` vs `blocking_show` + /// + /// The dialog builder includes two separate APIs for rendering the dialog: `show` and `blocking_show`. + /// The `show` function is asynchronous and takes a closure to be executed when the dialog is closed. + /// To block the current thread until the user acted on the dialog, you can use `blocking_show`, + /// but note that it cannot be executed on the main thread as it will freeze your application. + /// + /// ``` + /// use tauri_plugin_dialog::{DialogExt, MessageDialogButtons}; + /// + /// tauri::Builder::default() + /// .setup(|app| { + /// let handle = app.handle().clone(); + /// std::thread::spawn(move || { + /// let yes = handle.dialog() + /// .message("Are you sure?") + /// .buttons(MessageDialogButtons::OkCancelCustom("Yes", "No")) + /// .blocking_show(); + /// }); + /// + /// Ok(()) + /// }); + /// ``` pub fn message(&self, message: impl Into) -> MessageDialogBuilder { MessageDialogBuilder::new( self.clone(), @@ -71,6 +156,7 @@ impl Dialog { ) } + /// Creates a new builder for dialogs that lets the user select file(s) or folder(s). pub fn file(&self) -> FileDialogBuilder { FileDialogBuilder::new(self.clone()) } @@ -84,13 +170,7 @@ pub fn init() -> TauriPlugin { // Dialogs are implemented natively on Android #[cfg(not(target_os = "android"))] { - let mut init_script = include_str!("init-iife.js").to_string(); - init_script.push_str(include_str!("api-iife.js")); - builder = builder.js_init_script(init_script); - } - #[cfg(target_os = "android")] - { - builder = builder.js_init_script(include_str!("api-iife.js").to_string()); + builder = builder.js_init_script(include_str!("init-iife.js").to_string()); } builder @@ -119,10 +199,9 @@ pub struct MessageDialogBuilder { pub(crate) title: String, pub(crate) message: String, pub(crate) kind: MessageDialogKind, - pub(crate) ok_button_label: Option, - pub(crate) cancel_button_label: Option, + pub(crate) buttons: MessageDialogButtons, #[cfg(desktop)] - pub(crate) parent: Option, + pub(crate) parent: Option, } /// Payload for the message dialog mobile API. @@ -133,8 +212,8 @@ pub(crate) struct MessageDialogPayload<'a> { title: &'a String, message: &'a String, kind: &'a MessageDialogKind, - ok_button_label: &'a Option, - cancel_button_label: &'a Option, + ok_button_label: Option<&'a str>, + cancel_button_label: Option<&'a str>, } // raw window handle :( @@ -148,8 +227,7 @@ impl MessageDialogBuilder { title: title.into(), message: message.into(), kind: Default::default(), - ok_button_label: None, - cancel_button_label: None, + buttons: Default::default(), #[cfg(desktop)] parent: None, } @@ -157,12 +235,21 @@ impl MessageDialogBuilder { #[cfg(mobile)] pub(crate) fn payload(&self) -> MessageDialogPayload<'_> { + let (ok_button_label, cancel_button_label) = match &self.buttons { + MessageDialogButtons::Ok => (Some(OK), None), + MessageDialogButtons::OkCancel => (Some(OK), Some(CANCEL)), + MessageDialogButtons::YesNo => (Some(YES), Some(NO)), + MessageDialogButtons::OkCustom(ok) => (Some(ok.as_str()), Some(CANCEL)), + MessageDialogButtons::OkCancelCustom(ok, cancel) => { + (Some(ok.as_str()), Some(cancel.as_str())) + } + }; MessageDialogPayload { title: &self.title, message: &self.message, kind: &self.kind, - ok_button_label: &self.ok_button_label, - cancel_button_label: &self.cancel_button_label, + ok_button_label, + cancel_button_label, } } @@ -173,27 +260,25 @@ impl MessageDialogBuilder { } /// Set parent windows explicitly (optional) - /// - /// ## Platform-specific - /// - /// - **Linux:** Unsupported. #[cfg(desktop)] - pub fn parent(mut self, parent: &W) -> Self { - if let Ok(h) = parent.window_handle() { - self.parent.replace(h.as_raw()); + pub fn parent( + mut self, + parent: &W, + ) -> Self { + if let (Ok(window_handle), Ok(display_handle)) = + (parent.window_handle(), parent.display_handle()) + { + self.parent.replace(crate::desktop::WindowHandle::new( + window_handle.as_raw(), + display_handle.as_raw(), + )); } self } - /// Sets the label for the OK button. - pub fn ok_button_label(mut self, label: impl Into) -> Self { - self.ok_button_label.replace(label.into()); - self - } - - /// Sets the label for the Cancel button. - pub fn cancel_button_label(mut self, label: impl Into) -> Self { - self.cancel_button_label.replace(label.into()); + /// Sets the dialog buttons. + pub fn buttons(mut self, buttons: MessageDialogButtons) -> Self { + self.buttons = buttons; self } @@ -218,38 +303,6 @@ impl MessageDialogBuilder { blocking_fn!(self, show) } } - -#[derive(Debug, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct FileResponse { - pub base64_data: Option, - pub duration: Option, - pub height: Option, - pub width: Option, - pub mime_type: Option, - pub modified_at: Option, - pub name: Option, - pub path: PathBuf, - pub size: u64, -} - -impl FileResponse { - #[cfg(desktop)] - fn new(path: PathBuf) -> Self { - Self { - base64_data: None, - duration: None, - height: None, - width: None, - mime_type: None, - modified_at: None, - name: path.file_name().map(|f| f.to_string_lossy().into_owned()), - path, - size: 0, - } - } -} - #[derive(Debug, Serialize)] pub(crate) struct Filter { pub name: String, @@ -269,13 +322,14 @@ pub struct FileDialogBuilder { pub(crate) title: Option, pub(crate) can_create_directories: Option, #[cfg(desktop)] - pub(crate) parent: Option, + pub(crate) parent: Option, } #[cfg(mobile)] #[derive(Serialize)] #[serde(rename_all = "camelCase")] pub(crate) struct FileDialogPayload<'a> { + file_name: &'a Option, filters: &'a Vec, multiple: bool, } @@ -301,6 +355,7 @@ impl FileDialogBuilder { #[cfg(mobile)] pub(crate) fn payload(&self, multiple: bool) -> FileDialogPayload<'_> { FileDialogPayload { + file_name: &self.file_name, filters: &self.filters, multiple, } @@ -333,9 +388,19 @@ impl FileDialogBuilder { /// Sets the parent window of the dialog. #[cfg(desktop)] #[must_use] - pub fn set_parent(mut self, parent: &W) -> Self { - if let Ok(h) = parent.window_handle() { - self.parent.replace(h.as_raw()); + pub fn set_parent< + W: raw_window_handle::HasWindowHandle + raw_window_handle::HasDisplayHandle, + >( + mut self, + parent: &W, + ) -> Self { + if let (Ok(window_handle), Ok(display_handle)) = + (parent.window_handle(), parent.display_handle()) + { + self.parent.replace(crate::desktop::WindowHandle::new( + window_handle.as_raw(), + display_handle.as_raw(), + )); } self } @@ -361,21 +426,18 @@ impl FileDialogBuilder { /// /// # Examples /// - /// ```rust,no_run + /// ``` /// use tauri_plugin_dialog::DialogExt; /// tauri::Builder::default() - /// .build(tauri::generate_context!("test/tauri.conf.json")) - /// .expect("failed to build tauri app") - /// .run(|app, _event| { + /// .setup(|app| { /// app.dialog().file().pick_file(|file_path| { /// // do something with the optional file path here /// // the file path is `None` if the user closed the dialog - /// }) - /// }) + /// }); + /// Ok(()) + /// }); /// ``` - pub fn pick_file) + Send + 'static>(self, f: F) { - #[cfg(desktop)] - let f = |path: Option| f(path.map(FileResponse::new)); + pub fn pick_file) + Send + 'static>(self, f: F) { pick_file(self, f) } @@ -383,29 +445,44 @@ impl FileDialogBuilder { /// This is not a blocking operation, /// and should be used when running on the main thread to avoid deadlocks with the event loop. /// + /// # Reading the files + /// + /// The file paths cannot be read directly on Android as they are behind a content URI. + /// The recommended way to read the files is using the [`fs`](https://v2.tauri.app/plugin/file-system/) plugin: + /// + /// ``` + /// use tauri_plugin_dialog::DialogExt; + /// use tauri_plugin_fs::FsExt; + /// tauri::Builder::default() + /// .setup(|app| { + /// let handle = app.handle().clone(); + /// app.dialog().file().pick_file(move |file_path| { + /// let Some(path) = file_path else { return }; + /// let Ok(contents) = handle.fs().read_to_string(path) else { + /// eprintln!("failed to read file, "); + /// return; + /// }; + /// }); + /// Ok(()) + /// }); + /// ``` + /// + /// See for more information. + /// /// # Examples /// - /// ```rust,no_run + /// ``` /// use tauri_plugin_dialog::DialogExt; /// tauri::Builder::default() - /// .build(tauri::generate_context!("test/tauri.conf.json")) - /// .expect("failed to build tauri app") - /// .run(|app, _event| { + /// .setup(|app| { /// app.dialog().file().pick_files(|file_paths| { /// // do something with the optional file paths here /// // the file paths value is `None` if the user closed the dialog - /// }) - /// }) + /// }); + /// Ok(()) + /// }); /// ``` - pub fn pick_files>) + Send + 'static>(self, f: F) { - #[cfg(desktop)] - let f = |paths: Option>| { - f(paths.map(|p| { - p.into_iter() - .map(FileResponse::new) - .collect::>() - })) - }; + pub fn pick_files>) + Send + 'static>(self, f: F) { pick_files(self, f) } @@ -415,20 +492,19 @@ impl FileDialogBuilder { /// /// # Examples /// - /// ```rust,no_run + /// ``` /// use tauri_plugin_dialog::DialogExt; /// tauri::Builder::default() - /// .build(tauri::generate_context!("test/tauri.conf.json")) - /// .expect("failed to build tauri app") - /// .run(|app, _event| { + /// .setup(|app| { /// app.dialog().file().pick_folder(|folder_path| { /// // do something with the optional folder path here /// // the folder path is `None` if the user closed the dialog - /// }) - /// }) + /// }); + /// Ok(()) + /// }); /// ``` #[cfg(desktop)] - pub fn pick_folder) + Send + 'static>(self, f: F) { + pub fn pick_folder) + Send + 'static>(self, f: F) { pick_folder(self, f) } @@ -438,20 +514,19 @@ impl FileDialogBuilder { /// /// # Examples /// - /// ```rust,no_run + /// ``` /// use tauri_plugin_dialog::DialogExt; /// tauri::Builder::default() - /// .build(tauri::generate_context!("test/tauri.conf.json")) - /// .expect("failed to build tauri app") - /// .run(|app, _event| { + /// .setup(|app| { /// app.dialog().file().pick_folders(|file_paths| { /// // do something with the optional folder paths here /// // the folder paths value is `None` if the user closed the dialog - /// }) - /// }) + /// }); + /// Ok(()) + /// }); /// ``` #[cfg(desktop)] - pub fn pick_folders>) + Send + 'static>(self, f: F) { + pub fn pick_folders>) + Send + 'static>(self, f: F) { pick_folders(self, f) } @@ -462,20 +537,18 @@ impl FileDialogBuilder { /// /// # Examples /// - /// ```rust,no_run + /// ``` /// use tauri_plugin_dialog::DialogExt; /// tauri::Builder::default() - /// .build(tauri::generate_context!("test/tauri.conf.json")) - /// .expect("failed to build tauri app") - /// .run(|app, _event| { + /// .setup(|app| { /// app.dialog().file().save_file(|file_path| { /// // do something with the optional file path here /// // the file path is `None` if the user closed the dialog - /// }) - /// }) + /// }); + /// Ok(()) + /// }); /// ``` - #[cfg(desktop)] - pub fn save_file) + Send + 'static>(self, f: F) { + pub fn save_file) + Send + 'static>(self, f: F) { save_file(self, f) } } @@ -488,7 +561,7 @@ impl FileDialogBuilder { /// /// # Examples /// - /// ```rust,no_run + /// ``` /// use tauri_plugin_dialog::DialogExt; /// #[tauri::command] /// async fn my_command(app: tauri::AppHandle) { @@ -497,7 +570,7 @@ impl FileDialogBuilder { /// // the file path is `None` if the user closed the dialog /// } /// ``` - pub fn blocking_pick_file(self) -> Option { + pub fn blocking_pick_file(self) -> Option { blocking_fn!(self, pick_file) } @@ -507,7 +580,7 @@ impl FileDialogBuilder { /// /// # Examples /// - /// ```rust,no_run + /// ``` /// use tauri_plugin_dialog::DialogExt; /// #[tauri::command] /// async fn my_command(app: tauri::AppHandle) { @@ -516,7 +589,7 @@ impl FileDialogBuilder { /// // the file paths value is `None` if the user closed the dialog /// } /// ``` - pub fn blocking_pick_files(self) -> Option> { + pub fn blocking_pick_files(self) -> Option> { blocking_fn!(self, pick_files) } @@ -526,7 +599,7 @@ impl FileDialogBuilder { /// /// # Examples /// - /// ```rust,no_run + /// ``` /// use tauri_plugin_dialog::DialogExt; /// #[tauri::command] /// async fn my_command(app: tauri::AppHandle) { @@ -536,7 +609,7 @@ impl FileDialogBuilder { /// } /// ``` #[cfg(desktop)] - pub fn blocking_pick_folder(self) -> Option { + pub fn blocking_pick_folder(self) -> Option { blocking_fn!(self, pick_folder) } @@ -546,7 +619,7 @@ impl FileDialogBuilder { /// /// # Examples /// - /// ```rust,no_run + /// ``` /// use tauri_plugin_dialog::DialogExt; /// #[tauri::command] /// async fn my_command(app: tauri::AppHandle) { @@ -556,7 +629,7 @@ impl FileDialogBuilder { /// } /// ``` #[cfg(desktop)] - pub fn blocking_pick_folders(self) -> Option> { + pub fn blocking_pick_folders(self) -> Option> { blocking_fn!(self, pick_folders) } @@ -566,7 +639,7 @@ impl FileDialogBuilder { /// /// # Examples /// - /// ```rust,no_run + /// ``` /// use tauri_plugin_dialog::DialogExt; /// #[tauri::command] /// async fn my_command(app: tauri::AppHandle) { @@ -575,8 +648,7 @@ impl FileDialogBuilder { /// // the file path is `None` if the user closed the dialog /// } /// ``` - #[cfg(desktop)] - pub fn blocking_save_file(self) -> Option { + pub fn blocking_save_file(self) -> Option { blocking_fn!(self, save_file) } } diff --git a/plugins/dialog/src/mobile.rs b/plugins/dialog/src/mobile.rs index 289cbb7e..b73def4f 100644 --- a/plugins/dialog/src/mobile.rs +++ b/plugins/dialog/src/mobile.rs @@ -8,7 +8,7 @@ use tauri::{ AppHandle, Runtime, }; -use crate::{FileDialogBuilder, FileResponse, MessageDialogBuilder}; +use crate::{FileDialogBuilder, FilePath, MessageDialogBuilder}; #[cfg(target_os = "android")] const PLUGIN_IDENTIFIER: &str = "app.tauri.dialog"; @@ -46,10 +46,15 @@ impl Dialog { #[derive(Debug, Deserialize)] struct FilePickerResponse { - files: Vec, + files: Vec, } -pub fn pick_file) + Send + 'static>( +#[derive(Debug, Deserialize)] +struct SaveFileResponse { + file: FilePath, +} + +pub fn pick_file) + Send + 'static>( dialog: FileDialogBuilder, f: F, ) { @@ -66,7 +71,7 @@ pub fn pick_file) + Send + 'static>( }); } -pub fn pick_files>) + Send + 'static>( +pub fn pick_files>) + Send + 'static>( dialog: FileDialogBuilder, f: F, ) { @@ -83,6 +88,23 @@ pub fn pick_files>) + Send + 'sta }); } +pub fn save_file) + Send + 'static>( + dialog: FileDialogBuilder, + f: F, +) { + std::thread::spawn(move || { + let res = dialog + .dialog + .0 + .run_mobile_plugin::("saveFileDialog", dialog.payload(false)); + if let Ok(response) = res { + f(Some(response.file)) + } else { + f(None) + } + }); +} + #[derive(Debug, Deserialize)] struct ShowMessageDialogResponse { #[allow(dead_code)] diff --git a/plugins/dialog/src/models.rs b/plugins/dialog/src/models.rs index fa9224e1..d6452bce 100644 --- a/plugins/dialog/src/models.rs +++ b/plugins/dialog/src/models.rs @@ -49,3 +49,20 @@ impl Serialize for MessageDialogKind { } } } + +/// Set of button that will be displayed on the dialog +#[non_exhaustive] +#[derive(Debug, Default, Clone)] +pub enum MessageDialogButtons { + #[default] + /// A single `Ok` button with OS default dialog text + Ok, + /// 2 buttons `Ok` and `Cancel` with OS default dialog texts + OkCancel, + /// 2 buttons `Yes` and `No` with OS default dialog texts + YesNo, + /// A single `Ok` button with custom text + OkCustom(String), + /// 2 buttons `Ok` and `Cancel` with custom texts + OkCancelCustom(String, String), +} diff --git a/plugins/fs/.gitignore b/plugins/fs/.gitignore deleted file mode 100644 index b512c09d..00000000 --- a/plugins/fs/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/plugins/fs/CHANGELOG.md b/plugins/fs/CHANGELOG.md index c4e8e6d3..707733ee 100644 --- a/plugins/fs/CHANGELOG.md +++ b/plugins/fs/CHANGELOG.md @@ -1,5 +1,114 @@ # Changelog +## \[2.0.3] + +- [`14cee64c`](https://github.com/tauri-apps/plugins-workspace/commit/14cee64c82a72655ae6a4ac0892736a2959dbda5) ([#1958](https://github.com/tauri-apps/plugins-workspace/pull/1958) by [@bWanShiTong](https://github.com/tauri-apps/plugins-workspace/../../bWanShiTong)) Fix compilation on targets with pointer width of `16` or `32` + +## \[2.0.1] + +- [`ae802456`](https://github.com/tauri-apps/plugins-workspace/commit/ae8024565f074f313084777c8b10d1b5e3bbe220) ([#1950](https://github.com/tauri-apps/plugins-workspace/pull/1950) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Improve performance of the `FileHandle.read` and `writeTextFile` APIs. + +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.6] + +- [`fc9b189e`](https://github.com/tauri-apps/plugins-workspace/commit/fc9b189e83a29bd750714ec6336133c6eabdfa20) ([#1837](https://github.com/tauri-apps/plugins-workspace/pull/1837) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fix failing to deserialize capability file when using an OS specific path in the scope that is not available on the current OS. + +## \[2.0.0-rc.5] + +- [`cc03ccf5`](https://github.com/tauri-apps/plugins-workspace/commit/cc03ccf5e0e4be8bbf50bbdebe957c84be7f779b) ([#1774](https://github.com/tauri-apps/plugins-workspace/pull/1774)) Fix `scope-app`, `scope-app-recursive` and `scope-index` not properly enabling the application paths. + +## \[2.0.0-rc.4] + +- [`9291e4d2`](https://github.com/tauri-apps/plugins-workspace/commit/9291e4d2caa31c883c71e55f2193bd8754d72f03) ([#1640](https://github.com/tauri-apps/plugins-workspace/pull/1640) by [@SRutile](https://github.com/tauri-apps/plugins-workspace/../../SRutile)) Support any UTF-8 character in the writeFile API. + +## \[2.0.0-rc.3] + +- [`a2fe5551`](https://github.com/tauri-apps/plugins-workspace/commit/a2fe55512f908dd11c814ce021d164f01677572a) ([#1727](https://github.com/tauri-apps/plugins-workspace/pull/1727) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Add utility methods on `FilePath` and `SafeFilePath` enums which are: + + - `path` + - `simplified` + - `into_path` +- [`a2fe5551`](https://github.com/tauri-apps/plugins-workspace/commit/a2fe55512f908dd11c814ce021d164f01677572a) ([#1727](https://github.com/tauri-apps/plugins-workspace/pull/1727) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Implement `Serialize`, `Deserialize`, `From`, `TryFrom` and `FromStr` traits for `FilePath` and `SafeFilePath` enums. +- [`a2fe5551`](https://github.com/tauri-apps/plugins-workspace/commit/a2fe55512f908dd11c814ce021d164f01677572a) ([#1727](https://github.com/tauri-apps/plugins-workspace/pull/1727) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Mark `Error` enum as `#[non_exhuastive]`. +- [`a2fe5551`](https://github.com/tauri-apps/plugins-workspace/commit/a2fe55512f908dd11c814ce021d164f01677572a) ([#1727](https://github.com/tauri-apps/plugins-workspace/pull/1727) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Add `SafeFilePath` enum. + +## \[2.0.0-rc.2] + +- [`f7280c88`](https://github.com/tauri-apps/plugins-workspace/commit/f7280c88309cdf1f2330574fec31e26e01e9cdbd) ([#1710](https://github.com/tauri-apps/plugins-workspace/pull/1710) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Fix can't use Windows paths like `C:/Users/UserName/file.txt` + +### bug + +- [`51819c60`](https://github.com/tauri-apps/plugins-workspace/commit/51819c601f863cbfbd11809a1c4cf9df5a20b1e0) ([#1708](https://github.com/tauri-apps/plugins-workspace/pull/1708) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Fixes `writeFile` command implementation on Android. + +## \[2.0.0-rc.2] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.1] + +- [`5f689902`](https://github.com/tauri-apps/plugins-workspace/commit/5f68990297f2cefac4220649a469adb7fa94fe1b) ([#1645](https://github.com/tauri-apps/plugins-workspace/pull/1645) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update documentation. + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.8] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.7] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.6] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[2.0.0-beta.6] + +- [`b115fd22`](https://github.com/tauri-apps/plugins-workspace/commit/b115fd22e0da073f5d758c13474ec2106cf78163)([#1221](https://github.com/tauri-apps/plugins-workspace/pull/1221)) Fixes an issue that caused the app to freeze when the `dialog`, `fs`, and `persisted-scope` plugins were used together. + +## \[2.0.0-beta.5] + +- [`bb51a41`](https://github.com/tauri-apps/plugins-workspace/commit/bb51a41d67ebf989e8aedf10c4b1a7f9514d1bdf)([#1168](https://github.com/tauri-apps/plugins-workspace/pull/1168)) **Breaking Change:** All apis that return paths to the frontend will now remove the `\\?\` UNC prefix on Windows. +- [`e3d41f4`](https://github.com/tauri-apps/plugins-workspace/commit/e3d41f4011bd3ea3ce281bb38bbe31d3709f8e0f)([#1191](https://github.com/tauri-apps/plugins-workspace/pull/1191)) Internally use the webview scoped resources table instead of the app one, so other webviews can't access other webviews resources. +- [`e3d41f4`](https://github.com/tauri-apps/plugins-workspace/commit/e3d41f4011bd3ea3ce281bb38bbe31d3709f8e0f)([#1191](https://github.com/tauri-apps/plugins-workspace/pull/1191)) Update for tauri 2.0.0-beta.15. + +## \[2.0.0-beta.4] + +- [`9c2fb93`](https://github.com/tauri-apps/plugins-workspace/commit/9c2fb9306ecd3936a2aef56b3c012899036db098) Enhance the scope type to also allow a plain string representing the path to allow or deny. +- [`772f2bc`](https://github.com/tauri-apps/plugins-workspace/commit/772f2bc3495a4f83f1c3e538cbac6d29cbd7d5ef)([#1136](https://github.com/tauri-apps/plugins-workspace/pull/1136)) Update for tauri 2.0.0-beta.14. + +## \[2.0.0-beta.3] + +- [`cb96aa0`](https://github.com/tauri-apps/plugins-workspace/commit/cb96aa06277f7b864952827ec9fb1e74c8a1f761)([#1082](https://github.com/tauri-apps/plugins-workspace/pull/1082)) Fixes `watch` and `watchImmediate` which previously ignored the `baseDir` parameter. +- [`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] + +- [`7358102`](https://github.com/tauri-apps/plugins-workspace/commit/735810237e21504a027a65a7b3c25fd7e594288a)([#1029](https://github.com/tauri-apps/plugins-workspace/pull/1029)) Fix infinite loop on cargo build operations +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -55,4 +164,26 @@ - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ae67\`]\(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! + .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! + ac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + .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! + s/plugins-workspace/pull/371)) First v2 alpha release! + ac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + .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! + kspace/pull/371)) First v2 alpha release! + s/plugins-workspace/pull/371)) First v2 alpha release! + ac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + .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! + uri-apps/plugins-workspace/pull/371)) First v2 alpha release! + .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! + kspace/pull/371)) First v2 alpha release! + s/plugins-workspace/pull/371)) First v2 alpha release! + ac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + .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! diff --git a/plugins/fs/Cargo.toml b/plugins/fs/Cargo.toml index 3f7cdbf7..cd4e7716 100644 --- a/plugins/fs/Cargo.toml +++ b/plugins/fs/Cargo.toml @@ -1,34 +1,44 @@ [package] name = "tauri-plugin-fs" -version = "2.0.0-beta.1" +version = "2.0.3" description = "Access the file system." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-fs" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "No write access to `$RESOURCES` folder" } +macos = { level = "full", notes = "No write access to `$RESOURCES` folder" } +android = { level = "partial", notes = "Access is restricted to Application folder by default" } +ios = { level = "partial", notes = "Access is restricted to Application folder by default" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } schemars = { workspace = true } +serde = { workspace = true } [dependencies] serde = { workspace = true } serde_json = { workspace = true } -schemars = { workspace = true } serde_repr = "0.1" tauri = { workspace = true } thiserror = { workspace = true } url = { workspace = true } anyhow = "1" -uuid = { version = "1", features = [ "v4" ] } +uuid = { version = "1", features = ["v4"] } glob = "0.3" -notify = { version = "6", optional = true, features = [ "serde" ] } +notify = { version = "6", optional = true, features = ["serde"] } notify-debouncer-full = { version = "0.3", optional = true } +dunce = { workspace = true } +percent-encoding = "2" [features] -watch = [ "notify", "notify-debouncer-full" ] +watch = ["notify", "notify-debouncer-full"] diff --git a/plugins/fs/README.md b/plugins/fs/README.md index 239ff04c..af5c63a8 100644 --- a/plugins/fs/README.md +++ b/plugins/fs/README.md @@ -2,9 +2,17 @@ Access the file system. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ✓ | +| iOS | ✓ | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-fs = "2.0.0-beta" +tauri-plugin-fs = "2.0.0" # alternatively with Git: tauri-plugin-fs = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -60,9 +68,9 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { metadata } from "@tauri-apps/plugin-fs"; +import { metadata } from '@tauri-apps/plugin-fs' -await metadata("/path/to/file"); +await metadata('/path/to/file') ``` ## Contributing diff --git a/plugins/fs/SECURITY.md b/plugins/fs/SECURITY.md index 1adc7ebb..838ed670 100644 --- a/plugins/fs/SECURITY.md +++ b/plugins/fs/SECURITY.md @@ -36,7 +36,6 @@ the restrictions imposed by the scope. The scope is defined at compile time in the used permissions but the user or application developer can grant or revoke access to specific files or folders at runtime by modifying the scope state through the runtime authority, if configured during plugin initialization. - ### Security Assumptions - The filesystem access is limited by user permissions @@ -44,7 +43,6 @@ The scope is defined at compile time in the used permissions but the user or app - The scoping mechanism of the Tauri `fs` commands work as intended and has no bypasses - The user or application developer can grant or revoke access to specific files at runtime by modifying the scope - #### Out Of Scope - Exploits in underlying filesystems diff --git a/plugins/barcode-scanner/.gitignore b/plugins/fs/android/.gitignore similarity index 53% rename from plugins/barcode-scanner/.gitignore rename to plugins/fs/android/.gitignore index 1b0b469d..c0f21ec2 100644 --- a/plugins/barcode-scanner/.gitignore +++ b/plugins/fs/android/.gitignore @@ -1 +1,2 @@ +/build /.tauri diff --git a/plugins/fs/android/build.gradle.kts b/plugins/fs/android/build.gradle.kts new file mode 100644 index 00000000..575040aa --- /dev/null +++ b/plugins/fs/android/build.gradle.kts @@ -0,0 +1,45 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") +} + +android { + namespace = "com.plugin.fs" + compileSdk = 34 + + defaultConfig { + minSdk = 21 + targetSdk = 34 + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + + implementation("androidx.core:core-ktx:1.9.0") + implementation("androidx.appcompat:appcompat:1.6.0") + implementation("com.google.android.material:material:1.7.0") + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.5") + androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") + implementation(project(":tauri-android")) +} diff --git a/plugins/fs/android/proguard-rules.pro b/plugins/fs/android/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/plugins/fs/android/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/plugins/fs/android/settings.gradle b/plugins/fs/android/settings.gradle new file mode 100644 index 00000000..d7782a40 --- /dev/null +++ b/plugins/fs/android/settings.gradle @@ -0,0 +1,31 @@ +pluginManagement { + repositories { + mavenCentral() + gradlePluginPortal() + google() + } + resolutionStrategy { + eachPlugin { + switch (requested.id.id) { + case "com.android.library": + useVersion("8.0.2") + break + case "org.jetbrains.kotlin.android": + useVersion("1.8.20") + break + } + } + } +} + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + mavenCentral() + google() + + } +} + +include ':tauri-android' +project(':tauri-android').projectDir = new File('./.tauri/tauri-api') diff --git a/plugins/fs/android/src/androidTest/java/ExampleInstrumentedTest.kt b/plugins/fs/android/src/androidTest/java/ExampleInstrumentedTest.kt new file mode 100644 index 00000000..c3b473f7 --- /dev/null +++ b/plugins/fs/android/src/androidTest/java/ExampleInstrumentedTest.kt @@ -0,0 +1,28 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package com.plugin.fs + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.plugin.fs", appContext.packageName) + } +} diff --git a/plugins/fs/android/src/main/AndroidManifest.xml b/plugins/fs/android/src/main/AndroidManifest.xml new file mode 100644 index 00000000..9a40236b --- /dev/null +++ b/plugins/fs/android/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/plugins/fs/android/src/main/java/FsPlugin.kt b/plugins/fs/android/src/main/java/FsPlugin.kt new file mode 100644 index 00000000..877fbf4a --- /dev/null +++ b/plugins/fs/android/src/main/java/FsPlugin.kt @@ -0,0 +1,93 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package com.plugin.fs + +import android.annotation.SuppressLint +import android.app.Activity +import android.content.res.AssetManager.ACCESS_BUFFER +import android.net.Uri +import android.os.ParcelFileDescriptor +import app.tauri.annotation.Command +import app.tauri.annotation.InvokeArg +import app.tauri.annotation.TauriPlugin +import app.tauri.plugin.Invoke +import app.tauri.plugin.JSObject +import app.tauri.plugin.Plugin +import java.io.File +import java.io.FileOutputStream +import java.io.IOException +import java.io.InputStream +import java.io.OutputStream + +@InvokeArg +class WriteTextFileArgs { + val uri: String = "" + val content: String = "" +} + +@InvokeArg +class GetFileDescriptorArgs { + lateinit var uri: String + lateinit var mode: String +} + +@TauriPlugin +class FsPlugin(private val activity: Activity): Plugin(activity) { + @SuppressLint("Recycle") + @Command + fun getFileDescriptor(invoke: Invoke) { + val args = invoke.parseArgs(GetFileDescriptorArgs::class.java) + + val res = JSObject() + + if (args.uri.startsWith(app.tauri.TAURI_ASSETS_DIRECTORY_URI)) { + val path = args.uri.substring(app.tauri.TAURI_ASSETS_DIRECTORY_URI.length) + try { + val fd = activity.assets.openFd(path).parcelFileDescriptor?.detachFd() + res.put("fd", fd) + } catch (e: IOException) { + // if the asset is compressed, we cannot open a file descriptor directly + // so we copy it to the cache and get a fd from there + // this is a lot faster than serializing the file and sending it as invoke response + // because on the Rust side we can leverage the custom protocol IPC and read the file directly + val cacheFile = File(activity.cacheDir, "_assets/$path") + cacheFile.parentFile?.mkdirs() + copyAsset(path, cacheFile) + + val fd = ParcelFileDescriptor.open(cacheFile, ParcelFileDescriptor.parseMode(args.mode)).detachFd() + res.put("fd", fd) + } + } else { + val fd = activity.contentResolver.openAssetFileDescriptor( + Uri.parse(args.uri), + args.mode + )?.parcelFileDescriptor?.detachFd() + res.put("fd", fd) + } + + invoke.resolve(res) + } + + @Throws(IOException::class) + private fun copy(input: InputStream, output: OutputStream) { + val buf = ByteArray(1024) + var len: Int + while ((input.read(buf).also { len = it }) > 0) { + output.write(buf, 0, len) + } + } + + @Throws(IOException::class) + private fun copyAsset(assetPath: String, cacheFile: File) { + val input = activity.assets.open(assetPath, ACCESS_BUFFER) + input.use { i -> + val output = FileOutputStream(cacheFile, false) + output.use { o -> + copy(i, o) + } + } + } +} + diff --git a/plugins/fs/android/src/test/java/ExampleUnitTest.kt b/plugins/fs/android/src/test/java/ExampleUnitTest.kt new file mode 100644 index 00000000..340839a5 --- /dev/null +++ b/plugins/fs/android/src/test/java/ExampleUnitTest.kt @@ -0,0 +1,21 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package com.plugin.fs + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} diff --git a/plugins/fs/api-iife.js b/plugins/fs/api-iife.js new file mode 100644 index 00000000..f1e5360b --- /dev/null +++ b/plugins/fs/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_FS__=function(t){"use strict";function e(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function n(t,e,n,i,o){if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var i,o,r,a,s,c;"function"==typeof SuppressedError&&SuppressedError;class f{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,i.set(this,(()=>{})),o.set(this,0),r.set(this,{}),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:a})=>{if(a===e(this,o,"f")){n(this,o,a+1),e(this,i,"f").call(this,t);const s=Object.keys(e(this,r,"f"));if(s.length>0){let t=a+1;for(const n of s.sort()){if(parseInt(n)!==t)break;{const o=e(this,r,"f")[n];delete e(this,r,"f")[n],e(this,i,"f").call(this,o),t+=1}}n(this,o,t)}}else e(this,r,"f")[a.toString()]=t}))}set onmessage(t){n(this,i,t)}get onmessage(){return e(this,i,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function l(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}i=new WeakMap,o=new WeakMap,r=new WeakMap;class u{get rid(){return e(this,a,"f")}constructor(t){a.set(this,void 0),n(this,a,t)}async close(){return l("plugin:resources|close",{rid:this.rid})}}function p(t){return{isFile:t.isFile,isDirectory:t.isDirectory,isSymlink:t.isSymlink,size:t.size,mtime:null!==t.mtime?new Date(t.mtime):null,atime:null!==t.atime?new Date(t.atime):null,birthtime:null!==t.birthtime?new Date(t.birthtime):null,readonly:t.readonly,fileAttributes:t.fileAttributes,dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,blksize:t.blksize,blocks:t.blocks}}a=new WeakMap,t.BaseDirectory=void 0,(s=t.BaseDirectory||(t.BaseDirectory={}))[s.Audio=1]="Audio",s[s.Cache=2]="Cache",s[s.Config=3]="Config",s[s.Data=4]="Data",s[s.LocalData=5]="LocalData",s[s.Document=6]="Document",s[s.Download=7]="Download",s[s.Picture=8]="Picture",s[s.Public=9]="Public",s[s.Video=10]="Video",s[s.Resource=11]="Resource",s[s.Temp=12]="Temp",s[s.AppConfig=13]="AppConfig",s[s.AppData=14]="AppData",s[s.AppLocalData=15]="AppLocalData",s[s.AppCache=16]="AppCache",s[s.AppLog=17]="AppLog",s[s.Desktop=18]="Desktop",s[s.Executable=19]="Executable",s[s.Font=20]="Font",s[s.Home=21]="Home",s[s.Runtime=22]="Runtime",s[s.Template=23]="Template",t.SeekMode=void 0,(c=t.SeekMode||(t.SeekMode={}))[c.Start=0]="Start",c[c.Current=1]="Current",c[c.End=2]="End";class w extends u{async read(t){if(0===t.byteLength)return 0;const e=await l("plugin:fs|read",{rid:this.rid,len:t.byteLength}),n=function(t){const e=new Uint8ClampedArray(t),n=e.byteLength;let i=0;for(let t=0;tt instanceof URL?t.toString():t)),options:i,onEvent:r});return()=>{h(a)}},t.watchImmediate=async function(t,e,n){const i={recursive:!1,...n,delayMs:null},o=Array.isArray(t)?t:[t];for(const t of o)if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const r=new f;r.onmessage=e;const a=await l("plugin:fs|watch",{paths:o.map((t=>t instanceof URL?t.toString():t)),options:i,onEvent:r});return()=>{h(a)}},t.writeFile=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|write_file",e,{headers:{path:encodeURIComponent(t instanceof URL?t.toString():t),options:JSON.stringify(n)}})},t.writeTextFile=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const i=new TextEncoder;await l("plugin:fs|write_text_file",i.encode(e),{headers:{path:encodeURIComponent(t instanceof URL?t.toString():t),options:JSON.stringify(n)}})},t}({});Object.defineProperty(window.__TAURI__,"fs",{value:__TAURI_PLUGIN_FS__})} diff --git a/plugins/fs/build.rs b/plugins/fs/build.rs index 1901f3a4..cb9d00da 100644 --- a/plugins/fs/build.rs +++ b/plugins/fs/build.rs @@ -2,12 +2,40 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use std::{fs::create_dir_all, path::Path}; +use std::{ + fs::create_dir_all, + path::{Path, PathBuf}, +}; #[path = "src/scope.rs"] #[allow(dead_code)] mod scope; +/// FS scope entry. +#[derive(schemars::JsonSchema)] +#[serde(untagged)] +#[allow(unused)] +enum FsScopeEntry { + /// FS scope path. + Value(PathBuf), + Object { + /// FS scope path. + path: PathBuf, + }, +} + +// Ensure `FsScopeEntry` and `scope::EntryRaw` is kept in sync +fn _f() { + match scope::EntryRaw::Value(PathBuf::new()) { + scope::EntryRaw::Value(path) => FsScopeEntry::Value(path), + scope::EntryRaw::Object { path } => FsScopeEntry::Object { path }, + }; + match FsScopeEntry::Value(PathBuf::new()) { + FsScopeEntry::Value(path) => scope::EntryRaw::Value(path), + FsScopeEntry::Object { path } => scope::EntryRaw::Object { path }, + }; +} + const BASE_DIR_VARS: &[&str] = &[ "AUDIO", "CACHE", @@ -26,7 +54,6 @@ const BASE_DIR_VARS: &[&str] = &[ "TEMPLATE", "VIDEO", "RESOURCE", - "APP", "LOG", "TEMP", "APPCONFIG", @@ -83,15 +110,19 @@ fn main() { [[permission]] identifier = "scope-{lower}-recursive" -description = "This scope recursive access to the complete `${upper}` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `${upper}` folder, including sub directories and files." +[[permission.scope.allow]] +path = "${upper}" [[permission.scope.allow]] path = "${upper}/**" [[permission]] identifier = "scope-{lower}" -description = "This scope permits access to all files and list content of top level directories in the `${upper}`folder." +description = "This scope permits access to all files and list content of top level directories in the `${upper}` folder." +[[permission.scope.allow]] +path = "${upper}" [[permission.scope.allow]] path = "${upper}/*" @@ -100,7 +131,7 @@ identifier = "scope-{lower}-index" description = "This scope permits to list all files and folders in the `${upper}`folder." [[permission.scope.allow]] -path = "${upper}/" +path = "${upper}" # Sets Section # This section combines the scope elements with enablement of commands @@ -115,7 +146,7 @@ permissions = [ [[set]] identifier = "allow-{lower}-write-recursive" -description = "This allows full recusrive write access to the complete `${upper}` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `${upper}` folder, files and subdirectories." permissions = [ "write-all", "scope-{lower}-recursive" @@ -139,7 +170,7 @@ permissions = [ [[set]] identifier = "allow-{lower}-meta-recursive" -description = "This allows read access to metadata of the `${upper}` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `${upper}` folder, including file listing and statistics." permissions = [ "read-meta", "scope-{lower}-recursive" @@ -147,18 +178,23 @@ permissions = [ [[set]] identifier = "allow-{lower}-meta" -description = "This allows read access to metadata of the `${upper}` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `${upper}` folder, including file listing and statistics." permissions = [ "read-meta", "scope-{lower}-index" ]"### ); - std::fs::write(base_dirs.join(format!("{lower}.toml")), toml) - .unwrap_or_else(|e| panic!("unable to autogenerate ${upper}: {e}")); + let permission_path = base_dirs.join(format!("{lower}.toml")); + if toml != std::fs::read_to_string(&permission_path).unwrap_or_default() { + std::fs::write(permission_path, toml) + .unwrap_or_else(|e| panic!("unable to autogenerate ${lower}: {e}")); + } } tauri_plugin::Builder::new(COMMANDS) - .global_scope_schema(schemars::schema_for!(scope::Entry)) + .global_api_script_path("./api-iife.js") + .global_scope_schema(schemars::schema_for!(FsScopeEntry)) + .android_path("android") .build(); } diff --git a/plugins/fs/guest-js/index.ts b/plugins/fs/guest-js/index.ts index 3d9aca34..ed8749d7 100644 --- a/plugins/fs/guest-js/index.ts +++ b/plugins/fs/guest-js/index.ts @@ -7,16 +7,16 @@ * * ## Security * - * This module prevents path traversal, not allowing absolute paths or parent dir components - * (i.e. "/usr/path/to/file" or "../path/to/file" paths are not allowed). - * Paths accessed with this API must be relative to one of the {@link BaseDirectory | base directories} - * so if you need access to arbitrary filesystem paths, you must write such logic on the core layer instead. + * This module prevents path traversal, not allowing parent directory accessors to be used + * (i.e. "/usr/path/to/../file" or "../path/to/file" paths are not allowed). + * Paths accessed with this API must be either relative to one of the {@link BaseDirectory | base directories} + * or created with the {@link https://v2.tauri.app/reference/javascript/api/namespacepath | path API}. * * The API has a scope configuration that forces you to restrict the paths that can be accessed using glob patterns. * * The scope configuration is an array of glob patterns describing folder paths that are allowed. * For instance, this scope configuration only allows accessing files on the - * *databases* folder of the {@link https://beta.tauri.app/2/reference/js/core/namespacepath/#appdatadir | `$APPDATA` directory}: + * *databases* folder of the {@link https://v2.tauri.app/reference/javascript/api/namespacepath/#appdatadir | `$APPDATA` directory}: * ```json * { * "plugins": { @@ -27,32 +27,32 @@ * } * ``` * - * Notice the use of the `$APPDATA` variable. The value is injected at runtime, resolving to the {@link https://beta.tauri.app/2/reference/js/core/namespacepath/#appdatadir | app data directory}. + * Notice the use of the `$APPDATA` variable. The value is injected at runtime, resolving to the {@link https://v2.tauri.app/reference/javascript/api/namespacepath/#appdatadir | app data directory}. * * The available variables are: - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#appconfigdir | $APPCONFIG}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#appdatadir | $APPDATA}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#appLocaldatadir | $APPLOCALDATA}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#appcachedir | $APPCACHE}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#applogdir | $APPLOG}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#audiodir | $AUDIO}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#cachedir | $CACHE}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#configdir | $CONFIG}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#datadir | $DATA}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#localdatadir | $LOCALDATA}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#desktopdir | $DESKTOP}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#documentdir | $DOCUMENT}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#downloaddir | $DOWNLOAD}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#executabledir | $EXE}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#fontdir | $FONT}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#homedir | $HOME}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#picturedir | $PICTURE}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#publicdir | $PUBLIC}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#runtimedir | $RUNTIME}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#templatedir | $TEMPLATE}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#videodir | $VIDEO}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#resourcedir | $RESOURCE}, - * {@linkcode https://beta.tauri.app/2/reference/js/core/namespacepath/#tempdir | $TEMP}. + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#appconfigdir | $APPCONFIG}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#appdatadir | $APPDATA}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#applocaldatadir | $APPLOCALDATA}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#appcachedir | $APPCACHE}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#applogdir | $APPLOG}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#audiodir | $AUDIO}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#cachedir | $CACHE}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#configdir | $CONFIG}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#datadir | $DATA}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#localdatadir | $LOCALDATA}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#desktopdir | $DESKTOP}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#documentdir | $DOCUMENT}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#downloaddir | $DOWNLOAD}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#executabledir | $EXE}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#fontdir | $FONT}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#homedir | $HOME}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#picturedir | $PICTURE}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#publicdir | $PUBLIC}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#runtimedir | $RUNTIME}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#templatedir | $TEMPLATE}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#videodir | $VIDEO}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#resourcedir | $RESOURCE}, + * {@linkcode https://v2.tauri.app/reference/javascript/api/namespacepath/#tempdir | $TEMP}. * * Trying to execute any API with a URL not configured on the scope results in a promise rejection due to denied access. * @@ -61,13 +61,13 @@ * @module */ -import { BaseDirectory } from "@tauri-apps/api/path"; -import { Channel, invoke, Resource } from "@tauri-apps/api/core"; +import { BaseDirectory } from '@tauri-apps/api/path' +import { Channel, invoke, Resource } from '@tauri-apps/api/core' enum SeekMode { Start = 0, Current = 1, - End = 2, + End = 2 } /** @@ -80,41 +80,41 @@ interface FileInfo { * True if this is info for a regular file. Mutually exclusive to * `FileInfo.isDirectory` and `FileInfo.isSymlink`. */ - isFile: boolean; + isFile: boolean /** * True if this is info for a regular directory. Mutually exclusive to * `FileInfo.isFile` and `FileInfo.isSymlink`. */ - isDirectory: boolean; + isDirectory: boolean /** * True if this is info for a symlink. Mutually exclusive to * `FileInfo.isFile` and `FileInfo.isDirectory`. */ - isSymlink: boolean; + isSymlink: boolean /** * The size of the file, in bytes. */ - size: number; + size: number /** * The last modification time of the file. This corresponds to the `mtime` * field from `stat` on Linux/Mac OS and `ftLastWriteTime` on Windows. This * may not be available on all platforms. */ - mtime: Date | null; + mtime: Date | null /** * The last access time of the file. This corresponds to the `atime` * field from `stat` on Unix and `ftLastAccessTime` on Windows. This may not * be available on all platforms. */ - atime: Date | null; + atime: Date | null /** * The creation time of the file. This corresponds to the `birthtime` * field from `stat` on Mac/BSD and `ftCreationTime` on Windows. This may * not be available on all platforms. */ - birthtime: Date | null; + birthtime: Date | null /** Whether this is a readonly (unwritable) file. */ - readonly: boolean; + readonly: boolean /** * This field contains the file system attribute information for a file * or directory. For possible values and their descriptions, see @@ -124,7 +124,7 @@ interface FileInfo { * * - **macOS / Linux / Android / iOS:** Unsupported. */ - fileAttributes: number | null; + fileAttributes: number | null /** * ID of the device containing the file. * @@ -132,7 +132,7 @@ interface FileInfo { * * - **Windows:** Unsupported. */ - dev: number | null; + dev: number | null /** * Inode number. * @@ -140,7 +140,7 @@ interface FileInfo { * * - **Windows:** Unsupported. */ - ino: number | null; + ino: number | null /** * The underlying raw `st_mode` bits that contain the standard Unix * permissions for this file/directory. @@ -149,7 +149,7 @@ interface FileInfo { * * - **Windows:** Unsupported. */ - mode: number | null; + mode: number | null /** * Number of hard links pointing to this file. * @@ -157,7 +157,7 @@ interface FileInfo { * * - **Windows:** Unsupported. */ - nlink: number | null; + nlink: number | null /** * User ID of the owner of this file. * @@ -165,7 +165,7 @@ interface FileInfo { * * - **Windows:** Unsupported. */ - uid: number | null; + uid: number | null /** * Group ID of the owner of this file. * @@ -173,7 +173,7 @@ interface FileInfo { * * - **Windows:** Unsupported. */ - gid: number | null; + gid: number | null /** * Device ID of this file. * @@ -181,7 +181,7 @@ interface FileInfo { * * - **Windows:** Unsupported. */ - rdev: number | null; + rdev: number | null /** * Blocksize for filesystem I/O. * @@ -189,7 +189,7 @@ interface FileInfo { * * - **Windows:** Unsupported. */ - blksize: number | null; + blksize: number | null /** * Number of blocks allocated to the file, in 512-byte units. * @@ -197,28 +197,28 @@ interface FileInfo { * * - **Windows:** Unsupported. */ - blocks: number | null; + blocks: number | null } interface UnparsedFileInfo { - isFile: boolean; - isDirectory: boolean; - isSymlink: boolean; - size: number; - mtime: number | null; - atime: number | null; - birthtime: number | null; - readonly: boolean; - fileAttributes: number; - dev: number | null; - ino: number | null; - mode: number | null; - nlink: number | null; - uid: number | null; - gid: number | null; - rdev: number | null; - blksize: number | null; - blocks: number | null; + isFile: boolean + isDirectory: boolean + isSymlink: boolean + size: number + mtime: number | null + atime: number | null + birthtime: number | null + readonly: boolean + fileAttributes: number + dev: number | null + ino: number | null + mode: number | null + nlink: number | null + uid: number | null + gid: number | null + rdev: number | null + blksize: number | null + blocks: number | null } function parseFileInfo(r: UnparsedFileInfo): FileInfo { return { @@ -226,9 +226,9 @@ function parseFileInfo(r: UnparsedFileInfo): FileInfo { isDirectory: r.isDirectory, isSymlink: r.isSymlink, size: r.size, - mtime: r.mtime != null ? new Date(r.mtime) : null, - atime: r.atime != null ? new Date(r.atime) : null, - birthtime: r.birthtime != null ? new Date(r.birthtime) : null, + mtime: r.mtime !== null ? new Date(r.mtime) : null, + atime: r.atime !== null ? new Date(r.atime) : null, + birthtime: r.birthtime !== null ? new Date(r.birthtime) : null, readonly: r.readonly, fileAttributes: r.fileAttributes, dev: r.dev, @@ -239,8 +239,27 @@ function parseFileInfo(r: UnparsedFileInfo): FileInfo { gid: r.gid, rdev: r.rdev, blksize: r.blksize, - blocks: r.blocks, - }; + blocks: r.blocks + } +} + +// https://mstn.github.io/2018/06/08/fixed-size-arrays-in-typescript/ +type FixedSizeArray = ReadonlyArray & { + length: N +} + +// https://gist.github.com/zapthedingbat/38ebfbedd98396624e5b5f2ff462611d +/** Converts a big-endian eight byte array to number */ +function fromBytes(buffer: FixedSizeArray): number { + const bytes = new Uint8ClampedArray(buffer) + const size = bytes.byteLength + let x = 0 + for (let i = 0; i < size; i++) { + const byte = bytes[i] + x *= 0x100 + x += byte + } + return x } /** @@ -249,10 +268,6 @@ function parseFileInfo(r: UnparsedFileInfo): FileInfo { * @since 2.0.0 */ class FileHandle extends Resource { - constructor(rid: number) { - super(rid); - } - /** * Reads up to `p.byteLength` bytes into `p`. It resolves to the number of * bytes read (`0` < `n` <= `p.byteLength`) and rejects if any error @@ -273,30 +288,38 @@ class FileHandle extends Resource { * * @example * ```typescript - * import { open, read, close, BaseDirectory } from "@tauri-apps/plugin-fs" - * // if "$APP/foo/bar.txt" contains the text "hello world": - * const file = await open("foo/bar.txt", { baseDir: BaseDirectory.App }); + * import { open, BaseDirectory } from "@tauri-apps/plugin-fs" + * // if "$APPCONFIG/foo/bar.txt" contains the text "hello world": + * const file = await open("foo/bar.txt", { baseDir: BaseDirectory.AppConfig }); * const buf = new Uint8Array(100); * const numberOfBytesRead = await file.read(buf); // 11 bytes * const text = new TextDecoder().decode(buf); // "hello world" - * await close(file.rid); + * await file.close(); * ``` * * @since 2.0.0 */ async read(buffer: Uint8Array): Promise { if (buffer.byteLength === 0) { - return 0; + return 0 } - const [data, nread] = await invoke<[number[], number]>("plugin:fs|read", { + const data = await invoke('plugin:fs|read', { rid: this.rid, - len: buffer.byteLength, - }); + len: buffer.byteLength + }) + + // Rust side will never return an empty array for this command and + // ensure there is at least 8 elements there. + // + // This is an optimization to include the number of read bytes (as bigendian bytes) + // at the end of returned array to avoid serialization overhead of separate values. + const nread = fromBytes(data.slice(-8) as FixedSizeArray) - buffer.set(data); + const bytes = data instanceof ArrayBuffer ? new Uint8Array(data) : data + buffer.set(bytes.slice(0, bytes.length - 8)) - return nread === 0 ? null : nread; + return nread === 0 ? null : nread } /** @@ -313,11 +336,11 @@ class FileHandle extends Resource { * * @example * ```typescript - * import { open, seek, write, SeekMode, BaseDirectory } from '@tauri-apps/plugin-fs'; + * import { open, SeekMode, BaseDirectory } from '@tauri-apps/plugin-fs'; * * // Given hello.txt pointing to file with "Hello world", which is 11 bytes long: - * const file = await open('hello.txt', { read: true, write: true, truncate: true, create: true, baseDir: BaseDirectory.App }); - * await file.write(new TextEncoder().encode("Hello world"), { baseDir: BaseDirectory.App }); + * const file = await open('hello.txt', { read: true, write: true, truncate: true, create: true, baseDir: BaseDirectory.AppLocalData }); + * await file.write(new TextEncoder().encode("Hello world")); * * // Seek 6 bytes from the start of the file * console.log(await file.seek(6, SeekMode.Start)); // "6" @@ -325,16 +348,18 @@ class FileHandle extends Resource { * console.log(await file.seek(2, SeekMode.Current)); // "8" * // Seek backwards 2 bytes from the end of the file * console.log(await file.seek(-2, SeekMode.End)); // "9" (e.g. 11-2) + * + * await file.close(); * ``` * * @since 2.0.0 */ async seek(offset: number, whence: SeekMode): Promise { - return invoke("plugin:fs|seek", { + return await invoke('plugin:fs|seek', { rid: this.rid, offset, - whence, - }); + whence + }) } /** @@ -342,20 +367,21 @@ class FileHandle extends Resource { * * @example * ```typescript - * import { open, fstat, BaseDirectory } from '@tauri-apps/plugin-fs'; - * const file = await open("file.txt", { read: true, baseDir: BaseDirectory.App }); - * const fileInfo = await fstat(file.rid); + * import { open, BaseDirectory } from '@tauri-apps/plugin-fs'; + * const file = await open("file.txt", { read: true, baseDir: BaseDirectory.AppLocalData }); + * const fileInfo = await file.stat(); * console.log(fileInfo.isFile); // true + * await file.close(); * ``` * * @since 2.0.0 */ async stat(): Promise { - const res = await invoke("plugin:fs|fstat", { - rid: this.rid, - }); + const res = await invoke('plugin:fs|fstat', { + rid: this.rid + }) - return parseFileInfo(res); + return parseFileInfo(res) } /** @@ -364,28 +390,29 @@ class FileHandle extends Resource { * * @example * ```typescript - * import { ftruncate, open, write, read, BaseDirectory } from '@tauri-apps/plugin-fs'; + * import { open, BaseDirectory } from '@tauri-apps/plugin-fs'; * * // truncate the entire file - * const file = await open("my_file.txt", { read: true, write: true, create: true, baseDir: BaseDirectory.App }); - * await ftruncate(file.rid); + * const file = await open("my_file.txt", { read: true, write: true, create: true, baseDir: BaseDirectory.AppLocalData }); + * await file.truncate(); * * // truncate part of the file - * const file = await open("my_file.txt", { read: true, write: true, create: true, baseDir: BaseDirectory.App }); - * await write(file.rid, new TextEncoder().encode("Hello World")); - * await ftruncate(file.rid, 7); + * const file = await open("my_file.txt", { read: true, write: true, create: true, baseDir: BaseDirectory.AppLocalData }); + * await file.write(new TextEncoder().encode("Hello World")); + * await file.truncate(7); * const data = new Uint8Array(32); - * await read(file.rid, data); + * await file.read(data); * console.log(new TextDecoder().decode(data)); // Hello W + * await file.close(); * ``` * * @since 2.0.0 */ async truncate(len?: number): Promise { - return invoke("plugin:fs|ftruncate", { + await invoke('plugin:fs|ftruncate', { rid: this.rid, - len, - }); + len + }) } /** @@ -398,21 +425,21 @@ class FileHandle extends Resource { * * @example * ```typescript - * import { open, write, close, BaseDirectory } from '@tauri-apps/plugin-fs'; + * import { open, write, BaseDirectory } from '@tauri-apps/plugin-fs'; * const encoder = new TextEncoder(); * const data = encoder.encode("Hello world"); - * const file = await open("bar.txt", { write: true, baseDir: BaseDirectory.App }); - * const bytesWritten = await write(file.rid, data); // 11 - * await close(file.rid); + * const file = await open("bar.txt", { write: true, baseDir: BaseDirectory.AppLocalData }); + * const bytesWritten = await file.write(data); // 11 + * await file.close(); * ``` * * @since 2.0.0 */ async write(data: Uint8Array): Promise { - return invoke("plugin:fs|write", { + return await invoke('plugin:fs|write', { rid: this.rid, - data: Array.from(data), - }); + data + }) } } @@ -421,7 +448,7 @@ class FileHandle extends Resource { */ interface CreateOptions { /** Base directory for `path` */ - baseDir?: BaseDirectory; + baseDir?: BaseDirectory } /** @@ -431,25 +458,27 @@ interface CreateOptions { * @example * ```typescript * import { create, BaseDirectory } from "@tauri-apps/plugin-fs" - * const file = await create("foo/bar.txt", { baseDir: BaseDirectory.App }); + * const file = await create("foo/bar.txt", { baseDir: BaseDirectory.AppConfig }); + * await file.write(new TextEncoder().encode("Hello world")); + * await file.close(); * ``` * * @since 2.0.0 */ async function create( path: string | URL, - options?: CreateOptions, + options?: CreateOptions ): Promise { - if (path instanceof URL && path.protocol !== "file:") { - throw new TypeError("Must be a file URL."); + if (path instanceof URL && path.protocol !== 'file:') { + throw new TypeError('Must be a file URL.') } - const rid = await invoke("plugin:fs|create", { + const rid = await invoke('plugin:fs|create', { path: path instanceof URL ? path.toString() : path, - options, - }); + options + }) - return new FileHandle(rid); + return new FileHandle(rid) } /** @@ -460,49 +489,49 @@ interface OpenOptions { * Sets the option for read access. This option, when `true`, means that the * file should be read-able if opened. */ - read?: boolean; + read?: boolean /** * Sets the option for write access. This option, when `true`, means that * the file should be write-able if opened. If the file already exists, * any write calls on it will overwrite its contents, by default without * truncating it. */ - write?: boolean; + write?: boolean /** * Sets the option for the append mode. This option, when `true`, means that * writes will append to a file instead of overwriting previous contents. * Note that setting `{ write: true, append: true }` has the same effect as * setting only `{ append: true }`. */ - append?: boolean; + append?: boolean /** * Sets the option for truncating a previous file. If a file is * successfully opened with this option set it will truncate the file to `0` * size if it already exists. The file must be opened with write access * for truncate to work. */ - truncate?: boolean; + truncate?: boolean /** * Sets the option to allow creating a new file, if one doesn't already * exist at the specified path. Requires write or append access to be * used. */ - create?: boolean; + create?: boolean /** * Defaults to `false`. If set to `true`, no file, directory, or symlink is * allowed to exist at the target location. Requires write or append * access to be used. When createNew is set to `true`, create and truncate * are ignored. */ - createNew?: boolean; + createNew?: boolean /** * Permissions to use if creating the file (defaults to `0o666`, before * the process's umask). * Ignored on Windows. */ - mode?: number; + mode?: number /** Base directory for `path` */ - baseDir?: BaseDirectory; + baseDir?: BaseDirectory } /** @@ -514,27 +543,27 @@ interface OpenOptions { * @example * ```typescript * import { open, BaseDirectory } from "@tauri-apps/plugin-fs" - * const file = await open("foo/bar.txt", { read: true, write: true, baseDir: BaseDirectory.App }); + * const file = await open("foo/bar.txt", { read: true, write: true, baseDir: BaseDirectory.AppLocalData }); * // Do work with file - * await close(file.rid); + * await file.close(); * ``` * * @since 2.0.0 */ async function open( path: string | URL, - options?: OpenOptions, + options?: OpenOptions ): Promise { - if (path instanceof URL && path.protocol !== "file:") { - throw new TypeError("Must be a file URL."); + if (path instanceof URL && path.protocol !== 'file:') { + throw new TypeError('Must be a file URL.') } - const rid = await invoke("plugin:fs|open", { + const rid = await invoke('plugin:fs|open', { path: path instanceof URL ? path.toString() : path, - options, - }); + options + }) - return new FileHandle(rid); + return new FileHandle(rid) } /** @@ -542,9 +571,9 @@ async function open( */ interface CopyFileOptions { /** Base directory for `fromPath`. */ - fromPathBaseDir?: BaseDirectory; + fromPathBaseDir?: BaseDirectory /** Base directory for `toPath`. */ - toPathBaseDir?: BaseDirectory; + toPathBaseDir?: BaseDirectory } /** @@ -552,7 +581,7 @@ interface CopyFileOptions { * @example * ```typescript * import { copyFile, BaseDirectory } from '@tauri-apps/plugin-fs'; - * await copyFile('app.conf', 'app.conf.bk', { fromPathBaseDir: BaseDirectory.App, toPathBaseDir: BaseDirectory.App }); + * await copyFile('app.conf', 'app.conf.bk', { fromPathBaseDir: BaseDirectory.AppConfig, toPathBaseDir: BaseDirectory.AppConfig }); * ``` * * @since 2.0.0 @@ -560,20 +589,20 @@ interface CopyFileOptions { async function copyFile( fromPath: string | URL, toPath: string | URL, - options?: CopyFileOptions, + options?: CopyFileOptions ): Promise { if ( - (fromPath instanceof URL && fromPath.protocol !== "file:") || - (toPath instanceof URL && toPath.protocol !== "file:") + (fromPath instanceof URL && fromPath.protocol !== 'file:') || + (toPath instanceof URL && toPath.protocol !== 'file:') ) { - throw new TypeError("Must be a file URL."); + throw new TypeError('Must be a file URL.') } - return invoke("plugin:fs|copy_file", { + await invoke('plugin:fs|copy_file', { fromPath: fromPath instanceof URL ? fromPath.toString() : fromPath, toPath: toPath instanceof URL ? toPath.toString() : toPath, - options, - }); + options + }) } /** @@ -581,13 +610,13 @@ async function copyFile( */ interface MkdirOptions { /** Permissions to use when creating the directory (defaults to `0o777`, before the process's umask). Ignored on Windows. */ - mode?: number; + mode?: number /** * Defaults to `false`. If set to `true`, means that any intermediate directories will also be created (as with the shell command `mkdir -p`). * */ - recursive?: boolean; + recursive?: boolean /** Base directory for `path` */ - baseDir?: BaseDirectory; + baseDir?: BaseDirectory } /** @@ -595,23 +624,23 @@ interface MkdirOptions { * @example * ```typescript * import { mkdir, BaseDirectory } from '@tauri-apps/plugin-fs'; - * await mkdir('users', { baseDir: BaseDirectory.App }); + * await mkdir('users', { baseDir: BaseDirectory.AppLocalData }); * ``` * * @since 2.0.0 */ async function mkdir( path: string | URL, - options?: MkdirOptions, + options?: MkdirOptions ): Promise { - if (path instanceof URL && path.protocol !== "file:") { - throw new TypeError("Must be a file URL."); + if (path instanceof URL && path.protocol !== 'file:') { + throw new TypeError('Must be a file URL.') } - return invoke("plugin:fs|mkdir", { + await invoke('plugin:fs|mkdir', { path: path instanceof URL ? path.toString() : path, - options, - }); + options + }) } /** @@ -619,7 +648,7 @@ async function mkdir( */ interface ReadDirOptions { /** Base directory for `path` */ - baseDir?: BaseDirectory; + baseDir?: BaseDirectory } /** @@ -631,13 +660,13 @@ interface ReadDirOptions { */ interface DirEntry { /** The name of the entry (file name with extension or directory name). */ - name: string; + name: string /** Specifies whether this entry is a directory or not. */ - isDirectory: boolean; + isDirectory: boolean /** Specifies whether this entry is a file or not. */ - isFile: boolean; + isFile: boolean /** Specifies whether this entry is a symlink or not. */ - isSymlink: boolean; + isSymlink: boolean } /** @@ -645,15 +674,16 @@ interface DirEntry { * @example * ```typescript * import { readDir, BaseDirectory } from '@tauri-apps/plugin-fs'; + * import { join } from '@tauri-apps/api/path'; * const dir = "users" - * const entries = await readDir('users', { baseDir: BaseDirectory.App }); - * processEntriesRecursive(dir, entries); - * async function processEntriesRecursive(parent, entries) { + * const entries = await readDir('users', { baseDir: BaseDirectory.AppLocalData }); + * processEntriesRecursively(dir, entries); + * async function processEntriesRecursively(parent, entries) { * for (const entry of entries) { * console.log(`Entry: ${entry.name}`); * if (entry.isDirectory) { - * const dir = parent + entry.name; - * processEntriesRecursive(dir, await readDir(dir, { baseDir: BaseDirectory.App })) + * const dir = await join(parent, entry.name); + * processEntriesRecursively(dir, await readDir(dir, { baseDir: BaseDirectory.AppLocalData })) * } * } * } @@ -663,16 +693,16 @@ interface DirEntry { */ async function readDir( path: string | URL, - options?: ReadDirOptions, + options?: ReadDirOptions ): Promise { - if (path instanceof URL && path.protocol !== "file:") { - throw new TypeError("Must be a file URL."); + if (path instanceof URL && path.protocol !== 'file:') { + throw new TypeError('Must be a file URL.') } - return invoke("plugin:fs|read_dir", { + return await invoke('plugin:fs|read_dir', { path: path instanceof URL ? path.toString() : path, - options, - }); + options + }) } /** @@ -680,7 +710,7 @@ async function readDir( */ interface ReadFileOptions { /** Base directory for `path` */ - baseDir?: BaseDirectory; + baseDir?: BaseDirectory } /** @@ -696,18 +726,18 @@ interface ReadFileOptions { */ async function readFile( path: string | URL, - options?: ReadFileOptions, + options?: ReadFileOptions ): Promise { - if (path instanceof URL && path.protocol !== "file:") { - throw new TypeError("Must be a file URL."); + if (path instanceof URL && path.protocol !== 'file:') { + throw new TypeError('Must be a file URL.') } - const arr = await invoke("plugin:fs|read_file", { + const arr = await invoke('plugin:fs|read_file', { path: path instanceof URL ? path.toString() : path, - options, - }); + options + }) - return Uint8Array.from(arr); + return arr instanceof ArrayBuffer ? new Uint8Array(arr) : Uint8Array.from(arr) } /** @@ -715,23 +745,23 @@ async function readFile( * @example * ```typescript * import { readTextFile, BaseDirectory } from '@tauri-apps/plugin-fs'; - * const contents = await readTextFile('app.conf', { baseDir: BaseDirectory.App }); + * const contents = await readTextFile('app.conf', { baseDir: BaseDirectory.AppConfig }); * ``` * * @since 2.0.0 */ async function readTextFile( path: string | URL, - options?: ReadFileOptions, + options?: ReadFileOptions ): Promise { - if (path instanceof URL && path.protocol !== "file:") { - throw new TypeError("Must be a file URL."); + if (path instanceof URL && path.protocol !== 'file:') { + throw new TypeError('Must be a file URL.') } - return invoke("plugin:fs|read_text_file", { + return await invoke('plugin:fs|read_text_file', { path: path instanceof URL ? path.toString() : path, - options, - }); + options + }) } /** @@ -739,7 +769,7 @@ async function readTextFile( * @example * ```typescript * import { readTextFileLines, BaseDirectory } from '@tauri-apps/plugin-fs'; - * const lines = await readTextFileLines('app.conf', { baseDir: BaseDirectory.App }); + * const lines = await readTextFileLines('app.conf', { baseDir: BaseDirectory.AppConfig }); * for await (const line of lines) { * console.log(line); * } @@ -751,42 +781,42 @@ async function readTextFile( */ async function readTextFileLines( path: string | URL, - options?: ReadFileOptions, + options?: ReadFileOptions ): Promise> { - if (path instanceof URL && path.protocol !== "file:") { - throw new TypeError("Must be a file URL."); + if (path instanceof URL && path.protocol !== 'file:') { + throw new TypeError('Must be a file URL.') } - const pathStr = path instanceof URL ? path.toString() : path; + const pathStr = path instanceof URL ? path.toString() : path - return Promise.resolve({ + return await Promise.resolve({ path: pathStr, rid: null as number | null, async next(): Promise> { - if (!this.rid) { - this.rid = await invoke("plugin:fs|read_text_file_lines", { + if (this.rid === null) { + this.rid = await invoke('plugin:fs|read_text_file_lines', { path: pathStr, - options, - }); + options + }) } const [line, done] = await invoke<[string | null, boolean]>( - "plugin:fs|read_text_file_lines_next", - { rid: this.rid }, - ); + 'plugin:fs|read_text_file_lines_next', + { rid: this.rid } + ) // an iteration is over, reset rid for next iteration - if (done) this.rid = null; + if (done) this.rid = null return { - value: done ? "" : (line as string), - done, - }; + value: done ? '' : line!, + done + } }, [Symbol.asyncIterator](): AsyncIterableIterator { - return this; - }, - }); + return this + } + }) } /** @@ -794,9 +824,9 @@ async function readTextFileLines( */ interface RemoveOptions { /** Defaults to `false`. If set to `true`, path will be removed even if it's a non-empty directory. */ - recursive?: boolean; + recursive?: boolean /** Base directory for `path` */ - baseDir?: BaseDirectory; + baseDir?: BaseDirectory } /** @@ -805,24 +835,24 @@ interface RemoveOptions { * @example * ```typescript * import { remove, BaseDirectory } from '@tauri-apps/plugin-fs'; - * await remove('users/file.txt', { baseDir: BaseDirectory.App }); - * await remove('users', { baseDir: BaseDirectory.App }); + * await remove('users/file.txt', { baseDir: BaseDirectory.AppLocalData }); + * await remove('users', { baseDir: BaseDirectory.AppLocalData }); * ``` * * @since 2.0.0 */ async function remove( path: string | URL, - options?: RemoveOptions, + options?: RemoveOptions ): Promise { - if (path instanceof URL && path.protocol !== "file:") { - throw new TypeError("Must be a file URL."); + if (path instanceof URL && path.protocol !== 'file:') { + throw new TypeError('Must be a file URL.') } - return invoke("plugin:fs|remove", { + await invoke('plugin:fs|remove', { path: path instanceof URL ? path.toString() : path, - options, - }); + options + }) } /** @@ -830,9 +860,9 @@ async function remove( */ interface RenameOptions { /** Base directory for `oldPath`. */ - oldPathBaseDir?: BaseDirectory; + oldPathBaseDir?: BaseDirectory /** Base directory for `newPath`. */ - newPathBaseDir?: BaseDirectory; + newPathBaseDir?: BaseDirectory } /** @@ -845,7 +875,7 @@ interface RenameOptions { * @example * ```typescript * import { rename, BaseDirectory } from '@tauri-apps/plugin-fs'; - * await rename('avatar.png', 'deleted.png', { oldPathBaseDir: BaseDirectory.App, newPathBaseDir: BaseDirectory.App }); + * await rename('avatar.png', 'deleted.png', { oldPathBaseDir: BaseDirectory.App, newPathBaseDir: BaseDirectory.AppLocalData }); * ``` * * @since 2.0.0 @@ -853,20 +883,20 @@ interface RenameOptions { async function rename( oldPath: string | URL, newPath: string | URL, - options?: RenameOptions, + options?: RenameOptions ): Promise { if ( - (oldPath instanceof URL && oldPath.protocol !== "file:") || - (newPath instanceof URL && newPath.protocol !== "file:") + (oldPath instanceof URL && oldPath.protocol !== 'file:') || + (newPath instanceof URL && newPath.protocol !== 'file:') ) { - throw new TypeError("Must be a file URL."); + throw new TypeError('Must be a file URL.') } - return invoke("plugin:fs|rename", { + await invoke('plugin:fs|rename', { oldPath: oldPath instanceof URL ? oldPath.toString() : oldPath, newPath: newPath instanceof URL ? newPath.toString() : newPath, - options, - }); + options + }) } /** @@ -874,7 +904,7 @@ async function rename( */ interface StatOptions { /** Base directory for `path`. */ - baseDir?: BaseDirectory; + baseDir?: BaseDirectory } /** @@ -884,7 +914,7 @@ interface StatOptions { * @example * ```typescript * import { stat, BaseDirectory } from '@tauri-apps/plugin-fs'; - * const fileInfo = await stat("hello.txt", { baseDir: BaseDirectory.App }); + * const fileInfo = await stat("hello.txt", { baseDir: BaseDirectory.AppLocalData }); * console.log(fileInfo.isFile); // true * ``` * @@ -892,14 +922,14 @@ interface StatOptions { */ async function stat( path: string | URL, - options?: StatOptions, + options?: StatOptions ): Promise { - const res = await invoke("plugin:fs|stat", { + const res = await invoke('plugin:fs|stat', { path: path instanceof URL ? path.toString() : path, - options, - }); + options + }) - return parseFileInfo(res); + return parseFileInfo(res) } /** @@ -910,7 +940,7 @@ async function stat( * @example * ```typescript * import { lstat, BaseDirectory } from '@tauri-apps/plugin-fs'; - * const fileInfo = await lstat("hello.txt", { baseDir: BaseDirectory.App }); + * const fileInfo = await lstat("hello.txt", { baseDir: BaseDirectory.AppLocalData }); * console.log(fileInfo.isFile); // true * ``` * @@ -918,14 +948,14 @@ async function stat( */ async function lstat( path: string | URL, - options?: StatOptions, + options?: StatOptions ): Promise { - const res = await invoke("plugin:fs|lstat", { + const res = await invoke('plugin:fs|lstat', { path: path instanceof URL ? path.toString() : path, - options, - }); + options + }) - return parseFileInfo(res); + return parseFileInfo(res) } /** @@ -933,7 +963,7 @@ async function lstat( */ interface TruncateOptions { /** Base directory for `path`. */ - baseDir?: BaseDirectory; + baseDir?: BaseDirectory } /** @@ -942,16 +972,16 @@ interface TruncateOptions { * * @example * ```typescript - * import { truncate, readFile, writeFile, BaseDirectory } from '@tauri-apps/plugin-fs'; + * import { truncate, readTextFile, writeTextFile, BaseDirectory } from '@tauri-apps/plugin-fs'; * // truncate the entire file - * await truncate("my_file.txt", 0, { baseDir: BaseDirectory.App }); + * await truncate("my_file.txt", 0, { baseDir: BaseDirectory.AppLocalData }); * * // truncate part of the file - * let file = "file.txt"; - * await writeFile(file, new TextEncoder().encode("Hello World"), { baseDir: BaseDirectory.App }); - * await truncate(file, 7); - * const data = await readFile(file, { baseDir: BaseDirectory.App }); - * console.log(new TextDecoder().decode(data)); // "Hello W" + * const filePath = "file.txt"; + * await writeTextFile(filePath, "Hello World", { baseDir: BaseDirectory.AppLocalData }); + * await truncate(filePath, 7, { baseDir: BaseDirectory.AppLocalData }); + * const data = await readTextFile(filePath, { baseDir: BaseDirectory.AppLocalData }); + * console.log(data); // "Hello W" * ``` * * @since 2.0.0 @@ -959,17 +989,17 @@ interface TruncateOptions { async function truncate( path: string | URL, len?: number, - options?: TruncateOptions, + options?: TruncateOptions ): Promise { - if (path instanceof URL && path.protocol !== "file:") { - throw new TypeError("Must be a file URL."); + if (path instanceof URL && path.protocol !== 'file:') { + throw new TypeError('Must be a file URL.') } - return invoke("plugin:fs|truncate", { + await invoke('plugin:fs|truncate', { path: path instanceof URL ? path.toString() : path, len, - options, - }); + options + }) } /** @@ -977,15 +1007,15 @@ async function truncate( */ interface WriteFileOptions { /** Defaults to `false`. If set to `true`, will append to a file instead of overwriting previous contents. */ - append?: boolean; + append?: boolean /** Sets the option to allow creating a new file, if one doesn't already exist at the specified path (defaults to `true`). */ - create?: boolean; + create?: boolean /** Sets the option to create a new file, failing if it already exists. */ - createNew?: boolean; + createNew?: boolean /** File permissions. Ignored on Windows. */ - mode?: number; + mode?: number /** Base directory for `path` */ - baseDir?: BaseDirectory; + baseDir?: BaseDirectory } /** @@ -996,7 +1026,7 @@ interface WriteFileOptions { * * let encoder = new TextEncoder(); * let data = encoder.encode("Hello World"); - * await writeFile('file.txt', data, { baseDir: BaseDirectory.App }); + * await writeFile('file.txt', data, { baseDir: BaseDirectory.AppLocalData }); * ``` * * @since 2.0.0 @@ -1004,17 +1034,18 @@ interface WriteFileOptions { async function writeFile( path: string | URL, data: Uint8Array, - options?: WriteFileOptions, + options?: WriteFileOptions ): Promise { - if (path instanceof URL && path.protocol !== "file:") { - throw new TypeError("Must be a file URL."); + if (path instanceof URL && path.protocol !== 'file:') { + throw new TypeError('Must be a file URL.') } - return invoke("plugin:fs|write_file", { - path: path instanceof URL ? path.toString() : path, - data: Array.from(data), - options, - }); + await invoke('plugin:fs|write_file', data, { + headers: { + path: encodeURIComponent(path instanceof URL ? path.toString() : path), + options: JSON.stringify(options) + } + }) } /** @@ -1023,7 +1054,7 @@ async function writeFile( * ```typescript * import { writeTextFile, BaseDirectory } from '@tauri-apps/plugin-fs'; * - * await writeTextFile('file.txt', "Hello world", { baseDir: BaseDirectory.App }); + * await writeTextFile('file.txt', "Hello world", { baseDir: BaseDirectory.AppLocalData }); * ``` * * @since 2.0.0 @@ -1031,17 +1062,20 @@ async function writeFile( async function writeTextFile( path: string | URL, data: string, - options?: WriteFileOptions, + options?: WriteFileOptions ): Promise { - if (path instanceof URL && path.protocol !== "file:") { - throw new TypeError("Must be a file URL."); + if (path instanceof URL && path.protocol !== 'file:') { + throw new TypeError('Must be a file URL.') } - return invoke("plugin:fs|write_text_file", { - path: path instanceof URL ? path.toString() : path, - data, - options, - }); + const encoder = new TextEncoder() + + await invoke('plugin:fs|write_text_file', encoder.encode(data), { + headers: { + path: encodeURIComponent(path instanceof URL ? path.toString() : path), + options: JSON.stringify(options) + } + }) } /** @@ -1049,7 +1083,7 @@ async function writeTextFile( */ interface ExistsOptions { /** Base directory for `path`. */ - baseDir?: BaseDirectory; + baseDir?: BaseDirectory } /** @@ -1065,16 +1099,16 @@ interface ExistsOptions { */ async function exists( path: string | URL, - options?: ExistsOptions, + options?: ExistsOptions ): Promise { - if (path instanceof URL && path.protocol !== "file:") { - throw new TypeError("Must be a file URL."); + if (path instanceof URL && path.protocol !== 'file:') { + throw new TypeError('Must be a file URL.') } - return invoke("plugin:fs|exists", { + return await invoke('plugin:fs|exists', { path: path instanceof URL ? path.toString() : path, - options, - }); + options + }) } /** @@ -1082,9 +1116,9 @@ async function exists( */ interface WatchOptions { /** Watch a directory recursively */ - recursive?: boolean; + recursive?: boolean /** Base directory for `path` */ - baseDir?: BaseDirectory; + baseDir?: BaseDirectory } /** @@ -1092,83 +1126,83 @@ interface WatchOptions { */ interface DebouncedWatchOptions extends WatchOptions { /** Debounce delay */ - delayMs?: number; + delayMs?: number } /** * @since 2.0.0 */ -type WatchEvent = { - type: WatchEventKind; - paths: string[]; - attrs: unknown; -}; +interface WatchEvent { + type: WatchEventKind + paths: string[] + attrs: unknown +} /** * @since 2.0.0 */ type WatchEventKind = - | "any" + | 'any' | { access: WatchEventKindAccess } | { create: WatchEventKindCreate } | { modify: WatchEventKindModify } | { remove: WatchEventKindRemove } - | "other"; + | 'other' /** * @since 2.0.0 */ type WatchEventKindAccess = - | { kind: "any" } - | { kind: "close"; mode: "any" | "execute" | "read" | "write" | "other" } - | { kind: "open"; mode: "any" | "execute" | "read" | "write" | "other" } - | { kind: "other" }; + | { kind: 'any' } + | { kind: 'close'; mode: 'any' | 'execute' | 'read' | 'write' | 'other' } + | { kind: 'open'; mode: 'any' | 'execute' | 'read' | 'write' | 'other' } + | { kind: 'other' } /** * @since 2.0.0 */ type WatchEventKindCreate = - | { kind: "any" } - | { kind: "file" } - | { kind: "folder" } - | { kind: "other" }; + | { kind: 'any' } + | { kind: 'file' } + | { kind: 'folder' } + | { kind: 'other' } /** * @since 2.0.0 */ type WatchEventKindModify = - | { kind: "any" } - | { kind: "data"; mode: "any" | "size" | "content" | "other" } + | { kind: 'any' } + | { kind: 'data'; mode: 'any' | 'size' | 'content' | 'other' } | { - kind: "metadata"; + kind: 'metadata' mode: - | "any" - | "access-time" - | "write-time" - | "permissions" - | "ownership" - | "extended" - | "other"; + | 'any' + | 'access-time' + | 'write-time' + | 'permissions' + | 'ownership' + | 'extended' + | 'other' } - | { kind: "rename"; mode: "any" | "to" | "from" | "both" | "other" } - | { kind: "other" }; + | { kind: 'rename'; mode: 'any' | 'to' | 'from' | 'both' | 'other' } + | { kind: 'other' } /** * @since 2.0.0 */ type WatchEventKindRemove = - | { kind: "any" } - | { kind: "file" } - | { kind: "folder" } - | { kind: "other" }; + | { kind: 'any' } + | { kind: 'file' } + | { kind: 'folder' } + | { kind: 'other' } /** * @since 2.0.0 */ -type UnwatchFn = () => void; +type UnwatchFn = () => void async function unwatch(rid: number): Promise { - await invoke("plugin:fs|unwatch", { rid }); + await invoke('plugin:fs|unwatch', { rid }) } /** @@ -1179,34 +1213,34 @@ async function unwatch(rid: number): Promise { async function watch( paths: string | string[] | URL | URL[], cb: (event: WatchEvent) => void, - options?: DebouncedWatchOptions, + options?: DebouncedWatchOptions ): Promise { const opts = { recursive: false, delayMs: 2000, - ...options, - }; + ...options + } - const watchPaths = Array.isArray(paths) ? paths : [paths]; + const watchPaths = Array.isArray(paths) ? paths : [paths] for (const path of watchPaths) { - if (path instanceof URL && path.protocol !== "file:") { - throw new TypeError("Must be a file URL."); + if (path instanceof URL && path.protocol !== 'file:') { + throw new TypeError('Must be a file URL.') } } - const onEvent = new Channel(); - onEvent.onmessage = cb; + const onEvent = new Channel() + onEvent.onmessage = cb - const rid: number = await invoke("plugin:fs|watch", { + const rid: number = await invoke('plugin:fs|watch', { paths: watchPaths.map((p) => (p instanceof URL ? p.toString() : p)), options: opts, - onEvent, - }); + onEvent + }) return () => { - void unwatch(rid); - }; + void unwatch(rid) + } } /** @@ -1217,34 +1251,34 @@ async function watch( async function watchImmediate( paths: string | string[] | URL | URL[], cb: (event: WatchEvent) => void, - options?: WatchOptions, + options?: WatchOptions ): Promise { const opts = { recursive: false, ...options, - delayMs: null, - }; + delayMs: null + } - const watchPaths = Array.isArray(paths) ? paths : [paths]; + const watchPaths = Array.isArray(paths) ? paths : [paths] for (const path of watchPaths) { - if (path instanceof URL && path.protocol !== "file:") { - throw new TypeError("Must be a file URL."); + if (path instanceof URL && path.protocol !== 'file:') { + throw new TypeError('Must be a file URL.') } } - const onEvent = new Channel(); - onEvent.onmessage = cb; + const onEvent = new Channel() + onEvent.onmessage = cb - const rid: number = await invoke("plugin:fs|watch", { + const rid: number = await invoke('plugin:fs|watch', { paths: watchPaths.map((p) => (p instanceof URL ? p.toString() : p)), options: opts, - onEvent, - }); + onEvent + }) return () => { - void unwatch(rid); - }; + void unwatch(rid) + } } export type { @@ -1270,8 +1304,8 @@ export type { WatchEventKindCreate, WatchEventKindModify, WatchEventKindRemove, - UnwatchFn, -}; + UnwatchFn +} export { BaseDirectory, @@ -1294,5 +1328,5 @@ export { writeTextFile, exists, watch, - watchImmediate, -}; + watchImmediate +} diff --git a/plugins/fs/package.json b/plugins/fs/package.json index 1dc2a0da..0bce5c6c 100644 --- a/plugins/fs/package.json +++ b/plugins/fs/package.json @@ -1,11 +1,12 @@ { "name": "@tauri-apps/plugin-fs", - "version": "2.0.0-beta.1", + "version": "2.0.1", "description": "Access the file system.", - "license": "MIT or APACHE-2.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -24,6 +25,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/fs/permissions/app.toml b/plugins/fs/permissions/app.toml new file mode 100644 index 00000000..aeb0521b --- /dev/null +++ b/plugins/fs/permissions/app.toml @@ -0,0 +1,114 @@ +"$schema" = "schemas/schema.json" + +# Scopes Section +# This section contains scopes, which define file level access + +[[permission]] +identifier = "scope-app-recursive" +description = "This scope permits recursive access to the complete application folders, including sub directories and files." + +[[permission.scope.allow]] +path = "$APPCONFIG" +[[permission.scope.allow]] +path = "$APPCONFIG/**" + +[[permission.scope.allow]] +path = "$APPDATA" +[[permission.scope.allow]] +path = "$APPDATA/**" + +[[permission.scope.allow]] +path = "$APPLOCALDATA" +[[permission.scope.allow]] +path = "$APPLOCALDATA/**" + +[[permission.scope.allow]] +path = "$APPCACHE" +[[permission.scope.allow]] +path = "$APPCACHE/**" + +[[permission.scope.allow]] +path = "$APPLOG" +[[permission.scope.allow]] +path = "$APPLOG/**" + +[[permission]] +identifier = "scope-app" +description = "This scope permits access to all files and list content of top level directories in the application folders." + +[[permission.scope.allow]] +path = "$APPCONFIG" +[[permission.scope.allow]] +path = "$APPCONFIG/*" + +[[permission.scope.allow]] +path = "$APPDATA" +[[permission.scope.allow]] +path = "$APPDATA/*" + +[[permission.scope.allow]] +path = "$APPLOCALDATA" +[[permission.scope.allow]] +path = "$APPLOCALDATA/*" + +[[permission.scope.allow]] +path = "$APPCACHE" +[[permission.scope.allow]] +path = "$APPCACHE/*" + +[[permission.scope.allow]] +path = "$APPLOG" +[[permission.scope.allow]] +path = "$APPLOG/*" + +[[permission]] +identifier = "scope-app-index" +description = "This scope permits to list all files and folders in the application directories." + +[[permission.scope.allow]] +path = "$APPCONFIG" + +[[permission.scope.allow]] +path = "$APPDATA" + +[[permission.scope.allow]] +path = "$APPLOCALDATA" + +[[permission.scope.allow]] +path = "$APPCACHE" + +[[permission.scope.allow]] +path = "$APPLOG" + +# Sets Section +# This section combines the scope elements with enablement of commands + +[[set]] +identifier = "allow-app-read-recursive" +description = "This allows full recursive read access to the complete application folders, files and subdirectories." +permissions = ["read-all", "scope-app-recursive"] + +[[set]] +identifier = "allow-app-write-recursive" +description = "This allows full recursive write access to the complete application folders, files and subdirectories." +permissions = ["write-all", "scope-app-recursive"] + +[[set]] +identifier = "allow-app-read" +description = "This allows non-recursive read access to the application folders." +permissions = ["read-all", "scope-app"] + +[[set]] +identifier = "allow-app-write" +description = "This allows non-recursive write access to the application folders." +permissions = ["write-all", "scope-app"] + +[[set]] +identifier = "allow-app-meta-recursive" +description = "This allows full recursive read access to metadata of the application folders, including file listing and statistics." +permissions = ["read-meta", "scope-app-recursive"] + +[[set]] +identifier = "allow-app-meta" +description = "This allows non-recursive read access to metadata of the application folders, including file listing and statistics." +permissions = ["read-meta", "scope-app-index"] diff --git a/plugins/fs/permissions/autogenerated/base-directories/app.toml b/plugins/fs/permissions/autogenerated/base-directories/app.toml deleted file mode 100644 index 37eaadcf..00000000 --- a/plugins/fs/permissions/autogenerated/base-directories/app.toml +++ /dev/null @@ -1,78 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -# Scopes Section -# This section contains scopes, which define file level access - -[[permission]] -identifier = "scope-app-recursive" -description = "This scope recursive access to the complete `$APP` folder, including sub directories and files." - -[[permission.scope.allow]] -path = "$APP/**" - -[[permission]] -identifier = "scope-app" -description = "This scope permits access to all files and list content of top level directories in the `$APP`folder." - -[[permission.scope.allow]] -path = "$APP/*" - -[[permission]] -identifier = "scope-app-index" -description = "This scope permits to list all files and folders in the `$APP`folder." - -[[permission.scope.allow]] -path = "$APP/" - -# Sets Section -# This section combines the scope elements with enablement of commands - -[[set]] -identifier = "allow-app-read-recursive" -description = "This allows full recursive read access to the complete `$APP` folder, files and subdirectories." -permissions = [ - "read-all", - "scope-app-recursive" -] - -[[set]] -identifier = "allow-app-write-recursive" -description = "This allows full recusrive write access to the complete `$APP` folder, files and subdirectories." -permissions = [ - "write-all", - "scope-app-recursive" -] - -[[set]] -identifier = "allow-app-read" -description = "This allows non-recursive read access to the `$APP` folder." -permissions = [ - "read-all", - "scope-app" -] - -[[set]] -identifier = "allow-app-write" -description = "This allows non-recursive write access to the `$APP` folder." -permissions = [ - "write-all", - "scope-app" -] - -[[set]] -identifier = "allow-app-meta-recursive" -description = "This allows read access to metadata of the `$APP` folder, including file listing and statistics." -permissions = [ - "read-meta", - "scope-app-recursive" -] - -[[set]] -identifier = "allow-app-meta" -description = "This allows read access to metadata of the `$APP` folder, including file listing and statistics." -permissions = [ - "read-meta", - "scope-app-index" -] \ No newline at end of file diff --git a/plugins/fs/permissions/autogenerated/base-directories/appcache.toml b/plugins/fs/permissions/autogenerated/base-directories/appcache.toml index 4deca0ff..50e19efc 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/appcache.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/appcache.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-appcache-recursive" -description = "This scope recursive access to the complete `$APPCACHE` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$APPCACHE" [[permission.scope.allow]] path = "$APPCACHE/**" [[permission]] identifier = "scope-appcache" -description = "This scope permits access to all files and list content of top level directories in the `$APPCACHE`folder." +description = "This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder." +[[permission.scope.allow]] +path = "$APPCACHE" [[permission.scope.allow]] path = "$APPCACHE/*" @@ -24,7 +28,7 @@ identifier = "scope-appcache-index" description = "This scope permits to list all files and folders in the `$APPCACHE`folder." [[permission.scope.allow]] -path = "$APPCACHE/" +path = "$APPCACHE" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-appcache-write-recursive" -description = "This allows full recusrive write access to the complete `$APPCACHE` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories." permissions = [ "write-all", "scope-appcache-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-appcache-meta-recursive" -description = "This allows read access to metadata of the `$APPCACHE` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics." permissions = [ "read-meta", "scope-appcache-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-appcache-meta" -description = "This allows read access to metadata of the `$APPCACHE` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics." permissions = [ "read-meta", "scope-appcache-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/appconfig.toml b/plugins/fs/permissions/autogenerated/base-directories/appconfig.toml index e87229a7..ab136956 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/appconfig.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/appconfig.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-appconfig-recursive" -description = "This scope recursive access to the complete `$APPCONFIG` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$APPCONFIG" [[permission.scope.allow]] path = "$APPCONFIG/**" [[permission]] identifier = "scope-appconfig" -description = "This scope permits access to all files and list content of top level directories in the `$APPCONFIG`folder." +description = "This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder." +[[permission.scope.allow]] +path = "$APPCONFIG" [[permission.scope.allow]] path = "$APPCONFIG/*" @@ -24,7 +28,7 @@ identifier = "scope-appconfig-index" description = "This scope permits to list all files and folders in the `$APPCONFIG`folder." [[permission.scope.allow]] -path = "$APPCONFIG/" +path = "$APPCONFIG" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-appconfig-write-recursive" -description = "This allows full recusrive write access to the complete `$APPCONFIG` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories." permissions = [ "write-all", "scope-appconfig-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-appconfig-meta-recursive" -description = "This allows read access to metadata of the `$APPCONFIG` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics." permissions = [ "read-meta", "scope-appconfig-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-appconfig-meta" -description = "This allows read access to metadata of the `$APPCONFIG` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics." permissions = [ "read-meta", "scope-appconfig-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/appdata.toml b/plugins/fs/permissions/autogenerated/base-directories/appdata.toml index fc080b3a..1b0931e2 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/appdata.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/appdata.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-appdata-recursive" -description = "This scope recursive access to the complete `$APPDATA` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$APPDATA" [[permission.scope.allow]] path = "$APPDATA/**" [[permission]] identifier = "scope-appdata" -description = "This scope permits access to all files and list content of top level directories in the `$APPDATA`folder." +description = "This scope permits access to all files and list content of top level directories in the `$APPDATA` folder." +[[permission.scope.allow]] +path = "$APPDATA" [[permission.scope.allow]] path = "$APPDATA/*" @@ -24,7 +28,7 @@ identifier = "scope-appdata-index" description = "This scope permits to list all files and folders in the `$APPDATA`folder." [[permission.scope.allow]] -path = "$APPDATA/" +path = "$APPDATA" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-appdata-write-recursive" -description = "This allows full recusrive write access to the complete `$APPDATA` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories." permissions = [ "write-all", "scope-appdata-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-appdata-meta-recursive" -description = "This allows read access to metadata of the `$APPDATA` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics." permissions = [ "read-meta", "scope-appdata-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-appdata-meta" -description = "This allows read access to metadata of the `$APPDATA` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics." permissions = [ "read-meta", "scope-appdata-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/applocaldata.toml b/plugins/fs/permissions/autogenerated/base-directories/applocaldata.toml index f72202a2..a6e38a31 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/applocaldata.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/applocaldata.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-applocaldata-recursive" -description = "This scope recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$APPLOCALDATA" [[permission.scope.allow]] path = "$APPLOCALDATA/**" [[permission]] identifier = "scope-applocaldata" -description = "This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA`folder." +description = "This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder." +[[permission.scope.allow]] +path = "$APPLOCALDATA" [[permission.scope.allow]] path = "$APPLOCALDATA/*" @@ -24,7 +28,7 @@ identifier = "scope-applocaldata-index" description = "This scope permits to list all files and folders in the `$APPLOCALDATA`folder." [[permission.scope.allow]] -path = "$APPLOCALDATA/" +path = "$APPLOCALDATA" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-applocaldata-write-recursive" -description = "This allows full recusrive write access to the complete `$APPLOCALDATA` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories." permissions = [ "write-all", "scope-applocaldata-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-applocaldata-meta-recursive" -description = "This allows read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics." permissions = [ "read-meta", "scope-applocaldata-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-applocaldata-meta" -description = "This allows read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics." permissions = [ "read-meta", "scope-applocaldata-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/applog.toml b/plugins/fs/permissions/autogenerated/base-directories/applog.toml index e345bef8..a979ce76 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/applog.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/applog.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-applog-recursive" -description = "This scope recursive access to the complete `$APPLOG` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$APPLOG" [[permission.scope.allow]] path = "$APPLOG/**" [[permission]] identifier = "scope-applog" -description = "This scope permits access to all files and list content of top level directories in the `$APPLOG`folder." +description = "This scope permits access to all files and list content of top level directories in the `$APPLOG` folder." +[[permission.scope.allow]] +path = "$APPLOG" [[permission.scope.allow]] path = "$APPLOG/*" @@ -24,7 +28,7 @@ identifier = "scope-applog-index" description = "This scope permits to list all files and folders in the `$APPLOG`folder." [[permission.scope.allow]] -path = "$APPLOG/" +path = "$APPLOG" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-applog-write-recursive" -description = "This allows full recusrive write access to the complete `$APPLOG` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories." permissions = [ "write-all", "scope-applog-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-applog-meta-recursive" -description = "This allows read access to metadata of the `$APPLOG` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics." permissions = [ "read-meta", "scope-applog-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-applog-meta" -description = "This allows read access to metadata of the `$APPLOG` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics." permissions = [ "read-meta", "scope-applog-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/audio.toml b/plugins/fs/permissions/autogenerated/base-directories/audio.toml index adb15d93..d66d68a2 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/audio.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/audio.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-audio-recursive" -description = "This scope recursive access to the complete `$AUDIO` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$AUDIO" [[permission.scope.allow]] path = "$AUDIO/**" [[permission]] identifier = "scope-audio" -description = "This scope permits access to all files and list content of top level directories in the `$AUDIO`folder." +description = "This scope permits access to all files and list content of top level directories in the `$AUDIO` folder." +[[permission.scope.allow]] +path = "$AUDIO" [[permission.scope.allow]] path = "$AUDIO/*" @@ -24,7 +28,7 @@ identifier = "scope-audio-index" description = "This scope permits to list all files and folders in the `$AUDIO`folder." [[permission.scope.allow]] -path = "$AUDIO/" +path = "$AUDIO" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-audio-write-recursive" -description = "This allows full recusrive write access to the complete `$AUDIO` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories." permissions = [ "write-all", "scope-audio-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-audio-meta-recursive" -description = "This allows read access to metadata of the `$AUDIO` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics." permissions = [ "read-meta", "scope-audio-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-audio-meta" -description = "This allows read access to metadata of the `$AUDIO` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics." permissions = [ "read-meta", "scope-audio-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/cache.toml b/plugins/fs/permissions/autogenerated/base-directories/cache.toml index b9831a77..814319eb 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/cache.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/cache.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-cache-recursive" -description = "This scope recursive access to the complete `$CACHE` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$CACHE" [[permission.scope.allow]] path = "$CACHE/**" [[permission]] identifier = "scope-cache" -description = "This scope permits access to all files and list content of top level directories in the `$CACHE`folder." +description = "This scope permits access to all files and list content of top level directories in the `$CACHE` folder." +[[permission.scope.allow]] +path = "$CACHE" [[permission.scope.allow]] path = "$CACHE/*" @@ -24,7 +28,7 @@ identifier = "scope-cache-index" description = "This scope permits to list all files and folders in the `$CACHE`folder." [[permission.scope.allow]] -path = "$CACHE/" +path = "$CACHE" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-cache-write-recursive" -description = "This allows full recusrive write access to the complete `$CACHE` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories." permissions = [ "write-all", "scope-cache-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-cache-meta-recursive" -description = "This allows read access to metadata of the `$CACHE` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$CACHE` folder, including file listing and statistics." permissions = [ "read-meta", "scope-cache-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-cache-meta" -description = "This allows read access to metadata of the `$CACHE` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$CACHE` folder, including file listing and statistics." permissions = [ "read-meta", "scope-cache-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/config.toml b/plugins/fs/permissions/autogenerated/base-directories/config.toml index 6ad6d4b1..59221045 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/config.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/config.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-config-recursive" -description = "This scope recursive access to the complete `$CONFIG` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$CONFIG" [[permission.scope.allow]] path = "$CONFIG/**" [[permission]] identifier = "scope-config" -description = "This scope permits access to all files and list content of top level directories in the `$CONFIG`folder." +description = "This scope permits access to all files and list content of top level directories in the `$CONFIG` folder." +[[permission.scope.allow]] +path = "$CONFIG" [[permission.scope.allow]] path = "$CONFIG/*" @@ -24,7 +28,7 @@ identifier = "scope-config-index" description = "This scope permits to list all files and folders in the `$CONFIG`folder." [[permission.scope.allow]] -path = "$CONFIG/" +path = "$CONFIG" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-config-write-recursive" -description = "This allows full recusrive write access to the complete `$CONFIG` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories." permissions = [ "write-all", "scope-config-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-config-meta-recursive" -description = "This allows read access to metadata of the `$CONFIG` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics." permissions = [ "read-meta", "scope-config-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-config-meta" -description = "This allows read access to metadata of the `$CONFIG` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics." permissions = [ "read-meta", "scope-config-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/data.toml b/plugins/fs/permissions/autogenerated/base-directories/data.toml index d30423dd..a8428ca1 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/data.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/data.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-data-recursive" -description = "This scope recursive access to the complete `$DATA` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$DATA` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$DATA" [[permission.scope.allow]] path = "$DATA/**" [[permission]] identifier = "scope-data" -description = "This scope permits access to all files and list content of top level directories in the `$DATA`folder." +description = "This scope permits access to all files and list content of top level directories in the `$DATA` folder." +[[permission.scope.allow]] +path = "$DATA" [[permission.scope.allow]] path = "$DATA/*" @@ -24,7 +28,7 @@ identifier = "scope-data-index" description = "This scope permits to list all files and folders in the `$DATA`folder." [[permission.scope.allow]] -path = "$DATA/" +path = "$DATA" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-data-write-recursive" -description = "This allows full recusrive write access to the complete `$DATA` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$DATA` folder, files and subdirectories." permissions = [ "write-all", "scope-data-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-data-meta-recursive" -description = "This allows read access to metadata of the `$DATA` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$DATA` folder, including file listing and statistics." permissions = [ "read-meta", "scope-data-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-data-meta" -description = "This allows read access to metadata of the `$DATA` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$DATA` folder, including file listing and statistics." permissions = [ "read-meta", "scope-data-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/desktop.toml b/plugins/fs/permissions/autogenerated/base-directories/desktop.toml index 4268eb24..da369fa0 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/desktop.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/desktop.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-desktop-recursive" -description = "This scope recursive access to the complete `$DESKTOP` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$DESKTOP" [[permission.scope.allow]] path = "$DESKTOP/**" [[permission]] identifier = "scope-desktop" -description = "This scope permits access to all files and list content of top level directories in the `$DESKTOP`folder." +description = "This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder." +[[permission.scope.allow]] +path = "$DESKTOP" [[permission.scope.allow]] path = "$DESKTOP/*" @@ -24,7 +28,7 @@ identifier = "scope-desktop-index" description = "This scope permits to list all files and folders in the `$DESKTOP`folder." [[permission.scope.allow]] -path = "$DESKTOP/" +path = "$DESKTOP" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-desktop-write-recursive" -description = "This allows full recusrive write access to the complete `$DESKTOP` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories." permissions = [ "write-all", "scope-desktop-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-desktop-meta-recursive" -description = "This allows read access to metadata of the `$DESKTOP` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics." permissions = [ "read-meta", "scope-desktop-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-desktop-meta" -description = "This allows read access to metadata of the `$DESKTOP` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics." permissions = [ "read-meta", "scope-desktop-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/document.toml b/plugins/fs/permissions/autogenerated/base-directories/document.toml index 668286db..9feb4d0d 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/document.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/document.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-document-recursive" -description = "This scope recursive access to the complete `$DOCUMENT` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$DOCUMENT" [[permission.scope.allow]] path = "$DOCUMENT/**" [[permission]] identifier = "scope-document" -description = "This scope permits access to all files and list content of top level directories in the `$DOCUMENT`folder." +description = "This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder." +[[permission.scope.allow]] +path = "$DOCUMENT" [[permission.scope.allow]] path = "$DOCUMENT/*" @@ -24,7 +28,7 @@ identifier = "scope-document-index" description = "This scope permits to list all files and folders in the `$DOCUMENT`folder." [[permission.scope.allow]] -path = "$DOCUMENT/" +path = "$DOCUMENT" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-document-write-recursive" -description = "This allows full recusrive write access to the complete `$DOCUMENT` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories." permissions = [ "write-all", "scope-document-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-document-meta-recursive" -description = "This allows read access to metadata of the `$DOCUMENT` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics." permissions = [ "read-meta", "scope-document-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-document-meta" -description = "This allows read access to metadata of the `$DOCUMENT` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics." permissions = [ "read-meta", "scope-document-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/download.toml b/plugins/fs/permissions/autogenerated/base-directories/download.toml index b9ea94d2..8659e3ac 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/download.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/download.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-download-recursive" -description = "This scope recursive access to the complete `$DOWNLOAD` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$DOWNLOAD" [[permission.scope.allow]] path = "$DOWNLOAD/**" [[permission]] identifier = "scope-download" -description = "This scope permits access to all files and list content of top level directories in the `$DOWNLOAD`folder." +description = "This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder." +[[permission.scope.allow]] +path = "$DOWNLOAD" [[permission.scope.allow]] path = "$DOWNLOAD/*" @@ -24,7 +28,7 @@ identifier = "scope-download-index" description = "This scope permits to list all files and folders in the `$DOWNLOAD`folder." [[permission.scope.allow]] -path = "$DOWNLOAD/" +path = "$DOWNLOAD" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-download-write-recursive" -description = "This allows full recusrive write access to the complete `$DOWNLOAD` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories." permissions = [ "write-all", "scope-download-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-download-meta-recursive" -description = "This allows read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics." permissions = [ "read-meta", "scope-download-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-download-meta" -description = "This allows read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics." permissions = [ "read-meta", "scope-download-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/exe.toml b/plugins/fs/permissions/autogenerated/base-directories/exe.toml index 74da907a..94950e84 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/exe.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/exe.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-exe-recursive" -description = "This scope recursive access to the complete `$EXE` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$EXE` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$EXE" [[permission.scope.allow]] path = "$EXE/**" [[permission]] identifier = "scope-exe" -description = "This scope permits access to all files and list content of top level directories in the `$EXE`folder." +description = "This scope permits access to all files and list content of top level directories in the `$EXE` folder." +[[permission.scope.allow]] +path = "$EXE" [[permission.scope.allow]] path = "$EXE/*" @@ -24,7 +28,7 @@ identifier = "scope-exe-index" description = "This scope permits to list all files and folders in the `$EXE`folder." [[permission.scope.allow]] -path = "$EXE/" +path = "$EXE" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-exe-write-recursive" -description = "This allows full recusrive write access to the complete `$EXE` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$EXE` folder, files and subdirectories." permissions = [ "write-all", "scope-exe-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-exe-meta-recursive" -description = "This allows read access to metadata of the `$EXE` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$EXE` folder, including file listing and statistics." permissions = [ "read-meta", "scope-exe-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-exe-meta" -description = "This allows read access to metadata of the `$EXE` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$EXE` folder, including file listing and statistics." permissions = [ "read-meta", "scope-exe-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/font.toml b/plugins/fs/permissions/autogenerated/base-directories/font.toml index 13cfcc37..21840046 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/font.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/font.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-font-recursive" -description = "This scope recursive access to the complete `$FONT` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$FONT` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$FONT" [[permission.scope.allow]] path = "$FONT/**" [[permission]] identifier = "scope-font" -description = "This scope permits access to all files and list content of top level directories in the `$FONT`folder." +description = "This scope permits access to all files and list content of top level directories in the `$FONT` folder." +[[permission.scope.allow]] +path = "$FONT" [[permission.scope.allow]] path = "$FONT/*" @@ -24,7 +28,7 @@ identifier = "scope-font-index" description = "This scope permits to list all files and folders in the `$FONT`folder." [[permission.scope.allow]] -path = "$FONT/" +path = "$FONT" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-font-write-recursive" -description = "This allows full recusrive write access to the complete `$FONT` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$FONT` folder, files and subdirectories." permissions = [ "write-all", "scope-font-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-font-meta-recursive" -description = "This allows read access to metadata of the `$FONT` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$FONT` folder, including file listing and statistics." permissions = [ "read-meta", "scope-font-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-font-meta" -description = "This allows read access to metadata of the `$FONT` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$FONT` folder, including file listing and statistics." permissions = [ "read-meta", "scope-font-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/home.toml b/plugins/fs/permissions/autogenerated/base-directories/home.toml index a48d5d76..cbf48e2f 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/home.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/home.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-home-recursive" -description = "This scope recursive access to the complete `$HOME` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$HOME` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$HOME" [[permission.scope.allow]] path = "$HOME/**" [[permission]] identifier = "scope-home" -description = "This scope permits access to all files and list content of top level directories in the `$HOME`folder." +description = "This scope permits access to all files and list content of top level directories in the `$HOME` folder." +[[permission.scope.allow]] +path = "$HOME" [[permission.scope.allow]] path = "$HOME/*" @@ -24,7 +28,7 @@ identifier = "scope-home-index" description = "This scope permits to list all files and folders in the `$HOME`folder." [[permission.scope.allow]] -path = "$HOME/" +path = "$HOME" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-home-write-recursive" -description = "This allows full recusrive write access to the complete `$HOME` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$HOME` folder, files and subdirectories." permissions = [ "write-all", "scope-home-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-home-meta-recursive" -description = "This allows read access to metadata of the `$HOME` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$HOME` folder, including file listing and statistics." permissions = [ "read-meta", "scope-home-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-home-meta" -description = "This allows read access to metadata of the `$HOME` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$HOME` folder, including file listing and statistics." permissions = [ "read-meta", "scope-home-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/localdata.toml b/plugins/fs/permissions/autogenerated/base-directories/localdata.toml index 6d0633cf..90a8f48b 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/localdata.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/localdata.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-localdata-recursive" -description = "This scope recursive access to the complete `$LOCALDATA` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$LOCALDATA" [[permission.scope.allow]] path = "$LOCALDATA/**" [[permission]] identifier = "scope-localdata" -description = "This scope permits access to all files and list content of top level directories in the `$LOCALDATA`folder." +description = "This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder." +[[permission.scope.allow]] +path = "$LOCALDATA" [[permission.scope.allow]] path = "$LOCALDATA/*" @@ -24,7 +28,7 @@ identifier = "scope-localdata-index" description = "This scope permits to list all files and folders in the `$LOCALDATA`folder." [[permission.scope.allow]] -path = "$LOCALDATA/" +path = "$LOCALDATA" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-localdata-write-recursive" -description = "This allows full recusrive write access to the complete `$LOCALDATA` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories." permissions = [ "write-all", "scope-localdata-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-localdata-meta-recursive" -description = "This allows read access to metadata of the `$LOCALDATA` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics." permissions = [ "read-meta", "scope-localdata-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-localdata-meta" -description = "This allows read access to metadata of the `$LOCALDATA` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics." permissions = [ "read-meta", "scope-localdata-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/log.toml b/plugins/fs/permissions/autogenerated/base-directories/log.toml index 81d476e6..d505a3ce 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/log.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/log.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-log-recursive" -description = "This scope recursive access to the complete `$LOG` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$LOG` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$LOG" [[permission.scope.allow]] path = "$LOG/**" [[permission]] identifier = "scope-log" -description = "This scope permits access to all files and list content of top level directories in the `$LOG`folder." +description = "This scope permits access to all files and list content of top level directories in the `$LOG` folder." +[[permission.scope.allow]] +path = "$LOG" [[permission.scope.allow]] path = "$LOG/*" @@ -24,7 +28,7 @@ identifier = "scope-log-index" description = "This scope permits to list all files and folders in the `$LOG`folder." [[permission.scope.allow]] -path = "$LOG/" +path = "$LOG" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-log-write-recursive" -description = "This allows full recusrive write access to the complete `$LOG` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$LOG` folder, files and subdirectories." permissions = [ "write-all", "scope-log-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-log-meta-recursive" -description = "This allows read access to metadata of the `$LOG` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$LOG` folder, including file listing and statistics." permissions = [ "read-meta", "scope-log-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-log-meta" -description = "This allows read access to metadata of the `$LOG` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$LOG` folder, including file listing and statistics." permissions = [ "read-meta", "scope-log-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/picture.toml b/plugins/fs/permissions/autogenerated/base-directories/picture.toml index 5b6c361c..6a760909 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/picture.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/picture.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-picture-recursive" -description = "This scope recursive access to the complete `$PICTURE` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$PICTURE" [[permission.scope.allow]] path = "$PICTURE/**" [[permission]] identifier = "scope-picture" -description = "This scope permits access to all files and list content of top level directories in the `$PICTURE`folder." +description = "This scope permits access to all files and list content of top level directories in the `$PICTURE` folder." +[[permission.scope.allow]] +path = "$PICTURE" [[permission.scope.allow]] path = "$PICTURE/*" @@ -24,7 +28,7 @@ identifier = "scope-picture-index" description = "This scope permits to list all files and folders in the `$PICTURE`folder." [[permission.scope.allow]] -path = "$PICTURE/" +path = "$PICTURE" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-picture-write-recursive" -description = "This allows full recusrive write access to the complete `$PICTURE` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories." permissions = [ "write-all", "scope-picture-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-picture-meta-recursive" -description = "This allows read access to metadata of the `$PICTURE` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics." permissions = [ "read-meta", "scope-picture-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-picture-meta" -description = "This allows read access to metadata of the `$PICTURE` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics." permissions = [ "read-meta", "scope-picture-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/public.toml b/plugins/fs/permissions/autogenerated/base-directories/public.toml index 56e65f94..2e39abb4 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/public.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/public.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-public-recursive" -description = "This scope recursive access to the complete `$PUBLIC` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$PUBLIC" [[permission.scope.allow]] path = "$PUBLIC/**" [[permission]] identifier = "scope-public" -description = "This scope permits access to all files and list content of top level directories in the `$PUBLIC`folder." +description = "This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder." +[[permission.scope.allow]] +path = "$PUBLIC" [[permission.scope.allow]] path = "$PUBLIC/*" @@ -24,7 +28,7 @@ identifier = "scope-public-index" description = "This scope permits to list all files and folders in the `$PUBLIC`folder." [[permission.scope.allow]] -path = "$PUBLIC/" +path = "$PUBLIC" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-public-write-recursive" -description = "This allows full recusrive write access to the complete `$PUBLIC` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories." permissions = [ "write-all", "scope-public-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-public-meta-recursive" -description = "This allows read access to metadata of the `$PUBLIC` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics." permissions = [ "read-meta", "scope-public-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-public-meta" -description = "This allows read access to metadata of the `$PUBLIC` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics." permissions = [ "read-meta", "scope-public-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/resource.toml b/plugins/fs/permissions/autogenerated/base-directories/resource.toml index 05dd1a5e..53dfeb07 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/resource.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/resource.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-resource-recursive" -description = "This scope recursive access to the complete `$RESOURCE` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$RESOURCE" [[permission.scope.allow]] path = "$RESOURCE/**" [[permission]] identifier = "scope-resource" -description = "This scope permits access to all files and list content of top level directories in the `$RESOURCE`folder." +description = "This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder." +[[permission.scope.allow]] +path = "$RESOURCE" [[permission.scope.allow]] path = "$RESOURCE/*" @@ -24,7 +28,7 @@ identifier = "scope-resource-index" description = "This scope permits to list all files and folders in the `$RESOURCE`folder." [[permission.scope.allow]] -path = "$RESOURCE/" +path = "$RESOURCE" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-resource-write-recursive" -description = "This allows full recusrive write access to the complete `$RESOURCE` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories." permissions = [ "write-all", "scope-resource-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-resource-meta-recursive" -description = "This allows read access to metadata of the `$RESOURCE` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics." permissions = [ "read-meta", "scope-resource-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-resource-meta" -description = "This allows read access to metadata of the `$RESOURCE` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics." permissions = [ "read-meta", "scope-resource-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/runtime.toml b/plugins/fs/permissions/autogenerated/base-directories/runtime.toml index 50569412..8dcc2a03 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/runtime.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/runtime.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-runtime-recursive" -description = "This scope recursive access to the complete `$RUNTIME` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$RUNTIME" [[permission.scope.allow]] path = "$RUNTIME/**" [[permission]] identifier = "scope-runtime" -description = "This scope permits access to all files and list content of top level directories in the `$RUNTIME`folder." +description = "This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder." +[[permission.scope.allow]] +path = "$RUNTIME" [[permission.scope.allow]] path = "$RUNTIME/*" @@ -24,7 +28,7 @@ identifier = "scope-runtime-index" description = "This scope permits to list all files and folders in the `$RUNTIME`folder." [[permission.scope.allow]] -path = "$RUNTIME/" +path = "$RUNTIME" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-runtime-write-recursive" -description = "This allows full recusrive write access to the complete `$RUNTIME` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories." permissions = [ "write-all", "scope-runtime-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-runtime-meta-recursive" -description = "This allows read access to metadata of the `$RUNTIME` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics." permissions = [ "read-meta", "scope-runtime-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-runtime-meta" -description = "This allows read access to metadata of the `$RUNTIME` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics." permissions = [ "read-meta", "scope-runtime-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/temp.toml b/plugins/fs/permissions/autogenerated/base-directories/temp.toml index 9e359e95..c08e1da2 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/temp.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/temp.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-temp-recursive" -description = "This scope recursive access to the complete `$TEMP` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$TEMP" [[permission.scope.allow]] path = "$TEMP/**" [[permission]] identifier = "scope-temp" -description = "This scope permits access to all files and list content of top level directories in the `$TEMP`folder." +description = "This scope permits access to all files and list content of top level directories in the `$TEMP` folder." +[[permission.scope.allow]] +path = "$TEMP" [[permission.scope.allow]] path = "$TEMP/*" @@ -24,7 +28,7 @@ identifier = "scope-temp-index" description = "This scope permits to list all files and folders in the `$TEMP`folder." [[permission.scope.allow]] -path = "$TEMP/" +path = "$TEMP" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-temp-write-recursive" -description = "This allows full recusrive write access to the complete `$TEMP` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories." permissions = [ "write-all", "scope-temp-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-temp-meta-recursive" -description = "This allows read access to metadata of the `$TEMP` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$TEMP` folder, including file listing and statistics." permissions = [ "read-meta", "scope-temp-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-temp-meta" -description = "This allows read access to metadata of the `$TEMP` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$TEMP` folder, including file listing and statistics." permissions = [ "read-meta", "scope-temp-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/template.toml b/plugins/fs/permissions/autogenerated/base-directories/template.toml index 73e6262f..ce39f773 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/template.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/template.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-template-recursive" -description = "This scope recursive access to the complete `$TEMPLATE` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$TEMPLATE" [[permission.scope.allow]] path = "$TEMPLATE/**" [[permission]] identifier = "scope-template" -description = "This scope permits access to all files and list content of top level directories in the `$TEMPLATE`folder." +description = "This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder." +[[permission.scope.allow]] +path = "$TEMPLATE" [[permission.scope.allow]] path = "$TEMPLATE/*" @@ -24,7 +28,7 @@ identifier = "scope-template-index" description = "This scope permits to list all files and folders in the `$TEMPLATE`folder." [[permission.scope.allow]] -path = "$TEMPLATE/" +path = "$TEMPLATE" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-template-write-recursive" -description = "This allows full recusrive write access to the complete `$TEMPLATE` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories." permissions = [ "write-all", "scope-template-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-template-meta-recursive" -description = "This allows read access to metadata of the `$TEMPLATE` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics." permissions = [ "read-meta", "scope-template-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-template-meta" -description = "This allows read access to metadata of the `$TEMPLATE` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics." permissions = [ "read-meta", "scope-template-index" diff --git a/plugins/fs/permissions/autogenerated/base-directories/video.toml b/plugins/fs/permissions/autogenerated/base-directories/video.toml index 2b73c825..df41abdc 100644 --- a/plugins/fs/permissions/autogenerated/base-directories/video.toml +++ b/plugins/fs/permissions/autogenerated/base-directories/video.toml @@ -7,15 +7,19 @@ [[permission]] identifier = "scope-video-recursive" -description = "This scope recursive access to the complete `$VIDEO` folder, including sub directories and files." +description = "This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files." +[[permission.scope.allow]] +path = "$VIDEO" [[permission.scope.allow]] path = "$VIDEO/**" [[permission]] identifier = "scope-video" -description = "This scope permits access to all files and list content of top level directories in the `$VIDEO`folder." +description = "This scope permits access to all files and list content of top level directories in the `$VIDEO` folder." +[[permission.scope.allow]] +path = "$VIDEO" [[permission.scope.allow]] path = "$VIDEO/*" @@ -24,7 +28,7 @@ identifier = "scope-video-index" description = "This scope permits to list all files and folders in the `$VIDEO`folder." [[permission.scope.allow]] -path = "$VIDEO/" +path = "$VIDEO" # Sets Section # This section combines the scope elements with enablement of commands @@ -39,7 +43,7 @@ permissions = [ [[set]] identifier = "allow-video-write-recursive" -description = "This allows full recusrive write access to the complete `$VIDEO` folder, files and subdirectories." +description = "This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories." permissions = [ "write-all", "scope-video-recursive" @@ -63,7 +67,7 @@ permissions = [ [[set]] identifier = "allow-video-meta-recursive" -description = "This allows read access to metadata of the `$VIDEO` folder, including file listing and statistics." +description = "This allows full recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics." permissions = [ "read-meta", "scope-video-recursive" @@ -71,7 +75,7 @@ permissions = [ [[set]] identifier = "allow-video-meta" -description = "This allows read access to metadata of the `$VIDEO` folder, including file listing and statistics." +description = "This allows non-recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics." permissions = [ "read-meta", "scope-video-index" diff --git a/plugins/fs/permissions/autogenerated/reference.md b/plugins/fs/permissions/autogenerated/reference.md index 6e1d78d8..79ec2f55 100644 --- a/plugins/fs/permissions/autogenerated/reference.md +++ b/plugins/fs/permissions/autogenerated/reference.md @@ -1,1164 +1,3753 @@ -# Permissions +## Default Permission -## allow-app-read-recursive +This set of permissions describes the what kind of +file system access the `fs` plugin has enabled or denied by default. -This allows full recursive read access to the complete `$APP` folder, files and subdirectories. +#### Granted Permissions -## allow-app-write-recursive +This default permission set enables read access to the +application specific directories (AppConfig, AppData, AppLocalData, AppCache, +AppLog) and all files and sub directories created in it. +The location of these directories depends on the operating system, +where the application is run. + +In general these directories need to be manually created +by the application at runtime, before accessing files or folders +in it is possible. + +Therefore, it is also allowed to create all of these folders via +the `mkdir` command. + +#### Denied Permissions + +This default permission set prevents access to critical components +of the Tauri application by default. +On Windows the webview data folder access is denied. + + + +- `create-app-specific-dirs` +- `read-app-specific-dirs-recursive` +- `deny-default` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -This allows non-recursive read access to the `$APP` folder. + + + + -## allow-app-meta + + + + -This scope permits access to all files and list content of top level directories in the `$APP`folder. + + + + -## allow-appcache-write-recursive + + + + -This allows non-recursive write access to the `$APPCACHE` folder. + + + + -## scope-appcache-recursive + + + + -This scope permits to list all files and folders in the `$APPCACHE`folder. + + + + -## allow-appconfig-read + + + + -This allows read access to metadata of the `$APPCONFIG` folder, including file listing and statistics. + + + + -## scope-appconfig + + + + -This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories. + + + + -## allow-appdata-write + + + + -This allows read access to metadata of the `$APPDATA` folder, including file listing and statistics. + + + + -## scope-appdata-index + + + + -This allows full recusrive write access to the complete `$APPLOCALDATA` folder, files and subdirectories. + + + + -## allow-applocaldata-meta-recursive + + + + -This scope recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files. + + + + -## allow-applog-read-recursive + + + + -This allows non-recursive read access to the `$APPLOG` folder. + + + + -## allow-applog-meta + + + + -This scope permits access to all files and list content of top level directories in the `$APPLOG`folder. + + + + -## allow-audio-write-recursive + + + + -This allows non-recursive write access to the `$AUDIO` folder. + + + + -## scope-audio-recursive + + + + -This scope permits to list all files and folders in the `$AUDIO`folder. + + + + -## allow-cache-read + + + + -This allows read access to metadata of the `$CACHE` folder, including file listing and statistics. + + + + -## scope-cache + + + + -This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories. + + + + -## allow-config-write + + + + -This allows read access to metadata of the `$CONFIG` folder, including file listing and statistics. + + + + -## scope-config-index + + + + -This allows full recusrive write access to the complete `$DATA` folder, files and subdirectories. + + + + -## allow-data-meta-recursive + + + + -This scope recursive access to the complete `$DATA` folder, including sub directories and files. + + + + -## allow-desktop-read-recursive + + + + -This allows non-recursive read access to the `$DESKTOP` folder. + + + + -## allow-desktop-meta + + + + -This scope permits access to all files and list content of top level directories in the `$DESKTOP`folder. + + + + -## allow-document-write-recursive + + + + -This allows non-recursive write access to the `$DOCUMENT` folder. + + + + -## scope-document-recursive + + + + -This scope permits to list all files and folders in the `$DOCUMENT`folder. + + + + -## allow-download-read + + + + -This allows read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics. + + + + -## scope-download + + + + -This allows full recursive read access to the complete `$EXE` folder, files and subdirectories. + + + + -## allow-exe-write + + + + -This allows read access to metadata of the `$EXE` folder, including file listing and statistics. + + + + -## scope-exe-index + + + + -This allows full recusrive write access to the complete `$FONT` folder, files and subdirectories. + + + + -## allow-font-meta-recursive + + + + -This scope recursive access to the complete `$FONT` folder, including sub directories and files. + + + + -## allow-home-read-recursive + + + + -This allows non-recursive read access to the `$HOME` folder. + + + + -## allow-home-meta + + + + -This scope permits access to all files and list content of top level directories in the `$HOME`folder. + + + + -## allow-localdata-write-recursive + + + + -This allows non-recursive write access to the `$LOCALDATA` folder. + + + + -## scope-localdata-recursive + + + + -This scope permits to list all files and folders in the `$LOCALDATA`folder. + + + + -## allow-log-read + + + + -This allows read access to metadata of the `$LOG` folder, including file listing and statistics. + + + + -## scope-log + + + + -This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories. + + + + -## allow-picture-write + + + + -This allows read access to metadata of the `$PICTURE` folder, including file listing and statistics. + + + + -## scope-picture-index + + + + -This allows full recusrive write access to the complete `$PUBLIC` folder, files and subdirectories. + + + + -## allow-public-meta-recursive + + + + -This scope recursive access to the complete `$PUBLIC` folder, including sub directories and files. + + + + -## allow-resource-read-recursive + + + + -This allows non-recursive read access to the `$RESOURCE` folder. + + + + -## allow-resource-meta + + + + -This scope permits access to all files and list content of top level directories in the `$RESOURCE`folder. + + + + -## allow-runtime-write-recursive + + + + -This allows non-recursive write access to the `$RUNTIME` folder. + + + + -## scope-runtime-recursive + + + + -This scope permits to list all files and folders in the `$RUNTIME`folder. + + + + -## allow-temp-read + + + + -This allows read access to metadata of the `$TEMP` folder, including file listing and statistics. + + + + -## scope-temp + + + + -This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories. + + + + -## allow-template-write + + + + -This allows read access to metadata of the `$TEMPLATE` folder, including file listing and statistics. + + + + -## scope-template-index + + + + -This allows full recusrive write access to the complete `$VIDEO` folder, files and subdirectories. + + + + -## allow-video-meta-recursive + + + + -This scope recursive access to the complete `$VIDEO` folder, including sub directories and files. + + + + -## allow-copy-file + + + + -Enables the create command without any pre-configured scope. + + + + -## deny-exists + + + + -Denies the fstat command without any pre-configured scope. + + + + -## allow-lstat + + + + -Enables the mkdir command without any pre-configured scope. + + + + -## deny-open + + + + -Denies the read command without any pre-configured scope. + + + + -## allow-read-file + + + + -Enables the read_text_file command without any pre-configured scope. + + + + -## deny-read-text-file-lines + + + + -Denies the read_text_file_lines_next command without any pre-configured scope. + + + + -## allow-rename + + + + -Enables the seek command without any pre-configured scope. + + + + -## deny-stat + + + + -Denies the truncate command without any pre-configured scope. + + + + -## allow-watch + + + + -Enables the write command without any pre-configured scope. + + + + -## deny-write-file + + + + -Denies the write_text_file command without any pre-configured scope. + + + + -In general the `$APP` folder needs to be manually created -by the application at runtime, before accessing files or folders -in it is possible. + + + + -## deny-default + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`fs:allow-app-read-recursive` + + + +This allows full recursive read access to the complete application folders, files and subdirectories. + +
+ +`fs:allow-app-write-recursive` + + + +This allows full recursive write access to the complete application folders, files and subdirectories. + +
+ +`fs:allow-app-read` + + + +This allows non-recursive read access to the application folders. + +
+ +`fs:allow-app-write` + + + +This allows non-recursive write access to the application folders. + +
+ +`fs:allow-app-meta-recursive` + + + +This allows full recursive read access to metadata of the application folders, including file listing and statistics. + +
+ +`fs:allow-app-meta` + + + +This allows non-recursive read access to metadata of the application folders, including file listing and statistics. + +
+ +`fs:scope-app-recursive` + + + +This scope permits recursive access to the complete application folders, including sub directories and files. + +
+ +`fs:scope-app` + + + +This scope permits access to all files and list content of top level directories in the application folders. + +
+ +`fs:scope-app-index` + + + +This scope permits to list all files and folders in the application directories. + +
+ +`fs:allow-appcache-read-recursive` + + + +This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories. + +
+ +`fs:allow-appcache-write-recursive` + + + +This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories. + +
+ +`fs:allow-appcache-read` + + + +This allows non-recursive read access to the `$APPCACHE` folder. + +
+ +`fs:allow-appcache-write` + + + +This allows non-recursive write access to the `$APPCACHE` folder. + +
+ +`fs:allow-appcache-meta-recursive` + + + +This allows full recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics. + +
+ +`fs:allow-appcache-meta` + + + +This allows non-recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics. + +
+ +`fs:scope-appcache-recursive` + + + +This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files. + +
+ +`fs:scope-appcache` + + + +This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder. + +
+ +`fs:scope-appcache-index` + + + +This scope permits to list all files and folders in the `$APPCACHE`folder. + +
+ +`fs:allow-appconfig-read-recursive` + + + +This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories. + +
+ +`fs:allow-appconfig-write-recursive` + + + +This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories. + +
+ +`fs:allow-appconfig-read` + + + +This allows non-recursive read access to the `$APPCONFIG` folder. + +
+ +`fs:allow-appconfig-write` + + + +This allows non-recursive write access to the `$APPCONFIG` folder. + +
+ +`fs:allow-appconfig-meta-recursive` + + + +This allows full recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics. + +
+ +`fs:allow-appconfig-meta` + + + +This allows non-recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics. + +
+ +`fs:scope-appconfig-recursive` + + + +This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files. + +
+ +`fs:scope-appconfig` + + + +This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder. + +
+ +`fs:scope-appconfig-index` + + + +This scope permits to list all files and folders in the `$APPCONFIG`folder. + +
+ +`fs:allow-appdata-read-recursive` + + + +This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories. + +
+ +`fs:allow-appdata-write-recursive` + + + +This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories. + +
+ +`fs:allow-appdata-read` + + + +This allows non-recursive read access to the `$APPDATA` folder. + +
+ +`fs:allow-appdata-write` + + + +This allows non-recursive write access to the `$APPDATA` folder. + +
+ +`fs:allow-appdata-meta-recursive` + + + +This allows full recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics. + +
+ +`fs:allow-appdata-meta` + + + +This allows non-recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics. + +
+ +`fs:scope-appdata-recursive` + + + +This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files. + +
+ +`fs:scope-appdata` + + + +This scope permits access to all files and list content of top level directories in the `$APPDATA` folder. + +
+ +`fs:scope-appdata-index` + + + +This scope permits to list all files and folders in the `$APPDATA`folder. + +
+ +`fs:allow-applocaldata-read-recursive` + + + +This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories. + +
+ +`fs:allow-applocaldata-write-recursive` + + + +This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories. + +
+ +`fs:allow-applocaldata-read` + + + +This allows non-recursive read access to the `$APPLOCALDATA` folder. + +
+ +`fs:allow-applocaldata-write` + + + +This allows non-recursive write access to the `$APPLOCALDATA` folder. + +
+ +`fs:allow-applocaldata-meta-recursive` + + + +This allows full recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics. + +
+ +`fs:allow-applocaldata-meta` + + + +This allows non-recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics. + +
+ +`fs:scope-applocaldata-recursive` + + + +This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files. + +
+ +`fs:scope-applocaldata` + + + +This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder. + +
+ +`fs:scope-applocaldata-index` + + + +This scope permits to list all files and folders in the `$APPLOCALDATA`folder. + +
+ +`fs:allow-applog-read-recursive` + + + +This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories. + +
+ +`fs:allow-applog-write-recursive` + + + +This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories. + +
+ +`fs:allow-applog-read` + + + +This allows non-recursive read access to the `$APPLOG` folder. + +
+ +`fs:allow-applog-write` + + + +This allows non-recursive write access to the `$APPLOG` folder. + +
+ +`fs:allow-applog-meta-recursive` + + + +This allows full recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics. + +
+ +`fs:allow-applog-meta` + + + +This allows non-recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics. + +
+ +`fs:scope-applog-recursive` + + + +This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files. + +
+ +`fs:scope-applog` + + + +This scope permits access to all files and list content of top level directories in the `$APPLOG` folder. + +
+ +`fs:scope-applog-index` + + + +This scope permits to list all files and folders in the `$APPLOG`folder. + +
+ +`fs:allow-audio-read-recursive` + + + +This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories. + +
+ +`fs:allow-audio-write-recursive` + + + +This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories. + +
+ +`fs:allow-audio-read` + + + +This allows non-recursive read access to the `$AUDIO` folder. + +
+ +`fs:allow-audio-write` + + + +This allows non-recursive write access to the `$AUDIO` folder. + +
+ +`fs:allow-audio-meta-recursive` + + + +This allows full recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics. + +
+ +`fs:allow-audio-meta` + + + +This allows non-recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics. + +
+ +`fs:scope-audio-recursive` + + + +This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files. + +
+ +`fs:scope-audio` + + + +This scope permits access to all files and list content of top level directories in the `$AUDIO` folder. + +
+ +`fs:scope-audio-index` + + + +This scope permits to list all files and folders in the `$AUDIO`folder. + +
+ +`fs:allow-cache-read-recursive` + + + +This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories. + +
+ +`fs:allow-cache-write-recursive` + + + +This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories. + +
+ +`fs:allow-cache-read` + + + +This allows non-recursive read access to the `$CACHE` folder. + +
+ +`fs:allow-cache-write` + + + +This allows non-recursive write access to the `$CACHE` folder. + +
+ +`fs:allow-cache-meta-recursive` + + + +This allows full recursive read access to metadata of the `$CACHE` folder, including file listing and statistics. + +
+ +`fs:allow-cache-meta` + + + +This allows non-recursive read access to metadata of the `$CACHE` folder, including file listing and statistics. + +
+ +`fs:scope-cache-recursive` + + + +This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files. + +
+ +`fs:scope-cache` + + + +This scope permits access to all files and list content of top level directories in the `$CACHE` folder. + +
+ +`fs:scope-cache-index` + + + +This scope permits to list all files and folders in the `$CACHE`folder. + +
+ +`fs:allow-config-read-recursive` + + + +This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories. + +
+ +`fs:allow-config-write-recursive` + + + +This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories. + +
+ +`fs:allow-config-read` + + + +This allows non-recursive read access to the `$CONFIG` folder. + +
+ +`fs:allow-config-write` + + + +This allows non-recursive write access to the `$CONFIG` folder. + +
+ +`fs:allow-config-meta-recursive` + + + +This allows full recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics. + +
+ +`fs:allow-config-meta` + + + +This allows non-recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics. + +
+ +`fs:scope-config-recursive` + + + +This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files. + +
+ +`fs:scope-config` + + + +This scope permits access to all files and list content of top level directories in the `$CONFIG` folder. + +
+ +`fs:scope-config-index` + + + +This scope permits to list all files and folders in the `$CONFIG`folder. + +
+ +`fs:allow-data-read-recursive` + + + +This allows full recursive read access to the complete `$DATA` folder, files and subdirectories. + +
+ +`fs:allow-data-write-recursive` + + + +This allows full recursive write access to the complete `$DATA` folder, files and subdirectories. + +
+ +`fs:allow-data-read` + + + +This allows non-recursive read access to the `$DATA` folder. + +
+ +`fs:allow-data-write` + + + +This allows non-recursive write access to the `$DATA` folder. + +
+ +`fs:allow-data-meta-recursive` + + + +This allows full recursive read access to metadata of the `$DATA` folder, including file listing and statistics. + +
+ +`fs:allow-data-meta` + + + +This allows non-recursive read access to metadata of the `$DATA` folder, including file listing and statistics. + +
+ +`fs:scope-data-recursive` + + + +This scope permits recursive access to the complete `$DATA` folder, including sub directories and files. + +
+ +`fs:scope-data` + + + +This scope permits access to all files and list content of top level directories in the `$DATA` folder. + +
+ +`fs:scope-data-index` + + + +This scope permits to list all files and folders in the `$DATA`folder. + +
+ +`fs:allow-desktop-read-recursive` + + + +This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories. + +
+ +`fs:allow-desktop-write-recursive` + + + +This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories. + +
+ +`fs:allow-desktop-read` + + + +This allows non-recursive read access to the `$DESKTOP` folder. + +
+ +`fs:allow-desktop-write` + + + +This allows non-recursive write access to the `$DESKTOP` folder. + +
+ +`fs:allow-desktop-meta-recursive` + + + +This allows full recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics. + +
+ +`fs:allow-desktop-meta` + + + +This allows non-recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics. + +
+ +`fs:scope-desktop-recursive` + + + +This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files. + +
+ +`fs:scope-desktop` + + + +This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder. + +
+ +`fs:scope-desktop-index` + + + +This scope permits to list all files and folders in the `$DESKTOP`folder. + +
+ +`fs:allow-document-read-recursive` + + + +This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories. + +
+ +`fs:allow-document-write-recursive` + + + +This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories. + +
+ +`fs:allow-document-read` + + + +This allows non-recursive read access to the `$DOCUMENT` folder. + +
+ +`fs:allow-document-write` + + + +This allows non-recursive write access to the `$DOCUMENT` folder. + +
+ +`fs:allow-document-meta-recursive` + + + +This allows full recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics. + +
+ +`fs:allow-document-meta` + + + +This allows non-recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics. + +
+ +`fs:scope-document-recursive` + + + +This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files. + +
+ +`fs:scope-document` + + + +This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder. + +
+ +`fs:scope-document-index` + + + +This scope permits to list all files and folders in the `$DOCUMENT`folder. + +
+ +`fs:allow-download-read-recursive` + + + +This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories. + +
+ +`fs:allow-download-write-recursive` + + + +This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories. + +
+ +`fs:allow-download-read` + + + +This allows non-recursive read access to the `$DOWNLOAD` folder. + +
+ +`fs:allow-download-write` + + + +This allows non-recursive write access to the `$DOWNLOAD` folder. + +
+ +`fs:allow-download-meta-recursive` + + + +This allows full recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics. + +
+ +`fs:allow-download-meta` + + + +This allows non-recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics. + +
+ +`fs:scope-download-recursive` + + + +This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files. + +
+ +`fs:scope-download` + + + +This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder. + +
+ +`fs:scope-download-index` + + + +This scope permits to list all files and folders in the `$DOWNLOAD`folder. + +
+ +`fs:allow-exe-read-recursive` + + + +This allows full recursive read access to the complete `$EXE` folder, files and subdirectories. + +
+ +`fs:allow-exe-write-recursive` + + + +This allows full recursive write access to the complete `$EXE` folder, files and subdirectories. + +
+ +`fs:allow-exe-read` + + + +This allows non-recursive read access to the `$EXE` folder. + +
+ +`fs:allow-exe-write` + + + +This allows non-recursive write access to the `$EXE` folder. + +
+ +`fs:allow-exe-meta-recursive` + + + +This allows full recursive read access to metadata of the `$EXE` folder, including file listing and statistics. + +
+ +`fs:allow-exe-meta` + + + +This allows non-recursive read access to metadata of the `$EXE` folder, including file listing and statistics. + +
+ +`fs:scope-exe-recursive` + + + +This scope permits recursive access to the complete `$EXE` folder, including sub directories and files. + +
+ +`fs:scope-exe` + + + +This scope permits access to all files and list content of top level directories in the `$EXE` folder. + +
+ +`fs:scope-exe-index` + + + +This scope permits to list all files and folders in the `$EXE`folder. + +
+ +`fs:allow-font-read-recursive` + + + +This allows full recursive read access to the complete `$FONT` folder, files and subdirectories. + +
+ +`fs:allow-font-write-recursive` + + + +This allows full recursive write access to the complete `$FONT` folder, files and subdirectories. + +
+ +`fs:allow-font-read` + + + +This allows non-recursive read access to the `$FONT` folder. + +
+ +`fs:allow-font-write` + + + +This allows non-recursive write access to the `$FONT` folder. + +
+ +`fs:allow-font-meta-recursive` + + + +This allows full recursive read access to metadata of the `$FONT` folder, including file listing and statistics. + +
+ +`fs:allow-font-meta` + + + +This allows non-recursive read access to metadata of the `$FONT` folder, including file listing and statistics. + +
+ +`fs:scope-font-recursive` + + + +This scope permits recursive access to the complete `$FONT` folder, including sub directories and files. + +
+ +`fs:scope-font` + + + +This scope permits access to all files and list content of top level directories in the `$FONT` folder. + +
+ +`fs:scope-font-index` + + + +This scope permits to list all files and folders in the `$FONT`folder. + +
+ +`fs:allow-home-read-recursive` + + + +This allows full recursive read access to the complete `$HOME` folder, files and subdirectories. + +
+ +`fs:allow-home-write-recursive` + + + +This allows full recursive write access to the complete `$HOME` folder, files and subdirectories. + +
+ +`fs:allow-home-read` + + + +This allows non-recursive read access to the `$HOME` folder. + +
+ +`fs:allow-home-write` + + + +This allows non-recursive write access to the `$HOME` folder. + +
+ +`fs:allow-home-meta-recursive` + + + +This allows full recursive read access to metadata of the `$HOME` folder, including file listing and statistics. + +
+ +`fs:allow-home-meta` + + + +This allows non-recursive read access to metadata of the `$HOME` folder, including file listing and statistics. + +
-This allows full recusrive write access to the complete `$APP` folder, files and subdirectories. +`fs:scope-home-recursive` + + + +This scope permits recursive access to the complete `$HOME` folder, including sub directories and files. + +
+ +`fs:scope-home` + + + +This scope permits access to all files and list content of top level directories in the `$HOME` folder. + +
+ +`fs:scope-home-index` + + + +This scope permits to list all files and folders in the `$HOME`folder. + +
+ +`fs:allow-localdata-read-recursive` + + + +This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories. + +
+ +`fs:allow-localdata-write-recursive` + + + +This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories. + +
+ +`fs:allow-localdata-read` + + + +This allows non-recursive read access to the `$LOCALDATA` folder. + +
+ +`fs:allow-localdata-write` + + + +This allows non-recursive write access to the `$LOCALDATA` folder. + +
+ +`fs:allow-localdata-meta-recursive` + + + +This allows full recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics. + +
+ +`fs:allow-localdata-meta` + + + +This allows non-recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics. + +
+ +`fs:scope-localdata-recursive` + + + +This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files. + +
+ +`fs:scope-localdata` + + + +This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder. + +
+ +`fs:scope-localdata-index` + + + +This scope permits to list all files and folders in the `$LOCALDATA`folder. + +
+ +`fs:allow-log-read-recursive` + + + +This allows full recursive read access to the complete `$LOG` folder, files and subdirectories. + +
+ +`fs:allow-log-write-recursive` + + + +This allows full recursive write access to the complete `$LOG` folder, files and subdirectories. + +
+ +`fs:allow-log-read` + + + +This allows non-recursive read access to the `$LOG` folder. + +
+ +`fs:allow-log-write` + + + +This allows non-recursive write access to the `$LOG` folder. + +
+ +`fs:allow-log-meta-recursive` + + + +This allows full recursive read access to metadata of the `$LOG` folder, including file listing and statistics. + +
+ +`fs:allow-log-meta` + + + +This allows non-recursive read access to metadata of the `$LOG` folder, including file listing and statistics. + +
+ +`fs:scope-log-recursive` + + + +This scope permits recursive access to the complete `$LOG` folder, including sub directories and files. + +
+ +`fs:scope-log` + + + +This scope permits access to all files and list content of top level directories in the `$LOG` folder. + +
+ +`fs:scope-log-index` + + + +This scope permits to list all files and folders in the `$LOG`folder. + +
+ +`fs:allow-picture-read-recursive` + + + +This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories. + +
+ +`fs:allow-picture-write-recursive` + + + +This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories. + +
+ +`fs:allow-picture-read` + + + +This allows non-recursive read access to the `$PICTURE` folder. -## allow-app-read +
-## allow-app-write +`fs:allow-picture-write` -This allows non-recursive write access to the `$APP` folder. + -## allow-app-meta-recursive +This allows non-recursive write access to the `$PICTURE` folder. -This allows read access to metadata of the `$APP` folder, including file listing and statistics. +
-This allows read access to metadata of the `$APP` folder, including file listing and statistics. +`fs:allow-picture-meta-recursive` -## scope-app-recursive + -This scope recursive access to the complete `$APP` folder, including sub directories and files. +This allows full recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics. -## scope-app +
-## scope-app-index +`fs:allow-picture-meta` -This scope permits to list all files and folders in the `$APP`folder. + -## allow-appcache-read-recursive +This allows non-recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics. -This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories. +
-This allows full recusrive write access to the complete `$APPCACHE` folder, files and subdirectories. +`fs:scope-picture-recursive` -## allow-appcache-read + -This allows non-recursive read access to the `$APPCACHE` folder. +This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files. -## allow-appcache-write +
-## allow-appcache-meta-recursive +`fs:scope-picture` -This allows read access to metadata of the `$APPCACHE` folder, including file listing and statistics. + -## allow-appcache-meta +This scope permits access to all files and list content of top level directories in the `$PICTURE` folder. -This allows read access to metadata of the `$APPCACHE` folder, including file listing and statistics. +
-This scope recursive access to the complete `$APPCACHE` folder, including sub directories and files. +`fs:scope-picture-index` -## scope-appcache + -This scope permits access to all files and list content of top level directories in the `$APPCACHE`folder. +This scope permits to list all files and folders in the `$PICTURE`folder. -## scope-appcache-index +
-## allow-appconfig-read-recursive +`fs:allow-public-read-recursive` -This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories. + -## allow-appconfig-write-recursive +This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories. -This allows full recusrive write access to the complete `$APPCONFIG` folder, files and subdirectories. +
-This allows non-recursive read access to the `$APPCONFIG` folder. +`fs:allow-public-write-recursive` -## allow-appconfig-write + -This allows non-recursive write access to the `$APPCONFIG` folder. +This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories. -## allow-appconfig-meta-recursive +
-## allow-appconfig-meta +`fs:allow-public-read` -This allows read access to metadata of the `$APPCONFIG` folder, including file listing and statistics. + -## scope-appconfig-recursive +This allows non-recursive read access to the `$PUBLIC` folder. -This scope recursive access to the complete `$APPCONFIG` folder, including sub directories and files. +
-This scope permits access to all files and list content of top level directories in the `$APPCONFIG`folder. +`fs:allow-public-write` -## scope-appconfig-index + -This scope permits to list all files and folders in the `$APPCONFIG`folder. +This allows non-recursive write access to the `$PUBLIC` folder. -## allow-appdata-read-recursive +
-## allow-appdata-write-recursive +`fs:allow-public-meta-recursive` -This allows full recusrive write access to the complete `$APPDATA` folder, files and subdirectories. + -## allow-appdata-read +This allows full recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics. -This allows non-recursive read access to the `$APPDATA` folder. +
-This allows non-recursive write access to the `$APPDATA` folder. +`fs:allow-public-meta` -## allow-appdata-meta-recursive + -This allows read access to metadata of the `$APPDATA` folder, including file listing and statistics. +This allows non-recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics. -## allow-appdata-meta +
-## scope-appdata-recursive +`fs:scope-public-recursive` -This scope recursive access to the complete `$APPDATA` folder, including sub directories and files. + -## scope-appdata +This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files. -This scope permits access to all files and list content of top level directories in the `$APPDATA`folder. +
-This scope permits to list all files and folders in the `$APPDATA`folder. +`fs:scope-public` -## allow-applocaldata-read-recursive + -This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories. +This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder. -## allow-applocaldata-write-recursive +
-## allow-applocaldata-read +`fs:scope-public-index` -This allows non-recursive read access to the `$APPLOCALDATA` folder. + -## allow-applocaldata-write +This scope permits to list all files and folders in the `$PUBLIC`folder. -This allows non-recursive write access to the `$APPLOCALDATA` folder. +
-This allows read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics. +`fs:allow-resource-read-recursive` -## allow-applocaldata-meta + -This allows read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics. +This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories. -## scope-applocaldata-recursive +
-## scope-applocaldata +`fs:allow-resource-write-recursive` -This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA`folder. + -## scope-applocaldata-index +This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories. -This scope permits to list all files and folders in the `$APPLOCALDATA`folder. +
-This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories. +`fs:allow-resource-read` -## allow-applog-write-recursive + -This allows full recusrive write access to the complete `$APPLOG` folder, files and subdirectories. +This allows non-recursive read access to the `$RESOURCE` folder. -## allow-applog-read +
-## allow-applog-write +`fs:allow-resource-write` -This allows non-recursive write access to the `$APPLOG` folder. + -## allow-applog-meta-recursive +This allows non-recursive write access to the `$RESOURCE` folder. -This allows read access to metadata of the `$APPLOG` folder, including file listing and statistics. +
-This allows read access to metadata of the `$APPLOG` folder, including file listing and statistics. +`fs:allow-resource-meta-recursive` -## scope-applog-recursive + -This scope recursive access to the complete `$APPLOG` folder, including sub directories and files. +This allows full recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics. -## scope-applog +
-## scope-applog-index +`fs:allow-resource-meta` -This scope permits to list all files and folders in the `$APPLOG`folder. + -## allow-audio-read-recursive +This allows non-recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics. -This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories. +
-This allows full recusrive write access to the complete `$AUDIO` folder, files and subdirectories. +`fs:scope-resource-recursive` -## allow-audio-read + -This allows non-recursive read access to the `$AUDIO` folder. +This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files. -## allow-audio-write +
-## allow-audio-meta-recursive +`fs:scope-resource` -This allows read access to metadata of the `$AUDIO` folder, including file listing and statistics. + -## allow-audio-meta +This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder. -This allows read access to metadata of the `$AUDIO` folder, including file listing and statistics. +
-This scope recursive access to the complete `$AUDIO` folder, including sub directories and files. +`fs:scope-resource-index` -## scope-audio + -This scope permits access to all files and list content of top level directories in the `$AUDIO`folder. +This scope permits to list all files and folders in the `$RESOURCE`folder. -## scope-audio-index +
-## allow-cache-read-recursive +`fs:allow-runtime-read-recursive` -This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories. + -## allow-cache-write-recursive +This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories. -This allows full recusrive write access to the complete `$CACHE` folder, files and subdirectories. +
-This allows non-recursive read access to the `$CACHE` folder. +`fs:allow-runtime-write-recursive` -## allow-cache-write + -This allows non-recursive write access to the `$CACHE` folder. +This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories. -## allow-cache-meta-recursive +
-## allow-cache-meta +`fs:allow-runtime-read` -This allows read access to metadata of the `$CACHE` folder, including file listing and statistics. + -## scope-cache-recursive +This allows non-recursive read access to the `$RUNTIME` folder. -This scope recursive access to the complete `$CACHE` folder, including sub directories and files. +
-This scope permits access to all files and list content of top level directories in the `$CACHE`folder. +`fs:allow-runtime-write` -## scope-cache-index + -This scope permits to list all files and folders in the `$CACHE`folder. +This allows non-recursive write access to the `$RUNTIME` folder. -## allow-config-read-recursive +
-## allow-config-write-recursive +`fs:allow-runtime-meta-recursive` -This allows full recusrive write access to the complete `$CONFIG` folder, files and subdirectories. + -## allow-config-read +This allows full recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics. -This allows non-recursive read access to the `$CONFIG` folder. +
-This allows non-recursive write access to the `$CONFIG` folder. +`fs:allow-runtime-meta` -## allow-config-meta-recursive + -This allows read access to metadata of the `$CONFIG` folder, including file listing and statistics. +This allows non-recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics. -## allow-config-meta +
-## scope-config-recursive +`fs:scope-runtime-recursive` -This scope recursive access to the complete `$CONFIG` folder, including sub directories and files. + -## scope-config +This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files. -This scope permits access to all files and list content of top level directories in the `$CONFIG`folder. +
-This scope permits to list all files and folders in the `$CONFIG`folder. +`fs:scope-runtime` -## allow-data-read-recursive + -This allows full recursive read access to the complete `$DATA` folder, files and subdirectories. +This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder. -## allow-data-write-recursive +
-## allow-data-read +`fs:scope-runtime-index` -This allows non-recursive read access to the `$DATA` folder. + -## allow-data-write +This scope permits to list all files and folders in the `$RUNTIME`folder. -This allows non-recursive write access to the `$DATA` folder. +
-This allows read access to metadata of the `$DATA` folder, including file listing and statistics. +`fs:allow-temp-read-recursive` -## allow-data-meta + -This allows read access to metadata of the `$DATA` folder, including file listing and statistics. +This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories. -## scope-data-recursive +
-## scope-data +`fs:allow-temp-write-recursive` -This scope permits access to all files and list content of top level directories in the `$DATA`folder. + -## scope-data-index +This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories. -This scope permits to list all files and folders in the `$DATA`folder. +
-This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories. +`fs:allow-temp-read` -## allow-desktop-write-recursive + -This allows full recusrive write access to the complete `$DESKTOP` folder, files and subdirectories. +This allows non-recursive read access to the `$TEMP` folder. -## allow-desktop-read +
-## allow-desktop-write +`fs:allow-temp-write` -This allows non-recursive write access to the `$DESKTOP` folder. + -## allow-desktop-meta-recursive +This allows non-recursive write access to the `$TEMP` folder. -This allows read access to metadata of the `$DESKTOP` folder, including file listing and statistics. +
-This allows read access to metadata of the `$DESKTOP` folder, including file listing and statistics. +`fs:allow-temp-meta-recursive` -## scope-desktop-recursive + -This scope recursive access to the complete `$DESKTOP` folder, including sub directories and files. +This allows full recursive read access to metadata of the `$TEMP` folder, including file listing and statistics. -## scope-desktop +
-## scope-desktop-index +`fs:allow-temp-meta` -This scope permits to list all files and folders in the `$DESKTOP`folder. + -## allow-document-read-recursive +This allows non-recursive read access to metadata of the `$TEMP` folder, including file listing and statistics. -This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories. +
-This allows full recusrive write access to the complete `$DOCUMENT` folder, files and subdirectories. +`fs:scope-temp-recursive` -## allow-document-read + -This allows non-recursive read access to the `$DOCUMENT` folder. +This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files. -## allow-document-write +
-## allow-document-meta-recursive +`fs:scope-temp` -This allows read access to metadata of the `$DOCUMENT` folder, including file listing and statistics. + -## allow-document-meta +This scope permits access to all files and list content of top level directories in the `$TEMP` folder. -This allows read access to metadata of the `$DOCUMENT` folder, including file listing and statistics. +
-This scope recursive access to the complete `$DOCUMENT` folder, including sub directories and files. +`fs:scope-temp-index` -## scope-document + -This scope permits access to all files and list content of top level directories in the `$DOCUMENT`folder. +This scope permits to list all files and folders in the `$TEMP`folder. -## scope-document-index +
-## allow-download-read-recursive +`fs:allow-template-read-recursive` -This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories. + -## allow-download-write-recursive +This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories. -This allows full recusrive write access to the complete `$DOWNLOAD` folder, files and subdirectories. +
-This allows non-recursive read access to the `$DOWNLOAD` folder. +`fs:allow-template-write-recursive` -## allow-download-write + -This allows non-recursive write access to the `$DOWNLOAD` folder. +This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories. -## allow-download-meta-recursive +
-## allow-download-meta +`fs:allow-template-read` -This allows read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics. + -## scope-download-recursive +This allows non-recursive read access to the `$TEMPLATE` folder. -This scope recursive access to the complete `$DOWNLOAD` folder, including sub directories and files. +
-This scope permits access to all files and list content of top level directories in the `$DOWNLOAD`folder. +`fs:allow-template-write` -## scope-download-index + -This scope permits to list all files and folders in the `$DOWNLOAD`folder. +This allows non-recursive write access to the `$TEMPLATE` folder. -## allow-exe-read-recursive +
-## allow-exe-write-recursive +`fs:allow-template-meta-recursive` -This allows full recusrive write access to the complete `$EXE` folder, files and subdirectories. + -## allow-exe-read +This allows full recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics. -This allows non-recursive read access to the `$EXE` folder. +
-This allows non-recursive write access to the `$EXE` folder. +`fs:allow-template-meta` -## allow-exe-meta-recursive + -This allows read access to metadata of the `$EXE` folder, including file listing and statistics. +This allows non-recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics. -## allow-exe-meta +
-## scope-exe-recursive +`fs:scope-template-recursive` -This scope recursive access to the complete `$EXE` folder, including sub directories and files. + -## scope-exe +This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files. -This scope permits access to all files and list content of top level directories in the `$EXE`folder. +
-This scope permits to list all files and folders in the `$EXE`folder. +`fs:scope-template` -## allow-font-read-recursive + -This allows full recursive read access to the complete `$FONT` folder, files and subdirectories. +This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder. -## allow-font-write-recursive +
-## allow-font-read +`fs:scope-template-index` -This allows non-recursive read access to the `$FONT` folder. + -## allow-font-write +This scope permits to list all files and folders in the `$TEMPLATE`folder. -This allows non-recursive write access to the `$FONT` folder. +
-This allows read access to metadata of the `$FONT` folder, including file listing and statistics. +`fs:allow-video-read-recursive` -## allow-font-meta + -This allows read access to metadata of the `$FONT` folder, including file listing and statistics. +This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories. -## scope-font-recursive +
-## scope-font +`fs:allow-video-write-recursive` -This scope permits access to all files and list content of top level directories in the `$FONT`folder. + -## scope-font-index +This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories. -This scope permits to list all files and folders in the `$FONT`folder. +
-This allows full recursive read access to the complete `$HOME` folder, files and subdirectories. +`fs:allow-video-read` -## allow-home-write-recursive + -This allows full recusrive write access to the complete `$HOME` folder, files and subdirectories. +This allows non-recursive read access to the `$VIDEO` folder. -## allow-home-read +
-## allow-home-write +`fs:allow-video-write` -This allows non-recursive write access to the `$HOME` folder. + -## allow-home-meta-recursive +This allows non-recursive write access to the `$VIDEO` folder. -This allows read access to metadata of the `$HOME` folder, including file listing and statistics. +
-This allows read access to metadata of the `$HOME` folder, including file listing and statistics. +`fs:allow-video-meta-recursive` -## scope-home-recursive + -This scope recursive access to the complete `$HOME` folder, including sub directories and files. +This allows full recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics. -## scope-home +
-## scope-home-index +`fs:allow-video-meta` -This scope permits to list all files and folders in the `$HOME`folder. + -## allow-localdata-read-recursive +This allows non-recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics. -This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories. +
-This allows full recusrive write access to the complete `$LOCALDATA` folder, files and subdirectories. +`fs:scope-video-recursive` -## allow-localdata-read + -This allows non-recursive read access to the `$LOCALDATA` folder. +This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files. -## allow-localdata-write +
-## allow-localdata-meta-recursive +`fs:scope-video` -This allows read access to metadata of the `$LOCALDATA` folder, including file listing and statistics. + -## allow-localdata-meta +This scope permits access to all files and list content of top level directories in the `$VIDEO` folder. -This allows read access to metadata of the `$LOCALDATA` folder, including file listing and statistics. +
-This scope recursive access to the complete `$LOCALDATA` folder, including sub directories and files. +`fs:scope-video-index` -## scope-localdata + -This scope permits access to all files and list content of top level directories in the `$LOCALDATA`folder. +This scope permits to list all files and folders in the `$VIDEO`folder. -## scope-localdata-index +
-## allow-log-read-recursive +`fs:allow-copy-file` -This allows full recursive read access to the complete `$LOG` folder, files and subdirectories. + -## allow-log-write-recursive +Enables the copy_file command without any pre-configured scope. -This allows full recusrive write access to the complete `$LOG` folder, files and subdirectories. +
-This allows non-recursive read access to the `$LOG` folder. +`fs:deny-copy-file` -## allow-log-write + -This allows non-recursive write access to the `$LOG` folder. +Denies the copy_file command without any pre-configured scope. -## allow-log-meta-recursive +
-## allow-log-meta +`fs:allow-create` -This allows read access to metadata of the `$LOG` folder, including file listing and statistics. + -## scope-log-recursive +Enables the create command without any pre-configured scope. -This scope recursive access to the complete `$LOG` folder, including sub directories and files. +
-This scope permits access to all files and list content of top level directories in the `$LOG`folder. +`fs:deny-create` -## scope-log-index + -This scope permits to list all files and folders in the `$LOG`folder. +Denies the create command without any pre-configured scope. -## allow-picture-read-recursive +
-## allow-picture-write-recursive +`fs:allow-exists` -This allows full recusrive write access to the complete `$PICTURE` folder, files and subdirectories. + -## allow-picture-read +Enables the exists command without any pre-configured scope. -This allows non-recursive read access to the `$PICTURE` folder. +
-This allows non-recursive write access to the `$PICTURE` folder. +`fs:deny-exists` -## allow-picture-meta-recursive + -This allows read access to metadata of the `$PICTURE` folder, including file listing and statistics. +Denies the exists command without any pre-configured scope. -## allow-picture-meta +
-## scope-picture-recursive +`fs:allow-fstat` -This scope recursive access to the complete `$PICTURE` folder, including sub directories and files. + -## scope-picture +Enables the fstat command without any pre-configured scope. -This scope permits access to all files and list content of top level directories in the `$PICTURE`folder. +
-This scope permits to list all files and folders in the `$PICTURE`folder. +`fs:deny-fstat` -## allow-public-read-recursive + -This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories. +Denies the fstat command without any pre-configured scope. -## allow-public-write-recursive +
-## allow-public-read +`fs:allow-ftruncate` -This allows non-recursive read access to the `$PUBLIC` folder. + -## allow-public-write +Enables the ftruncate command without any pre-configured scope. -This allows non-recursive write access to the `$PUBLIC` folder. +
-This allows read access to metadata of the `$PUBLIC` folder, including file listing and statistics. +`fs:deny-ftruncate` -## allow-public-meta + -This allows read access to metadata of the `$PUBLIC` folder, including file listing and statistics. +Denies the ftruncate command without any pre-configured scope. -## scope-public-recursive +
-## scope-public +`fs:allow-lstat` -This scope permits access to all files and list content of top level directories in the `$PUBLIC`folder. + -## scope-public-index +Enables the lstat command without any pre-configured scope. -This scope permits to list all files and folders in the `$PUBLIC`folder. +
-This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories. +`fs:deny-lstat` -## allow-resource-write-recursive + -This allows full recusrive write access to the complete `$RESOURCE` folder, files and subdirectories. +Denies the lstat command without any pre-configured scope. -## allow-resource-read +
-## allow-resource-write +`fs:allow-mkdir` -This allows non-recursive write access to the `$RESOURCE` folder. + -## allow-resource-meta-recursive +Enables the mkdir command without any pre-configured scope. -This allows read access to metadata of the `$RESOURCE` folder, including file listing and statistics. +
-This allows read access to metadata of the `$RESOURCE` folder, including file listing and statistics. +`fs:deny-mkdir` -## scope-resource-recursive + -This scope recursive access to the complete `$RESOURCE` folder, including sub directories and files. +Denies the mkdir command without any pre-configured scope. -## scope-resource +
-## scope-resource-index +`fs:allow-open` -This scope permits to list all files and folders in the `$RESOURCE`folder. + -## allow-runtime-read-recursive +Enables the open command without any pre-configured scope. -This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories. +
-This allows full recusrive write access to the complete `$RUNTIME` folder, files and subdirectories. +`fs:deny-open` -## allow-runtime-read + -This allows non-recursive read access to the `$RUNTIME` folder. +Denies the open command without any pre-configured scope. -## allow-runtime-write +
-## allow-runtime-meta-recursive +`fs:allow-read` -This allows read access to metadata of the `$RUNTIME` folder, including file listing and statistics. + -## allow-runtime-meta +Enables the read command without any pre-configured scope. -This allows read access to metadata of the `$RUNTIME` folder, including file listing and statistics. +
-This scope recursive access to the complete `$RUNTIME` folder, including sub directories and files. +`fs:deny-read` -## scope-runtime + -This scope permits access to all files and list content of top level directories in the `$RUNTIME`folder. +Denies the read command without any pre-configured scope. -## scope-runtime-index +
-## allow-temp-read-recursive +`fs:allow-read-dir` -This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories. + -## allow-temp-write-recursive +Enables the read_dir command without any pre-configured scope. -This allows full recusrive write access to the complete `$TEMP` folder, files and subdirectories. +
-This allows non-recursive read access to the `$TEMP` folder. +`fs:deny-read-dir` -## allow-temp-write + -This allows non-recursive write access to the `$TEMP` folder. +Denies the read_dir command without any pre-configured scope. -## allow-temp-meta-recursive +
-## allow-temp-meta +`fs:allow-read-file` -This allows read access to metadata of the `$TEMP` folder, including file listing and statistics. + -## scope-temp-recursive +Enables the read_file command without any pre-configured scope. -This scope recursive access to the complete `$TEMP` folder, including sub directories and files. +
-This scope permits access to all files and list content of top level directories in the `$TEMP`folder. +`fs:deny-read-file` -## scope-temp-index + -This scope permits to list all files and folders in the `$TEMP`folder. +Denies the read_file command without any pre-configured scope. -## allow-template-read-recursive +
-## allow-template-write-recursive +`fs:allow-read-text-file` -This allows full recusrive write access to the complete `$TEMPLATE` folder, files and subdirectories. + -## allow-template-read +Enables the read_text_file command without any pre-configured scope. -This allows non-recursive read access to the `$TEMPLATE` folder. +
-This allows non-recursive write access to the `$TEMPLATE` folder. +`fs:deny-read-text-file` -## allow-template-meta-recursive + -This allows read access to metadata of the `$TEMPLATE` folder, including file listing and statistics. +Denies the read_text_file command without any pre-configured scope. -## allow-template-meta +
-## scope-template-recursive +`fs:allow-read-text-file-lines` -This scope recursive access to the complete `$TEMPLATE` folder, including sub directories and files. + -## scope-template +Enables the read_text_file_lines command without any pre-configured scope. -This scope permits access to all files and list content of top level directories in the `$TEMPLATE`folder. +
-This scope permits to list all files and folders in the `$TEMPLATE`folder. +`fs:deny-read-text-file-lines` -## allow-video-read-recursive + -This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories. +Denies the read_text_file_lines command without any pre-configured scope. -## allow-video-write-recursive +
-## allow-video-read +`fs:allow-read-text-file-lines-next` -This allows non-recursive read access to the `$VIDEO` folder. + -## allow-video-write +Enables the read_text_file_lines_next command without any pre-configured scope. -This allows non-recursive write access to the `$VIDEO` folder. +
-This allows read access to metadata of the `$VIDEO` folder, including file listing and statistics. +`fs:deny-read-text-file-lines-next` -## allow-video-meta + -This allows read access to metadata of the `$VIDEO` folder, including file listing and statistics. +Denies the read_text_file_lines_next command without any pre-configured scope. -## scope-video-recursive +
-## scope-video +`fs:allow-remove` -This scope permits access to all files and list content of top level directories in the `$VIDEO`folder. + -## scope-video-index +Enables the remove command without any pre-configured scope. -This scope permits to list all files and folders in the `$VIDEO`folder. +
-Enables the copy_file command without any pre-configured scope. +`fs:deny-remove` -## deny-copy-file + -Denies the copy_file command without any pre-configured scope. +Denies the remove command without any pre-configured scope. -## allow-create +
-## deny-create +`fs:allow-rename` -Denies the create command without any pre-configured scope. + -## allow-exists +Enables the rename command without any pre-configured scope. -Enables the exists command without any pre-configured scope. +
-Denies the exists command without any pre-configured scope. +`fs:deny-rename` -## allow-fstat + -Enables the fstat command without any pre-configured scope. +Denies the rename command without any pre-configured scope. -## deny-fstat +
-## allow-ftruncate +`fs:allow-seek` -Enables the ftruncate command without any pre-configured scope. + -## deny-ftruncate +Enables the seek command without any pre-configured scope. -Denies the ftruncate command without any pre-configured scope. +
-Enables the lstat command without any pre-configured scope. +`fs:deny-seek` -## deny-lstat + -Denies the lstat command without any pre-configured scope. +Denies the seek command without any pre-configured scope. -## allow-mkdir +
-## deny-mkdir +`fs:allow-stat` -Denies the mkdir command without any pre-configured scope. + -## allow-open +Enables the stat command without any pre-configured scope. -Enables the open command without any pre-configured scope. +
-Denies the open command without any pre-configured scope. +`fs:deny-stat` -## allow-read + -Enables the read command without any pre-configured scope. +Denies the stat command without any pre-configured scope. -## deny-read +
-## allow-read-dir +`fs:allow-truncate` -Enables the read_dir command without any pre-configured scope. + -## deny-read-dir +Enables the truncate command without any pre-configured scope. -Denies the read_dir command without any pre-configured scope. +
-Enables the read_file command without any pre-configured scope. +`fs:deny-truncate` -## deny-read-file + -Denies the read_file command without any pre-configured scope. +Denies the truncate command without any pre-configured scope. -## allow-read-text-file +
-## deny-read-text-file +`fs:allow-unwatch` -Denies the read_text_file command without any pre-configured scope. + -## allow-read-text-file-lines +Enables the unwatch command without any pre-configured scope. -Enables the read_text_file_lines command without any pre-configured scope. +
-Denies the read_text_file_lines command without any pre-configured scope. +`fs:deny-unwatch` -## allow-read-text-file-lines-next + -Enables the read_text_file_lines_next command without any pre-configured scope. +Denies the unwatch command without any pre-configured scope. -## deny-read-text-file-lines-next +
-## allow-remove +`fs:allow-watch` -Enables the remove command without any pre-configured scope. + -## deny-remove +Enables the watch command without any pre-configured scope. -Denies the remove command without any pre-configured scope. +
-Enables the rename command without any pre-configured scope. +`fs:deny-watch` -## deny-rename + -Denies the rename command without any pre-configured scope. +Denies the watch command without any pre-configured scope. -## allow-seek +
-## deny-seek +`fs:allow-write` -Denies the seek command without any pre-configured scope. + -## allow-stat +Enables the write command without any pre-configured scope. -Enables the stat command without any pre-configured scope. +
-Denies the stat command without any pre-configured scope. +`fs:deny-write` -## allow-truncate + -Enables the truncate command without any pre-configured scope. +Denies the write command without any pre-configured scope. -## deny-truncate +
-## allow-unwatch +`fs:allow-write-file` -Enables the unwatch command without any pre-configured scope. + -## deny-unwatch +Enables the write_file command without any pre-configured scope. -Denies the unwatch command without any pre-configured scope. +
-Enables the watch command without any pre-configured scope. +`fs:deny-write-file` -## deny-watch + -Denies the watch command without any pre-configured scope. +Denies the write_file command without any pre-configured scope. -## allow-write +
-## deny-write +`fs:allow-write-text-file` -Denies the write command without any pre-configured scope. + -## allow-write-file +Enables the write_text_file command without any pre-configured scope. -Enables the write_file command without any pre-configured scope. +
-Denies the write_file command without any pre-configured scope. +`fs:deny-write-text-file` -## allow-write-text-file + -Enables the write_text_file command without any pre-configured scope. +Denies the write_text_file command without any pre-configured scope. -## deny-write-text-file +
-## default +`fs:create-app-specific-dirs` -# Tauri `fs` default permissions + -This configuration file defines the default permissions granted -to the filesystem. +This permissions allows to create the application specific directories. -### Granted Permissions -This default permission set enables all read-related commands and -allows access to the `$APP` folder and sub directories created in it. -The location of the `$APP` folder depends on the operating system, -where the application is run. +
-### Denied Permissions +`fs:deny-default` -This default permission set prevents access to critical components -of the Tauri application by default. -On Windows the webview data folder access is denied. + +This denies access to dangerous Tauri relevant files and folders by default. +
-This denies access to dangerous Tauri relevant files and folders by default. +`fs:deny-webview-data-linux` -## deny-webview-data-linux + This denies read access to the `$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here. Allowing access can lead to sensitive information disclosure and should be well considered. -## deny-webview-data-windows +
+ +`fs:deny-webview-data-windows` + + This denies read access to the `$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here. Allowing access can lead to sensitive information disclosure and should be well considered. -## read-all +
+ +`fs:read-all` + + This enables all read related commands without any pre-configured accessible paths. -## read-dirs +
+ +`fs:read-app-specific-dirs-recursive` + + + +This permission allows recursive read functionality on the application +specific base directories. + + +
+ +`fs:read-dirs` + + This enables directory read and file metadata related commands without any pre-configured accessible paths. -## read-files +
+ +`fs:read-files` + + This enables file read related commands without any pre-configured accessible paths. -## read-meta +
+ +`fs:read-meta` + + This enables all index or metadata related commands without any pre-configured accessible paths. -## scope +
+ +`fs:scope` + + An empty permission you can use to modify the global scope. -## write-all +
+ +`fs:write-all` + + This enables all write related commands without any pre-configured accessible paths. -## write-files +
+ +`fs:write-files` + + This enables all file write related commands without any pre-configured accessible paths. +
diff --git a/plugins/fs/permissions/create-app-specific-dirs.toml b/plugins/fs/permissions/create-app-specific-dirs.toml new file mode 100644 index 00000000..7785cb13 --- /dev/null +++ b/plugins/fs/permissions/create-app-specific-dirs.toml @@ -0,0 +1,8 @@ +"$schema" = "schemas/schema.json" + +[[permission]] +identifier = "create-app-specific-dirs" +description = """ +This permissions allows to create the application specific directories. +""" +commands.allow = ["mkdir", "scope-app-index"] diff --git a/plugins/fs/permissions/default.toml b/plugins/fs/permissions/default.toml index 213fece0..d519d758 100644 --- a/plugins/fs/permissions/default.toml +++ b/plugins/fs/permissions/default.toml @@ -2,27 +2,33 @@ [default] description = """ -# Tauri `fs` default permissions +This set of permissions describes the what kind of +file system access the `fs` plugin has enabled or denied by default. -This configuration file defines the default permissions granted -to the filesystem. +#### Granted Permissions -### Granted Permissions - -This default permission set enables all read-related commands and -allows access to the `$APP` folder and sub directories created in it. -The location of the `$APP` folder depends on the operating system, +This default permission set enables read access to the +application specific directories (AppConfig, AppData, AppLocalData, AppCache, +AppLog) and all files and sub directories created in it. +The location of these directories depends on the operating system, where the application is run. -In general the `$APP` folder needs to be manually created +In general these directories need to be manually created by the application at runtime, before accessing files or folders in it is possible. -### Denied Permissions +Therefore, it is also allowed to create all of these folders via +the `mkdir` command. + +#### Denied Permissions This default permission set prevents access to critical components of the Tauri application by default. On Windows the webview data folder access is denied. """ -permissions = ["read-all", "scope-app-recursive", "deny-default"] +permissions = [ + "create-app-specific-dirs", + "read-app-specific-dirs-recursive", + "deny-default", +] diff --git a/plugins/fs/permissions/read-all.toml b/plugins/fs/permissions/read-all.toml index 99cbadf3..d43af5e0 100644 --- a/plugins/fs/permissions/read-all.toml +++ b/plugins/fs/permissions/read-all.toml @@ -4,18 +4,18 @@ identifier = "read-all" description = "This enables all read related commands without any pre-configured accessible paths." commands.allow = [ - "read_dir", - "read_file", - "read", - "open", - "read_text_file", - "read_text_file_lines", - "read_text_file_lines_next", - "seek", - "stat", - "lstat", - "fstat", - "exists", - "watch", - "unwatch", + "read_dir", + "read_file", + "read", + "open", + "read_text_file", + "read_text_file_lines", + "read_text_file_lines_next", + "seek", + "stat", + "lstat", + "fstat", + "exists", + "watch", + "unwatch", ] diff --git a/plugins/fs/permissions/read-app-specific-dirs-recursive.toml b/plugins/fs/permissions/read-app-specific-dirs-recursive.toml new file mode 100644 index 00000000..5342dbc0 --- /dev/null +++ b/plugins/fs/permissions/read-app-specific-dirs-recursive.toml @@ -0,0 +1,17 @@ +"$schema" = "schemas/schema.json" + +[[permission]] +identifier = "read-app-specific-dirs-recursive" +description = """ +This permission allows recursive read functionality on the application +specific base directories. +""" +commands.allow = [ + "read_dir", + "read_file", + "read_text_file", + "read_text_file_lines", + "read_text_file_lines_next", + "exists", + "scope-app-recursive", +] diff --git a/plugins/fs/permissions/read-files.toml b/plugins/fs/permissions/read-files.toml index a0691b44..f2685108 100644 --- a/plugins/fs/permissions/read-files.toml +++ b/plugins/fs/permissions/read-files.toml @@ -4,16 +4,16 @@ identifier = "read-files" description = "This enables file read related commands without any pre-configured accessible paths." commands.allow = [ - "read_file", - "read", - "open", - "read_text_file", - "read_text_file_lines", - "read_text_file_lines_next", - "seek", - "stat", - "lstat", - "fstat", - "exists", + "read_file", + "read", + "open", + "read_text_file", + "read_text_file_lines", + "read_text_file_lines_next", + "seek", + "stat", + "lstat", + "fstat", + "exists", ] diff --git a/plugins/fs/permissions/schemas/schema.json b/plugins/fs/permissions/schemas/schema.json index fa9eeaf0..57ab0634 100644 --- a/plugins/fs/permissions/schemas/schema.json +++ b/plugins/fs/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,1996 +251,1478 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-app-read-recursive -> This allows full recursive read access to the complete `$APP` folder, files and subdirectories.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-app-read-recursive" + "macOS" ] }, { - "description": "allow-app-write-recursive -> This allows full recusrive write access to the complete `$APP` folder, files and subdirectories.", + "description": "Windows.", "type": "string", "enum": [ - "allow-app-write-recursive" + "windows" ] }, { - "description": "allow-app-read -> This allows non-recursive read access to the `$APP` folder.", + "description": "Linux.", "type": "string", "enum": [ - "allow-app-read" + "linux" ] }, { - "description": "allow-app-write -> This allows non-recursive write access to the `$APP` folder.", + "description": "Android.", "type": "string", "enum": [ - "allow-app-write" + "android" ] }, { - "description": "allow-app-meta-recursive -> This allows read access to metadata of the `$APP` folder, including file listing and statistics.", + "description": "iOS.", "type": "string", "enum": [ - "allow-app-meta-recursive" + "iOS" ] - }, + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ { - "description": "allow-app-meta -> This allows read access to metadata of the `$APP` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete application folders, files and subdirectories.", "type": "string", - "enum": [ - "allow-app-meta" - ] + "const": "allow-app-read-recursive" }, { - "description": "scope-app-recursive -> This scope recursive access to the complete `$APP` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete application folders, files and subdirectories.", "type": "string", - "enum": [ - "scope-app-recursive" - ] + "const": "allow-app-write-recursive" }, { - "description": "scope-app -> This scope permits access to all files and list content of top level directories in the `$APP`folder.", + "description": "This allows non-recursive read access to the application folders.", "type": "string", - "enum": [ - "scope-app" - ] + "const": "allow-app-read" }, { - "description": "scope-app-index -> This scope permits to list all files and folders in the `$APP`folder.", + "description": "This allows non-recursive write access to the application folders.", "type": "string", - "enum": [ - "scope-app-index" - ] + "const": "allow-app-write" }, { - "description": "allow-appcache-read-recursive -> This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the application folders, including file listing and statistics.", "type": "string", - "enum": [ - "allow-appcache-read-recursive" - ] + "const": "allow-app-meta-recursive" }, { - "description": "allow-appcache-write-recursive -> This allows full recusrive write access to the complete `$APPCACHE` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the application folders, including file listing and statistics.", "type": "string", - "enum": [ - "allow-appcache-write-recursive" - ] + "const": "allow-app-meta" }, { - "description": "allow-appcache-read -> This allows non-recursive read access to the `$APPCACHE` folder.", + "description": "This scope permits recursive access to the complete application folders, including sub directories and files.", "type": "string", - "enum": [ - "allow-appcache-read" - ] + "const": "scope-app-recursive" }, { - "description": "allow-appcache-write -> This allows non-recursive write access to the `$APPCACHE` folder.", + "description": "This scope permits access to all files and list content of top level directories in the application folders.", "type": "string", - "enum": [ - "allow-appcache-write" - ] + "const": "scope-app" }, { - "description": "allow-appcache-meta-recursive -> This allows read access to metadata of the `$APPCACHE` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the application directories.", "type": "string", - "enum": [ - "allow-appcache-meta-recursive" - ] + "const": "scope-app-index" }, { - "description": "allow-appcache-meta -> This allows read access to metadata of the `$APPCACHE` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-appcache-meta" - ] + "const": "allow-appcache-read-recursive" }, { - "description": "scope-appcache-recursive -> This scope recursive access to the complete `$APPCACHE` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-appcache-recursive" - ] + "const": "allow-appcache-write-recursive" }, { - "description": "scope-appcache -> This scope permits access to all files and list content of top level directories in the `$APPCACHE`folder.", + "description": "This allows non-recursive read access to the `$APPCACHE` folder.", "type": "string", - "enum": [ - "scope-appcache" - ] + "const": "allow-appcache-read" }, { - "description": "scope-appcache-index -> This scope permits to list all files and folders in the `$APPCACHE`folder.", + "description": "This allows non-recursive write access to the `$APPCACHE` folder.", "type": "string", - "enum": [ - "scope-appcache-index" - ] + "const": "allow-appcache-write" }, { - "description": "allow-appconfig-read-recursive -> This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-appconfig-read-recursive" - ] + "const": "allow-appcache-meta-recursive" }, { - "description": "allow-appconfig-write-recursive -> This allows full recusrive write access to the complete `$APPCONFIG` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-appconfig-write-recursive" - ] + "const": "allow-appcache-meta" }, { - "description": "allow-appconfig-read -> This allows non-recursive read access to the `$APPCONFIG` folder.", + "description": "This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-appconfig-read" - ] + "const": "scope-appcache-recursive" }, { - "description": "allow-appconfig-write -> This allows non-recursive write access to the `$APPCONFIG` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder.", "type": "string", - "enum": [ - "allow-appconfig-write" - ] + "const": "scope-appcache" }, { - "description": "allow-appconfig-meta-recursive -> This allows read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$APPCACHE`folder.", "type": "string", - "enum": [ - "allow-appconfig-meta-recursive" - ] + "const": "scope-appcache-index" }, { - "description": "allow-appconfig-meta -> This allows read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-appconfig-meta" - ] + "const": "allow-appconfig-read-recursive" }, { - "description": "scope-appconfig-recursive -> This scope recursive access to the complete `$APPCONFIG` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-appconfig-recursive" - ] + "const": "allow-appconfig-write-recursive" }, { - "description": "scope-appconfig -> This scope permits access to all files and list content of top level directories in the `$APPCONFIG`folder.", + "description": "This allows non-recursive read access to the `$APPCONFIG` folder.", "type": "string", - "enum": [ - "scope-appconfig" - ] + "const": "allow-appconfig-read" }, { - "description": "scope-appconfig-index -> This scope permits to list all files and folders in the `$APPCONFIG`folder.", + "description": "This allows non-recursive write access to the `$APPCONFIG` folder.", "type": "string", - "enum": [ - "scope-appconfig-index" - ] + "const": "allow-appconfig-write" }, { - "description": "allow-appdata-read-recursive -> This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-appdata-read-recursive" - ] + "const": "allow-appconfig-meta-recursive" }, { - "description": "allow-appdata-write-recursive -> This allows full recusrive write access to the complete `$APPDATA` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-appdata-write-recursive" - ] + "const": "allow-appconfig-meta" }, { - "description": "allow-appdata-read -> This allows non-recursive read access to the `$APPDATA` folder.", + "description": "This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-appdata-read" - ] + "const": "scope-appconfig-recursive" }, { - "description": "allow-appdata-write -> This allows non-recursive write access to the `$APPDATA` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder.", "type": "string", - "enum": [ - "allow-appdata-write" - ] + "const": "scope-appconfig" }, { - "description": "allow-appdata-meta-recursive -> This allows read access to metadata of the `$APPDATA` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$APPCONFIG`folder.", "type": "string", - "enum": [ - "allow-appdata-meta-recursive" - ] + "const": "scope-appconfig-index" }, { - "description": "allow-appdata-meta -> This allows read access to metadata of the `$APPDATA` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-appdata-meta" - ] + "const": "allow-appdata-read-recursive" }, { - "description": "scope-appdata-recursive -> This scope recursive access to the complete `$APPDATA` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-appdata-recursive" - ] + "const": "allow-appdata-write-recursive" }, { - "description": "scope-appdata -> This scope permits access to all files and list content of top level directories in the `$APPDATA`folder.", + "description": "This allows non-recursive read access to the `$APPDATA` folder.", "type": "string", - "enum": [ - "scope-appdata" - ] + "const": "allow-appdata-read" }, { - "description": "scope-appdata-index -> This scope permits to list all files and folders in the `$APPDATA`folder.", + "description": "This allows non-recursive write access to the `$APPDATA` folder.", "type": "string", - "enum": [ - "scope-appdata-index" - ] + "const": "allow-appdata-write" }, { - "description": "allow-applocaldata-read-recursive -> This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-applocaldata-read-recursive" - ] + "const": "allow-appdata-meta-recursive" }, { - "description": "allow-applocaldata-write-recursive -> This allows full recusrive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-applocaldata-write-recursive" - ] + "const": "allow-appdata-meta" }, { - "description": "allow-applocaldata-read -> This allows non-recursive read access to the `$APPLOCALDATA` folder.", + "description": "This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-applocaldata-read" - ] + "const": "scope-appdata-recursive" }, { - "description": "allow-applocaldata-write -> This allows non-recursive write access to the `$APPLOCALDATA` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$APPDATA` folder.", "type": "string", - "enum": [ - "allow-applocaldata-write" - ] + "const": "scope-appdata" }, { - "description": "allow-applocaldata-meta-recursive -> This allows read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$APPDATA`folder.", "type": "string", - "enum": [ - "allow-applocaldata-meta-recursive" - ] + "const": "scope-appdata-index" }, { - "description": "allow-applocaldata-meta -> This allows read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-applocaldata-meta" - ] + "const": "allow-applocaldata-read-recursive" }, { - "description": "scope-applocaldata-recursive -> This scope recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-applocaldata-recursive" - ] + "const": "allow-applocaldata-write-recursive" }, { - "description": "scope-applocaldata -> This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA`folder.", + "description": "This allows non-recursive read access to the `$APPLOCALDATA` folder.", "type": "string", - "enum": [ - "scope-applocaldata" - ] + "const": "allow-applocaldata-read" }, { - "description": "scope-applocaldata-index -> This scope permits to list all files and folders in the `$APPLOCALDATA`folder.", + "description": "This allows non-recursive write access to the `$APPLOCALDATA` folder.", "type": "string", - "enum": [ - "scope-applocaldata-index" - ] + "const": "allow-applocaldata-write" }, { - "description": "allow-applog-read-recursive -> This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-applog-read-recursive" - ] + "const": "allow-applocaldata-meta-recursive" }, { - "description": "allow-applog-write-recursive -> This allows full recusrive write access to the complete `$APPLOG` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-applog-write-recursive" - ] + "const": "allow-applocaldata-meta" }, { - "description": "allow-applog-read -> This allows non-recursive read access to the `$APPLOG` folder.", + "description": "This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-applog-read" - ] + "const": "scope-applocaldata-recursive" }, { - "description": "allow-applog-write -> This allows non-recursive write access to the `$APPLOG` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder.", "type": "string", - "enum": [ - "allow-applog-write" - ] + "const": "scope-applocaldata" }, { - "description": "allow-applog-meta-recursive -> This allows read access to metadata of the `$APPLOG` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$APPLOCALDATA`folder.", "type": "string", - "enum": [ - "allow-applog-meta-recursive" - ] + "const": "scope-applocaldata-index" }, { - "description": "allow-applog-meta -> This allows read access to metadata of the `$APPLOG` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-applog-meta" - ] + "const": "allow-applog-read-recursive" }, { - "description": "scope-applog-recursive -> This scope recursive access to the complete `$APPLOG` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-applog-recursive" - ] + "const": "allow-applog-write-recursive" }, { - "description": "scope-applog -> This scope permits access to all files and list content of top level directories in the `$APPLOG`folder.", + "description": "This allows non-recursive read access to the `$APPLOG` folder.", "type": "string", - "enum": [ - "scope-applog" - ] + "const": "allow-applog-read" }, { - "description": "scope-applog-index -> This scope permits to list all files and folders in the `$APPLOG`folder.", + "description": "This allows non-recursive write access to the `$APPLOG` folder.", "type": "string", - "enum": [ - "scope-applog-index" - ] + "const": "allow-applog-write" }, { - "description": "allow-audio-read-recursive -> This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-audio-read-recursive" - ] + "const": "allow-applog-meta-recursive" }, { - "description": "allow-audio-write-recursive -> This allows full recusrive write access to the complete `$AUDIO` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-audio-write-recursive" - ] + "const": "allow-applog-meta" }, { - "description": "allow-audio-read -> This allows non-recursive read access to the `$AUDIO` folder.", + "description": "This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-audio-read" - ] + "const": "scope-applog-recursive" }, { - "description": "allow-audio-write -> This allows non-recursive write access to the `$AUDIO` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$APPLOG` folder.", "type": "string", - "enum": [ - "allow-audio-write" - ] + "const": "scope-applog" }, { - "description": "allow-audio-meta-recursive -> This allows read access to metadata of the `$AUDIO` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$APPLOG`folder.", "type": "string", - "enum": [ - "allow-audio-meta-recursive" - ] + "const": "scope-applog-index" }, { - "description": "allow-audio-meta -> This allows read access to metadata of the `$AUDIO` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-audio-meta" - ] + "const": "allow-audio-read-recursive" }, { - "description": "scope-audio-recursive -> This scope recursive access to the complete `$AUDIO` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-audio-recursive" - ] + "const": "allow-audio-write-recursive" }, { - "description": "scope-audio -> This scope permits access to all files and list content of top level directories in the `$AUDIO`folder.", + "description": "This allows non-recursive read access to the `$AUDIO` folder.", "type": "string", - "enum": [ - "scope-audio" - ] + "const": "allow-audio-read" }, { - "description": "scope-audio-index -> This scope permits to list all files and folders in the `$AUDIO`folder.", + "description": "This allows non-recursive write access to the `$AUDIO` folder.", "type": "string", - "enum": [ - "scope-audio-index" - ] + "const": "allow-audio-write" }, { - "description": "allow-cache-read-recursive -> This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-cache-read-recursive" - ] + "const": "allow-audio-meta-recursive" }, { - "description": "allow-cache-write-recursive -> This allows full recusrive write access to the complete `$CACHE` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-cache-write-recursive" - ] + "const": "allow-audio-meta" }, { - "description": "allow-cache-read -> This allows non-recursive read access to the `$CACHE` folder.", + "description": "This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-cache-read" - ] + "const": "scope-audio-recursive" }, { - "description": "allow-cache-write -> This allows non-recursive write access to the `$CACHE` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$AUDIO` folder.", "type": "string", - "enum": [ - "allow-cache-write" - ] + "const": "scope-audio" }, { - "description": "allow-cache-meta-recursive -> This allows read access to metadata of the `$CACHE` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$AUDIO`folder.", "type": "string", - "enum": [ - "allow-cache-meta-recursive" - ] + "const": "scope-audio-index" }, { - "description": "allow-cache-meta -> This allows read access to metadata of the `$CACHE` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-cache-meta" - ] + "const": "allow-cache-read-recursive" }, { - "description": "scope-cache-recursive -> This scope recursive access to the complete `$CACHE` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-cache-recursive" - ] + "const": "allow-cache-write-recursive" }, { - "description": "scope-cache -> This scope permits access to all files and list content of top level directories in the `$CACHE`folder.", + "description": "This allows non-recursive read access to the `$CACHE` folder.", "type": "string", - "enum": [ - "scope-cache" - ] + "const": "allow-cache-read" }, { - "description": "scope-cache-index -> This scope permits to list all files and folders in the `$CACHE`folder.", + "description": "This allows non-recursive write access to the `$CACHE` folder.", "type": "string", - "enum": [ - "scope-cache-index" - ] + "const": "allow-cache-write" }, { - "description": "allow-config-read-recursive -> This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-config-read-recursive" - ] + "const": "allow-cache-meta-recursive" }, { - "description": "allow-config-write-recursive -> This allows full recusrive write access to the complete `$CONFIG` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-config-write-recursive" - ] + "const": "allow-cache-meta" }, { - "description": "allow-config-read -> This allows non-recursive read access to the `$CONFIG` folder.", + "description": "This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-config-read" - ] + "const": "scope-cache-recursive" }, { - "description": "allow-config-write -> This allows non-recursive write access to the `$CONFIG` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$CACHE` folder.", "type": "string", - "enum": [ - "allow-config-write" - ] + "const": "scope-cache" }, { - "description": "allow-config-meta-recursive -> This allows read access to metadata of the `$CONFIG` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$CACHE`folder.", "type": "string", - "enum": [ - "allow-config-meta-recursive" - ] + "const": "scope-cache-index" }, { - "description": "allow-config-meta -> This allows read access to metadata of the `$CONFIG` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-config-meta" - ] + "const": "allow-config-read-recursive" }, { - "description": "scope-config-recursive -> This scope recursive access to the complete `$CONFIG` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-config-recursive" - ] + "const": "allow-config-write-recursive" }, { - "description": "scope-config -> This scope permits access to all files and list content of top level directories in the `$CONFIG`folder.", + "description": "This allows non-recursive read access to the `$CONFIG` folder.", "type": "string", - "enum": [ - "scope-config" - ] + "const": "allow-config-read" }, { - "description": "scope-config-index -> This scope permits to list all files and folders in the `$CONFIG`folder.", + "description": "This allows non-recursive write access to the `$CONFIG` folder.", "type": "string", - "enum": [ - "scope-config-index" - ] + "const": "allow-config-write" }, { - "description": "allow-data-read-recursive -> This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-data-read-recursive" - ] + "const": "allow-config-meta-recursive" }, { - "description": "allow-data-write-recursive -> This allows full recusrive write access to the complete `$DATA` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-data-write-recursive" - ] + "const": "allow-config-meta" }, { - "description": "allow-data-read -> This allows non-recursive read access to the `$DATA` folder.", + "description": "This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-data-read" - ] + "const": "scope-config-recursive" }, { - "description": "allow-data-write -> This allows non-recursive write access to the `$DATA` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$CONFIG` folder.", "type": "string", - "enum": [ - "allow-data-write" - ] + "const": "scope-config" }, { - "description": "allow-data-meta-recursive -> This allows read access to metadata of the `$DATA` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$CONFIG`folder.", "type": "string", - "enum": [ - "allow-data-meta-recursive" - ] + "const": "scope-config-index" }, { - "description": "allow-data-meta -> This allows read access to metadata of the `$DATA` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-data-meta" - ] + "const": "allow-data-read-recursive" }, { - "description": "scope-data-recursive -> This scope recursive access to the complete `$DATA` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-data-recursive" - ] + "const": "allow-data-write-recursive" }, { - "description": "scope-data -> This scope permits access to all files and list content of top level directories in the `$DATA`folder.", + "description": "This allows non-recursive read access to the `$DATA` folder.", "type": "string", - "enum": [ - "scope-data" - ] + "const": "allow-data-read" }, { - "description": "scope-data-index -> This scope permits to list all files and folders in the `$DATA`folder.", + "description": "This allows non-recursive write access to the `$DATA` folder.", "type": "string", - "enum": [ - "scope-data-index" - ] + "const": "allow-data-write" }, { - "description": "allow-desktop-read-recursive -> This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$DATA` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-desktop-read-recursive" - ] + "const": "allow-data-meta-recursive" }, { - "description": "allow-desktop-write-recursive -> This allows full recusrive write access to the complete `$DESKTOP` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$DATA` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-desktop-write-recursive" - ] + "const": "allow-data-meta" }, { - "description": "allow-desktop-read -> This allows non-recursive read access to the `$DESKTOP` folder.", + "description": "This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-desktop-read" - ] + "const": "scope-data-recursive" }, { - "description": "allow-desktop-write -> This allows non-recursive write access to the `$DESKTOP` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$DATA` folder.", "type": "string", - "enum": [ - "allow-desktop-write" - ] + "const": "scope-data" }, { - "description": "allow-desktop-meta-recursive -> This allows read access to metadata of the `$DESKTOP` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$DATA`folder.", "type": "string", - "enum": [ - "allow-desktop-meta-recursive" - ] + "const": "scope-data-index" }, { - "description": "allow-desktop-meta -> This allows read access to metadata of the `$DESKTOP` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-desktop-meta" - ] + "const": "allow-desktop-read-recursive" }, { - "description": "scope-desktop-recursive -> This scope recursive access to the complete `$DESKTOP` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-desktop-recursive" - ] + "const": "allow-desktop-write-recursive" }, { - "description": "scope-desktop -> This scope permits access to all files and list content of top level directories in the `$DESKTOP`folder.", + "description": "This allows non-recursive read access to the `$DESKTOP` folder.", "type": "string", - "enum": [ - "scope-desktop" - ] + "const": "allow-desktop-read" }, { - "description": "scope-desktop-index -> This scope permits to list all files and folders in the `$DESKTOP`folder.", + "description": "This allows non-recursive write access to the `$DESKTOP` folder.", "type": "string", - "enum": [ - "scope-desktop-index" - ] + "const": "allow-desktop-write" }, { - "description": "allow-document-read-recursive -> This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-document-read-recursive" - ] + "const": "allow-desktop-meta-recursive" }, { - "description": "allow-document-write-recursive -> This allows full recusrive write access to the complete `$DOCUMENT` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-document-write-recursive" - ] + "const": "allow-desktop-meta" }, { - "description": "allow-document-read -> This allows non-recursive read access to the `$DOCUMENT` folder.", + "description": "This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-document-read" - ] + "const": "scope-desktop-recursive" }, { - "description": "allow-document-write -> This allows non-recursive write access to the `$DOCUMENT` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder.", "type": "string", - "enum": [ - "allow-document-write" - ] + "const": "scope-desktop" }, { - "description": "allow-document-meta-recursive -> This allows read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$DESKTOP`folder.", "type": "string", - "enum": [ - "allow-document-meta-recursive" - ] + "const": "scope-desktop-index" }, { - "description": "allow-document-meta -> This allows read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-document-meta" - ] + "const": "allow-document-read-recursive" }, { - "description": "scope-document-recursive -> This scope recursive access to the complete `$DOCUMENT` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-document-recursive" - ] + "const": "allow-document-write-recursive" }, { - "description": "scope-document -> This scope permits access to all files and list content of top level directories in the `$DOCUMENT`folder.", + "description": "This allows non-recursive read access to the `$DOCUMENT` folder.", "type": "string", - "enum": [ - "scope-document" - ] + "const": "allow-document-read" }, { - "description": "scope-document-index -> This scope permits to list all files and folders in the `$DOCUMENT`folder.", + "description": "This allows non-recursive write access to the `$DOCUMENT` folder.", "type": "string", - "enum": [ - "scope-document-index" - ] + "const": "allow-document-write" }, { - "description": "allow-download-read-recursive -> This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-download-read-recursive" - ] + "const": "allow-document-meta-recursive" }, { - "description": "allow-download-write-recursive -> This allows full recusrive write access to the complete `$DOWNLOAD` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-download-write-recursive" - ] + "const": "allow-document-meta" }, { - "description": "allow-download-read -> This allows non-recursive read access to the `$DOWNLOAD` folder.", + "description": "This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-download-read" - ] + "const": "scope-document-recursive" }, { - "description": "allow-download-write -> This allows non-recursive write access to the `$DOWNLOAD` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder.", "type": "string", - "enum": [ - "allow-download-write" - ] + "const": "scope-document" }, { - "description": "allow-download-meta-recursive -> This allows read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$DOCUMENT`folder.", "type": "string", - "enum": [ - "allow-download-meta-recursive" - ] + "const": "scope-document-index" }, { - "description": "allow-download-meta -> This allows read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-download-meta" - ] + "const": "allow-download-read-recursive" }, { - "description": "scope-download-recursive -> This scope recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-download-recursive" - ] + "const": "allow-download-write-recursive" }, { - "description": "scope-download -> This scope permits access to all files and list content of top level directories in the `$DOWNLOAD`folder.", + "description": "This allows non-recursive read access to the `$DOWNLOAD` folder.", "type": "string", - "enum": [ - "scope-download" - ] + "const": "allow-download-read" }, { - "description": "scope-download-index -> This scope permits to list all files and folders in the `$DOWNLOAD`folder.", + "description": "This allows non-recursive write access to the `$DOWNLOAD` folder.", "type": "string", - "enum": [ - "scope-download-index" - ] + "const": "allow-download-write" }, { - "description": "allow-exe-read-recursive -> This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-exe-read-recursive" - ] + "const": "allow-download-meta-recursive" }, { - "description": "allow-exe-write-recursive -> This allows full recusrive write access to the complete `$EXE` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-exe-write-recursive" - ] + "const": "allow-download-meta" }, { - "description": "allow-exe-read -> This allows non-recursive read access to the `$EXE` folder.", + "description": "This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-exe-read" - ] + "const": "scope-download-recursive" }, { - "description": "allow-exe-write -> This allows non-recursive write access to the `$EXE` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder.", "type": "string", - "enum": [ - "allow-exe-write" - ] + "const": "scope-download" }, { - "description": "allow-exe-meta-recursive -> This allows read access to metadata of the `$EXE` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$DOWNLOAD`folder.", "type": "string", - "enum": [ - "allow-exe-meta-recursive" - ] + "const": "scope-download-index" }, { - "description": "allow-exe-meta -> This allows read access to metadata of the `$EXE` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-exe-meta" - ] + "const": "allow-exe-read-recursive" }, { - "description": "scope-exe-recursive -> This scope recursive access to the complete `$EXE` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-exe-recursive" - ] + "const": "allow-exe-write-recursive" }, { - "description": "scope-exe -> This scope permits access to all files and list content of top level directories in the `$EXE`folder.", + "description": "This allows non-recursive read access to the `$EXE` folder.", "type": "string", - "enum": [ - "scope-exe" - ] + "const": "allow-exe-read" }, { - "description": "scope-exe-index -> This scope permits to list all files and folders in the `$EXE`folder.", + "description": "This allows non-recursive write access to the `$EXE` folder.", "type": "string", - "enum": [ - "scope-exe-index" - ] + "const": "allow-exe-write" }, { - "description": "allow-font-read-recursive -> This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$EXE` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-font-read-recursive" - ] + "const": "allow-exe-meta-recursive" }, { - "description": "allow-font-write-recursive -> This allows full recusrive write access to the complete `$FONT` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$EXE` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-font-write-recursive" - ] + "const": "allow-exe-meta" }, { - "description": "allow-font-read -> This allows non-recursive read access to the `$FONT` folder.", + "description": "This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-font-read" - ] + "const": "scope-exe-recursive" }, { - "description": "allow-font-write -> This allows non-recursive write access to the `$FONT` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$EXE` folder.", "type": "string", - "enum": [ - "allow-font-write" - ] + "const": "scope-exe" }, { - "description": "allow-font-meta-recursive -> This allows read access to metadata of the `$FONT` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$EXE`folder.", "type": "string", - "enum": [ - "allow-font-meta-recursive" - ] + "const": "scope-exe-index" }, { - "description": "allow-font-meta -> This allows read access to metadata of the `$FONT` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-font-meta" - ] + "const": "allow-font-read-recursive" }, { - "description": "scope-font-recursive -> This scope recursive access to the complete `$FONT` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-font-recursive" - ] + "const": "allow-font-write-recursive" }, { - "description": "scope-font -> This scope permits access to all files and list content of top level directories in the `$FONT`folder.", + "description": "This allows non-recursive read access to the `$FONT` folder.", "type": "string", - "enum": [ - "scope-font" - ] + "const": "allow-font-read" }, { - "description": "scope-font-index -> This scope permits to list all files and folders in the `$FONT`folder.", + "description": "This allows non-recursive write access to the `$FONT` folder.", "type": "string", - "enum": [ - "scope-font-index" - ] + "const": "allow-font-write" }, { - "description": "allow-home-read-recursive -> This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$FONT` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-home-read-recursive" - ] + "const": "allow-font-meta-recursive" }, { - "description": "allow-home-write-recursive -> This allows full recusrive write access to the complete `$HOME` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$FONT` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-home-write-recursive" - ] + "const": "allow-font-meta" }, { - "description": "allow-home-read -> This allows non-recursive read access to the `$HOME` folder.", + "description": "This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-home-read" - ] + "const": "scope-font-recursive" }, { - "description": "allow-home-write -> This allows non-recursive write access to the `$HOME` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$FONT` folder.", "type": "string", - "enum": [ - "allow-home-write" - ] + "const": "scope-font" }, { - "description": "allow-home-meta-recursive -> This allows read access to metadata of the `$HOME` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$FONT`folder.", "type": "string", - "enum": [ - "allow-home-meta-recursive" - ] + "const": "scope-font-index" }, { - "description": "allow-home-meta -> This allows read access to metadata of the `$HOME` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-home-meta" - ] + "const": "allow-home-read-recursive" }, { - "description": "scope-home-recursive -> This scope recursive access to the complete `$HOME` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-home-recursive" - ] + "const": "allow-home-write-recursive" }, { - "description": "scope-home -> This scope permits access to all files and list content of top level directories in the `$HOME`folder.", + "description": "This allows non-recursive read access to the `$HOME` folder.", "type": "string", - "enum": [ - "scope-home" - ] + "const": "allow-home-read" }, { - "description": "scope-home-index -> This scope permits to list all files and folders in the `$HOME`folder.", + "description": "This allows non-recursive write access to the `$HOME` folder.", "type": "string", - "enum": [ - "scope-home-index" - ] + "const": "allow-home-write" }, { - "description": "allow-localdata-read-recursive -> This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$HOME` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-localdata-read-recursive" - ] + "const": "allow-home-meta-recursive" }, { - "description": "allow-localdata-write-recursive -> This allows full recusrive write access to the complete `$LOCALDATA` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$HOME` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-localdata-write-recursive" - ] + "const": "allow-home-meta" }, { - "description": "allow-localdata-read -> This allows non-recursive read access to the `$LOCALDATA` folder.", + "description": "This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-localdata-read" - ] + "const": "scope-home-recursive" }, { - "description": "allow-localdata-write -> This allows non-recursive write access to the `$LOCALDATA` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$HOME` folder.", "type": "string", - "enum": [ - "allow-localdata-write" - ] + "const": "scope-home" }, { - "description": "allow-localdata-meta-recursive -> This allows read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$HOME`folder.", "type": "string", - "enum": [ - "allow-localdata-meta-recursive" - ] + "const": "scope-home-index" }, { - "description": "allow-localdata-meta -> This allows read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-localdata-meta" - ] + "const": "allow-localdata-read-recursive" }, { - "description": "scope-localdata-recursive -> This scope recursive access to the complete `$LOCALDATA` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-localdata-recursive" - ] + "const": "allow-localdata-write-recursive" }, { - "description": "scope-localdata -> This scope permits access to all files and list content of top level directories in the `$LOCALDATA`folder.", + "description": "This allows non-recursive read access to the `$LOCALDATA` folder.", "type": "string", - "enum": [ - "scope-localdata" - ] + "const": "allow-localdata-read" }, { - "description": "scope-localdata-index -> This scope permits to list all files and folders in the `$LOCALDATA`folder.", + "description": "This allows non-recursive write access to the `$LOCALDATA` folder.", "type": "string", - "enum": [ - "scope-localdata-index" - ] + "const": "allow-localdata-write" }, { - "description": "allow-log-read-recursive -> This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-log-read-recursive" - ] + "const": "allow-localdata-meta-recursive" }, { - "description": "allow-log-write-recursive -> This allows full recusrive write access to the complete `$LOG` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-log-write-recursive" - ] + "const": "allow-localdata-meta" }, { - "description": "allow-log-read -> This allows non-recursive read access to the `$LOG` folder.", + "description": "This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-log-read" - ] + "const": "scope-localdata-recursive" }, { - "description": "allow-log-write -> This allows non-recursive write access to the `$LOG` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder.", "type": "string", - "enum": [ - "allow-log-write" - ] + "const": "scope-localdata" }, { - "description": "allow-log-meta-recursive -> This allows read access to metadata of the `$LOG` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$LOCALDATA`folder.", "type": "string", - "enum": [ - "allow-log-meta-recursive" - ] + "const": "scope-localdata-index" }, { - "description": "allow-log-meta -> This allows read access to metadata of the `$LOG` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-log-meta" - ] + "const": "allow-log-read-recursive" }, { - "description": "scope-log-recursive -> This scope recursive access to the complete `$LOG` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-log-recursive" - ] + "const": "allow-log-write-recursive" }, { - "description": "scope-log -> This scope permits access to all files and list content of top level directories in the `$LOG`folder.", + "description": "This allows non-recursive read access to the `$LOG` folder.", "type": "string", - "enum": [ - "scope-log" - ] + "const": "allow-log-read" }, { - "description": "scope-log-index -> This scope permits to list all files and folders in the `$LOG`folder.", + "description": "This allows non-recursive write access to the `$LOG` folder.", "type": "string", - "enum": [ - "scope-log-index" - ] + "const": "allow-log-write" }, { - "description": "allow-picture-read-recursive -> This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$LOG` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-picture-read-recursive" - ] + "const": "allow-log-meta-recursive" }, { - "description": "allow-picture-write-recursive -> This allows full recusrive write access to the complete `$PICTURE` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$LOG` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-picture-write-recursive" - ] + "const": "allow-log-meta" }, { - "description": "allow-picture-read -> This allows non-recursive read access to the `$PICTURE` folder.", + "description": "This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-picture-read" - ] + "const": "scope-log-recursive" }, { - "description": "allow-picture-write -> This allows non-recursive write access to the `$PICTURE` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$LOG` folder.", "type": "string", - "enum": [ - "allow-picture-write" - ] + "const": "scope-log" }, { - "description": "allow-picture-meta-recursive -> This allows read access to metadata of the `$PICTURE` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$LOG`folder.", "type": "string", - "enum": [ - "allow-picture-meta-recursive" - ] + "const": "scope-log-index" }, { - "description": "allow-picture-meta -> This allows read access to metadata of the `$PICTURE` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-picture-meta" - ] + "const": "allow-picture-read-recursive" }, { - "description": "scope-picture-recursive -> This scope recursive access to the complete `$PICTURE` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-picture-recursive" - ] + "const": "allow-picture-write-recursive" }, { - "description": "scope-picture -> This scope permits access to all files and list content of top level directories in the `$PICTURE`folder.", + "description": "This allows non-recursive read access to the `$PICTURE` folder.", "type": "string", - "enum": [ - "scope-picture" - ] + "const": "allow-picture-read" }, { - "description": "scope-picture-index -> This scope permits to list all files and folders in the `$PICTURE`folder.", + "description": "This allows non-recursive write access to the `$PICTURE` folder.", "type": "string", - "enum": [ - "scope-picture-index" - ] + "const": "allow-picture-write" }, { - "description": "allow-public-read-recursive -> This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-public-read-recursive" - ] + "const": "allow-picture-meta-recursive" }, { - "description": "allow-public-write-recursive -> This allows full recusrive write access to the complete `$PUBLIC` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-public-write-recursive" - ] + "const": "allow-picture-meta" }, { - "description": "allow-public-read -> This allows non-recursive read access to the `$PUBLIC` folder.", + "description": "This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-public-read" - ] + "const": "scope-picture-recursive" }, { - "description": "allow-public-write -> This allows non-recursive write access to the `$PUBLIC` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$PICTURE` folder.", "type": "string", - "enum": [ - "allow-public-write" - ] + "const": "scope-picture" }, { - "description": "allow-public-meta-recursive -> This allows read access to metadata of the `$PUBLIC` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$PICTURE`folder.", "type": "string", - "enum": [ - "allow-public-meta-recursive" - ] + "const": "scope-picture-index" }, { - "description": "allow-public-meta -> This allows read access to metadata of the `$PUBLIC` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-public-meta" - ] + "const": "allow-public-read-recursive" }, { - "description": "scope-public-recursive -> This scope recursive access to the complete `$PUBLIC` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-public-recursive" - ] + "const": "allow-public-write-recursive" }, { - "description": "scope-public -> This scope permits access to all files and list content of top level directories in the `$PUBLIC`folder.", + "description": "This allows non-recursive read access to the `$PUBLIC` folder.", "type": "string", - "enum": [ - "scope-public" - ] + "const": "allow-public-read" }, { - "description": "scope-public-index -> This scope permits to list all files and folders in the `$PUBLIC`folder.", + "description": "This allows non-recursive write access to the `$PUBLIC` folder.", "type": "string", - "enum": [ - "scope-public-index" - ] + "const": "allow-public-write" }, { - "description": "allow-resource-read-recursive -> This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-resource-read-recursive" - ] + "const": "allow-public-meta-recursive" }, { - "description": "allow-resource-write-recursive -> This allows full recusrive write access to the complete `$RESOURCE` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-resource-write-recursive" - ] + "const": "allow-public-meta" }, { - "description": "allow-resource-read -> This allows non-recursive read access to the `$RESOURCE` folder.", + "description": "This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-resource-read" - ] + "const": "scope-public-recursive" }, { - "description": "allow-resource-write -> This allows non-recursive write access to the `$RESOURCE` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder.", "type": "string", - "enum": [ - "allow-resource-write" - ] + "const": "scope-public" }, { - "description": "allow-resource-meta-recursive -> This allows read access to metadata of the `$RESOURCE` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$PUBLIC`folder.", "type": "string", - "enum": [ - "allow-resource-meta-recursive" - ] + "const": "scope-public-index" }, { - "description": "allow-resource-meta -> This allows read access to metadata of the `$RESOURCE` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-resource-meta" - ] + "const": "allow-resource-read-recursive" }, { - "description": "scope-resource-recursive -> This scope recursive access to the complete `$RESOURCE` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-resource-recursive" - ] + "const": "allow-resource-write-recursive" }, { - "description": "scope-resource -> This scope permits access to all files and list content of top level directories in the `$RESOURCE`folder.", + "description": "This allows non-recursive read access to the `$RESOURCE` folder.", "type": "string", - "enum": [ - "scope-resource" - ] + "const": "allow-resource-read" }, { - "description": "scope-resource-index -> This scope permits to list all files and folders in the `$RESOURCE`folder.", + "description": "This allows non-recursive write access to the `$RESOURCE` folder.", "type": "string", - "enum": [ - "scope-resource-index" - ] + "const": "allow-resource-write" }, { - "description": "allow-runtime-read-recursive -> This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-runtime-read-recursive" - ] + "const": "allow-resource-meta-recursive" }, { - "description": "allow-runtime-write-recursive -> This allows full recusrive write access to the complete `$RUNTIME` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-runtime-write-recursive" - ] + "const": "allow-resource-meta" }, { - "description": "allow-runtime-read -> This allows non-recursive read access to the `$RUNTIME` folder.", + "description": "This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-runtime-read" - ] + "const": "scope-resource-recursive" }, { - "description": "allow-runtime-write -> This allows non-recursive write access to the `$RUNTIME` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder.", "type": "string", - "enum": [ - "allow-runtime-write" - ] + "const": "scope-resource" }, { - "description": "allow-runtime-meta-recursive -> This allows read access to metadata of the `$RUNTIME` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$RESOURCE`folder.", "type": "string", - "enum": [ - "allow-runtime-meta-recursive" - ] + "const": "scope-resource-index" }, { - "description": "allow-runtime-meta -> This allows read access to metadata of the `$RUNTIME` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-runtime-meta" - ] + "const": "allow-runtime-read-recursive" }, { - "description": "scope-runtime-recursive -> This scope recursive access to the complete `$RUNTIME` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-runtime-recursive" - ] + "const": "allow-runtime-write-recursive" }, { - "description": "scope-runtime -> This scope permits access to all files and list content of top level directories in the `$RUNTIME`folder.", + "description": "This allows non-recursive read access to the `$RUNTIME` folder.", "type": "string", - "enum": [ - "scope-runtime" - ] + "const": "allow-runtime-read" }, { - "description": "scope-runtime-index -> This scope permits to list all files and folders in the `$RUNTIME`folder.", + "description": "This allows non-recursive write access to the `$RUNTIME` folder.", "type": "string", - "enum": [ - "scope-runtime-index" - ] + "const": "allow-runtime-write" }, { - "description": "allow-temp-read-recursive -> This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-temp-read-recursive" - ] + "const": "allow-runtime-meta-recursive" }, { - "description": "allow-temp-write-recursive -> This allows full recusrive write access to the complete `$TEMP` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-temp-write-recursive" - ] + "const": "allow-runtime-meta" }, { - "description": "allow-temp-read -> This allows non-recursive read access to the `$TEMP` folder.", + "description": "This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-temp-read" - ] + "const": "scope-runtime-recursive" }, { - "description": "allow-temp-write -> This allows non-recursive write access to the `$TEMP` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder.", "type": "string", - "enum": [ - "allow-temp-write" - ] + "const": "scope-runtime" }, { - "description": "allow-temp-meta-recursive -> This allows read access to metadata of the `$TEMP` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$RUNTIME`folder.", "type": "string", - "enum": [ - "allow-temp-meta-recursive" - ] + "const": "scope-runtime-index" }, { - "description": "allow-temp-meta -> This allows read access to metadata of the `$TEMP` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-temp-meta" - ] + "const": "allow-temp-read-recursive" }, { - "description": "scope-temp-recursive -> This scope recursive access to the complete `$TEMP` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-temp-recursive" - ] + "const": "allow-temp-write-recursive" }, { - "description": "scope-temp -> This scope permits access to all files and list content of top level directories in the `$TEMP`folder.", + "description": "This allows non-recursive read access to the `$TEMP` folder.", "type": "string", - "enum": [ - "scope-temp" - ] + "const": "allow-temp-read" }, { - "description": "scope-temp-index -> This scope permits to list all files and folders in the `$TEMP`folder.", + "description": "This allows non-recursive write access to the `$TEMP` folder.", "type": "string", - "enum": [ - "scope-temp-index" - ] + "const": "allow-temp-write" }, { - "description": "allow-template-read-recursive -> This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-template-read-recursive" - ] + "const": "allow-temp-meta-recursive" }, { - "description": "allow-template-write-recursive -> This allows full recusrive write access to the complete `$TEMPLATE` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-template-write-recursive" - ] + "const": "allow-temp-meta" }, { - "description": "allow-template-read -> This allows non-recursive read access to the `$TEMPLATE` folder.", + "description": "This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-template-read" - ] + "const": "scope-temp-recursive" }, { - "description": "allow-template-write -> This allows non-recursive write access to the `$TEMPLATE` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$TEMP` folder.", "type": "string", - "enum": [ - "allow-template-write" - ] + "const": "scope-temp" }, { - "description": "allow-template-meta-recursive -> This allows read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$TEMP`folder.", "type": "string", - "enum": [ - "allow-template-meta-recursive" - ] + "const": "scope-temp-index" }, { - "description": "allow-template-meta -> This allows read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-template-meta" - ] + "const": "allow-template-read-recursive" }, { - "description": "scope-template-recursive -> This scope recursive access to the complete `$TEMPLATE` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-template-recursive" - ] + "const": "allow-template-write-recursive" }, { - "description": "scope-template -> This scope permits access to all files and list content of top level directories in the `$TEMPLATE`folder.", + "description": "This allows non-recursive read access to the `$TEMPLATE` folder.", "type": "string", - "enum": [ - "scope-template" - ] + "const": "allow-template-read" }, { - "description": "scope-template-index -> This scope permits to list all files and folders in the `$TEMPLATE`folder.", + "description": "This allows non-recursive write access to the `$TEMPLATE` folder.", "type": "string", - "enum": [ - "scope-template-index" - ] + "const": "allow-template-write" }, { - "description": "allow-video-read-recursive -> This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.", + "description": "This allows full recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-video-read-recursive" - ] + "const": "allow-template-meta-recursive" }, { - "description": "allow-video-write-recursive -> This allows full recusrive write access to the complete `$VIDEO` folder, files and subdirectories.", + "description": "This allows non-recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-video-write-recursive" - ] + "const": "allow-template-meta" }, { - "description": "allow-video-read -> This allows non-recursive read access to the `$VIDEO` folder.", + "description": "This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-video-read" - ] + "const": "scope-template-recursive" }, { - "description": "allow-video-write -> This allows non-recursive write access to the `$VIDEO` folder.", + "description": "This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder.", "type": "string", - "enum": [ - "allow-video-write" - ] + "const": "scope-template" }, { - "description": "allow-video-meta-recursive -> This allows read access to metadata of the `$VIDEO` folder, including file listing and statistics.", + "description": "This scope permits to list all files and folders in the `$TEMPLATE`folder.", "type": "string", - "enum": [ - "allow-video-meta-recursive" - ] + "const": "scope-template-index" }, { - "description": "allow-video-meta -> This allows read access to metadata of the `$VIDEO` folder, including file listing and statistics.", + "description": "This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.", "type": "string", - "enum": [ - "allow-video-meta" - ] + "const": "allow-video-read-recursive" }, { - "description": "scope-video-recursive -> This scope recursive access to the complete `$VIDEO` folder, including sub directories and files.", + "description": "This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.", "type": "string", - "enum": [ - "scope-video-recursive" - ] + "const": "allow-video-write-recursive" }, { - "description": "scope-video -> This scope permits access to all files and list content of top level directories in the `$VIDEO`folder.", + "description": "This allows non-recursive read access to the `$VIDEO` folder.", "type": "string", - "enum": [ - "scope-video" - ] + "const": "allow-video-read" }, { - "description": "scope-video-index -> This scope permits to list all files and folders in the `$VIDEO`folder.", + "description": "This allows non-recursive write access to the `$VIDEO` folder.", "type": "string", - "enum": [ - "scope-video-index" - ] + "const": "allow-video-write" }, { - "description": "allow-copy-file -> Enables the copy_file command without any pre-configured scope.", + "description": "This allows full recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.", "type": "string", - "enum": [ - "allow-copy-file" - ] + "const": "allow-video-meta-recursive" }, { - "description": "deny-copy-file -> Denies the copy_file command without any pre-configured scope.", + "description": "This allows non-recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.", "type": "string", - "enum": [ - "deny-copy-file" - ] + "const": "allow-video-meta" }, { - "description": "allow-create -> Enables the create command without any pre-configured scope.", + "description": "This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.", "type": "string", - "enum": [ - "allow-create" - ] + "const": "scope-video-recursive" }, { - "description": "deny-create -> Denies the create command without any pre-configured scope.", + "description": "This scope permits access to all files and list content of top level directories in the `$VIDEO` folder.", "type": "string", - "enum": [ - "deny-create" - ] + "const": "scope-video" }, { - "description": "allow-exists -> Enables the exists command without any pre-configured scope.", + "description": "This scope permits to list all files and folders in the `$VIDEO`folder.", "type": "string", - "enum": [ - "allow-exists" - ] + "const": "scope-video-index" }, { - "description": "deny-exists -> Denies the exists command without any pre-configured scope.", + "description": "Enables the copy_file command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-exists" - ] + "const": "allow-copy-file" }, { - "description": "allow-fstat -> Enables the fstat command without any pre-configured scope.", + "description": "Denies the copy_file command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-fstat" - ] + "const": "deny-copy-file" }, { - "description": "deny-fstat -> Denies the fstat command without any pre-configured scope.", + "description": "Enables the create command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-fstat" - ] + "const": "allow-create" }, { - "description": "allow-ftruncate -> Enables the ftruncate command without any pre-configured scope.", + "description": "Denies the create command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-ftruncate" - ] + "const": "deny-create" }, { - "description": "deny-ftruncate -> Denies the ftruncate command without any pre-configured scope.", + "description": "Enables the exists command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-ftruncate" - ] + "const": "allow-exists" }, { - "description": "allow-lstat -> Enables the lstat command without any pre-configured scope.", + "description": "Denies the exists command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-lstat" - ] + "const": "deny-exists" }, { - "description": "deny-lstat -> Denies the lstat command without any pre-configured scope.", + "description": "Enables the fstat command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-lstat" - ] + "const": "allow-fstat" }, { - "description": "allow-mkdir -> Enables the mkdir command without any pre-configured scope.", + "description": "Denies the fstat command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-mkdir" - ] + "const": "deny-fstat" }, { - "description": "deny-mkdir -> Denies the mkdir command without any pre-configured scope.", + "description": "Enables the ftruncate command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-mkdir" - ] + "const": "allow-ftruncate" }, { - "description": "allow-open -> Enables the open command without any pre-configured scope.", + "description": "Denies the ftruncate command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-open" - ] + "const": "deny-ftruncate" }, { - "description": "deny-open -> Denies the open command without any pre-configured scope.", + "description": "Enables the lstat command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-open" - ] + "const": "allow-lstat" }, { - "description": "allow-read -> Enables the read command without any pre-configured scope.", + "description": "Denies the lstat command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-read" - ] + "const": "deny-lstat" }, { - "description": "deny-read -> Denies the read command without any pre-configured scope.", + "description": "Enables the mkdir command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-read" - ] + "const": "allow-mkdir" }, { - "description": "allow-read-dir -> Enables the read_dir command without any pre-configured scope.", + "description": "Denies the mkdir command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-read-dir" - ] + "const": "deny-mkdir" }, { - "description": "deny-read-dir -> Denies the read_dir command without any pre-configured scope.", + "description": "Enables the open command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-read-dir" - ] + "const": "allow-open" }, { - "description": "allow-read-file -> Enables the read_file command without any pre-configured scope.", + "description": "Denies the open command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-read-file" - ] + "const": "deny-open" }, { - "description": "deny-read-file -> Denies the read_file command without any pre-configured scope.", + "description": "Enables the read command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-read-file" - ] + "const": "allow-read" }, { - "description": "allow-read-text-file -> Enables the read_text_file command without any pre-configured scope.", + "description": "Denies the read command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-read-text-file" - ] + "const": "deny-read" }, { - "description": "deny-read-text-file -> Denies the read_text_file command without any pre-configured scope.", + "description": "Enables the read_dir command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-read-text-file" - ] + "const": "allow-read-dir" }, { - "description": "allow-read-text-file-lines -> Enables the read_text_file_lines command without any pre-configured scope.", + "description": "Denies the read_dir command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-read-text-file-lines" - ] + "const": "deny-read-dir" }, { - "description": "deny-read-text-file-lines -> Denies the read_text_file_lines command without any pre-configured scope.", + "description": "Enables the read_file command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-read-text-file-lines" - ] + "const": "allow-read-file" }, { - "description": "allow-read-text-file-lines-next -> Enables the read_text_file_lines_next command without any pre-configured scope.", + "description": "Denies the read_file command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-read-text-file-lines-next" - ] + "const": "deny-read-file" }, { - "description": "deny-read-text-file-lines-next -> Denies the read_text_file_lines_next command without any pre-configured scope.", + "description": "Enables the read_text_file command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-read-text-file-lines-next" - ] + "const": "allow-read-text-file" }, { - "description": "allow-remove -> Enables the remove command without any pre-configured scope.", + "description": "Denies the read_text_file command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-remove" - ] + "const": "deny-read-text-file" }, { - "description": "deny-remove -> Denies the remove command without any pre-configured scope.", + "description": "Enables the read_text_file_lines command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-remove" - ] + "const": "allow-read-text-file-lines" }, { - "description": "allow-rename -> Enables the rename command without any pre-configured scope.", + "description": "Denies the read_text_file_lines command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-rename" - ] + "const": "deny-read-text-file-lines" }, { - "description": "deny-rename -> Denies the rename command without any pre-configured scope.", + "description": "Enables the read_text_file_lines_next command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-rename" - ] + "const": "allow-read-text-file-lines-next" }, { - "description": "allow-seek -> Enables the seek command without any pre-configured scope.", + "description": "Denies the read_text_file_lines_next command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-seek" - ] + "const": "deny-read-text-file-lines-next" }, { - "description": "deny-seek -> Denies the seek command without any pre-configured scope.", + "description": "Enables the remove command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-seek" - ] + "const": "allow-remove" }, { - "description": "allow-stat -> Enables the stat command without any pre-configured scope.", + "description": "Denies the remove command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-stat" - ] + "const": "deny-remove" }, { - "description": "deny-stat -> Denies the stat command without any pre-configured scope.", + "description": "Enables the rename command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-stat" - ] + "const": "allow-rename" }, { - "description": "allow-truncate -> Enables the truncate command without any pre-configured scope.", + "description": "Denies the rename command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-truncate" - ] + "const": "deny-rename" }, { - "description": "deny-truncate -> Denies the truncate command without any pre-configured scope.", + "description": "Enables the seek command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-truncate" - ] + "const": "allow-seek" }, { - "description": "allow-unwatch -> Enables the unwatch command without any pre-configured scope.", + "description": "Denies the seek command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-unwatch" - ] + "const": "deny-seek" }, { - "description": "deny-unwatch -> Denies the unwatch command without any pre-configured scope.", + "description": "Enables the stat command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-unwatch" - ] + "const": "allow-stat" }, { - "description": "allow-watch -> Enables the watch command without any pre-configured scope.", + "description": "Denies the stat command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-watch" - ] + "const": "deny-stat" }, { - "description": "deny-watch -> Denies the watch command without any pre-configured scope.", + "description": "Enables the truncate command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-watch" - ] + "const": "allow-truncate" }, { - "description": "allow-write -> Enables the write command without any pre-configured scope.", + "description": "Denies the truncate command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-write" - ] + "const": "deny-truncate" }, { - "description": "deny-write -> Denies the write command without any pre-configured scope.", + "description": "Enables the unwatch command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-write" - ] + "const": "allow-unwatch" }, { - "description": "allow-write-file -> Enables the write_file command without any pre-configured scope.", + "description": "Denies the unwatch command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-write-file" - ] + "const": "deny-unwatch" }, { - "description": "deny-write-file -> Denies the write_file command without any pre-configured scope.", + "description": "Enables the watch command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-write-file" - ] + "const": "allow-watch" }, { - "description": "allow-write-text-file -> Enables the write_text_file command without any pre-configured scope.", + "description": "Denies the watch command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-write-text-file" - ] + "const": "deny-watch" }, { - "description": "deny-write-text-file -> Denies the write_text_file command without any pre-configured scope.", + "description": "Enables the write command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-write-text-file" - ] + "const": "allow-write" }, { - "description": "default -> # Tauri `fs` default permissions\n\nThis configuration file defines the default permissions granted\nto the filesystem.\n\n### Granted Permissions\n\nThis default permission set enables all read-related commands and\nallows access to the `$APP` folder and sub directories created in it.\nThe location of the `$APP` folder depends on the operating system,\nwhere the application is run.\n\nIn general the `$APP` folder needs to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\n### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\nOn Windows the webview data folder access is denied.\n\n", + "description": "Denies the write command without any pre-configured scope.", "type": "string", - "enum": [ - "default" - ] + "const": "deny-write" }, { - "description": "deny-default -> This denies access to dangerous Tauri relevant files and folders by default.", + "description": "Enables the write_file command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-default" - ] + "const": "allow-write-file" }, { - "description": "deny-webview-data-linux -> This denies read access to the\n`$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.", + "description": "Denies the write_file command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-webview-data-linux" - ] + "const": "deny-write-file" }, { - "description": "deny-webview-data-windows -> This denies read access to the\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.", + "description": "Enables the write_text_file command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-webview-data-windows" - ] + "const": "allow-write-text-file" }, { - "description": "read-all -> This enables all read related commands without any pre-configured accessible paths.", + "description": "Denies the write_text_file command without any pre-configured scope.", "type": "string", - "enum": [ - "read-all" - ] + "const": "deny-write-text-file" }, { - "description": "read-dirs -> This enables directory read and file metadata related commands without any pre-configured accessible paths.", + "description": "This permissions allows to create the application specific directories.\n", "type": "string", - "enum": [ - "read-dirs" - ] + "const": "create-app-specific-dirs" }, { - "description": "read-files -> This enables file read related commands without any pre-configured accessible paths.", + "description": "This set of permissions describes the what kind of\nfile system access the `fs` plugin has enabled or denied by default.\n\n#### Granted Permissions\n\nThis default permission set enables read access to the\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\nAppLog) and all files and sub directories created in it.\nThe location of these directories depends on the operating system,\nwhere the application is run.\n\nIn general these directories need to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\nTherefore, it is also allowed to create all of these folders via\nthe `mkdir` command.\n\n#### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\nOn Windows the webview data folder access is denied.\n\n", "type": "string", - "enum": [ - "read-files" - ] + "const": "default" }, { - "description": "read-meta -> This enables all index or metadata related commands without any pre-configured accessible paths.", + "description": "This denies access to dangerous Tauri relevant files and folders by default.", "type": "string", - "enum": [ - "read-meta" - ] + "const": "deny-default" }, { - "description": "scope -> An empty permission you can use to modify the global scope.", + "description": "This denies read access to the\n`$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.", "type": "string", - "enum": [ - "scope" - ] + "const": "deny-webview-data-linux" }, { - "description": "write-all -> This enables all write related commands without any pre-configured accessible paths.", + "description": "This denies read access to the\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.", "type": "string", - "enum": [ - "write-all" - ] + "const": "deny-webview-data-windows" }, { - "description": "write-files -> This enables all file write related commands without any pre-configured accessible paths.", + "description": "This enables all read related commands without any pre-configured accessible paths.", "type": "string", - "enum": [ - "write-files" - ] + "const": "read-all" + }, + { + "description": "This permission allows recursive read functionality on the application\nspecific base directories. \n", + "type": "string", + "const": "read-app-specific-dirs-recursive" + }, + { + "description": "This enables directory read and file metadata related commands without any pre-configured accessible paths.", + "type": "string", + "const": "read-dirs" + }, + { + "description": "This enables file read related commands without any pre-configured accessible paths.", + "type": "string", + "const": "read-files" + }, + { + "description": "This enables all index or metadata related commands without any pre-configured accessible paths.", + "type": "string", + "const": "read-meta" + }, + { + "description": "An empty permission you can use to modify the global scope.", + "type": "string", + "const": "scope" + }, + { + "description": "This enables all write related commands without any pre-configured accessible paths.", + "type": "string", + "const": "write-all" + }, + { + "description": "This enables all file write related commands without any pre-configured accessible paths.", + "type": "string", + "const": "write-files" } ] } diff --git a/plugins/fs/permissions/write-all.toml b/plugins/fs/permissions/write-all.toml index 55a512de..c1802782 100644 --- a/plugins/fs/permissions/write-all.toml +++ b/plugins/fs/permissions/write-all.toml @@ -4,14 +4,14 @@ identifier = "write-all" description = "This enables all write related commands without any pre-configured accessible paths." commands.allow = [ - "mkdir", - "create", - "copy_file", - "remove", - "rename", - "truncate", - "ftruncate", - "write", - "write_file", - "write_text_file", + "mkdir", + "create", + "copy_file", + "remove", + "rename", + "truncate", + "ftruncate", + "write", + "write_file", + "write_text_file", ] diff --git a/plugins/fs/permissions/write-files.toml b/plugins/fs/permissions/write-files.toml index 239bc60d..2d6aeffb 100644 --- a/plugins/fs/permissions/write-files.toml +++ b/plugins/fs/permissions/write-files.toml @@ -4,13 +4,13 @@ identifier = "write-files" description = "This enables all file write related commands without any pre-configured accessible paths." commands.allow = [ - "create", - "copy_file", - "remove", - "rename", - "truncate", - "ftruncate", - "write", - "write_file", - "write_text_file", + "create", + "copy_file", + "remove", + "rename", + "truncate", + "ftruncate", + "write", + "write_file", + "write_text_file", ] diff --git a/plugins/fs/rollup.config.js b/plugins/fs/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/fs/rollup.config.js +++ b/plugins/fs/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/fs/src/api-iife.js b/plugins/fs/src/api-iife.js deleted file mode 100644 index f380ba77..00000000 --- a/plugins/fs/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_FS__=function(t){"use strict";function e(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function n(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n}var i,o,r,a;"function"==typeof SuppressedError&&SuppressedError;class s{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,i.set(this,(()=>{})),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((t=>{e(this,i,"f").call(this,t)}))}set onmessage(t){n(this,i,t,"f")}get onmessage(){return e(this,i,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function c(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}i=new WeakMap;class f{get rid(){return e(this,o,"f")}constructor(t){o.set(this,void 0),n(this,o,t,"f")}async close(){return c("plugin:resources|close",{rid:this.rid})}}function l(t){return{isFile:t.isFile,isDirectory:t.isDirectory,isSymlink:t.isSymlink,size:t.size,mtime:null!=t.mtime?new Date(t.mtime):null,atime:null!=t.atime?new Date(t.atime):null,birthtime:null!=t.birthtime?new Date(t.birthtime):null,readonly:t.readonly,fileAttributes:t.fileAttributes,dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,blksize:t.blksize,blocks:t.blocks}}o=new WeakMap,t.BaseDirectory=void 0,(r=t.BaseDirectory||(t.BaseDirectory={}))[r.Audio=1]="Audio",r[r.Cache=2]="Cache",r[r.Config=3]="Config",r[r.Data=4]="Data",r[r.LocalData=5]="LocalData",r[r.Document=6]="Document",r[r.Download=7]="Download",r[r.Picture=8]="Picture",r[r.Public=9]="Public",r[r.Video=10]="Video",r[r.Resource=11]="Resource",r[r.Temp=12]="Temp",r[r.AppConfig=13]="AppConfig",r[r.AppData=14]="AppData",r[r.AppLocalData=15]="AppLocalData",r[r.AppCache=16]="AppCache",r[r.AppLog=17]="AppLog",r[r.Desktop=18]="Desktop",r[r.Executable=19]="Executable",r[r.Font=20]="Font",r[r.Home=21]="Home",r[r.Runtime=22]="Runtime",r[r.Template=23]="Template",t.SeekMode=void 0,(a=t.SeekMode||(t.SeekMode={}))[a.Start=0]="Start",a[a.Current=1]="Current",a[a.End=2]="End";class u extends f{constructor(t){super(t)}async read(t){if(0===t.byteLength)return 0;const[e,n]=await c("plugin:fs|read",{rid:this.rid,len:t.byteLength});return t.set(e),0===n?null:n}async seek(t,e){return c("plugin:fs|seek",{rid:this.rid,offset:t,whence:e})}async stat(){return l(await c("plugin:fs|fstat",{rid:this.rid}))}async truncate(t){return c("plugin:fs|ftruncate",{rid:this.rid,len:t})}async write(t){return c("plugin:fs|write",{rid:this.rid,data:Array.from(t)})}}async function p(t){await c("plugin:fs|unwatch",{rid:t})}return t.FileHandle=u,t.copyFile=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol||e instanceof URL&&"file:"!==e.protocol)throw new TypeError("Must be a file URL.");return c("plugin:fs|copy_file",{fromPath:t instanceof URL?t.toString():t,toPath:e instanceof URL?e.toString():e,options:n})},t.create=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const n=await c("plugin:fs|create",{path:t instanceof URL?t.toString():t,options:e});return new u(n)},t.exists=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");return c("plugin:fs|exists",{path:t instanceof URL?t.toString():t,options:e})},t.lstat=async function(t,e){return l(await c("plugin:fs|lstat",{path:t instanceof URL?t.toString():t,options:e}))},t.mkdir=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");return c("plugin:fs|mkdir",{path:t instanceof URL?t.toString():t,options:e})},t.open=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const n=await c("plugin:fs|open",{path:t instanceof URL?t.toString():t,options:e});return new u(n)},t.readDir=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");return c("plugin:fs|read_dir",{path:t instanceof URL?t.toString():t,options:e})},t.readFile=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const n=await c("plugin:fs|read_file",{path:t instanceof URL?t.toString():t,options:e});return Uint8Array.from(n)},t.readTextFile=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");return c("plugin:fs|read_text_file",{path:t instanceof URL?t.toString():t,options:e})},t.readTextFileLines=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const n=t instanceof URL?t.toString():t;return Promise.resolve({path:n,rid:null,async next(){this.rid||(this.rid=await c("plugin:fs|read_text_file_lines",{path:n,options:e}));const[t,i]=await c("plugin:fs|read_text_file_lines_next",{rid:this.rid});return i&&(this.rid=null),{value:i?"":t,done:i}},[Symbol.asyncIterator](){return this}})},t.remove=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");return c("plugin:fs|remove",{path:t instanceof URL?t.toString():t,options:e})},t.rename=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol||e instanceof URL&&"file:"!==e.protocol)throw new TypeError("Must be a file URL.");return c("plugin:fs|rename",{oldPath:t instanceof URL?t.toString():t,newPath:e instanceof URL?e.toString():e,options:n})},t.stat=async function(t,e){return l(await c("plugin:fs|stat",{path:t instanceof URL?t.toString():t,options:e}))},t.truncate=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");return c("plugin:fs|truncate",{path:t instanceof URL?t.toString():t,len:e,options:n})},t.watch=async function(t,e,n){const i={recursive:!1,delayMs:2e3,...n},o=Array.isArray(t)?t:[t];for(const t of o)if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const r=new s;r.onmessage=e;const a=await c("plugin:fs|watch",{paths:o.map((t=>t instanceof URL?t.toString():t)),options:i,onEvent:r});return()=>{p(a)}},t.watchImmediate=async function(t,e,n){const i={recursive:!1,...n,delayMs:null},o=Array.isArray(t)?t:[t];for(const t of o)if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const r=new s;r.onmessage=e;const a=await c("plugin:fs|watch",{paths:o.map((t=>t instanceof URL?t.toString():t)),options:i,onEvent:r});return()=>{p(a)}},t.writeFile=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");return c("plugin:fs|write_file",{path:t instanceof URL?t.toString():t,data:Array.from(e),options:n})},t.writeTextFile=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");return c("plugin:fs|write_text_file",{path:t instanceof URL?t.toString():t,data:e,options:n})},t}({});Object.defineProperty(window.__TAURI__,"fs",{value:__TAURI_PLUGIN_FS__})} diff --git a/plugins/fs/src/commands.rs b/plugins/fs/src/commands.rs index fe49d15c..99eb5aa0 100644 --- a/plugins/fs/src/commands.rs +++ b/plugins/fs/src/commands.rs @@ -7,20 +7,22 @@ use serde::{Deserialize, Serialize, Serializer}; use serde_repr::{Deserialize_repr, Serialize_repr}; use tauri::{ ipc::{CommandScope, GlobalScope}, - path::{BaseDirectory, SafePathBuf}, + path::BaseDirectory, utils::config::FsScope, - AppHandle, Manager, Resource, ResourceId, Runtime, + Manager, Resource, ResourceId, Runtime, Webview, }; use std::{ + borrow::Cow, fs::File, io::{BufReader, Lines, Read, Write}, path::{Path, PathBuf}, + str::FromStr, sync::Mutex, time::{SystemTime, UNIX_EPOCH}, }; -use crate::{scope::Entry, Error, FsExt}; +use crate::{scope::Entry, Error, FsExt, SafeFilePath}; #[derive(Debug, thiserror::Error)] pub enum CommandError { @@ -31,6 +33,10 @@ pub enum CommandError { #[error(transparent)] Tauri(#[from] tauri::Error), #[error(transparent)] + Json(#[from] serde_json::Error), + #[error(transparent)] + Io(#[from] std::io::Error), + #[error(transparent)] UrlParseError(#[from] url::ParseError), #[cfg(feature = "watch")] #[error(transparent)] @@ -64,7 +70,7 @@ impl Serialize for CommandError { pub type CommandResult = std::result::Result; -#[derive(Debug, Clone, Deserialize)] +#[derive(Debug, Default, Clone, Deserialize)] #[serde(rename_all = "camelCase")] pub struct BaseOptions { base_dir: Option, @@ -72,14 +78,14 @@ pub struct BaseOptions { #[tauri::command] pub fn create( - app: AppHandle, + webview: Webview, global_scope: GlobalScope, command_scope: CommandScope, - path: SafePathBuf, + path: SafeFilePath, options: Option, ) -> CommandResult { let resolved_path = resolve_path( - &app, + &webview, &global_scope, &command_scope, path, @@ -91,87 +97,62 @@ pub fn create( resolved_path.display() ) })?; - let rid = app.resources_table().add(StdFileResource::new(file)); + let rid = webview.resources_table().add(StdFileResource::new(file)); Ok(rid) } -#[derive(Debug, Clone, Deserialize)] +#[derive(Debug, Default, Clone, Deserialize)] #[serde(rename_all = "camelCase")] pub struct OpenOptions { #[serde(flatten)] base: BaseOptions, - #[serde(default = "default_true")] - read: bool, - #[serde(default)] - write: bool, - #[serde(default)] - append: bool, - #[serde(default)] - truncate: bool, - #[serde(default)] - create: bool, - #[serde(default)] - create_new: bool, - #[allow(unused)] - mode: Option, -} - -fn default_true() -> bool { - true + #[serde(flatten)] + options: crate::OpenOptions, } #[tauri::command] pub fn open( - app: AppHandle, + webview: Webview, global_scope: GlobalScope, command_scope: CommandScope, - path: SafePathBuf, + path: SafeFilePath, options: Option, ) -> CommandResult { - let resolved_path = resolve_path( - &app, + let (file, _path) = resolve_file( + &webview, &global_scope, &command_scope, path, - options.as_ref().and_then(|o| o.base.base_dir), - )?; - - let mut opts = std::fs::OpenOptions::new(); - // default to read-only - opts.read(true); - - if let Some(options) = options { - #[cfg(unix)] - { - use std::os::unix::fs::OpenOptionsExt; - if let Some(mode) = options.mode { - opts.mode(mode); + if let Some(opts) = options { + OpenOptions { + base: opts.base, + options: opts.options, } - } - - opts.read(options.read) - .create(options.create) - .write(options.write) - .truncate(options.truncate) - .append(options.append) - .create_new(options.create_new); - } - - let file = opts.open(&resolved_path).map_err(|e| { - format!( - "failed to open file at path: {} with error: {e}", - resolved_path.display() - ) - })?; + } else { + OpenOptions { + base: BaseOptions { base_dir: None }, + options: crate::OpenOptions { + read: true, + write: false, + truncate: false, + create: false, + create_new: false, + append: false, + mode: None, + custom_flags: None, + }, + } + }, + )?; - let rid = app.resources_table().add(StdFileResource::new(file)); + let rid = webview.resources_table().add(StdFileResource::new(file)); Ok(rid) } #[tauri::command] -pub fn close(app: AppHandle, rid: ResourceId) -> CommandResult<()> { - app.resources_table().close(rid).map_err(Into::into) +pub fn close(webview: Webview, rid: ResourceId) -> CommandResult<()> { + webview.resources_table().close(rid).map_err(Into::into) } #[derive(Debug, Clone, Deserialize)] @@ -182,23 +163,23 @@ pub struct CopyFileOptions { } #[tauri::command] -pub fn copy_file( - app: AppHandle, +pub async fn copy_file( + webview: Webview, global_scope: GlobalScope, command_scope: CommandScope, - from_path: SafePathBuf, - to_path: SafePathBuf, + from_path: SafeFilePath, + to_path: SafeFilePath, options: Option, ) -> CommandResult<()> { let resolved_from_path = resolve_path( - &app, + &webview, &global_scope, &command_scope, from_path, options.as_ref().and_then(|o| o.from_path_base_dir), )?; let resolved_to_path = resolve_path( - &app, + &webview, &global_scope, &command_scope, to_path, @@ -225,14 +206,14 @@ pub struct MkdirOptions { #[tauri::command] pub fn mkdir( - app: AppHandle, + webview: Webview, global_scope: GlobalScope, command_scope: CommandScope, - path: SafePathBuf, + path: SafeFilePath, options: Option, ) -> CommandResult<()> { let resolved_path = resolve_path( - &app, + &webview, &global_scope, &command_scope, path, @@ -291,15 +272,15 @@ fn read_dir_inner>(path: P) -> crate::Result> { } #[tauri::command] -pub fn read_dir( - app: AppHandle, +pub async fn read_dir( + webview: Webview, global_scope: GlobalScope, command_scope: CommandScope, - path: SafePathBuf, + path: SafeFilePath, options: Option, ) -> CommandResult> { let resolved_path = resolve_path( - &app, + &webview, &global_scope, &command_scope, path, @@ -317,80 +298,125 @@ pub fn read_dir( } #[tauri::command] -pub fn read( - app: AppHandle, +pub async fn read( + webview: Webview, rid: ResourceId, - len: u32, -) -> CommandResult<(Vec, usize)> { - let mut data = vec![0; len as usize]; - let file = app.resources_table().get::(rid)?; + len: usize, +) -> CommandResult { + let mut data = vec![0; len]; + let file = webview.resources_table().get::(rid)?; let nread = StdFileResource::with_lock(&file, |mut file| file.read(&mut data)) .map_err(|e| format!("faied to read bytes from file with error: {e}"))?; - Ok((data, nread)) + + // This is an optimization to include the number of read bytes (as bigendian bytes) + // at the end of returned vector so we can use `tauri::ipc::Response` + // and avoid serialization overhead of separate values. + #[cfg(target_pointer_width = "16")] + let nread = { + let nread = nread.to_be_bytes(); + let mut out = [0; 8]; + out[6..].copy_from_slice(&nread); + out + }; + #[cfg(target_pointer_width = "32")] + let nread = { + let nread = nread.to_be_bytes(); + let mut out = [0; 8]; + out[4..].copy_from_slice(&nread); + out + }; + #[cfg(target_pointer_width = "64")] + let nread = nread.to_be_bytes(); + + data.extend(nread); + + Ok(tauri::ipc::Response::new(data)) } #[tauri::command] -pub fn read_file( - app: AppHandle, +pub async fn read_file( + webview: Webview, global_scope: GlobalScope, command_scope: CommandScope, - path: SafePathBuf, + path: SafeFilePath, options: Option, -) -> CommandResult> { - let resolved_path = resolve_path( - &app, +) -> CommandResult { + let (mut file, path) = resolve_file( + &webview, &global_scope, &command_scope, path, - options.as_ref().and_then(|o| o.base_dir), + OpenOptions { + base: BaseOptions { + base_dir: options.as_ref().and_then(|o| o.base_dir), + }, + options: crate::OpenOptions { + read: true, + ..Default::default() + }, + }, )?; - std::fs::read(&resolved_path) - .map_err(|e| { - format!( - "failed to read file at path: {} with error: {e}", - resolved_path.display() - ) - }) - .map_err(Into::into) + + let mut contents = Vec::new(); + + file.read_to_end(&mut contents).map_err(|e| { + format!( + "failed to read file as text at path: {} with error: {e}", + path.display() + ) + })?; + + Ok(tauri::ipc::Response::new(contents)) } #[tauri::command] -pub fn read_text_file( - app: AppHandle, +pub async fn read_text_file( + webview: Webview, global_scope: GlobalScope, command_scope: CommandScope, - path: SafePathBuf, + path: SafeFilePath, options: Option, ) -> CommandResult { - let resolved_path = resolve_path( - &app, + let (mut file, path) = resolve_file( + &webview, &global_scope, &command_scope, path, - options.as_ref().and_then(|o| o.base_dir), + OpenOptions { + base: BaseOptions { + base_dir: options.as_ref().and_then(|o| o.base_dir), + }, + options: crate::OpenOptions { + read: true, + ..Default::default() + }, + }, )?; - std::fs::read_to_string(&resolved_path) - .map_err(|e| { - format!( - "failed to read file as text at path: {} with error: {e}", - resolved_path.display() - ) - }) - .map_err(Into::into) + + let mut contents = String::new(); + + file.read_to_string(&mut contents).map_err(|e| { + format!( + "failed to read file as text at path: {} with error: {e}", + path.display() + ) + })?; + + Ok(contents) } #[tauri::command] pub fn read_text_file_lines( - app: AppHandle, + webview: Webview, global_scope: GlobalScope, command_scope: CommandScope, - path: SafePathBuf, + path: SafeFilePath, options: Option, ) -> CommandResult { use std::io::BufRead; let resolved_path = resolve_path( - &app, + &webview, &global_scope, &command_scope, path, @@ -405,17 +431,17 @@ pub fn read_text_file_lines( })?; let lines = BufReader::new(file).lines(); - let rid = app.resources_table().add(StdLinesResource::new(lines)); + let rid = webview.resources_table().add(StdLinesResource::new(lines)); Ok(rid) } #[tauri::command] -pub fn read_text_file_lines_next( - app: AppHandle, +pub async fn read_text_file_lines_next( + webview: Webview, rid: ResourceId, ) -> CommandResult<(Option, bool)> { - let mut resource_table = app.resources_table(); + let mut resource_table = webview.resources_table(); let lines = resource_table.get::(rid)?; let ret = StdLinesResource::with_lock(&lines, |lines| { @@ -437,14 +463,14 @@ pub struct RemoveOptions { #[tauri::command] pub fn remove( - app: AppHandle, + webview: Webview, global_scope: GlobalScope, command_scope: CommandScope, - path: SafePathBuf, + path: SafeFilePath, options: Option, ) -> CommandResult<()> { let resolved_path = resolve_path( - &app, + &webview, &global_scope, &command_scope, path, @@ -505,22 +531,22 @@ pub struct RenameOptions { #[tauri::command] pub fn rename( - app: AppHandle, + webview: Webview, global_scope: GlobalScope, command_scope: CommandScope, - old_path: SafePathBuf, - new_path: SafePathBuf, + old_path: SafeFilePath, + new_path: SafeFilePath, options: Option, ) -> CommandResult<()> { let resolved_old_path = resolve_path( - &app, + &webview, &global_scope, &command_scope, old_path, options.as_ref().and_then(|o| o.old_path_base_dir), )?; let resolved_new_path = resolve_path( - &app, + &webview, &global_scope, &command_scope, new_path, @@ -546,14 +572,14 @@ pub enum SeekMode { } #[tauri::command] -pub fn seek( - app: AppHandle, +pub async fn seek( + webview: Webview, rid: ResourceId, offset: i64, whence: SeekMode, ) -> CommandResult { use std::io::{Seek, SeekFrom}; - let file = app.resources_table().get::(rid)?; + let file = webview.resources_table().get::(rid)?; StdFileResource::with_lock(&file, |mut file| { file.seek(match whence { SeekMode::Start => SeekFrom::Start(offset as u64), @@ -565,73 +591,150 @@ pub fn seek( .map_err(Into::into) } -#[tauri::command] -pub fn stat( - app: AppHandle, - global_scope: GlobalScope, - command_scope: CommandScope, - path: SafePathBuf, +#[cfg(target_os = "android")] +fn get_metadata std::io::Result>( + metadata_fn: F, + webview: &Webview, + global_scope: &GlobalScope, + command_scope: &CommandScope, + path: SafeFilePath, options: Option, -) -> CommandResult { +) -> CommandResult { + match path { + SafeFilePath::Url(url) => { + let (file, path) = resolve_file( + webview, + global_scope, + command_scope, + SafeFilePath::Url(url), + OpenOptions { + base: BaseOptions { base_dir: None }, + options: crate::OpenOptions { + read: true, + ..Default::default() + }, + }, + )?; + file.metadata().map_err(|e| { + format!( + "failed to get metadata of path: {} with error: {e}", + path.display() + ) + .into() + }) + } + SafeFilePath::Path(p) => get_fs_metadata( + metadata_fn, + webview, + global_scope, + command_scope, + SafeFilePath::Path(p), + options, + ), + } +} + +#[cfg(not(target_os = "android"))] +fn get_metadata std::io::Result>( + metadata_fn: F, + webview: &Webview, + global_scope: &GlobalScope, + command_scope: &CommandScope, + path: SafeFilePath, + options: Option, +) -> CommandResult { + get_fs_metadata( + metadata_fn, + webview, + global_scope, + command_scope, + path, + options, + ) +} + +fn get_fs_metadata std::io::Result>( + metadata_fn: F, + webview: &Webview, + global_scope: &GlobalScope, + command_scope: &CommandScope, + path: SafeFilePath, + options: Option, +) -> CommandResult { let resolved_path = resolve_path( - &app, - &global_scope, - &command_scope, + webview, + global_scope, + command_scope, path, options.as_ref().and_then(|o| o.base_dir), )?; - let metadata = std::fs::metadata(&resolved_path).map_err(|e| { + let metadata = metadata_fn(&resolved_path).map_err(|e| { format!( "failed to get metadata of path: {} with error: {e}", resolved_path.display() ) })?; + Ok(metadata) +} + +#[tauri::command] +pub fn stat( + webview: Webview, + global_scope: GlobalScope, + command_scope: CommandScope, + path: SafeFilePath, + options: Option, +) -> CommandResult { + let metadata = get_metadata( + |p| std::fs::metadata(p), + &webview, + &global_scope, + &command_scope, + path, + options, + )?; + Ok(get_stat(metadata)) } #[tauri::command] pub fn lstat( - app: AppHandle, + webview: Webview, global_scope: GlobalScope, command_scope: CommandScope, - path: SafePathBuf, + path: SafeFilePath, options: Option, ) -> CommandResult { - let resolved_path = resolve_path( - &app, + let metadata = get_metadata( + |p| std::fs::symlink_metadata(p), + &webview, &global_scope, &command_scope, path, - options.as_ref().and_then(|o| o.base_dir), + options, )?; - let metadata = std::fs::symlink_metadata(&resolved_path).map_err(|e| { - format!( - "failed to get metadata of path: {} with error: {e}", - resolved_path.display() - ) - })?; Ok(get_stat(metadata)) } #[tauri::command] -pub fn fstat(app: AppHandle, rid: ResourceId) -> CommandResult { - let file = app.resources_table().get::(rid)?; +pub fn fstat(webview: Webview, rid: ResourceId) -> CommandResult { + let file = webview.resources_table().get::(rid)?; let metadata = StdFileResource::with_lock(&file, |file| file.metadata()) .map_err(|e| format!("failed to get metadata of file with error: {e}"))?; Ok(get_stat(metadata)) } #[tauri::command] -pub fn truncate( - app: AppHandle, +pub async fn truncate( + webview: Webview, global_scope: GlobalScope, command_scope: CommandScope, - path: SafePathBuf, + path: SafeFilePath, len: Option, options: Option, ) -> CommandResult<()> { let resolved_path = resolve_path( - &app, + &webview, &global_scope, &command_scope, path, @@ -657,24 +760,24 @@ pub fn truncate( } #[tauri::command] -pub fn ftruncate( - app: AppHandle, +pub async fn ftruncate( + webview: Webview, rid: ResourceId, len: Option, ) -> CommandResult<()> { - let file = app.resources_table().get::(rid)?; + let file = webview.resources_table().get::(rid)?; StdFileResource::with_lock(&file, |file| file.set_len(len.unwrap_or(0))) .map_err(|e| format!("failed to truncate file with error: {e}")) .map_err(Into::into) } #[tauri::command] -pub fn write( - app: AppHandle, +pub async fn write( + webview: Webview, rid: ResourceId, data: Vec, ) -> CommandResult { - let file = app.resources_table().get::(rid)?; + let file = webview.resources_table().get::(rid)?; StdFileResource::with_lock(&file, |mut file| file.write(&data)) .map_err(|e| format!("failed to write bytes to file with error: {e}")) .map_err(Into::into) @@ -700,98 +803,114 @@ fn default_create_value() -> bool { } fn write_file_inner( - app: AppHandle, + webview: Webview, global_scope: &GlobalScope, command_scope: &CommandScope, - path: SafePathBuf, - data: &[u8], - options: Option, + request: tauri::ipc::Request<'_>, ) -> CommandResult<()> { - let resolved_path = resolve_path( - &app, + let data = match request.body() { + tauri::ipc::InvokeBody::Raw(data) => Cow::Borrowed(data), + tauri::ipc::InvokeBody::Json(serde_json::Value::Array(data)) => Cow::Owned( + data.iter() + .flat_map(|v| v.as_number().and_then(|v| v.as_u64().map(|v| v as u8))) + .collect(), + ), + _ => return Err(anyhow::anyhow!("unexpected invoke body").into()), + }; + + let path = request + .headers() + .get("path") + .ok_or_else(|| anyhow::anyhow!("missing file path").into()) + .and_then(|p| { + percent_encoding::percent_decode(p.as_ref()) + .decode_utf8() + .map_err(|_| anyhow::anyhow!("path is not a valid UTF-8").into()) + }) + .and_then(|p| SafeFilePath::from_str(&p).map_err(CommandError::from))?; + let options: Option = request + .headers() + .get("options") + .and_then(|p| p.to_str().ok()) + .and_then(|opts| serde_json::from_str(opts).ok()); + + let (mut file, path) = resolve_file( + &webview, global_scope, command_scope, path, - options.as_ref().and_then(|o| o.base.base_dir), - )?; - - let mut opts = std::fs::OpenOptions::new(); - // defaults - opts.read(false).write(true).truncate(true).create(true); - - if let Some(options) = options { - #[cfg(unix)] - { - use std::os::unix::fs::OpenOptionsExt; - if let Some(mode) = options.mode { - opts.mode(mode); + if let Some(opts) = options { + OpenOptions { + base: opts.base, + options: crate::OpenOptions { + read: false, + write: true, + create: opts.create, + truncate: !opts.append, + append: opts.append, + create_new: opts.create_new, + mode: opts.mode, + custom_flags: None, + }, } - } - - opts.create(options.create) - .append(options.append) - .truncate(!options.append) - .create_new(options.create_new); - } - - let mut file = opts.open(&resolved_path).map_err(|e| { - format!( - "failed to open file at path: {} with error: {e}", - resolved_path.display() - ) - })?; + } else { + OpenOptions { + base: BaseOptions { base_dir: None }, + options: crate::OpenOptions { + read: false, + write: true, + truncate: true, + create: true, + create_new: false, + append: false, + mode: None, + custom_flags: None, + }, + } + }, + )?; - file.write_all(data) + file.write_all(&data) .map_err(|e| { format!( "failed to write bytes to file at path: {} with error: {e}", - resolved_path.display() + path.display() ) }) .map_err(Into::into) } #[tauri::command] -pub fn write_file( - app: AppHandle, +pub async fn write_file( + webview: Webview, global_scope: GlobalScope, command_scope: CommandScope, - path: SafePathBuf, - data: Vec, - options: Option, + request: tauri::ipc::Request<'_>, ) -> CommandResult<()> { - write_file_inner(app, &global_scope, &command_scope, path, &data, options) + write_file_inner(webview, &global_scope, &command_scope, request) } +// TODO, in v3, remove this command and rely on `write_file` command only #[tauri::command] -pub fn write_text_file( - app: AppHandle, +pub async fn write_text_file( + webview: Webview, global_scope: GlobalScope, command_scope: CommandScope, - path: SafePathBuf, - data: String, - options: Option, + request: tauri::ipc::Request<'_>, ) -> CommandResult<()> { - write_file_inner( - app, - &global_scope, - &command_scope, - path, - data.as_bytes(), - options, - ) + write_file_inner(webview, &global_scope, &command_scope, request) } #[tauri::command] pub fn exists( - app: AppHandle, + webview: Webview, global_scope: GlobalScope, command_scope: CommandScope, - path: SafePathBuf, + path: SafeFilePath, options: Option, ) -> CommandResult { let resolved_path = resolve_path( - &app, + &webview, &global_scope, &command_scope, path, @@ -800,46 +919,107 @@ pub fn exists( Ok(resolved_path.exists()) } +#[cfg(not(target_os = "android"))] +pub fn resolve_file( + webview: &Webview, + global_scope: &GlobalScope, + command_scope: &CommandScope, + path: SafeFilePath, + open_options: OpenOptions, +) -> CommandResult<(File, PathBuf)> { + resolve_file_in_fs(webview, global_scope, command_scope, path, open_options) +} + +fn resolve_file_in_fs( + webview: &Webview, + global_scope: &GlobalScope, + command_scope: &CommandScope, + path: SafeFilePath, + open_options: OpenOptions, +) -> CommandResult<(File, PathBuf)> { + let path = resolve_path( + webview, + global_scope, + command_scope, + path, + open_options.base.base_dir, + )?; + + let file = std::fs::OpenOptions::from(open_options.options) + .open(&path) + .map_err(|e| { + format!( + "failed to open file at path: {} with error: {e}", + path.display() + ) + })?; + Ok((file, path)) +} + +#[cfg(target_os = "android")] +pub fn resolve_file( + webview: &Webview, + global_scope: &GlobalScope, + command_scope: &CommandScope, + path: SafeFilePath, + open_options: OpenOptions, +) -> CommandResult<(File, PathBuf)> { + match path { + SafeFilePath::Url(url) => { + let path = url.as_str().into(); + let file = webview + .fs() + .open(SafeFilePath::Url(url), open_options.options)?; + Ok((file, path)) + } + SafeFilePath::Path(path) => resolve_file_in_fs( + webview, + global_scope, + command_scope, + SafeFilePath::Path(path), + open_options, + ), + } +} + pub fn resolve_path( - app: &AppHandle, + webview: &Webview, global_scope: &GlobalScope, command_scope: &CommandScope, - path: SafePathBuf, + path: SafeFilePath, base_dir: Option, ) -> CommandResult { - let path = file_url_to_safe_pathbuf(path)?; + let path = path.into_path()?; let path = if let Some(base_dir) = base_dir { - app.path() - .resolve(&path, base_dir) - .map_err(Error::CannotResolvePath)? + webview.path().resolve(&path, base_dir)? } else { - path.as_ref().to_path_buf() + path }; let scope = tauri::scope::fs::Scope::new( - app, + webview, &FsScope::Scope { - allow: app + allow: webview .fs_scope() .allowed .lock() .unwrap() .clone() .into_iter() - .chain(global_scope.allows().iter().map(|e| e.path.clone())) - .chain(command_scope.allows().iter().map(|e| e.path.clone())) + .chain(global_scope.allows().iter().filter_map(|e| e.path.clone())) + .chain(command_scope.allows().iter().filter_map(|e| e.path.clone())) .collect(), - deny: app + deny: webview .fs_scope() .denied .lock() .unwrap() .clone() .into_iter() - .chain(global_scope.denies().iter().map(|e| e.path.clone())) - .chain(command_scope.denies().iter().map(|e| e.path.clone())) + .chain(global_scope.denies().iter().filter_map(|e| e.path.clone())) + .chain(command_scope.denies().iter().filter_map(|e| e.path.clone())) .collect(), - require_literal_leading_dot: None, + require_literal_leading_dot: webview.fs_scope().require_literal_leading_dot, }, )?; @@ -850,18 +1030,6 @@ pub fn resolve_path( } } -#[inline] -fn file_url_to_safe_pathbuf(path: SafePathBuf) -> CommandResult { - if path.as_ref().starts_with("file:") { - let url = url::Url::parse(&path.display().to_string())? - .to_file_path() - .map_err(|_| "failed to get path from `file:` url")?; - SafePathBuf::new(url).map_err(Into::into) - } else { - Ok(path) - } -} - struct StdFileResource(Mutex); impl StdFileResource { @@ -982,3 +1150,19 @@ fn get_stat(metadata: std::fs::Metadata) -> FileInfo { blocks: usm!(blocks), } } + +mod test { + #[test] + fn safe_file_path_parse() { + use super::SafeFilePath; + + assert!(matches!( + serde_json::from_str::("\"C:/Users\""), + Ok(SafeFilePath::Path(_)) + )); + assert!(matches!( + serde_json::from_str::("\"file:///C:/Users\""), + Ok(SafeFilePath::Url(_)) + )); + } +} diff --git a/plugins/fs/src/config.rs b/plugins/fs/src/config.rs index d8a19714..db3bae45 100644 --- a/plugins/fs/src/config.rs +++ b/plugins/fs/src/config.rs @@ -5,6 +5,7 @@ use serde::Deserialize; #[derive(Deserialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Config { /// Whether or not paths that contain components that start with a `.` /// will require that `.` appears literally in the pattern; `*`, `?`, `**`, diff --git a/plugins/fs/src/desktop.rs b/plugins/fs/src/desktop.rs new file mode 100644 index 00000000..477c0537 --- /dev/null +++ b/plugins/fs/src/desktop.rs @@ -0,0 +1,35 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::path::PathBuf; + +use tauri::{AppHandle, Runtime}; + +use crate::{FilePath, OpenOptions}; + +pub struct Fs(pub(crate) AppHandle); + +fn path_or_err>(p: P) -> std::io::Result { + match p.into() { + FilePath::Path(p) => Ok(p), + FilePath::Url(u) if u.scheme() == "file" => u + .to_file_path() + .map_err(|_| std::io::Error::new(std::io::ErrorKind::InvalidInput, "invalid file URL")), + FilePath::Url(_) => Err(std::io::Error::new( + std::io::ErrorKind::InvalidInput, + "cannot use a URL to load files on desktop and iOS", + )), + } +} + +impl Fs { + pub fn open>( + &self, + path: P, + opts: OpenOptions, + ) -> std::io::Result { + let path = path_or_err(path)?; + std::fs::OpenOptions::from(opts).open(path) + } +} diff --git a/plugins/fs/src/error.rs b/plugins/fs/src/error.rs index 212714ef..0c98e83f 100644 --- a/plugins/fs/src/error.rs +++ b/plugins/fs/src/error.rs @@ -7,6 +7,7 @@ use std::path::PathBuf; use serde::{Serialize, Serializer}; #[derive(Debug, thiserror::Error)] +#[non_exhaustive] pub enum Error { #[error(transparent)] Json(#[from] serde_json::Error), @@ -16,8 +17,6 @@ pub enum Error { Io(#[from] std::io::Error), #[error("forbidden path: {0}")] PathForbidden(PathBuf), - #[error("failed to resolve path: {0}")] - CannotResolvePath(tauri::path::Error), /// Invalid glob pattern. #[error("invalid glob pattern: {0}")] GlobPattern(#[from] glob::PatternError), @@ -25,6 +24,13 @@ pub enum Error { #[cfg(feature = "watch")] #[error(transparent)] Watch(#[from] notify::Error), + #[cfg(target_os = "android")] + #[error(transparent)] + PluginInvoke(#[from] tauri::plugin::mobile::PluginInvokeError), + #[error("URL is not a valid path")] + InvalidPathUrl, + #[error("Unsafe PathBuf: {0}")] + UnsafePathBuf(&'static str), } impl Serialize for Error { diff --git a/plugins/fs/src/file_path.rs b/plugins/fs/src/file_path.rs new file mode 100644 index 00000000..9ff7a947 --- /dev/null +++ b/plugins/fs/src/file_path.rs @@ -0,0 +1,314 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::{ + convert::Infallible, + path::{Path, PathBuf}, + str::FromStr, +}; + +use serde::Serialize; +use tauri::path::SafePathBuf; + +use crate::{Error, Result}; + +/// Represents either a filesystem path or a URI pointing to a file +/// such as `file://` URIs or Android `content://` URIs. +#[derive(Debug, Serialize, Clone)] +#[serde(untagged)] +pub enum FilePath { + /// `file://` URIs or Android `content://` URIs. + Url(url::Url), + /// Regular [`PathBuf`] + Path(PathBuf), +} + +/// Represents either a safe filesystem path or a URI pointing to a file +/// such as `file://` URIs or Android `content://` URIs. +#[derive(Debug, Clone, Serialize)] +pub enum SafeFilePath { + /// `file://` URIs or Android `content://` URIs. + Url(url::Url), + /// Safe [`PathBuf`], see [`SafePathBuf``]. + Path(SafePathBuf), +} + +impl FilePath { + /// Get a reference to the contained [`Path`] if the variant is [`FilePath::Path`]. + /// + /// Use [`FilePath::into_path`] to try to convert the [`FilePath::Url`] variant as well. + #[inline] + pub fn as_path(&self) -> Option<&Path> { + match self { + Self::Url(_) => None, + Self::Path(p) => Some(p), + } + } + + /// Try to convert into [`PathBuf`] if possible. + /// + /// This calls [`Url::to_file_path`](url::Url::to_file_path) if the variant is [`FilePath::Url`], + /// otherwise returns the contained [PathBuf] as is. + #[inline] + pub fn into_path(self) -> Result { + match self { + Self::Url(url) => url + .to_file_path() + .map(PathBuf::from) + .map_err(|_| Error::InvalidPathUrl), + Self::Path(p) => Ok(p), + } + } + + /// Takes the contained [`PathBuf`] if the variant is [`FilePath::Path`], + /// and when possible, converts Windows UNC paths to regular paths. + #[inline] + pub fn simplified(self) -> Self { + match self { + Self::Url(url) => Self::Url(url), + Self::Path(p) => Self::Path(dunce::simplified(&p).to_path_buf()), + } + } +} + +impl SafeFilePath { + /// Get a reference to the contained [`Path`] if the variant is [`SafeFilePath::Path`]. + /// + /// Use [`SafeFilePath::into_path`] to try to convert the [`SafeFilePath::Url`] variant as well. + #[inline] + pub fn as_path(&self) -> Option<&Path> { + match self { + Self::Url(_) => None, + Self::Path(p) => Some(p.as_ref()), + } + } + + /// Try to convert into [`PathBuf`] if possible. + /// + /// This calls [`Url::to_file_path`](url::Url::to_file_path) if the variant is [`SafeFilePath::Url`], + /// otherwise returns the contained [PathBuf] as is. + #[inline] + pub fn into_path(self) -> Result { + match self { + Self::Url(url) => url + .to_file_path() + .map(PathBuf::from) + .map_err(|_| Error::InvalidPathUrl), + Self::Path(p) => Ok(p.as_ref().to_owned()), + } + } + + /// Takes the contained [`PathBuf`] if the variant is [`SafeFilePath::Path`], + /// and when possible, converts Windows UNC paths to regular paths. + #[inline] + pub fn simplified(self) -> Self { + match self { + Self::Url(url) => Self::Url(url), + Self::Path(p) => { + // Safe to unwrap since it was a safe file path already + Self::Path(SafePathBuf::new(dunce::simplified(p.as_ref()).to_path_buf()).unwrap()) + } + } + } +} + +impl std::fmt::Display for FilePath { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::Url(u) => u.fmt(f), + Self::Path(p) => p.display().fmt(f), + } + } +} + +impl std::fmt::Display for SafeFilePath { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::Url(u) => u.fmt(f), + Self::Path(p) => p.display().fmt(f), + } + } +} + +impl<'de> serde::Deserialize<'de> for FilePath { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct FilePathVisitor; + + impl<'de> serde::de::Visitor<'de> for FilePathVisitor { + type Value = FilePath; + + fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { + formatter.write_str("a string representing an file URL or a path") + } + + fn visit_str(self, s: &str) -> std::result::Result + where + E: serde::de::Error, + { + FilePath::from_str(s).map_err(|e| { + serde::de::Error::invalid_value( + serde::de::Unexpected::Str(s), + &e.to_string().as_str(), + ) + }) + } + } + + deserializer.deserialize_str(FilePathVisitor) + } +} + +impl<'de> serde::Deserialize<'de> for SafeFilePath { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct SafeFilePathVisitor; + + impl<'de> serde::de::Visitor<'de> for SafeFilePathVisitor { + type Value = SafeFilePath; + + fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { + formatter.write_str("a string representing an file URL or a path") + } + + fn visit_str(self, s: &str) -> std::result::Result + where + E: serde::de::Error, + { + SafeFilePath::from_str(s).map_err(|e| { + serde::de::Error::invalid_value( + serde::de::Unexpected::Str(s), + &e.to_string().as_str(), + ) + }) + } + } + + deserializer.deserialize_str(SafeFilePathVisitor) + } +} + +impl FromStr for FilePath { + type Err = Infallible; + fn from_str(s: &str) -> std::result::Result { + if let Ok(url) = url::Url::from_str(s) { + if url.scheme().len() != 1 { + return Ok(Self::Url(url)); + } + } + Ok(Self::Path(PathBuf::from(s))) + } +} + +impl FromStr for SafeFilePath { + type Err = Error; + fn from_str(s: &str) -> Result { + if let Ok(url) = url::Url::from_str(s) { + if url.scheme().len() != 1 { + return Ok(Self::Url(url)); + } + } + + SafePathBuf::new(s.into()) + .map(SafeFilePath::Path) + .map_err(Error::UnsafePathBuf) + } +} + +impl From for FilePath { + fn from(value: PathBuf) -> Self { + Self::Path(value) + } +} + +impl TryFrom for SafeFilePath { + type Error = Error; + fn try_from(value: PathBuf) -> Result { + SafePathBuf::new(value) + .map(SafeFilePath::Path) + .map_err(Error::UnsafePathBuf) + } +} + +impl From<&Path> for FilePath { + fn from(value: &Path) -> Self { + Self::Path(value.to_owned()) + } +} + +impl TryFrom<&Path> for SafeFilePath { + type Error = Error; + fn try_from(value: &Path) -> Result { + SafePathBuf::new(value.to_path_buf()) + .map(SafeFilePath::Path) + .map_err(Error::UnsafePathBuf) + } +} + +impl From<&PathBuf> for FilePath { + fn from(value: &PathBuf) -> Self { + Self::Path(value.to_owned()) + } +} + +impl TryFrom<&PathBuf> for SafeFilePath { + type Error = Error; + fn try_from(value: &PathBuf) -> Result { + SafePathBuf::new(value.to_owned()) + .map(SafeFilePath::Path) + .map_err(Error::UnsafePathBuf) + } +} + +impl From for FilePath { + fn from(value: url::Url) -> Self { + Self::Url(value) + } +} + +impl From for SafeFilePath { + fn from(value: url::Url) -> Self { + Self::Url(value) + } +} + +impl TryFrom for PathBuf { + type Error = Error; + fn try_from(value: FilePath) -> Result { + value.into_path() + } +} + +impl TryFrom for PathBuf { + type Error = Error; + fn try_from(value: SafeFilePath) -> Result { + value.into_path() + } +} + +impl From for FilePath { + fn from(value: SafeFilePath) -> Self { + match value { + SafeFilePath::Url(url) => FilePath::Url(url), + SafeFilePath::Path(p) => FilePath::Path(p.as_ref().to_owned()), + } + } +} + +impl TryFrom for SafeFilePath { + type Error = Error; + + fn try_from(value: FilePath) -> Result { + match value { + FilePath::Url(url) => Ok(SafeFilePath::Url(url)), + FilePath::Path(p) => SafePathBuf::new(p) + .map(SafeFilePath::Path) + .map_err(Error::UnsafePathBuf), + } + } +} diff --git a/plugins/fs/src/lib.rs b/plugins/fs/src/lib.rs index 2c8843ff..a1cf2766 100644 --- a/plugins/fs/src/lib.rs +++ b/plugins/fs/src/lib.rs @@ -11,65 +11,386 @@ html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png" )] -use std::path::PathBuf; +use std::io::Read; use serde::Deserialize; use tauri::{ ipc::ScopeObject, plugin::{Builder as PluginBuilder, TauriPlugin}, utils::acl::Value, - AppHandle, FileDropEvent, Manager, RunEvent, Runtime, WindowEvent, + AppHandle, DragDropEvent, Manager, RunEvent, Runtime, WindowEvent, }; mod commands; mod config; +#[cfg(not(target_os = "android"))] +mod desktop; mod error; +mod file_path; +#[cfg(target_os = "android")] +mod mobile; +#[cfg(target_os = "android")] +mod models; mod scope; #[cfg(feature = "watch")] mod watcher; +#[cfg(not(target_os = "android"))] +pub use desktop::Fs; +#[cfg(target_os = "android")] +pub use mobile::Fs; + pub use error::Error; pub use scope::{Event as ScopeEvent, Scope}; +pub use file_path::FilePath; +pub use file_path::SafeFilePath; + type Result = std::result::Result; -pub trait FsExt { - fn fs_scope(&self) -> &Scope; - fn try_fs_scope(&self) -> Option<&Scope>; +#[derive(Debug, Default, Clone, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct OpenOptions { + #[serde(default = "default_true")] + read: bool, + #[serde(default)] + write: bool, + #[serde(default)] + append: bool, + #[serde(default)] + truncate: bool, + #[serde(default)] + create: bool, + #[serde(default)] + create_new: bool, + #[serde(default)] + #[allow(unused)] + mode: Option, + #[serde(default)] + #[allow(unused)] + custom_flags: Option, } -impl> FsExt for T { - fn fs_scope(&self) -> &Scope { - self.state::().inner() +fn default_true() -> bool { + true +} + +impl From for std::fs::OpenOptions { + fn from(open_options: OpenOptions) -> Self { + let mut opts = std::fs::OpenOptions::new(); + + #[cfg(unix)] + { + use std::os::unix::fs::OpenOptionsExt; + if let Some(mode) = open_options.mode { + opts.mode(mode); + } + if let Some(flags) = open_options.custom_flags { + opts.custom_flags(flags); + } + } + + opts.read(open_options.read) + .write(open_options.write) + .create(open_options.create) + .append(open_options.append) + .truncate(open_options.truncate) + .create_new(open_options.create_new); + + opts } +} - fn try_fs_scope(&self) -> Option<&Scope> { - self.try_state::().map(|s| s.inner()) +impl OpenOptions { + /// Creates a blank new set of options ready for configuration. + /// + /// All options are initially set to `false`. + /// + /// # Examples + /// + /// ```no_run + /// use tauri_plugin_fs::OpenOptions; + /// + /// let mut options = OpenOptions::new(); + /// let file = options.read(true).open("foo.txt"); + /// ``` + #[must_use] + pub fn new() -> Self { + Self::default() + } + + /// Sets the option for read access. + /// + /// This option, when true, will indicate that the file should be + /// `read`-able if opened. + /// + /// # Examples + /// + /// ```no_run + /// use tauri_plugin_fs::OpenOptions; + /// + /// let file = OpenOptions::new().read(true).open("foo.txt"); + /// ``` + pub fn read(&mut self, read: bool) -> &mut Self { + self.read = read; + self + } + + /// Sets the option for write access. + /// + /// This option, when true, will indicate that the file should be + /// `write`-able if opened. + /// + /// If the file already exists, any write calls on it will overwrite its + /// contents, without truncating it. + /// + /// # Examples + /// + /// ```no_run + /// use tauri_plugin_fs::OpenOptions; + /// + /// let file = OpenOptions::new().write(true).open("foo.txt"); + /// ``` + pub fn write(&mut self, write: bool) -> &mut Self { + self.write = write; + self + } + + /// Sets the option for the append mode. + /// + /// This option, when true, means that writes will append to a file instead + /// of overwriting previous contents. + /// Note that setting `.write(true).append(true)` has the same effect as + /// setting only `.append(true)`. + /// + /// Append mode guarantees that writes will be positioned at the current end of file, + /// even when there are other processes or threads appending to the same file. This is + /// unlike [seek]\([SeekFrom]::[End]\(0)) followed by `write()`, which + /// has a race between seeking and writing during which another writer can write, with + /// our `write()` overwriting their data. + /// + /// Keep in mind that this does not necessarily guarantee that data appended by + /// different processes or threads does not interleave. The amount of data accepted a + /// single `write()` call depends on the operating system and file system. A + /// successful `write()` is allowed to write only part of the given data, so even if + /// you're careful to provide the whole message in a single call to `write()`, there + /// is no guarantee that it will be written out in full. If you rely on the filesystem + /// accepting the message in a single write, make sure that all data that belongs + /// together is written in one operation. This can be done by concatenating strings + /// before passing them to [`write()`]. + /// + /// If a file is opened with both read and append access, beware that after + /// opening, and after every write, the position for reading may be set at the + /// end of the file. So, before writing, save the current position (using + /// [Seek]::[stream_position]), and restore it before the next read. + /// + /// ## Note + /// + /// This function doesn't create the file if it doesn't exist. Use the + /// [`OpenOptions::create`] method to do so. + /// + /// [`write()`]: Write::write "io::Write::write" + /// [`flush()`]: Write::flush "io::Write::flush" + /// [stream_position]: Seek::stream_position "io::Seek::stream_position" + /// [seek]: Seek::seek "io::Seek::seek" + /// [Current]: SeekFrom::Current "io::SeekFrom::Current" + /// [End]: SeekFrom::End "io::SeekFrom::End" + /// + /// # Examples + /// + /// ```no_run + /// use tauri_plugin_fs::OpenOptions; + /// + /// let file = OpenOptions::new().append(true).open("foo.txt"); + /// ``` + pub fn append(&mut self, append: bool) -> &mut Self { + self.append = append; + self + } + + /// Sets the option for truncating a previous file. + /// + /// If a file is successfully opened with this option set it will truncate + /// the file to 0 length if it already exists. + /// + /// The file must be opened with write access for truncate to work. + /// + /// # Examples + /// + /// ```no_run + /// use tauri_plugin_fs::OpenOptions; + /// + /// let file = OpenOptions::new().write(true).truncate(true).open("foo.txt"); + /// ``` + pub fn truncate(&mut self, truncate: bool) -> &mut Self { + self.truncate = truncate; + self + } + + /// Sets the option to create a new file, or open it if it already exists. + /// + /// In order for the file to be created, [`OpenOptions::write`] or + /// [`OpenOptions::append`] access must be used. + /// + /// + /// # Examples + /// + /// ```no_run + /// use tauri_plugin_fs::OpenOptions; + /// + /// let file = OpenOptions::new().write(true).create(true).open("foo.txt"); + /// ``` + pub fn create(&mut self, create: bool) -> &mut Self { + self.create = create; + self + } + + /// Sets the option to create a new file, failing if it already exists. + /// + /// No file is allowed to exist at the target location, also no (dangling) symlink. In this + /// way, if the call succeeds, the file returned is guaranteed to be new. + /// If a file exists at the target location, creating a new file will fail with [`AlreadyExists`] + /// or another error based on the situation. See [`OpenOptions::open`] for a + /// non-exhaustive list of likely errors. + /// + /// This option is useful because it is atomic. Otherwise between checking + /// whether a file exists and creating a new one, the file may have been + /// created by another process (a TOCTOU race condition / attack). + /// + /// If `.create_new(true)` is set, [`.create()`] and [`.truncate()`] are + /// ignored. + /// + /// The file must be opened with write or append access in order to create + /// a new file. + /// + /// [`.create()`]: OpenOptions::create + /// [`.truncate()`]: OpenOptions::truncate + /// [`AlreadyExists`]: io::ErrorKind::AlreadyExists + /// + /// # Examples + /// + /// ```no_run + /// use tauri_plugin_fs::OpenOptions; + /// + /// let file = OpenOptions::new().write(true) + /// .create_new(true) + /// .open("foo.txt"); + /// ``` + pub fn create_new(&mut self, create_new: bool) -> &mut Self { + self.create_new = create_new; + self + } +} + +#[cfg(unix)] +impl std::os::unix::fs::OpenOptionsExt for OpenOptions { + fn custom_flags(&mut self, flags: i32) -> &mut Self { + self.custom_flags.replace(flags); + self + } + + fn mode(&mut self, mode: u32) -> &mut Self { + self.mode.replace(mode); + self } } +impl OpenOptions { + #[cfg(target_os = "android")] + fn android_mode(&self) -> String { + let mut mode = String::new(); + + if self.read { + mode.push('r'); + } + if self.write { + mode.push('w'); + } + if self.truncate { + mode.push('t'); + } + if self.append { + mode.push('a'); + } + + mode + } +} + +impl Fs { + pub fn read_to_string>(&self, path: P) -> std::io::Result { + let mut s = String::new(); + self.open( + path, + OpenOptions { + read: true, + ..Default::default() + }, + )? + .read_to_string(&mut s)?; + Ok(s) + } + + pub fn read>(&self, path: P) -> std::io::Result> { + let mut buf = Vec::new(); + self.open( + path, + OpenOptions { + read: true, + ..Default::default() + }, + )? + .read_to_end(&mut buf)?; + Ok(buf) + } +} + +// implement ScopeObject here instead of in the scope module because it is also used on the build script +// and we don't want to add tauri as a build dependency impl ScopeObject for scope::Entry { type Error = Error; fn deserialize( app: &AppHandle, raw: Value, ) -> std::result::Result { - #[derive(Deserialize)] - struct EntryRaw { - path: PathBuf, + let path = serde_json::from_value(raw.into()).map(|raw| match raw { + scope::EntryRaw::Value(path) => path, + scope::EntryRaw::Object { path } => path, + })?; + + match app.path().parse(path) { + Ok(path) => Ok(Self { path: Some(path) }), + #[cfg(not(target_os = "android"))] + Err(tauri::Error::UnknownPath) => Ok(Self { path: None }), + Err(err) => Err(err.into()), } + } +} + +pub trait FsExt { + fn fs_scope(&self) -> &Scope; + fn try_fs_scope(&self) -> Option<&Scope>; - let entry = serde_json::from_value::(raw.into())?; + /// Cross platform file system APIs that also support manipulating Android files. + fn fs(&self) -> &Fs; +} - Ok(Self { - path: app.path().parse(entry.path)?, - }) +impl> FsExt for T { + fn fs_scope(&self) -> &Scope { + self.state::().inner() + } + + fn try_fs_scope(&self) -> Option<&Scope> { + self.try_state::().map(|s| s.inner()) + } + + fn fs(&self) -> &Fs { + self.state::>().inner() } } pub fn init() -> TauriPlugin> { PluginBuilder::>::new("fs") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![ commands::create, commands::open, @@ -105,13 +426,22 @@ pub fn init() -> TauriPlugin> { .config() .as_ref() .and_then(|c| c.require_literal_leading_dot); + + #[cfg(target_os = "android")] + { + let fs = mobile::init(app, api)?; + app.manage(fs); + } + #[cfg(not(target_os = "android"))] + app.manage(Fs(app.clone())); + app.manage(scope); Ok(()) }) .on_event(|app, event| { if let RunEvent::WindowEvent { label: _, - event: WindowEvent::FileDrop(FileDropEvent::Dropped { paths, position: _ }), + event: WindowEvent::DragDrop(DragDropEvent::Drop { paths, position: _ }), .. } = event { diff --git a/plugins/fs/src/mobile.rs b/plugins/fs/src/mobile.rs new file mode 100644 index 00000000..06422be6 --- /dev/null +++ b/plugins/fs/src/mobile.rs @@ -0,0 +1,96 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use serde::de::DeserializeOwned; +use tauri::{ + plugin::{PluginApi, PluginHandle}, + AppHandle, Runtime, +}; + +use crate::{models::*, FilePath, OpenOptions}; + +#[cfg(target_os = "android")] +const PLUGIN_IDENTIFIER: &str = "com.plugin.fs"; + +#[cfg(target_os = "ios")] +tauri::ios_plugin_binding!(init_plugin_fs); + +// initializes the Kotlin or Swift plugin classes +pub fn init( + _app: &AppHandle, + api: PluginApi, +) -> crate::Result> { + #[cfg(target_os = "android")] + let handle = api + .register_android_plugin(PLUGIN_IDENTIFIER, "FsPlugin") + .unwrap(); + #[cfg(target_os = "ios")] + let handle = api.register_ios_plugin(init_plugin_android - intent - send)?; + Ok(Fs(handle)) +} + +/// Access to the android-intent-send APIs. +pub struct Fs(PluginHandle); + +impl Fs { + pub fn open>( + &self, + path: P, + opts: OpenOptions, + ) -> std::io::Result { + match path.into() { + FilePath::Url(u) => self + .resolve_content_uri(u.to_string(), opts.android_mode()) + .map_err(|e| { + std::io::Error::new( + std::io::ErrorKind::Other, + format!("failed to open file: {e}"), + ) + }), + FilePath::Path(p) => { + // tauri::utils::platform::resources_dir() returns a PathBuf with the Android asset URI prefix + // we must resolve that file with the Android API + if p.strip_prefix(tauri::utils::platform::ANDROID_ASSET_PROTOCOL_URI_PREFIX) + .is_ok() + { + self.resolve_content_uri(p.to_string_lossy(), opts.android_mode()) + .map_err(|e| { + std::io::Error::new( + std::io::ErrorKind::Other, + format!("failed to open file: {e}"), + ) + }) + } else { + std::fs::OpenOptions::from(opts).open(p) + } + } + } + } + + #[cfg(target_os = "android")] + fn resolve_content_uri( + &self, + uri: impl Into, + mode: impl Into, + ) -> crate::Result { + #[cfg(target_os = "android")] + { + let result = self.0.run_mobile_plugin::( + "getFileDescriptor", + GetFileDescriptorPayload { + uri: uri.into(), + mode: mode.into(), + }, + )?; + if let Some(fd) = result.fd { + Ok(unsafe { + use std::os::fd::FromRawFd; + std::fs::File::from_raw_fd(fd) + }) + } else { + todo!() + } + } + } +} diff --git a/plugins/fs/src/models.rs b/plugins/fs/src/models.rs new file mode 100644 index 00000000..b9edc2cb --- /dev/null +++ b/plugins/fs/src/models.rs @@ -0,0 +1,18 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Default, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct GetFileDescriptorPayload { + pub uri: String, + pub mode: String, +} + +#[derive(Debug, Clone, Default, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct GetFileDescriptorResponse { + pub fd: Option, +} diff --git a/plugins/fs/src/scope.rs b/plugins/fs/src/scope.rs index d7040a58..e8361d51 100644 --- a/plugins/fs/src/scope.rs +++ b/plugins/fs/src/scope.rs @@ -11,9 +11,18 @@ use std::{ }, }; -#[derive(Debug, schemars::JsonSchema)] +use serde::Deserialize; + +#[derive(Deserialize)] +#[serde(untagged)] +pub(crate) enum EntryRaw { + Value(PathBuf), + Object { path: PathBuf }, +} + +#[derive(Debug)] pub struct Entry { - pub path: PathBuf, + pub path: Option, } pub type EventId = u32; @@ -45,9 +54,11 @@ impl Scope { pub fn allow_directory>(&self, path: P, recursive: bool) { let path = path.as_ref(); - let mut allowed = self.allowed.lock().unwrap(); - allowed.push(path.to_path_buf()); - allowed.push(path.join(if recursive { "**" } else { "*" })); + { + let mut allowed = self.allowed.lock().unwrap(); + allowed.push(path.to_path_buf()); + allowed.push(path.join(if recursive { "**" } else { "*" })); + } self.emit(Event::PathAllowed(path.to_path_buf())); } @@ -69,9 +80,11 @@ impl Scope { pub fn forbid_directory>(&self, path: P, recursive: bool) { let path = path.as_ref(); - let mut denied = self.denied.lock().unwrap(); - denied.push(path.to_path_buf()); - denied.push(path.join(if recursive { "**" } else { "*" })); + { + let mut denied = self.denied.lock().unwrap(); + denied.push(path.to_path_buf()); + denied.push(path.join(if recursive { "**" } else { "*" })); + } self.emit(Event::PathForbidden(path.to_path_buf())); } diff --git a/plugins/fs/src/watcher.rs b/plugins/fs/src/watcher.rs index d83262a2..cf2af503 100644 --- a/plugins/fs/src/watcher.rs +++ b/plugins/fs/src/watcher.rs @@ -7,8 +7,8 @@ use notify_debouncer_full::{new_debouncer, DebounceEventResult, Debouncer, FileI use serde::Deserialize; use tauri::{ ipc::{Channel, CommandScope, GlobalScope}, - path::{BaseDirectory, SafePathBuf}, - AppHandle, Manager, Resource, ResourceId, Runtime, + path::BaseDirectory, + Manager, Resource, ResourceId, Runtime, Webview, }; use std::{ @@ -24,6 +24,7 @@ use std::{ use crate::{ commands::{resolve_path, CommandResult}, scope::Entry, + SafeFilePath, }; struct InnerWatcher { @@ -50,57 +51,57 @@ enum WatcherKind { Watcher(RecommendedWatcher), } -fn watch_raw(on_event: Channel, rx: Receiver>) { +fn watch_raw(on_event: Channel, rx: Receiver>) { spawn(move || { while let Ok(event) = rx.recv() { if let Ok(event) = event { // TODO: Should errors be emitted too? - let _ = on_event.send(&event); + let _ = on_event.send(event); } } }); } -fn watch_debounced(on_event: Channel, rx: Receiver) { +fn watch_debounced(on_event: Channel, rx: Receiver) { spawn(move || { while let Ok(Ok(events)) = rx.recv() { for event in events { // TODO: Should errors be emitted too? - let _ = on_event.send(&event.event); + let _ = on_event.send(event.event); } } }); } -#[derive(Deserialize)] +#[derive(Clone, Deserialize)] #[serde(rename_all = "camelCase")] pub struct WatchOptions { - dir: Option, + base_dir: Option, recursive: bool, delay_ms: Option, } #[tauri::command] pub async fn watch( - app: AppHandle, - paths: Vec, + webview: Webview, + paths: Vec, options: WatchOptions, - on_event: Channel, + on_event: Channel, global_scope: GlobalScope, command_scope: CommandScope, ) -> CommandResult { let mut resolved_paths = Vec::with_capacity(paths.capacity()); for path in paths { resolved_paths.push(resolve_path( - &app, + &webview, &global_scope, &command_scope, path, - options.dir, + options.base_dir, )?); } - let mode = if options.recursive { + let recursive_mode = if options.recursive { RecursiveMode::Recursive } else { RecursiveMode::NonRecursive @@ -110,7 +111,8 @@ pub async fn watch( let (tx, rx) = channel(); let mut debouncer = new_debouncer(Duration::from_millis(delay), None, tx)?; for path in &resolved_paths { - debouncer.watcher().watch(path.as_ref(), mode)?; + debouncer.watcher().watch(path.as_ref(), recursive_mode)?; + debouncer.cache().add_root(path, recursive_mode); } watch_debounced(on_event, rx); WatcherKind::Debouncer(debouncer) @@ -118,13 +120,13 @@ pub async fn watch( let (tx, rx) = channel(); let mut watcher = RecommendedWatcher::new(tx, Config::default())?; for path in &resolved_paths { - watcher.watch(path.as_ref(), mode)?; + watcher.watch(path.as_ref(), recursive_mode)?; } watch_raw(on_event, rx); WatcherKind::Watcher(watcher) }; - let rid = app + let rid = webview .resources_table() .add(WatcherResource::new(kind, resolved_paths)); @@ -132,8 +134,8 @@ pub async fn watch( } #[tauri::command] -pub async fn unwatch(app: AppHandle, rid: ResourceId) -> CommandResult<()> { - let watcher = app.resources_table().take::(rid)?; +pub async fn unwatch(webview: Webview, rid: ResourceId) -> CommandResult<()> { + let watcher = webview.resources_table().take::(rid)?; WatcherResource::with_lock(&watcher, |watcher| { match &mut watcher.kind { WatcherKind::Debouncer(ref mut debouncer) => { diff --git a/plugins/geolocation/CHANGELOG.md b/plugins/geolocation/CHANGELOG.md new file mode 100644 index 00000000..32952ac7 --- /dev/null +++ b/plugins/geolocation/CHANGELOG.md @@ -0,0 +1,36 @@ +# Changelog + +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.2] + +- [`60765694`](https://github.com/tauri-apps/plugins-workspace/commit/60765694f54875e22b8eb70b1d2e32dbf0c585c7) ([#1773](https://github.com/tauri-apps/plugins-workspace/pull/1773) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update API to match other plugins. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Use `PermissionState` from the `tauri` crate, which now also includes a "prompt with rationale" variant for Android (returned when your app must explain to the user why it needs the permission). +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.2] + +- [`b9147758`](https://github.com/tauri-apps/plugins-workspace/commit/b914775898c2bee7ceb20bd17ee595005cd17a64) ([#1679](https://github.com/tauri-apps/plugins-workspace/pull/1679) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Explicitly set a minimum macOS version for the Swift package. + +## \[2.0.0-rc.1] + +- [`5d170a54`](https://github.com/tauri-apps/plugins-workspace/commit/5d170a5444982dcc14135f6f1fc3e5da359f0eb0) ([#1671](https://github.com/tauri-apps/plugins-workspace/pull/1671) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.3. + +### changes + +- [`6b079cfd`](https://github.com/tauri-apps/plugins-workspace/commit/6b079cfdd107c94abc2c7300f6af00bac3ff4040) ([#1649](https://github.com/tauri-apps/plugins-workspace/pull/1649) by [@ahqsoftwares](https://github.com/tauri-apps/plugins-workspace/../../ahqsoftwares)) Remove targetSdk from build.kts files as it is deprecated and will be removed from DSL v9.0 + +## \[2.0.0-rc.0] + +- [`9606089b`](https://github.com/tauri-apps/plugins-workspace/commit/9606089b2add4a17f80ed5a09d59ce94824bd672) ([#1599](https://github.com/tauri-apps/plugins-workspace/pull/1599)) Initial release. +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. diff --git a/plugins/geolocation/Cargo.toml b/plugins/geolocation/Cargo.toml new file mode 100644 index 00000000..550a66cb --- /dev/null +++ b/plugins/geolocation/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "tauri-plugin-geolocation" +description = "Get and track the device's current position" +version = "2.0.1" +edition = { workspace = true } +authors = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +links = "tauri-plugin-geolocation" + +[package.metadata.docs.rs] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] +targets = ["x86_64-linux-android"] + +[package.metadata.platforms.support] +windows = { level = "none", notes = "" } +linux = { level = "none", notes = "" } +macos = { level = "none", notes = "" } +android = { level = "full", notes = "" } +ios = { level = "full", notes = "" } + +[build-dependencies] +tauri-plugin = { workspace = true, features = ["build"] } + +[dependencies] +serde = { workspace = true } +serde_json = { workspace = true } +tauri = { workspace = true, features = ["specta"] } +log = { workspace = true } +thiserror = { workspace = true } +specta = { workspace = true } + +[target.'cfg(target_os = "ios")'.dependencies] +tauri = { workspace = true, features = ["wry"] } diff --git a/plugins/authenticator/LICENSE.spdx b/plugins/geolocation/LICENSE.spdx similarity index 100% rename from plugins/authenticator/LICENSE.spdx rename to plugins/geolocation/LICENSE.spdx diff --git a/plugins/authenticator/LICENSE_APACHE-2.0 b/plugins/geolocation/LICENSE_APACHE-2.0 similarity index 100% rename from plugins/authenticator/LICENSE_APACHE-2.0 rename to plugins/geolocation/LICENSE_APACHE-2.0 diff --git a/plugins/authenticator/LICENSE_MIT b/plugins/geolocation/LICENSE_MIT similarity index 100% rename from plugins/authenticator/LICENSE_MIT rename to plugins/geolocation/LICENSE_MIT diff --git a/plugins/geolocation/README.md b/plugins/geolocation/README.md new file mode 100644 index 00000000..0557cc98 --- /dev/null +++ b/plugins/geolocation/README.md @@ -0,0 +1,168 @@ +![geolocation](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/geolocation/banner.png) + +This plugin provides APIs for getting and tracking the device's current position, including information about altitude, heading, and speed (if available). + +| Platform | Supported | +| -------- | --------- | +| Linux | x | +| Windows | x | +| macOS | x | +| Android | ✓ | +| iOS | ✓ | + +## Install + +_This plugin requires a Rust version of at least **1.77.2**_ + +There are three general methods of installation that we can recommend. + +1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) +2. Pull sources directly from Github using git tags / revision hashes (most secure) +3. Git submodule install this repo in your tauri project and then use file protocol to ingest the source (most secure, but inconvenient to use) + +Install the Core plugin by adding the following to your `Cargo.toml` file: + +`src-tauri/Cargo.toml` + +```toml +[dependencies] +tauri-plugin-geolocation = "2.0.0" +# alternatively with Git: +tauri-plugin-geolocation = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } +``` + +You can install the JavaScript Guest bindings using your preferred JavaScript package manager: + +> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. + + + +```sh +pnpm add @tauri-apps/plugin-geolocation +# or +npm add @tauri-apps/plugin-geolocation +# or +yarn add @tauri-apps/plugin-geolocation + +# alternatively with Git: +pnpm add https://github.com/tauri-apps/tauri-plugin-geolocation#v2 +# or +npm add https://github.com/tauri-apps/tauri-plugin-geolocation#v2 +# or +yarn add https://github.com/tauri-apps/tauri-plugin-geolocation#v2 +``` + +## Setting up + +### iOS + +Apple requires privacy descriptions to be specified in `Info.plist` for location information: + +- `NSLocationWhenInUseDescription` + +### Android + +This plugin automatically adds the following permissions to your `AndroidManifest.xml` file: + +```xml + + +``` + +If your app requires GPS functionality to function, **you** should add the following to your `AndroidManifest.xml` file: + +```xml + +``` + +The Google Play Store uses this property to decide whether it should show the app to devices without GPS capabilities. + +## Usage + +First you need to register the core plugin with Tauri: + +`src-tauri/src/main.rs` + +```rust +fn main() { + tauri::Builder::default() + .plugin(tauri_plugin_geolocation::init()) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} +``` + +Afterwards all the plugin's APIs are available through the JavaScript guest bindings: + +```javascript +import { + checkPermissions, + requestPermissions, + getCurrentPosition, + watchPosition +} from '@tauri-apps/plugin-log' + +let permissions = await checkPermissions() +if ( + permissions.location === 'prompt' || + permissions.location === 'prompt-with-rationale' +) { + permissions = await requestPermissions(['location']) +} + +if (permissions.location === 'granted') { + const pos = await getCurrentPosition() + + await watchPosition( + { enableHighAccuracy: true, timeout: 10000, maximumAge: 0 }, + (pos) => { + console.log(pos) + } + ) +} +``` + +## Contributing + +PRs accepted. Please make sure to read the Contributing Guide before making a pull request. + +## Contributed By + + + + + + + + +
+ + CrabNebula + + + + Rescue.co + +
+ +## Partners + + + + + + + +
+ + CrabNebula + +
+ +For the complete list of sponsors please visit our [website](https://tauri.app#sponsors) and [Open Collective](https://opencollective.com/tauri). + +## License + +Code: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy. + +MIT or MIT/Apache 2.0 where applicable. diff --git a/plugins/geolocation/SECURITY.md b/plugins/geolocation/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/geolocation/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/biometric/.gitignore b/plugins/geolocation/android/.gitignore similarity index 53% rename from plugins/biometric/.gitignore rename to plugins/geolocation/android/.gitignore index 1b0b469d..c0f21ec2 100644 --- a/plugins/biometric/.gitignore +++ b/plugins/geolocation/android/.gitignore @@ -1 +1,2 @@ +/build /.tauri diff --git a/plugins/geolocation/android/build.gradle.kts b/plugins/geolocation/android/build.gradle.kts new file mode 100644 index 00000000..18fba0f3 --- /dev/null +++ b/plugins/geolocation/android/build.gradle.kts @@ -0,0 +1,45 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") +} + +android { + namespace = "app.tauri.geolocation" + compileSdk = 34 + + defaultConfig { + minSdk = 24 + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + + implementation("androidx.core:core-ktx:1.9.0") + implementation("androidx.appcompat:appcompat:1.6.0") + implementation("com.google.android.material:material:1.7.0") + implementation("com.google.android.gms:play-services-location:21.3.0") + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.5") + androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") + implementation(project(":tauri-android")) +} diff --git a/plugins/geolocation/android/proguard-rules.pro b/plugins/geolocation/android/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/plugins/geolocation/android/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/plugins/geolocation/android/settings.gradle b/plugins/geolocation/android/settings.gradle new file mode 100644 index 00000000..14a752e4 --- /dev/null +++ b/plugins/geolocation/android/settings.gradle @@ -0,0 +1,2 @@ +include ':tauri-android' +project(':tauri-android').projectDir = new File('./.tauri/tauri-api') diff --git a/plugins/geolocation/android/src/androidTest/java/ExampleInstrumentedTest.kt b/plugins/geolocation/android/src/androidTest/java/ExampleInstrumentedTest.kt new file mode 100644 index 00000000..a301dc2d --- /dev/null +++ b/plugins/geolocation/android/src/androidTest/java/ExampleInstrumentedTest.kt @@ -0,0 +1,28 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package app.tauri.geolocation + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("app.tauri.geolocation", appContext.packageName) + } +} diff --git a/plugins/geolocation/android/src/main/AndroidManifest.xml b/plugins/geolocation/android/src/main/AndroidManifest.xml new file mode 100644 index 00000000..a47edd1c --- /dev/null +++ b/plugins/geolocation/android/src/main/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/plugins/geolocation/android/src/main/java/Geolocation.kt b/plugins/geolocation/android/src/main/java/Geolocation.kt new file mode 100644 index 00000000..b16a4482 --- /dev/null +++ b/plugins/geolocation/android/src/main/java/Geolocation.kt @@ -0,0 +1,148 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package app.tauri.geolocation + +import android.annotation.SuppressLint +import android.content.Context +import android.location.Location +import android.location.LocationManager +import android.os.SystemClock +import androidx.core.location.LocationManagerCompat +import app.tauri.Logger +import com.google.android.gms.common.ConnectionResult +import com.google.android.gms.common.GoogleApiAvailability +import com.google.android.gms.location.FusedLocationProviderClient +import com.google.android.gms.location.LocationCallback +import com.google.android.gms.location.LocationRequest +import com.google.android.gms.location.LocationResult +import com.google.android.gms.location.LocationServices +import com.google.android.gms.location.Priority + + +public class Geolocation(private val context: Context) { + private var fusedLocationClient: FusedLocationProviderClient? = null + private var locationCallback: LocationCallback? = null + + + fun isLocationServicesEnabled(): Boolean { + val lm = context.getSystemService(Context.LOCATION_SERVICE) as LocationManager + return LocationManagerCompat.isLocationEnabled(lm) + } + + @SuppressWarnings("MissingPermission") + fun sendLocation(enableHighAccuracy: Boolean, successCallback: (location: Location) -> Unit, errorCallback: (error: String) -> Unit) { + val resultCode = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context); + if (resultCode == ConnectionResult.SUCCESS) { + val lm = context.getSystemService(Context.LOCATION_SERVICE) as LocationManager + + if (this.isLocationServicesEnabled()) { + var networkEnabled = false + + try { + networkEnabled = lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER) + } catch (_: Exception) { + Logger.error("isProviderEnabled failed") + } + + val lowPrio = if (networkEnabled) Priority.PRIORITY_BALANCED_POWER_ACCURACY else Priority.PRIORITY_LOW_POWER + val prio = if (enableHighAccuracy) Priority.PRIORITY_HIGH_ACCURACY else lowPrio + + Logger.error(prio.toString()) + + LocationServices + .getFusedLocationProviderClient(context) + .getCurrentLocation(prio, null) + .addOnFailureListener { e -> e.message?.let { errorCallback(it) } } + .addOnSuccessListener { location -> + if (location == null) { + errorCallback("Location unavailable.") + } else { + successCallback(location) + } + } + } else { + errorCallback("Location disabled.") + } + } else { + errorCallback("Google Play Services unavailable.") + } + } + + @SuppressLint("MissingPermission") + fun requestLocationUpdates(enableHighAccuracy: Boolean, timeout: Long, successCallback: (location: Location) -> Unit, errorCallback: (error: String) -> Unit) { + val resultCode = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context); + if (resultCode == ConnectionResult.SUCCESS) { + clearLocationUpdates() + fusedLocationClient = LocationServices.getFusedLocationProviderClient(context) + + val lm = context.getSystemService(Context.LOCATION_SERVICE) as LocationManager + + if (this.isLocationServicesEnabled()) { + var networkEnabled = false + + try { + networkEnabled = lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER) + } catch (_: Exception) { + Logger.error("isProviderEnabled failed") + } + + val lowPrio = if (networkEnabled) Priority.PRIORITY_BALANCED_POWER_ACCURACY else Priority.PRIORITY_LOW_POWER + val prio = if (enableHighAccuracy) Priority.PRIORITY_HIGH_ACCURACY else lowPrio + + Logger.error(prio.toString()) + + val locationRequest = LocationRequest.Builder(10000) + .setMaxUpdateDelayMillis(timeout) + .setMinUpdateIntervalMillis(5000) + .setPriority(prio) + .build() + + locationCallback = + object : LocationCallback() { + override fun onLocationResult(locationResult: LocationResult) { + val lastLocation = locationResult.lastLocation + if (lastLocation == null) { + errorCallback("Location unavailable.") + } else { + successCallback(lastLocation) + } + } + } + + fusedLocationClient?.requestLocationUpdates(locationRequest, locationCallback!!, null) + } else { + errorCallback("Location disabled.") + } + } else { + errorCallback("Google Play Services not available.") + } + } + + fun clearLocationUpdates() { + if (locationCallback != null) { + fusedLocationClient?.removeLocationUpdates(locationCallback!!) + locationCallback = null + } + } + + @SuppressLint("MissingPermission") + fun getLastLocation(maximumAge: Long): Location? { + var lastLoc: Location? = null + val lm = context.getSystemService(Context.LOCATION_SERVICE) as LocationManager + + for (provider in lm.allProviders) { + val tmpLoc = lm.getLastKnownLocation(provider) + if (tmpLoc != null) { + val locationAge = SystemClock.elapsedRealtimeNanos() - tmpLoc.elapsedRealtimeNanos + val maxAgeNano = maximumAge * 1000000L + if (locationAge <= maxAgeNano && (lastLoc == null || lastLoc.elapsedRealtimeNanos > tmpLoc.elapsedRealtimeNanos)) { + lastLoc = tmpLoc + } + } + } + + return lastLoc + } +} \ No newline at end of file diff --git a/plugins/geolocation/android/src/main/java/GeolocationPlugin.kt b/plugins/geolocation/android/src/main/java/GeolocationPlugin.kt new file mode 100644 index 00000000..cf81f5e3 --- /dev/null +++ b/plugins/geolocation/android/src/main/java/GeolocationPlugin.kt @@ -0,0 +1,172 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package app.tauri.geolocation + +import android.Manifest +import android.app.Activity +import android.location.Location +import android.os.Build +import android.webkit.WebView +import app.tauri.Logger +import app.tauri.PermissionState +import app.tauri.annotation.Command +import app.tauri.annotation.InvokeArg +import app.tauri.annotation.Permission +import app.tauri.annotation.PermissionCallback +import app.tauri.annotation.TauriPlugin +import app.tauri.plugin.Channel +import app.tauri.plugin.Invoke +import app.tauri.plugin.JSObject +import app.tauri.plugin.Plugin + +@InvokeArg +class PositionOptions { + var enableHighAccuracy: Boolean = false + var maximumAge: Long = 0 + var timeout: Long = 10000 +} + +@InvokeArg +class WatchArgs { + var options: PositionOptions = PositionOptions() + lateinit var channel: Channel +} + +@InvokeArg +class ClearWatchArgs { + var channelId: Long = 0 +} + +// TODO: Plugin does not ask user to enable google location services (like gmaps does) + +private const val ALIAS_LOCATION: String = "location" +private const val ALIAS_COARSE_LOCATION: String = "coarseLocation" + +@TauriPlugin( + permissions = [ + Permission(strings = [ + Manifest.permission.ACCESS_FINE_LOCATION, + Manifest.permission.ACCESS_COARSE_LOCATION + ], + alias = ALIAS_LOCATION + ), + Permission(strings = [ + Manifest.permission.ACCESS_COARSE_LOCATION + ], + alias = ALIAS_COARSE_LOCATION + ) + ] +) +class GeolocationPlugin(private val activity: Activity): Plugin(activity) { + private lateinit var implementation: Geolocation + private var watchers = hashMapOf>() + + override fun load(webView: WebView) { + super.load(webView) + implementation = Geolocation(activity.applicationContext) + } + + override fun onPause() { + super.onPause() + // Clear all location updates on pause to avoid possible background location calls + implementation.clearLocationUpdates() + } + + override fun onResume() { + super.onResume() + // resume watchers + for ((watcher, args) in watchers.values) { + startWatch(watcher, args) + } + } + + @Command + override fun checkPermissions(invoke: Invoke) { + if (implementation.isLocationServicesEnabled()) { + super.checkPermissions(invoke) + } else { + invoke.reject("Location services are disabled.") + } + } + + @Command + override fun requestPermissions(invoke: Invoke) { + if (implementation.isLocationServicesEnabled()) { + super.requestPermissions(invoke) + } else { + invoke.reject("Location services are disabled.") + } + } + + @Command + fun getCurrentPosition(invoke: Invoke) { + val args = invoke.parseArgs(PositionOptions::class.java) + + val location = implementation.getLastLocation(args.maximumAge) + if (location != null) { + invoke.resolve(convertLocation(location)) + } else { + implementation.sendLocation(args.enableHighAccuracy, + { loc -> invoke.resolve(convertLocation(loc)) }, + { error -> invoke.reject(error) }) + } + } + + @PermissionCallback + private fun positionPermissionCallback(invoke: Invoke) { + val permissionsResultJSON = JSObject() + permissionsResultJSON.put("location", getPermissionState(ALIAS_LOCATION)) + permissionsResultJSON.put("coarseLocation", getPermissionState(ALIAS_COARSE_LOCATION)) + invoke.resolve(permissionsResultJSON) + } + + @Command + fun watchPosition(invoke: Invoke) { + val args = invoke.parseArgs(WatchArgs::class.java) + startWatch(invoke, args) + } + + private fun startWatch(invoke: Invoke, args: WatchArgs) { + implementation.requestLocationUpdates( + args.options.enableHighAccuracy, + args.options.timeout, + { location -> args.channel.send(convertLocation(location)) }, + { error -> args.channel.sendObject(error) }) + + watchers[args.channel.id] = Pair(invoke, args) + } + + @Command + fun clearWatch(invoke: Invoke) { + val args = invoke.parseArgs(ClearWatchArgs::class.java) + + watchers.remove(args.channelId) + + if (watchers.isEmpty()) { + implementation.clearLocationUpdates() + } + + invoke.resolve() + } + + private fun convertLocation(location: Location): JSObject { + val ret = JSObject() + val coords = JSObject() + + coords.put("latitude", location.latitude) + coords.put("longitude", location.longitude) + coords.put("accuracy", location.accuracy) + coords.put("altitude", location.altitude) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + coords.put("altitudeAccuracy", location.verticalAccuracyMeters) + } + coords.put("speed", location.speed) + coords.put("heading", location.bearing) + ret.put("timestamp", location.time) + ret.put("coords", coords) + + return ret + } +} diff --git a/plugins/geolocation/android/src/test/java/ExampleUnitTest.kt b/plugins/geolocation/android/src/test/java/ExampleUnitTest.kt new file mode 100644 index 00000000..03c99f7d --- /dev/null +++ b/plugins/geolocation/android/src/test/java/ExampleUnitTest.kt @@ -0,0 +1,21 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package app.tauri.geolocation + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} diff --git a/plugins/geolocation/api-iife.js b/plugins/geolocation/api-iife.js new file mode 100644 index 00000000..912c073e --- /dev/null +++ b/plugins/geolocation/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_GEOLOCATION__=function(t){"use strict";function e(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function n(t,e,n,i,o){if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var i,o,s;"function"==typeof SuppressedError&&SuppressedError;class r{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,i.set(this,(()=>{})),o.set(this,0),s.set(this,{}),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:r})=>{if(r===e(this,o,"f")){n(this,o,r+1),e(this,i,"f").call(this,t);const a=Object.keys(e(this,s,"f"));if(a.length>0){let t=r+1;for(const n of a.sort()){if(parseInt(n)!==t)break;{const o=e(this,s,"f")[n];delete e(this,s,"f")[n],e(this,i,"f").call(this,o),t+=1}}n(this,o,t)}}else e(this,s,"f")[r.toString()]=t}))}set onmessage(t){n(this,i,t)}get onmessage(){return e(this,i,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}return i=new WeakMap,o=new WeakMap,s=new WeakMap,t.checkPermissions=async function(){return await async function(t){return a(`plugin:${t}|check_permissions`)}("geolocation")},t.clearWatch=async function(t){await a("plugin:geolocation|clear_watch",{channelId:t})},t.getCurrentPosition=async function(t){return await a("plugin:geolocation|get_current_position",{options:t})},t.requestPermissions=async function(t){return await a("plugin:geolocation|request_permissions",{permissions:t})},t.watchPosition=async function(t,e){const n=new r;return n.onmessage=t=>{"string"==typeof t?e(null,t):e(t)},await a("plugin:geolocation|watch_position",{options:t,channel:n}),n.id},t}({});Object.defineProperty(window.__TAURI__,"geolocation",{value:__TAURI_PLUGIN_GEOLOCATION__})} diff --git a/plugins/geolocation/build.rs b/plugins/geolocation/build.rs new file mode 100644 index 00000000..b5249761 --- /dev/null +++ b/plugins/geolocation/build.rs @@ -0,0 +1,24 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +const COMMANDS: &[&str] = &[ + "get_current_position", + "watch_position", + "clear_watch", + "check_permissions", + "request_permissions", +]; + +fn main() { + let result = tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .android_path("android") + .ios_path("ios") + .try_build(); + + // when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build + if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) { + result.unwrap(); + } +} diff --git a/plugins/geolocation/contributors/crabnebula.svg b/plugins/geolocation/contributors/crabnebula.svg new file mode 100644 index 00000000..40e24131 --- /dev/null +++ b/plugins/geolocation/contributors/crabnebula.svg @@ -0,0 +1,31 @@ + \ No newline at end of file diff --git a/plugins/geolocation/contributors/rescue.png b/plugins/geolocation/contributors/rescue.png new file mode 100644 index 00000000..2b5916f4 Binary files /dev/null and b/plugins/geolocation/contributors/rescue.png differ diff --git a/plugins/geolocation/guest-js/index.ts b/plugins/geolocation/guest-js/index.ts new file mode 100644 index 00000000..8ef5c533 --- /dev/null +++ b/plugins/geolocation/guest-js/index.ts @@ -0,0 +1,138 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import { + Channel, + invoke, + PermissionState, + checkPermissions as checkPluginPermissions +} from '@tauri-apps/api/core' + +export type Coordinates = { + /** + * Latitude in decimal degrees. + */ + latitude: number + /** + * Longitude in decimal degrees. + */ + longitude: number + /** + * Accuracy level of the latitude and longitude coordinates in meters. + */ + accuracy: number + /** + * Accuracy level of the altitude coordinate in meters, if available. + * Available on all iOS versions and on Android 8 and above. + */ + altitudeAccuracy: number | null + /** + * The altitude the user is at, if available. + */ + altitude: number | null + speed: number | null + /** + * The heading the user is facing, if available. + */ + heading: number | null +} + +export type PermissionStatus = { + /** + * Permission state for the location alias. + * + * On Android it requests/checks both ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION permissions. + * + * On iOS it requests/checks location permissions. + */ + location: PermissionState + /** + * Permissions state for the coarseLoaction alias. + * + * On Android it requests/checks ACCESS_COARSE_LOCATION. + * + * On Android 12+, users can choose between Approximate location (ACCESS_COARSE_LOCATION) and Precise location (ACCESS_FINE_LOCATION). + * + * On iOS it will have the same value as the `location` alias. + */ + coarseLocation: PermissionState +} + +export type PermissionType = 'location' | 'coarseLocation' + +export type Position = { + /** + * Creation time for these coordinates. + */ + timestamp: number + /** + * The GPD coordinates along with the accuracy of the data. + */ + coords: Coordinates +} + +export type PositionOptions = { + /** + * High accuracy mode (such as GPS, if available) + * Will be ignored on Android 12+ if users didn't grant the ACCESS_FINE_LOCATION permission (`coarseLocation` permission). + */ + enableHighAccuracy: boolean + /** + * The maximum wait time in milliseconds for location updates. + * On Android the timeout gets ignored for getCurrentPosition. + * Ignored on iOS + */ + timeout: number + /** + * The maximum age in milliseconds of a possible cached position that is acceptable to return. + * Default: 0 + * Ignored on iOS + */ + maximumAge: number +} + +export async function watchPosition( + options: PositionOptions, + cb: (location: Position | null, error?: string) => void +): Promise { + const channel = new Channel() + channel.onmessage = (message) => { + if (typeof message === 'string') { + cb(null, message) + } else { + cb(message) + } + } + await invoke('plugin:geolocation|watch_position', { + options, + channel + }) + return channel.id +} + +export async function getCurrentPosition( + options?: PositionOptions +): Promise { + return await invoke('plugin:geolocation|get_current_position', { + options + }) +} + +export async function clearWatch(channelId: number): Promise { + await invoke('plugin:geolocation|clear_watch', { + channelId + }) +} + +export async function checkPermissions(): Promise { + return await checkPluginPermissions('geolocation') +} + +export async function requestPermissions( + permissions: PermissionType[] | null +): Promise { + return await invoke('plugin:geolocation|request_permissions', { + permissions + }) +} diff --git a/plugins/geolocation/ios/.gitignore b/plugins/geolocation/ios/.gitignore new file mode 100644 index 00000000..5922fdaa --- /dev/null +++ b/plugins/geolocation/ios/.gitignore @@ -0,0 +1,10 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj +xcuserdata/ +DerivedData/ +.swiftpm/config/registries.json +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.netrc +Package.resolved diff --git a/plugins/geolocation/ios/Package.swift b/plugins/geolocation/ios/Package.swift new file mode 100644 index 00000000..f8cfb73f --- /dev/null +++ b/plugins/geolocation/ios/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version:5.3 +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import PackageDescription + +let package = Package( + name: "tauri-plugin-geolocation", + platforms: [ + .macOS(.v10_13), + .iOS(.v13), + ], + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "tauri-plugin-geolocation", + type: .static, + targets: ["tauri-plugin-geolocation"]) + ], + dependencies: [ + .package(name: "Tauri", path: "../.tauri/tauri-api") + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "tauri-plugin-geolocation", + dependencies: [ + .byName(name: "Tauri") + ], + path: "Sources") + ] +) diff --git a/plugins/geolocation/ios/README.md b/plugins/geolocation/ios/README.md new file mode 100644 index 00000000..5612ac82 --- /dev/null +++ b/plugins/geolocation/ios/README.md @@ -0,0 +1,3 @@ +# Tauri Plugin Geolocation + +A description of this package. diff --git a/plugins/geolocation/ios/Sources/GeolocationPlugin.swift b/plugins/geolocation/ios/Sources/GeolocationPlugin.swift new file mode 100644 index 00000000..7a2b57a9 --- /dev/null +++ b/plugins/geolocation/ios/Sources/GeolocationPlugin.swift @@ -0,0 +1,250 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import CoreLocation +import SwiftRs +import Tauri +import UIKit +import WebKit + +class GetPositionArgs: Decodable { + var enableHighAccuracy: Bool? +} + +class WatchPositionArgs: Decodable { + let options: GetPositionArgs + let channel: Channel +} + +class ClearWatchArgs: Decodable { + let channelId: UInt32 +} + +class GeolocationPlugin: Plugin, CLLocationManagerDelegate { + private let locationManager = CLLocationManager() + private var isUpdatingLocation: Bool = false + private var permissionRequests: [Invoke] = [] + private var positionRequests: [Invoke] = [] + private var watcherChannels: [Channel] = [] + + override init() { + super.init() + locationManager.delegate = self + } + + // + // Tauri commands + // + + @objc public func getCurrentPosition(_ invoke: Invoke) throws { + let args = try invoke.parseArgs(GetPositionArgs.self) + + self.positionRequests.append(invoke) + + DispatchQueue.main.async { + if args.enableHighAccuracy == true { + self.locationManager.desiredAccuracy = kCLLocationAccuracyBest + } else { + self.locationManager.desiredAccuracy = kCLLocationAccuracyKilometer + } + + // TODO: Use the authorizationStatus instance property with locationManagerDidChangeAuthorization(_:) instead. + if CLLocationManager.authorizationStatus() == .notDetermined { + self.locationManager.requestWhenInUseAuthorization() + } else { + self.locationManager.requestLocation() + } + } + } + + @objc public func watchPosition(_ invoke: Invoke) throws { + let args = try invoke.parseArgs(WatchPositionArgs.self) + + self.watcherChannels.append(args.channel) + + DispatchQueue.main.async { + if args.options.enableHighAccuracy == true { + self.locationManager.desiredAccuracy = kCLLocationAccuracyBest + } else { + self.locationManager.desiredAccuracy = kCLLocationAccuracyKilometer + } + + // TODO: Use the authorizationStatus instance property with locationManagerDidChangeAuthorization(_:) instead. + if CLLocationManager.authorizationStatus() == .notDetermined { + self.locationManager.requestWhenInUseAuthorization() + } else { + self.locationManager.startUpdatingLocation() + self.isUpdatingLocation = true + } + } + + invoke.resolve() + } + + @objc public func clearWatch(_ invoke: Invoke) throws { + let args = try invoke.parseArgs(ClearWatchArgs.self) + + self.watcherChannels = self.watcherChannels.filter { $0.id != args.channelId } + + // TODO: capacitor plugin calls stopUpdating unconditionally + if self.watcherChannels.isEmpty { + self.stopUpdating() + } + + invoke.resolve() + } + + @objc override public func checkPermissions(_ invoke: Invoke) { + var status: String = "" + + if CLLocationManager.locationServicesEnabled() { + // TODO: Use the authorizationStatus instance property with locationManagerDidChangeAuthorization(_:) instead. + switch CLLocationManager.authorizationStatus() { + case .notDetermined: + status = "prompt" + case .restricted, .denied: + status = "denied" + case .authorizedAlways, .authorizedWhenInUse: + status = "granted" + @unknown default: + status = "prompt" + } + } else { + invoke.reject("Location services are not enabled.") + return + } + + let result = ["location": status, "coarseLocation": status] + + invoke.resolve(result) + } + + @objc override public func requestPermissions(_ invoke: Invoke) { + if CLLocationManager.locationServicesEnabled() { + // TODO: Use the authorizationStatus instance property with locationManagerDidChangeAuthorization(_:) instead. + if CLLocationManager.authorizationStatus() == .notDetermined { + self.permissionRequests.append(invoke) + + DispatchQueue.main.async { + self.locationManager.requestWhenInUseAuthorization() + } + } else { + checkPermissions(invoke) + } + } else { + invoke.reject("Location services are not enabled.") + } + } + + // + // Delegate methods + // + + public func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) { + Logger.error(error) + + let requests = self.positionRequests + self.permissionRequests + self.positionRequests.removeAll() + self.permissionRequests.removeAll() + + for request in requests { + request.reject(error.localizedDescription) + } + + for channel in self.watcherChannels { + do { + try channel.send(error.localizedDescription) + } catch { + Logger.error(error) + } + } + } + + public func locationManager( + _ manager: CLLocationManager, didUpdateLocations locations: [CLLocation] + ) { + // Respond to all getCurrentPosition() calls. + for request in self.positionRequests { + // The capacitor plugin uses locations.first but .last should be the most current one + // and i don't see a reason to use old locations + if let location = locations.last { + let result = convertLocation(location) + request.resolve(result) + } else { + request.reject("Location service returned an empty Location array.") + } + } + + for channel in self.watcherChannels { + // The capacitor plugin uses locations.first but .last should be the most recent one + // and i don't see a reason to use old locations + if let location = locations.last { + let result = convertLocation(location) + do { + try channel.send(result) + } catch { + Logger.error(error) + } + } else { + do { + try channel.send("Location service returned an empty Location array.") + } catch { + Logger.error(error) + } + } + } + } + + public func locationManager( + _ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus + ) { + let requests = self.permissionRequests + self.permissionRequests.removeAll() + + for request in requests { + checkPermissions(request) + } + + if !self.positionRequests.isEmpty { + self.locationManager.requestLocation() + } + + if !self.watcherChannels.isEmpty && !self.isUpdatingLocation { + self.locationManager.startUpdatingLocation() + self.isUpdatingLocation = true + } + } + + // + // Internal/Helper methods + // + + // TODO: Why is this pub in capacitor + private func stopUpdating() { + self.locationManager.stopUpdatingLocation() + self.isUpdatingLocation = false + } + + private func convertLocation(_ location: CLLocation) -> JsonObject { + var ret: JsonObject = [:] + var coords: JsonObject = [:] + + coords["latitude"] = location.coordinate.latitude + coords["longitude"] = location.coordinate.longitude + coords["accuracy"] = location.horizontalAccuracy + coords["altitude"] = location.altitude + coords["altitudeAccuracy"] = location.verticalAccuracy + coords["speed"] = location.speed + coords["heading"] = location.course + ret["timestamp"] = Int((location.timestamp.timeIntervalSince1970 * 1000)) + ret["coords"] = coords + + return ret + } +} + +@_cdecl("init_plugin_geolocation") +func initPlugin() -> Plugin { + return GeolocationPlugin() +} diff --git a/plugins/geolocation/ios/Tests/PluginTests/PluginTests.swift b/plugins/geolocation/ios/Tests/PluginTests/PluginTests.swift new file mode 100644 index 00000000..99992ce4 --- /dev/null +++ b/plugins/geolocation/ios/Tests/PluginTests/PluginTests.swift @@ -0,0 +1,12 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import XCTest +@testable import ExamplePlugin + +final class ExamplePluginTests: XCTestCase { + func testExample() throws { + let plugin = ExamplePlugin() + } +} diff --git a/plugins/authenticator/package.json b/plugins/geolocation/package.json similarity index 68% rename from plugins/authenticator/package.json rename to plugins/geolocation/package.json index 7e57c456..998d2456 100644 --- a/plugins/authenticator/package.json +++ b/plugins/geolocation/package.json @@ -1,11 +1,11 @@ { - "name": "@tauri-apps/plugin-authenticator", - "version": "2.0.0-beta.1", - "description": "Use hardware security-keys in your Tauri App.", - "license": "MIT or APACHE-2.0", + "name": "@tauri-apps/plugin-geolocation", + "version": "2.0.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -24,6 +24,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/geolocation/permissions/autogenerated/commands/check_permissions.toml b/plugins/geolocation/permissions/autogenerated/commands/check_permissions.toml new file mode 100644 index 00000000..f5af08b1 --- /dev/null +++ b/plugins/geolocation/permissions/autogenerated/commands/check_permissions.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-check-permissions" +description = "Enables the check_permissions command without any pre-configured scope." +commands.allow = ["check_permissions"] + +[[permission]] +identifier = "deny-check-permissions" +description = "Denies the check_permissions command without any pre-configured scope." +commands.deny = ["check_permissions"] diff --git a/plugins/geolocation/permissions/autogenerated/commands/clear_permissions.toml b/plugins/geolocation/permissions/autogenerated/commands/clear_permissions.toml new file mode 100644 index 00000000..a3e6ab5c --- /dev/null +++ b/plugins/geolocation/permissions/autogenerated/commands/clear_permissions.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-clear-permissions" +description = "Enables the clear_permissions command without any pre-configured scope." +commands.allow = ["clear_permissions"] + +[[permission]] +identifier = "deny-clear-permissions" +description = "Denies the clear_permissions command without any pre-configured scope." +commands.deny = ["clear_permissions"] diff --git a/plugins/geolocation/permissions/autogenerated/commands/clear_watch.toml b/plugins/geolocation/permissions/autogenerated/commands/clear_watch.toml new file mode 100644 index 00000000..19fb5776 --- /dev/null +++ b/plugins/geolocation/permissions/autogenerated/commands/clear_watch.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-clear-watch" +description = "Enables the clear_watch command without any pre-configured scope." +commands.allow = ["clear_watch"] + +[[permission]] +identifier = "deny-clear-watch" +description = "Denies the clear_watch command without any pre-configured scope." +commands.deny = ["clear_watch"] diff --git a/plugins/geolocation/permissions/autogenerated/commands/get_current_position.toml b/plugins/geolocation/permissions/autogenerated/commands/get_current_position.toml new file mode 100644 index 00000000..fefb951b --- /dev/null +++ b/plugins/geolocation/permissions/autogenerated/commands/get_current_position.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-get-current-position" +description = "Enables the get_current_position command without any pre-configured scope." +commands.allow = ["get_current_position"] + +[[permission]] +identifier = "deny-get-current-position" +description = "Denies the get_current_position command without any pre-configured scope." +commands.deny = ["get_current_position"] diff --git a/plugins/geolocation/permissions/autogenerated/commands/request_permissions.toml b/plugins/geolocation/permissions/autogenerated/commands/request_permissions.toml new file mode 100644 index 00000000..02dcd627 --- /dev/null +++ b/plugins/geolocation/permissions/autogenerated/commands/request_permissions.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-request-permissions" +description = "Enables the request_permissions command without any pre-configured scope." +commands.allow = ["request_permissions"] + +[[permission]] +identifier = "deny-request-permissions" +description = "Denies the request_permissions command without any pre-configured scope." +commands.deny = ["request_permissions"] diff --git a/plugins/geolocation/permissions/autogenerated/commands/watch_position.toml b/plugins/geolocation/permissions/autogenerated/commands/watch_position.toml new file mode 100644 index 00000000..5878ba1a --- /dev/null +++ b/plugins/geolocation/permissions/autogenerated/commands/watch_position.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-watch-position" +description = "Enables the watch_position command without any pre-configured scope." +commands.allow = ["watch_position"] + +[[permission]] +identifier = "deny-watch-position" +description = "Denies the watch_position command without any pre-configured scope." +commands.deny = ["watch_position"] diff --git a/plugins/geolocation/permissions/autogenerated/reference.md b/plugins/geolocation/permissions/autogenerated/reference.md new file mode 100644 index 00000000..71d81a72 --- /dev/null +++ b/plugins/geolocation/permissions/autogenerated/reference.md @@ -0,0 +1,166 @@ + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`geolocation:allow-check-permissions` + + + +Enables the check_permissions command without any pre-configured scope. + +
+ +`geolocation:deny-check-permissions` + + + +Denies the check_permissions command without any pre-configured scope. + +
+ +`geolocation:allow-clear-permissions` + + + +Enables the clear_permissions command without any pre-configured scope. + +
+ +`geolocation:deny-clear-permissions` + + + +Denies the clear_permissions command without any pre-configured scope. + +
+ +`geolocation:allow-clear-watch` + + + +Enables the clear_watch command without any pre-configured scope. + +
+ +`geolocation:deny-clear-watch` + + + +Denies the clear_watch command without any pre-configured scope. + +
+ +`geolocation:allow-get-current-position` + + + +Enables the get_current_position command without any pre-configured scope. + +
+ +`geolocation:deny-get-current-position` + + + +Denies the get_current_position command without any pre-configured scope. + +
+ +`geolocation:allow-request-permissions` + + + +Enables the request_permissions command without any pre-configured scope. + +
+ +`geolocation:deny-request-permissions` + + + +Denies the request_permissions command without any pre-configured scope. + +
+ +`geolocation:allow-watch-position` + + + +Enables the watch_position command without any pre-configured scope. + +
+ +`geolocation:deny-watch-position` + + + +Denies the watch_position command without any pre-configured scope. + +
diff --git a/plugins/geolocation/permissions/schemas/schema.json b/plugins/geolocation/permissions/schemas/schema.json new file mode 100644 index 00000000..4474ec6b --- /dev/null +++ b/plugins/geolocation/permissions/schemas/schema.json @@ -0,0 +1,360 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "set": { + "description": "A list of permissions sets defined", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + } + }, + "definitions": { + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "description": { + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", + "type": [ + "string", + "null" + ] + }, + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } + } + } + }, + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Scopes": { + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a null JSON value.", + "type": "null" + }, + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "Target": { + "description": "Platform target.", + "oneOf": [ + { + "description": "MacOS.", + "type": "string", + "enum": [ + "macOS" + ] + }, + { + "description": "Windows.", + "type": "string", + "enum": [ + "windows" + ] + }, + { + "description": "Linux.", + "type": "string", + "enum": [ + "linux" + ] + }, + { + "description": "Android.", + "type": "string", + "enum": [ + "android" + ] + }, + { + "description": "iOS.", + "type": "string", + "enum": [ + "iOS" + ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the check_permissions command without any pre-configured scope.", + "type": "string", + "const": "allow-check-permissions" + }, + { + "description": "Denies the check_permissions command without any pre-configured scope.", + "type": "string", + "const": "deny-check-permissions" + }, + { + "description": "Enables the clear_permissions command without any pre-configured scope.", + "type": "string", + "const": "allow-clear-permissions" + }, + { + "description": "Denies the clear_permissions command without any pre-configured scope.", + "type": "string", + "const": "deny-clear-permissions" + }, + { + "description": "Enables the clear_watch command without any pre-configured scope.", + "type": "string", + "const": "allow-clear-watch" + }, + { + "description": "Denies the clear_watch command without any pre-configured scope.", + "type": "string", + "const": "deny-clear-watch" + }, + { + "description": "Enables the get_current_position command without any pre-configured scope.", + "type": "string", + "const": "allow-get-current-position" + }, + { + "description": "Denies the get_current_position command without any pre-configured scope.", + "type": "string", + "const": "deny-get-current-position" + }, + { + "description": "Enables the request_permissions command without any pre-configured scope.", + "type": "string", + "const": "allow-request-permissions" + }, + { + "description": "Denies the request_permissions command without any pre-configured scope.", + "type": "string", + "const": "deny-request-permissions" + }, + { + "description": "Enables the watch_position command without any pre-configured scope.", + "type": "string", + "const": "allow-watch-position" + }, + { + "description": "Denies the watch_position command without any pre-configured scope.", + "type": "string", + "const": "deny-watch-position" + } + ] + } + } +} \ No newline at end of file diff --git a/plugins/authenticator/rollup.config.js b/plugins/geolocation/rollup.config.js similarity index 60% rename from plugins/authenticator/rollup.config.js rename to plugins/geolocation/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/authenticator/rollup.config.js +++ b/plugins/geolocation/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/geolocation/src/commands.rs b/plugins/geolocation/src/commands.rs new file mode 100644 index 00000000..9f9b7aa0 --- /dev/null +++ b/plugins/geolocation/src/commands.rs @@ -0,0 +1,47 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use tauri::{command, ipc::Channel, AppHandle, Runtime}; + +use crate::{GeolocationExt, PermissionStatus, PermissionType, Position, PositionOptions, Result}; + +#[command] +#[specta::specta] +pub(crate) async fn get_current_position( + app: AppHandle, + options: Option, +) -> Result { + app.geolocation().get_current_position(options) +} + +#[command] +#[specta::specta] +pub(crate) async fn watch_position( + app: AppHandle, + options: PositionOptions, + channel: Channel, +) -> Result<()> { + app.geolocation().watch_position_inner(options, channel) +} + +#[command] +#[specta::specta] +pub(crate) async fn clear_watch(app: AppHandle, channel_id: u32) -> Result<()> { + app.geolocation().clear_watch(channel_id) +} + +#[command] +#[specta::specta] +pub(crate) async fn check_permissions(app: AppHandle) -> Result { + app.geolocation().check_permissions() +} + +#[command] +#[specta::specta] +pub(crate) async fn request_permissions( + app: AppHandle, + permissions: Option>, +) -> Result { + app.geolocation().request_permissions(permissions) +} diff --git a/plugins/geolocation/src/desktop.rs b/plugins/geolocation/src/desktop.rs new file mode 100644 index 00000000..00da1fad --- /dev/null +++ b/plugins/geolocation/src/desktop.rs @@ -0,0 +1,95 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use serde::{de::DeserializeOwned, Serialize}; +use tauri::{ + ipc::{Channel, InvokeResponseBody}, + plugin::PluginApi, + AppHandle, Runtime, +}; + +use crate::models::*; + +pub fn init( + app: &AppHandle, + _api: PluginApi, +) -> crate::Result> { + Ok(Geolocation(app.clone())) +} + +/// Access to the geolocation APIs. +pub struct Geolocation(AppHandle); + +impl Geolocation { + pub fn get_current_position( + &self, + _options: Option, + ) -> crate::Result { + Ok(Position::default()) + } + + pub fn watch_position( + &self, + options: PositionOptions, + callback: F, + ) -> crate::Result { + let channel = Channel::new(move |event| { + let payload = match event { + InvokeResponseBody::Json(payload) => serde_json::from_str::(&payload) + .unwrap_or_else(|error| { + WatchEvent::Error(format!( + "Couldn't deserialize watch event payload: `{error}`" + )) + }), + _ => WatchEvent::Error("Unexpected watch event payload.".to_string()), + }; + + callback(payload); + + Ok(()) + }); + let id = channel.id(); + + self.watch_position_inner(options, channel)?; + + Ok(id) + } + + pub(crate) fn watch_position_inner( + &self, + _options: PositionOptions, + _callback_channel: Channel, + ) -> crate::Result<()> { + Ok(()) + } + + pub fn clear_watch(&self, _channel_id: u32) -> crate::Result<()> { + Ok(()) + } + + pub fn check_permissions(&self) -> crate::Result { + Ok(PermissionStatus::default()) + } + + pub fn request_permissions( + &self, + _permissions: Option>, + ) -> crate::Result { + Ok(PermissionStatus::default()) + } +} + +#[derive(Serialize)] +#[allow(unused)] // TODO: +struct WatchPayload { + options: PositionOptions, + channel: Channel, +} + +#[derive(Serialize)] +#[serde(rename_all = "camelCase")] +#[allow(unused)] // TODO: +struct ClearWatchPayload { + channel_id: u32, +} diff --git a/plugins/geolocation/src/error.rs b/plugins/geolocation/src/error.rs new file mode 100644 index 00000000..30ff7f44 --- /dev/null +++ b/plugins/geolocation/src/error.rs @@ -0,0 +1,30 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use serde::{ser::Serializer, Serialize}; +use specta::Type; + +pub type Result = std::result::Result; + +// TODO: Improve Error handling (different typed errors instead of one (stringified) PluginInvokeError for all mobile errors) + +#[derive(Debug, thiserror::Error, Type)] +pub enum Error { + #[cfg(mobile)] + #[error(transparent)] + PluginInvoke( + #[serde(skip)] + #[from] + tauri::plugin::mobile::PluginInvokeError, + ), +} + +impl Serialize for Error { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + serializer.serialize_str(self.to_string().as_ref()) + } +} diff --git a/plugins/geolocation/src/lib.rs b/plugins/geolocation/src/lib.rs new file mode 100644 index 00000000..eed4a475 --- /dev/null +++ b/plugins/geolocation/src/lib.rs @@ -0,0 +1,100 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use tauri::{ + plugin::{Builder, TauriPlugin}, + Manager, Runtime, +}; + +//use tauri_specta::*; + +pub use models::*; + +#[cfg(desktop)] +mod desktop; +#[cfg(mobile)] +mod mobile; + +mod commands; +mod error; +mod models; + +pub use error::{Error, Result}; + +#[cfg(desktop)] +use desktop::Geolocation; +#[cfg(mobile)] +use mobile::Geolocation; + +/* macro_rules! specta_builder { + () => { + ts::builder() + .commands(collect_commands![ + commands::get_current_position, + commands::watch_position, + commands::clear_watch, + commands::check_permissions, + commands::request_permissions + ]) + .header("// @ts-nocheck") + .config( + specta::ts::ExportConfig::default() + .bigint(specta::ts::BigIntExportBehavior::Number), + ) + }; +} */ + +/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the geolocation APIs. +pub trait GeolocationExt { + fn geolocation(&self) -> &Geolocation; +} + +impl> crate::GeolocationExt for T { + fn geolocation(&self) -> &Geolocation { + self.state::>().inner() + } +} + +/// Initializes the plugin. +pub fn init() -> TauriPlugin { + /* let (invoke_handler, register_events) = + specta_builder!().build_plugin_utils("geolocation").unwrap(); */ + + Builder::new("geolocation") + .invoke_handler(tauri::generate_handler![ + commands::get_current_position, + commands::watch_position, + commands::clear_watch, + commands::check_permissions, + commands::request_permissions + ]) + .setup(|app, api| { + #[cfg(mobile)] + let geolocation = mobile::init(app, api)?; + #[cfg(desktop)] + let geolocation = desktop::init(app, api)?; + app.manage(geolocation); + Ok(()) + }) + .build() +} + +/* #[cfg(test)] +mod test { + use super::*; + + #[test] + fn export_types() { + specta_builder!() + .path("./guest-js/bindings.ts") + .config( + specta::ts::ExportConfig::default() + .formatter(specta::ts::formatter::prettier) + .bigint(specta::ts::BigIntExportBehavior::Number), + ) + .export_for_plugin("geolocation") + .expect("failed to export specta types"); + } +} + */ diff --git a/plugins/geolocation/src/mobile.rs b/plugins/geolocation/src/mobile.rs new file mode 100644 index 00000000..48a3f5de --- /dev/null +++ b/plugins/geolocation/src/mobile.rs @@ -0,0 +1,119 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use serde::{de::DeserializeOwned, Serialize}; +use tauri::{ + ipc::{Channel, InvokeResponseBody}, + plugin::{PluginApi, PluginHandle}, + AppHandle, Runtime, +}; + +use crate::models::*; + +#[cfg(target_os = "android")] +const PLUGIN_IDENTIFIER: &str = "app.tauri.geolocation"; + +#[cfg(target_os = "ios")] +tauri::ios_plugin_binding!(init_plugin_geolocation); + +// initializes the Kotlin or Swift plugin classes +pub fn init( + _app: &AppHandle, + api: PluginApi, +) -> crate::Result> { + #[cfg(target_os = "android")] + let handle = api.register_android_plugin(PLUGIN_IDENTIFIER, "GeolocationPlugin")?; + #[cfg(target_os = "ios")] + let handle = api.register_ios_plugin(init_plugin_geolocation)?; + Ok(Geolocation(handle)) +} + +/// Access to the geolocation APIs. +pub struct Geolocation(PluginHandle); + +impl Geolocation { + pub fn get_current_position( + &self, + options: Option, + ) -> crate::Result { + // TODO: We may have to send over None if that's better on Android + self.0 + .run_mobile_plugin("getCurrentPosition", options.unwrap_or_default()) + .map_err(Into::into) + } + + /// Register a position watcher. This method returns an id to use in `clear_watch`. + pub fn watch_position( + &self, + options: PositionOptions, + callback: F, + ) -> crate::Result { + let channel = Channel::new(move |event| { + let payload = match event { + InvokeResponseBody::Json(payload) => serde_json::from_str::(&payload) + .unwrap_or_else(|error| { + WatchEvent::Error(format!( + "Couldn't deserialize watch event payload: `{error}`" + )) + }), + _ => WatchEvent::Error("Unexpected watch event payload.".to_string()), + }; + + callback(payload); + + Ok(()) + }); + let id = channel.id(); + + self.watch_position_inner(options, channel)?; + + Ok(id) + } + + pub(crate) fn watch_position_inner( + &self, + options: PositionOptions, + channel: Channel, + ) -> crate::Result<()> { + self.0 + .run_mobile_plugin("watchPosition", WatchPayload { options, channel }) + .map_err(Into::into) + } + + pub fn clear_watch(&self, channel_id: u32) -> crate::Result<()> { + self.0 + .run_mobile_plugin("clearWatch", ClearWatchPayload { channel_id }) + .map_err(Into::into) + } + + pub fn check_permissions(&self) -> crate::Result { + self.0 + .run_mobile_plugin("checkPermissions", ()) + .map_err(Into::into) + } + + pub fn request_permissions( + &self, + permissions: Option>, + ) -> crate::Result { + self.0 + .run_mobile_plugin( + "requestPermissions", + serde_json::json!({ "permissions": permissions }), + ) + .map_err(Into::into) + } +} + +#[derive(Serialize)] +struct WatchPayload { + options: PositionOptions, + channel: Channel, +} + +#[derive(Serialize)] +#[serde(rename_all = "camelCase")] +struct ClearWatchPayload { + channel_id: u32, +} diff --git a/plugins/geolocation/src/models.rs b/plugins/geolocation/src/models.rs new file mode 100644 index 00000000..165c036f --- /dev/null +++ b/plugins/geolocation/src/models.rs @@ -0,0 +1,91 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use serde::{Deserialize, Serialize}; +use specta::Type; +use tauri::plugin::PermissionState; + +#[derive(Debug, Clone, Default, Serialize, Deserialize, Type)] +#[serde(rename_all = "camelCase")] +pub struct PermissionStatus { + /// Permission state for the location alias. + /// + /// On Android it requests/checks both ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION permissions. + /// + /// On iOS it requests/checks location permissions. + pub location: PermissionState, + /// Permissions state for the coarseLoaction alias. + /// + /// On Android it requests/checks ACCESS_COARSE_LOCATION. + /// + /// On Android 12+, users can choose between Approximate location (ACCESS_COARSE_LOCATION) and Precise location (ACCESS_FINE_LOCATION). + /// + /// On iOS it will have the same value as the `location` alias. + pub coarse_location: PermissionState, +} + +#[derive(Debug, Clone, Default, Serialize, Deserialize, Type)] +#[serde(rename_all = "camelCase")] +pub struct PositionOptions { + /// High accuracy mode (such as GPS, if available) + /// Will be ignored on Android 12+ if users didn't grant the ACCESS_FINE_LOCATION permission. + pub enable_high_accuracy: bool, + /// The maximum wait time in milliseconds for location updates. + /// Default: 10000 + /// On Android the timeout gets ignored for getCurrentPosition. + /// Ignored on iOS. + // TODO: Handle Infinity and default to it. + // TODO: Should be u64+ but specta doesn't like that? + pub timeout: u32, + /// The maximum age in milliseconds of a possible cached position that is acceptable to return. + /// Default: 0 + /// Ignored on iOS. + // TODO: Handle Infinity. + // TODO: Should be u64+ but specta doesn't like that? + pub maximum_age: u32, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Type)] +#[serde(rename_all = "camelCase")] +pub enum PermissionType { + Location, + CoarseLocation, +} + +#[derive(Debug, Clone, Default, Serialize, Deserialize, Type)] +#[serde(rename_all = "camelCase")] +pub struct Coordinates { + /// Latitude in decimal degrees. + pub latitude: f64, + /// Longitude in decimal degrees. + pub longitude: f64, + /// Accuracy level of the latitude and longitude coordinates in meters. + pub accuracy: f64, + /// Accuracy level of the altitude coordinate in meters, if available. + /// Available on all iOS versions and on Android 8 and above. + pub altitude_accuracy: Option, + /// The altitude the user is at, if available. + pub altitude: Option, + // The speed the user is traveling, if available. + pub speed: Option, + /// The heading the user is facing, if available. + pub heading: Option, +} + +#[derive(Debug, Clone, Default, Serialize, Deserialize, Type)] +#[serde(rename_all = "camelCase")] +pub struct Position { + /// Creation time for these coordinates. + // TODO: Check if we're actually losing precision. + pub timestamp: u64, + /// The GPS coordinates along with the accuracy of the data. + pub coords: Coordinates, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Type)] +#[serde(untagged)] +pub enum WatchEvent { + Position(Position), + Error(String), +} diff --git a/plugins/authenticator/tsconfig.json b/plugins/geolocation/tsconfig.json similarity index 100% rename from plugins/authenticator/tsconfig.json rename to plugins/geolocation/tsconfig.json diff --git a/plugins/global-shortcut/CHANGELOG.md b/plugins/global-shortcut/CHANGELOG.md index fd670851..5cd07c7d 100644 --- a/plugins/global-shortcut/CHANGELOG.md +++ b/plugins/global-shortcut/CHANGELOG.md @@ -1,5 +1,73 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.1] + +- [`2c00c029`](https://github.com/tauri-apps/plugins-workspace/commit/2c00c0292c9127b81567de46691e8c0f73557261) ([#1630](https://github.com/tauri-apps/plugins-workspace/pull/1630) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fixed an issue that caused multi-word IIFE names to not be formatted correctly. For example the `barcode-scanner` was defined as `window.__TAURI_PLUGIN_CLIPBOARDMANAGER__` instead of `window.__TAURI_PLUGIN_CLIPBOARD_MANAGER__`. + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.8] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.7] + +- [`381a466d`](https://github.com/tauri-apps/plugins-workspace/commit/381a466db344e59a76b2a4d5785b2a0b64d4d373) ([#1117](https://github.com/tauri-apps/plugins-workspace/pull/1117) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Refactored the JS APIs: + + - Enhanced `register` and `unregister` to take either a single shortcut or an array. + - Removed `registerAll` instead use `register` with an array. +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.6] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.3] + +- [`9c7eb359`](https://github.com/tauri-apps/plugins-workspace/commit/9c7eb35967ad10659eb4976bd6f77d9d270bfeed)([#1244](https://github.com/tauri-apps/plugins-workspace/pull/1244)) Refactored APIs to introduce new pressed and released events: + + - Added `ShortcutEvent` and `ShortcutState` types in Rust. + - Changed the handler function passed to `GlobalShortcut::on_shortcut`, `GlobalShortcut::on_all_shortcuts` and `Builder::with_handler` to take a 3rd argument of type `ShortcutEvent`. + - Added `ShortcutEvent` interface in JS. + - Changed `ShortcutHandler` type alias (which affects the JS `register` and `registerAll` APIs) to take `ShortcutEvent` instead of a string. +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[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. +- [`62dafda`](https://github.com/tauri-apps/plugins-workspace/commit/62dafda6526899b407a7c5a1bb269c5c0dfb2630)([#969](https://github.com/tauri-apps/plugins-workspace/pull/969)) **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. + +## \[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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -47,4 +115,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! -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/pull/371)) First v2 alpha release! + 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + st v2 alpha release! + ]\(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! + om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/global-shortcut/Cargo.toml b/plugins/global-shortcut/Cargo.toml index 90cbaa58..a26be3fb 100644 --- a/plugins/global-shortcut/Cargo.toml +++ b/plugins/global-shortcut/Cargo.toml @@ -1,19 +1,27 @@ [package] name = "tauri-plugin-global-shortcut" -version = "2.0.0-beta.1" +version = "2.0.1" description = "Register global hotkeys listeners on your Tauri application." edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-global-shortcut" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "none", notes = "" } +ios = { level = "none", notes = "" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -23,4 +31,4 @@ log = { workspace = true } thiserror = { workspace = true } [target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies] -global-hotkey = "0.2.1" +global-hotkey = { version = "0.6", features = ["serde"] } diff --git a/plugins/global-shortcut/README.md b/plugins/global-shortcut/README.md index 4bdb24f4..12a9b08d 100644 --- a/plugins/global-shortcut/README.md +++ b/plugins/global-shortcut/README.md @@ -2,11 +2,17 @@ Register global shortcuts. -- Supported platforms: Windows, Linux and macOS. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | x | +| iOS | x | ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -21,7 +27,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml # you can add the dependencies on the `[dependencies]` section if you do not target mobile [target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies] -tauri-plugin-global-shortcut = "2.0.0-beta" +tauri-plugin-global-shortcut = "2.0.0" # alternatively with Git: tauri-plugin-global-shortcut = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -57,20 +63,24 @@ fn main() { .setup(|app| { #[cfg(desktop)] { - use tauri_plugin_global_shortcut::{Code, GlobalShortcutExt, Modifiers, Shortcut}; + use tauri::Manager; + use tauri_plugin_global_shortcut::{Code, Modifiers, ShortcutState}; - let ctrl_n_shortcut = Shortcut::new(Some(Modifiers::CONTROL), Code::KeyN); app.handle().plugin( - tauri_plugin_global_shortcut::Builder::with_handler(move |_app, shortcut| { - println!("{:?}", shortcut); - if shortcut == &ctrl_n_shortcut { - println!("Ctrl-N Detected!"); - } - }) - .build(), + tauri_plugin_global_shortcut::Builder::new() + .with_shortcuts(["ctrl+d", "alt+space"])? + .with_handler(|app, shortcut, event| { + if event.state == ShortcutState::Pressed { + if shortcut.matches(Modifiers::CONTROL, Code::KeyD) { + let _ = app.emit("shortcut-event", "Ctrl+D triggered"); + } + if shortcut.matches(Modifiers::ALT, Code::Space) { + let _ = app.emit("shortcut-event", "Alt+Space triggered"); + } + } + }) + .build(), )?; - - app.global_shortcut().register(ctrl_n_shortcut)?; } Ok(()) @@ -83,10 +93,12 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript bindings: ```javascript -import { register } from "@tauri-apps/plugin-global-shortcut"; -await register("CommandOrControl+Shift+C", () => { - console.log("Shortcut triggered"); -}); +import { register } from '@tauri-apps/plugin-global-shortcut' +await register('CommandOrControl+Shift+C', (event) => { + if (event.state === 'Pressed') { + console.log('Shortcut triggered') + } +}) ``` ## Contributing diff --git a/plugins/global-shortcut/SECURITY.md b/plugins/global-shortcut/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/global-shortcut/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/global-shortcut/api-iife.js b/plugins/global-shortcut/api-iife.js new file mode 100644 index 00000000..67ec9e47 --- /dev/null +++ b/plugins/global-shortcut/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_GLOBAL_SHORTCUT__=function(t){"use strict";function e(t,e,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(t):s?s.value:e.get(t)}function r(t,e,r,s,n){if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,r),r}var s,n,i;"function"==typeof SuppressedError&&SuppressedError;class o{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,s.set(this,(()=>{})),n.set(this,0),i.set(this,{}),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:o})=>{if(o===e(this,n,"f")){r(this,n,o+1),e(this,s,"f").call(this,t);const a=Object.keys(e(this,i,"f"));if(a.length>0){let t=o+1;for(const r of a.sort()){if(parseInt(r)!==t)break;{const n=e(this,i,"f")[r];delete e(this,i,"f")[r],e(this,s,"f").call(this,n),t+=1}}r(this,n,t)}}else e(this,i,"f")[o.toString()]=t}))}set onmessage(t){r(this,s,t)}get onmessage(){return e(this,s,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}return s=new WeakMap,n=new WeakMap,i=new WeakMap,t.isRegistered=async function(t){return await a("plugin:global-shortcut|is_registered",{shortcut:t})},t.register=async function(t,e){const r=new o;return r.onmessage=e,await a("plugin:global-shortcut|register",{shortcuts:Array.isArray(t)?t:[t],handler:r})},t.unregister=async function(t){return await a("plugin:global-shortcut|unregister",{shortcuts:Array.isArray(t)?t:[t]})},t.unregisterAll=async function(){return await a("plugin:global-shortcut|unregister_all",{})},t}({});Object.defineProperty(window.__TAURI__,"globalShortcut",{value:__TAURI_PLUGIN_GLOBAL_SHORTCUT__})} diff --git a/plugins/global-shortcut/build.rs b/plugins/global-shortcut/build.rs index 8c5c71df..20b7b7f8 100644 --- a/plugins/global-shortcut/build.rs +++ b/plugins/global-shortcut/build.rs @@ -2,14 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -const COMMANDS: &[&str] = &[ - "register", - "register_all", - "unregister", - "unregister_all", - "is_registered", -]; +const COMMANDS: &[&str] = &["register", "unregister", "unregister_all", "is_registered"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/global-shortcut/guest-js/index.ts b/plugins/global-shortcut/guest-js/index.ts index e9cd935f..13e8e50e 100644 --- a/plugins/global-shortcut/guest-js/index.ts +++ b/plugins/global-shortcut/guest-js/index.ts @@ -8,17 +8,38 @@ * @module */ -import { invoke, Channel } from "@tauri-apps/api/core"; +import { invoke, Channel } from '@tauri-apps/api/core' -export type ShortcutHandler = (shortcut: string) => void; +export interface ShortcutEvent { + shortcut: string + id: number + state: 'Released' | 'Pressed' +} + +export type ShortcutHandler = (event: ShortcutEvent) => void /** - * Register a global shortcut. + * Register a global shortcut or a list of shortcuts. + * + * The handler is called when any of the registered shortcuts are pressed by the user. + * + * If the shortcut is already taken by another application, the handler will not be triggered. + * Make sure the shortcut is as unique as possible while still taking user experience into consideration. + * * @example * ```typescript * import { register } from '@tauri-apps/plugin-global-shortcut'; - * await register('CommandOrControl+Shift+C', () => { - * console.log('Shortcut triggered'); + * + * // register a single hotkey + * await register('CommandOrControl+Shift+C', (event) => { + * if (event.state === "Pressed") { + * console.log('Shortcut triggered'); + * } + * }); + * + * // or register multiple hotkeys at once + * await register(['CommandOrControl+Shift+C', 'Alt+A'], (event) => { + * console.log(`Shortcut ${event.shortcut} triggered`); * }); * ``` * @@ -28,97 +49,75 @@ export type ShortcutHandler = (shortcut: string) => void; * @since 2.0.0 */ async function register( - shortcut: string, - handler: ShortcutHandler, + shortcuts: string | string[], + handler: ShortcutHandler ): Promise { - const h = new Channel(); - h.onmessage = handler; + const h = new Channel() + h.onmessage = handler - return await invoke("plugin:global-shortcut|register", { - shortcut, - handler: h, - }); + return await invoke('plugin:global-shortcut|register', { + shortcuts: Array.isArray(shortcuts) ? shortcuts : [shortcuts], + handler: h + }) } /** - * Register a collection of global shortcuts. + * Unregister a global shortcut or a list of shortcuts. + * * @example * ```typescript - * import { registerAll } from '@tauri-apps/plugin-global-shortcut'; - * await registerAll(['CommandOrControl+Shift+C', 'Ctrl+Alt+F12'], (shortcut) => { - * console.log(`Shortcut ${shortcut} triggered`); - * }); + * import { unregister } from '@tauri-apps/plugin-global-shortcut'; + * + * // unregister a single hotkey + * await unregister('CmdOrControl+Space'); + * + * // or unregister multiple hotkeys at the same time + * await unregister(['CmdOrControl+Space', 'Alt+A']); * ``` * - * @param shortcuts Array of shortcut definitions, modifiers and key separated by "+" e.g. CmdOrControl+Q - * @param handler Shortcut handler callback - takes the triggered shortcut as argument + * @param shortcut shortcut definition (modifiers and key separated by "+" e.g. CmdOrControl+Q), also accepts a list of shortcuts * * @since 2.0.0 */ -async function registerAll( - shortcuts: string[], - handler: ShortcutHandler, -): Promise { - const h = new Channel(); - h.onmessage = handler; - - return await invoke("plugin:global-shortcut|register_all", { - shortcuts, - handler: h, - }); +async function unregister(shortcuts: string | string[]): Promise { + return await invoke('plugin:global-shortcut|unregister', { + shortcuts: Array.isArray(shortcuts) ? shortcuts : [shortcuts] + }) } /** - * Determines whether the given shortcut is registered by this application or not. - * - * If the shortcut is registered by another application, it will still return `false`. + * Unregister all global shortcuts. * * @example * ```typescript - * import { isRegistered } from '@tauri-apps/plugin-global-shortcut'; - * const isRegistered = await isRegistered('CommandOrControl+P'); + * import { unregisterAll } from '@tauri-apps/plugin-global-shortcut'; + * await unregisterAll(); * ``` - * - * @param shortcut shortcut definition, modifiers and key separated by "+" e.g. CmdOrControl+Q - * * @since 2.0.0 */ -async function isRegistered(shortcut: string): Promise { - return await invoke("plugin:global-shortcut|is_registered", { - shortcut, - }); +async function unregisterAll(): Promise { + return await invoke('plugin:global-shortcut|unregister_all', {}) } /** - * Unregister a global shortcut. - * @example - * ```typescript - * import { unregister } from '@tauri-apps/plugin-global-shortcut'; - * await unregister('CmdOrControl+Space'); - * ``` + * Determines whether the given shortcut is registered by this application or not. * - * @param shortcut shortcut definition, modifiers and key separated by "+" e.g. CmdOrControl+Q + * If the shortcut is registered by another application, it will still return `false`. * - * @since 2.0.0 - */ -async function unregister(shortcut: string): Promise { - return await invoke("plugin:global-shortcut|unregister", { - shortcut, - }); -} - -/** - * Unregisters all shortcuts registered by the application. * @example * ```typescript - * import { unregisterAll } from '@tauri-apps/plugin-global-shortcut'; - * await unregisterAll(); + * import { isRegistered } from '@tauri-apps/plugin-global-shortcut'; + * const isRegistered = await isRegistered('CommandOrControl+P'); * ``` * + * @param shortcut shortcut definition, modifiers and key separated by "+" e.g. CmdOrControl+Q + * * @since 2.0.0 */ -async function unregisterAll(): Promise { - return await invoke("plugin:global-shortcut|unregister_all"); +async function isRegistered(shortcut: string): Promise { + return await invoke('plugin:global-shortcut|is_registered', { + shortcut + }) } -export { register, registerAll, isRegistered, unregister, unregisterAll }; +export { register, unregister, unregisterAll, isRegistered } diff --git a/plugins/global-shortcut/package.json b/plugins/global-shortcut/package.json index 3bfdf0b2..a247f93b 100644 --- a/plugins/global-shortcut/package.json +++ b/plugins/global-shortcut/package.json @@ -1,10 +1,11 @@ { "name": "@tauri-apps/plugin-global-shortcut", - "version": "2.0.0-beta.1", - "license": "MIT or APACHE-2.0", + "version": "2.0.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -23,6 +24,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/global-shortcut/permissions/autogenerated/reference.md b/plugins/global-shortcut/permissions/autogenerated/reference.md index daff8aba..f8571c04 100644 --- a/plugins/global-shortcut/permissions/autogenerated/reference.md +++ b/plugins/global-shortcut/permissions/autogenerated/reference.md @@ -1,42 +1,148 @@ -# Permissions +## Default Permission -## allow-is-registered +No features are enabled by default, as we believe +the shortcuts can be inherently dangerous and it is +application specific if specific shortcuts should be +registered or unregistered. + + + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`global-shortcut:allow-is-registered` + + Enables the is_registered command without any pre-configured scope. -## deny-is-registered +
+ +`global-shortcut:deny-is-registered` + + Denies the is_registered command without any pre-configured scope. -## allow-register +
+ +`global-shortcut:allow-register` + + Enables the register command without any pre-configured scope. -## deny-register +
+ +`global-shortcut:deny-register` + + Denies the register command without any pre-configured scope. -## allow-register-all +
+ +`global-shortcut:allow-register-all` + + Enables the register_all command without any pre-configured scope. -## deny-register-all +
+ +`global-shortcut:deny-register-all` + + Denies the register_all command without any pre-configured scope. -## allow-unregister +
+ +`global-shortcut:allow-unregister` + + Enables the unregister command without any pre-configured scope. -## deny-unregister +
+ +`global-shortcut:deny-unregister` + + Denies the unregister command without any pre-configured scope. -## allow-unregister-all +
+ +`global-shortcut:allow-unregister-all` + + Enables the unregister_all command without any pre-configured scope. -## deny-unregister-all +
+ +`global-shortcut:deny-unregister-all` + + Denies the unregister_all command without any pre-configured scope. +
diff --git a/plugins/global-shortcut/permissions/default.toml b/plugins/global-shortcut/permissions/default.toml new file mode 100644 index 00000000..fd32c51e --- /dev/null +++ b/plugins/global-shortcut/permissions/default.toml @@ -0,0 +1,10 @@ +"$schema" = "schemas/schema.json" +[default] +description = """ +No features are enabled by default, as we believe +the shortcuts can be inherently dangerous and it is +application specific if specific shortcuts should be +registered or unregistered. +""" + +permissions = [] diff --git a/plugins/global-shortcut/permissions/schemas/schema.json b/plugins/global-shortcut/permissions/schemas/schema.json index cf1ca136..66b92b07 100644 --- a/plugins/global-shortcut/permissions/schemas/schema.json +++ b/plugins/global-shortcut/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,78 +251,103 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-is-registered -> Enables the is_registered command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-is-registered" + "macOS" ] }, { - "description": "deny-is-registered -> Denies the is_registered command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-is-registered" + "windows" ] }, { - "description": "allow-register -> Enables the register command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-register" + "linux" ] }, { - "description": "deny-register -> Denies the register command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-register" + "android" ] }, { - "description": "allow-register-all -> Enables the register_all command without any pre-configured scope.", + "description": "iOS.", "type": "string", "enum": [ - "allow-register-all" + "iOS" ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the is_registered command without any pre-configured scope.", + "type": "string", + "const": "allow-is-registered" }, { - "description": "deny-register-all -> Denies the register_all command without any pre-configured scope.", + "description": "Denies the is_registered command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-register-all" - ] + "const": "deny-is-registered" }, { - "description": "allow-unregister -> Enables the unregister command without any pre-configured scope.", + "description": "Enables the register command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-unregister" - ] + "const": "allow-register" }, { - "description": "deny-unregister -> Denies the unregister command without any pre-configured scope.", + "description": "Denies the register command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-unregister" - ] + "const": "deny-register" }, { - "description": "allow-unregister-all -> Enables the unregister_all command without any pre-configured scope.", + "description": "Enables the register_all command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-unregister-all" - ] + "const": "allow-register-all" }, { - "description": "deny-unregister-all -> Denies the unregister_all command without any pre-configured scope.", + "description": "Denies the register_all command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-unregister-all" - ] + "const": "deny-register-all" + }, + { + "description": "Enables the unregister command without any pre-configured scope.", + "type": "string", + "const": "allow-unregister" + }, + { + "description": "Denies the unregister command without any pre-configured scope.", + "type": "string", + "const": "deny-unregister" + }, + { + "description": "Enables the unregister_all command without any pre-configured scope.", + "type": "string", + "const": "allow-unregister-all" + }, + { + "description": "Denies the unregister_all command without any pre-configured scope.", + "type": "string", + "const": "deny-unregister-all" + }, + { + "description": "No features are enabled by default, as we believe\nthe shortcuts can be inherently dangerous and it is\napplication specific if specific shortcuts should be\nregistered or unregistered.\n", + "type": "string", + "const": "default" } ] } diff --git a/plugins/global-shortcut/rollup.config.js b/plugins/global-shortcut/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/global-shortcut/rollup.config.js +++ b/plugins/global-shortcut/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/global-shortcut/src/api-iife.js b/plugins/global-shortcut/src/api-iife.js deleted file mode 100644 index 54da2b59..00000000 --- a/plugins/global-shortcut/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_GLOBALSHORTCUT__=function(t){"use strict";function e(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)}var r;"function"==typeof SuppressedError&&SuppressedError;class n{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,r.set(this,(()=>{})),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((t=>{e(this,r,"f").call(this,t)}))}set onmessage(t){!function(t,e,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(t,r):o?o.value=r:e.set(t,r)}(this,r,t,"f")}get onmessage(){return e(this,r,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function o(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}return r=new WeakMap,t.isRegistered=async function(t){return await o("plugin:global-shortcut|is_registered",{shortcut:t})},t.register=async function(t,e){const r=new n;return r.onmessage=e,await o("plugin:global-shortcut|register",{shortcut:t,handler:r})},t.registerAll=async function(t,e){const r=new n;return r.onmessage=e,await o("plugin:global-shortcut|register_all",{shortcuts:t,handler:r})},t.unregister=async function(t){return await o("plugin:global-shortcut|unregister",{shortcut:t})},t.unregisterAll=async function(){return await o("plugin:global-shortcut|unregister_all")},t}({});Object.defineProperty(window.__TAURI__,"globalShortcut",{value:__TAURI_PLUGIN_GLOBALSHORTCUT__})} diff --git a/plugins/global-shortcut/src/error.rs b/plugins/global-shortcut/src/error.rs index 8157000c..37392b32 100644 --- a/plugins/global-shortcut/src/error.rs +++ b/plugins/global-shortcut/src/error.rs @@ -5,9 +5,14 @@ use serde::{Serialize, Serializer}; #[derive(Debug, thiserror::Error)] +#[non_exhaustive] pub enum Error { #[error("{0}")] GlobalHotkey(String), + #[error(transparent)] + RecvError(#[from] std::sync::mpsc::RecvError), + #[error(transparent)] + Tauri(#[from] tauri::Error), } impl Serialize for Error { @@ -24,3 +29,9 @@ impl From for Error { Self::GlobalHotkey(value.to_string()) } } + +impl From for Error { + fn from(value: global_hotkey::hotkey::HotKeyParseError) -> Self { + Self::GlobalHotkey(value.to_string()) + } +} diff --git a/plugins/global-shortcut/src/lib.rs b/plugins/global-shortcut/src/lib.rs index eed72a99..5868ff9d 100644 --- a/plugins/global-shortcut/src/lib.rs +++ b/plugins/global-shortcut/src/lib.rs @@ -20,34 +20,25 @@ use std::{ sync::{Arc, Mutex}, }; -pub use global_hotkey::hotkey::{Code, HotKey as Shortcut, Modifiers}; -use global_hotkey::{GlobalHotKeyEvent, GlobalHotKeyManager}; +use global_hotkey::GlobalHotKeyEvent; +pub use global_hotkey::{ + hotkey::{Code, HotKey as Shortcut, Modifiers}, + GlobalHotKeyEvent as ShortcutEvent, HotKeyState as ShortcutState, +}; +use serde::Serialize; use tauri::{ ipc::Channel, plugin::{Builder as PluginBuilder, TauriPlugin}, - AppHandle, Manager, Runtime, State, Window, + AppHandle, Manager, Runtime, State, }; mod error; pub use error::Error; type Result = std::result::Result; -type HotKeyId = u32; -type HandlerFn = Box, &Shortcut) + Send + Sync + 'static>; - -enum ShortcutSource { - Ipc(Channel), - Rust, -} -impl Clone for ShortcutSource { - fn clone(&self) -> Self { - match self { - Self::Ipc(channel) => Self::Ipc(channel.clone()), - Self::Rust => Self::Rust, - } - } -} +type HotKeyId = u32; +type HandlerFn = Box, &Shortcut, ShortcutEvent) + Send + Sync + 'static>; pub struct ShortcutWrapper(Shortcut); @@ -58,109 +49,183 @@ impl From for ShortcutWrapper { } impl TryFrom<&str> for ShortcutWrapper { - type Error = global_hotkey::Error; + type Error = global_hotkey::hotkey::HotKeyParseError; fn try_from(value: &str) -> std::result::Result { Shortcut::from_str(value).map(ShortcutWrapper) } } -struct RegisteredShortcut { - source: ShortcutSource, - shortcut: (Shortcut, Option), +struct RegisteredShortcut { + shortcut: Shortcut, + handler: Option>>, } +struct GlobalHotKeyManager(global_hotkey::GlobalHotKeyManager); + +/// SAFETY: we ensure it is run on main thread only +unsafe impl Send for GlobalHotKeyManager {} +/// SAFETY: we ensure it is run on main thread only +unsafe impl Sync for GlobalHotKeyManager {} + pub struct GlobalShortcut { #[allow(dead_code)] app: AppHandle, - manager: std::result::Result, - shortcuts: Arc>>, + manager: Arc, + shortcuts: Arc>>>, +} + +macro_rules! run_main_thread { + ($handle:expr, $manager:expr, |$m:ident| $ex:expr) => {{ + let (tx, rx) = std::sync::mpsc::channel(); + let manager = $manager.clone(); + let task = move || { + let f = |$m: &GlobalHotKeyManager| $ex; + let _ = tx.send(f(&*manager)); + }; + $handle.run_on_main_thread(task)?; + rx.recv()? + }}; } impl GlobalShortcut { - fn register_internal( + fn register_internal, &Shortcut, ShortcutEvent) + Send + Sync + 'static>( &self, - shortcut: (Shortcut, Option), - source: ShortcutSource, + shortcut: Shortcut, + handler: Option, ) -> Result<()> { - let id = shortcut.0.id(); - acquire_manager(&self.manager)?.register(shortcut.0)?; + let id = shortcut.id(); + let handler = handler.map(|h| Arc::new(Box::new(h) as HandlerFn)); + run_main_thread!(self.app, self.manager, |m| m.0.register(shortcut))?; self.shortcuts .lock() .unwrap() - .insert(id, RegisteredShortcut { source, shortcut }); + .insert(id, RegisteredShortcut { shortcut, handler }); Ok(()) } - fn register_all_internal)>>( - &self, - shortcuts: S, - source: ShortcutSource, - ) -> Result<()> { - let hotkeys = shortcuts - .into_iter() - .collect::)>>(); + fn register_multiple_internal(&self, shortcuts: S, handler: Option) -> Result<()> + where + S: IntoIterator, + F: Fn(&AppHandle, &Shortcut, ShortcutEvent) + Send + Sync + 'static, + { + let handler = handler.map(|h| Arc::new(Box::new(h) as HandlerFn)); - let manager = acquire_manager(&self.manager)?; - let mut shortcuts = self.shortcuts.lock().unwrap(); - for hotkey in hotkeys { - manager.register(hotkey.0)?; + let hotkeys = shortcuts.into_iter().collect::>(); + let mut shortcuts = self.shortcuts.lock().unwrap(); + for shortcut in hotkeys { + run_main_thread!(self.app, self.manager, |m| m.0.register(shortcut))?; shortcuts.insert( - hotkey.0.id(), + shortcut.id(), RegisteredShortcut { - source: source.clone(), - shortcut: hotkey, + shortcut, + handler: handler.clone(), }, ); } Ok(()) } +} - pub fn register>(&self, shortcut: S) -> Result<()> +impl GlobalShortcut { + /// Register a shortcut. + pub fn register(&self, shortcut: S) -> Result<()> where + S: TryInto, S::Error: std::error::Error, { - self.register_internal((try_into_shortcut(shortcut)?, None), ShortcutSource::Rust) + self.register_internal( + try_into_shortcut(shortcut)?, + None::, &Shortcut, ShortcutEvent)>, + ) } - pub fn register_all, S: IntoIterator>( - &self, - shortcuts: S, - ) -> Result<()> + /// Register a shortcut with a handler. + pub fn on_shortcut(&self, shortcut: S, handler: F) -> Result<()> + where + S: TryInto, + S::Error: std::error::Error, + F: Fn(&AppHandle, &Shortcut, ShortcutEvent) + Send + Sync + 'static, + { + self.register_internal(try_into_shortcut(shortcut)?, Some(handler)) + } + + /// Register multiple shortcuts. + pub fn register_multiple(&self, shortcuts: S) -> Result<()> where + S: IntoIterator, + T: TryInto, T::Error: std::error::Error, { let mut s = Vec::new(); for shortcut in shortcuts { - s.push((try_into_shortcut(shortcut)?, None)); + s.push(try_into_shortcut(shortcut)?); } - self.register_all_internal(s, ShortcutSource::Rust) + self.register_multiple_internal(s, None::, &Shortcut, ShortcutEvent)>) } + /// Register multiple shortcuts with a handler. + pub fn on_shortcuts(&self, shortcuts: S, handler: F) -> Result<()> + where + S: IntoIterator, + T: TryInto, + T::Error: std::error::Error, + F: Fn(&AppHandle, &Shortcut, ShortcutEvent) + Send + Sync + 'static, + { + let mut s = Vec::new(); + for shortcut in shortcuts { + s.push(try_into_shortcut(shortcut)?); + } + self.register_multiple_internal(s, Some(handler)) + } + + /// Unregister a shortcut pub fn unregister>(&self, shortcut: S) -> Result<()> where S::Error: std::error::Error, { - acquire_manager(&self.manager)? - .unregister(try_into_shortcut(shortcut)?) - .map_err(Into::into) + let shortcut = try_into_shortcut(shortcut)?; + run_main_thread!(self.app, self.manager, |m| m.0.unregister(shortcut))?; + self.shortcuts.lock().unwrap().remove(&shortcut.id()); + Ok(()) } - pub fn unregister_all, S: IntoIterator>( + /// Unregister multiple shortcuts. + pub fn unregister_multiple, S: IntoIterator>( &self, shortcuts: S, ) -> Result<()> where T::Error: std::error::Error, { - let mut s = Vec::new(); + let mut mapped_shortcuts = Vec::new(); for shortcut in shortcuts { - s.push(try_into_shortcut(shortcut)?); + mapped_shortcuts.push(try_into_shortcut(shortcut)?); + } + + { + let mapped_shortcuts = mapped_shortcuts.clone(); + #[rustfmt::skip] + run_main_thread!(self.app, self.manager, |m| m.0.unregister_all(&mapped_shortcuts))?; + } + + let mut shortcuts = self.shortcuts.lock().unwrap(); + for s in mapped_shortcuts { + shortcuts.remove(&s.id()); } - acquire_manager(&self.manager)? - .unregister_all(&s) - .map_err(Into::into) + + Ok(()) + } + + /// Unregister all registered shortcuts. + pub fn unregister_all(&self) -> Result<()> { + let mut shortcuts = self.shortcuts.lock().unwrap(); + let hotkeys = std::mem::take(&mut *shortcuts); + let hotkeys = hotkeys.values().map(|s| s.shortcut).collect::>(); + #[rustfmt::skip] + let res = run_main_thread!(self.app, self.manager, |m| m.0.unregister_all(hotkeys.as_slice())); + res.map_err(Into::into) } /// Determines whether the given shortcut is registered by this application or not. @@ -188,14 +253,6 @@ impl> GlobalShortcutExt for T { } } -fn acquire_manager( - manager: &std::result::Result, -) -> Result<&GlobalHotKeyManager> { - manager - .as_ref() - .map_err(|e| Error::GlobalHotkey(e.to_string())) -} - fn parse_shortcut>(shortcut: S) -> Result { shortcut.as_ref().parse().map_err(Into::into) } @@ -210,53 +267,63 @@ where .map_err(|e| Error::GlobalHotkey(e.to_string())) } -#[tauri::command] -fn register( - _window: Window, - global_shortcut: State<'_, GlobalShortcut>, +#[derive(Clone, Serialize)] +struct ShortcutJsEvent { shortcut: String, - handler: Channel, -) -> Result<()> { - global_shortcut.register_internal( - (parse_shortcut(&shortcut)?, Some(shortcut)), - ShortcutSource::Ipc(handler), - ) + id: u32, + state: ShortcutState, } #[tauri::command] -fn register_all( - _window: Window, +fn register( + _app: AppHandle, global_shortcut: State<'_, GlobalShortcut>, shortcuts: Vec, - handler: Channel, + handler: Channel, ) -> Result<()> { let mut hotkeys = Vec::new(); + + let mut shortcut_map = HashMap::new(); for shortcut in shortcuts { - hotkeys.push((parse_shortcut(&shortcut)?, Some(shortcut))); + let hotkey = parse_shortcut(&shortcut)?; + shortcut_map.insert(hotkey.id(), shortcut); + hotkeys.push(hotkey); } - global_shortcut.register_all_internal(hotkeys, ShortcutSource::Ipc(handler)) + + global_shortcut.register_multiple_internal( + hotkeys, + Some( + move |_app: &AppHandle, shortcut: &Shortcut, e: ShortcutEvent| { + let js_event = ShortcutJsEvent { + id: e.id, + state: e.state, + shortcut: shortcut.into_string(), + }; + let _ = handler.send(js_event); + }, + ), + ) } #[tauri::command] fn unregister( _app: AppHandle, global_shortcut: State<'_, GlobalShortcut>, - shortcut: String, + shortcuts: Vec, ) -> Result<()> { - global_shortcut.unregister(parse_shortcut(shortcut)?) + let mut hotkeys = Vec::new(); + for shortcut in shortcuts { + hotkeys.push(parse_shortcut(&shortcut)?); + } + global_shortcut.unregister_multiple(hotkeys) } #[tauri::command] fn unregister_all( _app: AppHandle, global_shortcut: State<'_, GlobalShortcut>, - shortcuts: Vec, ) -> Result<()> { - let mut hotkeys = Vec::new(); - for shortcut in shortcuts { - hotkeys.push(parse_shortcut(&shortcut)?); - } - global_shortcut.unregister_all(hotkeys) + global_shortcut.unregister_all() } #[tauri::command] @@ -269,12 +336,14 @@ fn is_registered( } pub struct Builder { + shortcuts: Vec, handler: Option>, } impl Default for Builder { fn default() -> Self { Self { + shortcuts: Vec::new(), handler: Default::default(), } } @@ -285,49 +354,81 @@ impl Builder { Self::default() } - pub fn with_handler, &Shortcut) + Send + Sync + 'static>( + /// Add a shortcut to be registerd. + pub fn with_shortcut(mut self, shortcut: T) -> Result + where + T: TryInto, + T::Error: std::error::Error, + { + self.shortcuts.push(try_into_shortcut(shortcut)?); + Ok(self) + } + + /// Add multiple shortcuts to be registerd. + pub fn with_shortcuts(mut self, shortcuts: S) -> Result + where + S: IntoIterator, + T: TryInto, + T::Error: std::error::Error, + { + for shortcut in shortcuts { + self.shortcuts.push(try_into_shortcut(shortcut)?); + } + + Ok(self) + } + + /// Specify a global shortcut handler that will be triggered for any and all shortcuts. + pub fn with_handler, &Shortcut, ShortcutEvent) + Send + Sync + 'static>( + mut self, handler: F, ) -> Self { - Self { - handler: Some(Box::new(handler)), - } + self.handler.replace(Box::new(handler)); + self } pub fn build(self) -> TauriPlugin { let handler = self.handler; + let shortcuts = self.shortcuts; PluginBuilder::new("global-shortcut") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![ register, - register_all, unregister, unregister_all, - is_registered + is_registered, ]) .setup(move |app, _api| { - let shortcuts = - Arc::new(Mutex::new(HashMap::::new())); + let manager = global_hotkey::GlobalHotKeyManager::new()?; + let mut store = HashMap::>::new(); + for shortcut in shortcuts { + manager.register(shortcut)?; + store.insert( + shortcut.id(), + RegisteredShortcut { + shortcut, + handler: None, + }, + ); + } + + let shortcuts = Arc::new(Mutex::new(store)); let shortcuts_ = shortcuts.clone(); let app_handle = app.clone(); GlobalHotKeyEvent::set_event_handler(Some(move |e: GlobalHotKeyEvent| { if let Some(shortcut) = shortcuts_.lock().unwrap().get(&e.id) { - match &shortcut.source { - ShortcutSource::Ipc(channel) => { - let _ = channel.send(&shortcut.shortcut.1); - } - ShortcutSource::Rust => { - if let Some(handler) = &handler { - handler(&app_handle, &shortcut.shortcut.0); - } - } + if let Some(handler) = &shortcut.handler { + handler(&app_handle, &shortcut.shortcut, e); + } + if let Some(handler) = &handler { + handler(&app_handle, &shortcut.shortcut, e); } } })); app.manage(GlobalShortcut { app: app.clone(), - manager: GlobalHotKeyManager::new(), + manager: Arc::new(GlobalHotKeyManager(manager)), shortcuts, }); Ok(()) diff --git a/plugins/haptics/CHANGELOG.md b/plugins/haptics/CHANGELOG.md new file mode 100644 index 00000000..f8e3fad7 --- /dev/null +++ b/plugins/haptics/CHANGELOG.md @@ -0,0 +1,28 @@ +# Changelog + +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.2] + +- [`b9147758`](https://github.com/tauri-apps/plugins-workspace/commit/b914775898c2bee7ceb20bd17ee595005cd17a64) ([#1679](https://github.com/tauri-apps/plugins-workspace/pull/1679) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Explicitly set a minimum macOS version for the Swift package. + +## \[2.0.0-rc.1] + +### changes + +- [`6b079cfd`](https://github.com/tauri-apps/plugins-workspace/commit/6b079cfdd107c94abc2c7300f6af00bac3ff4040) ([#1649](https://github.com/tauri-apps/plugins-workspace/pull/1649) by [@ahqsoftwares](https://github.com/tauri-apps/plugins-workspace/../../ahqsoftwares)) Remove targetSdk from build.kts files as it is deprecated and will be removed from DSL v9.0 + +## \[2.0.0-rc.0] + +- [`9606089b`](https://github.com/tauri-apps/plugins-workspace/commit/9606089b2add4a17f80ed5a09d59ce94824bd672) ([#1599](https://github.com/tauri-apps/plugins-workspace/pull/1599)) Initial release. +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. diff --git a/plugins/haptics/Cargo.toml b/plugins/haptics/Cargo.toml new file mode 100644 index 00000000..8335475f --- /dev/null +++ b/plugins/haptics/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "tauri-plugin-haptics" +description = "Haptic feedback and vibrations on Android and iOS" +version = "2.0.1" +edition = { workspace = true } +authors = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +links = "tauri-plugin-haptics" + +[package.metadata.docs.rs] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] +targets = ["x86_64-linux-android"] + +[package.metadata.platforms.support] +windows = { level = "none", notes = "" } +linux = { level = "none", notes = "" } +macos = { level = "none", notes = "" } +android = { level = "full", notes = "" } +ios = { level = "full", notes = "" } + +[build-dependencies] +tauri-plugin = { workspace = true, features = ["build"] } + +[dependencies] +serde = { workspace = true } +serde_json = { workspace = true } +tauri = { workspace = true, features = ["specta"] } +log = { workspace = true } +thiserror = { workspace = true } +specta = { workspace = true } + +[target.'cfg(target_os = "ios")'.dependencies] +tauri = { workspace = true, features = ["wry"] } diff --git a/plugins/haptics/LICENSE.spdx b/plugins/haptics/LICENSE.spdx new file mode 100644 index 00000000..cdd0df5a --- /dev/null +++ b/plugins/haptics/LICENSE.spdx @@ -0,0 +1,20 @@ +SPDXVersion: SPDX-2.1 +DataLicense: CC0-1.0 +PackageName: tauri +DataFormat: SPDXRef-1 +PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy +PackageHomePage: https://tauri.app +PackageLicenseDeclared: Apache-2.0 +PackageLicenseDeclared: MIT +PackageCopyrightText: 2019-2022, The Tauri Programme in the Commons Conservancy +PackageSummary: Tauri is a rust project that enables developers to make secure +and small desktop applications using a web frontend. + +PackageComment: The package includes the following libraries; see +Relationship information. + +Created: 2019-05-20T09:00:00Z +PackageDownloadLocation: git://github.com/tauri-apps/tauri +PackageDownloadLocation: git+https://github.com/tauri-apps/tauri.git +PackageDownloadLocation: git+ssh://github.com/tauri-apps/tauri.git +Creator: Person: Daniel Thompson-Yvetot \ No newline at end of file diff --git a/plugins/haptics/LICENSE_APACHE-2.0 b/plugins/haptics/LICENSE_APACHE-2.0 new file mode 100644 index 00000000..4947287f --- /dev/null +++ b/plugins/haptics/LICENSE_APACHE-2.0 @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/plugins/haptics/LICENSE_MIT b/plugins/haptics/LICENSE_MIT new file mode 100644 index 00000000..4d754725 --- /dev/null +++ b/plugins/haptics/LICENSE_MIT @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 - Present Tauri Apps Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/plugins/haptics/README.md b/plugins/haptics/README.md new file mode 100644 index 00000000..b96e267c --- /dev/null +++ b/plugins/haptics/README.md @@ -0,0 +1,131 @@ +![haptics](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/haptics/banner.png) + +Haptic feedback and vibrations on Android and iOS. + +There are no standards/requirements for vibration support on Android, so the `feedback` APIs may not work correctly on more affordable phones, including recently released ones. + +| Platform | Supported | +| -------- | --------- | +| Linux | x | +| Windows | x | +| macOS | x | +| Android | ✓ | +| iOS | ✓ | + +## Install + +_This plugin requires a Rust version of at least **1.77.2**_ + +There are three general methods of installation that we can recommend. + +1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) +2. Pull sources directly from Github using git tags / revision hashes (most secure) +3. Git submodule install this repo in your tauri project and then use file protocol to ingest the source (most secure, but inconvenient to use) + +Install the Core plugin by adding the following to your `Cargo.toml` file: + +`src-tauri/Cargo.toml` + +```toml +[dependencies] +tauri-plugin-haptics = "2.0.0" +# alternatively with Git: +tauri-plugin-haptics = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } +``` + +You can install the JavaScript Guest bindings using your preferred JavaScript package manager: + +> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. + + + +```sh +pnpm add @tauri-apps/plugin-haptics +# or +npm add @tauri-apps/plugin-haptics +# or +yarn add @tauri-apps/plugin-haptics + +# alternatively with Git: +pnpm add https://github.com/tauri-apps/tauri-plugin-haptics#v2 +# or +npm add https://github.com/tauri-apps/tauri-plugin-haptics#v2 +# or +yarn add https://github.com/tauri-apps/tauri-plugin-haptics#v2 +``` + +## Usage + +First you need to register the core plugin with Tauri: + +`src-tauri/src/main.rs` + +```rust +fn main() { + tauri::Builder::default() + .plugin(tauri_plugin_haptics::init()) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} +``` + +Afterwards all the plugin's APIs are available through the JavaScript guest bindings: + +```javascript +import { + vibrate, + impactFeedback, + notificationFeedback, + selectionFeedback +} from '@tauri-apps/plugin-haptics' + +await vibrate(1) +await impactFeedback('medium') +await notificationFeedback('warning') +await selectionFeedback() +``` + +## Contributing + +PRs accepted. Please make sure to read the Contributing Guide before making a pull request. + +## Contributed By + + + + + + + + +
+ + CrabNebula + + + + Rescue.co + +
+ +## Partners + + + + + + + +
+ + CrabNebula + +
+ +For the complete list of sponsors please visit our [website](https://tauri.app#sponsors) and [Open Collective](https://opencollective.com/tauri). + +## License + +Code: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy. + +MIT or MIT/Apache 2.0 where applicable. diff --git a/plugins/haptics/SECURITY.md b/plugins/haptics/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/haptics/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/clipboard-manager/.gitignore b/plugins/haptics/android/.gitignore similarity index 53% rename from plugins/clipboard-manager/.gitignore rename to plugins/haptics/android/.gitignore index 1b0b469d..c0f21ec2 100644 --- a/plugins/clipboard-manager/.gitignore +++ b/plugins/haptics/android/.gitignore @@ -1 +1,2 @@ +/build /.tauri diff --git a/plugins/haptics/android/build.gradle.kts b/plugins/haptics/android/build.gradle.kts new file mode 100644 index 00000000..7de1d372 --- /dev/null +++ b/plugins/haptics/android/build.gradle.kts @@ -0,0 +1,45 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") +} + +android { + namespace = "app.tauri.haptics" + compileSdk = 34 + + defaultConfig { + minSdk = 24 + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + + implementation("androidx.core:core-ktx:1.9.0") + implementation("androidx.appcompat:appcompat:1.6.0") + implementation("com.google.android.material:material:1.7.0") + implementation("com.fasterxml.jackson.core:jackson-databind:2.15.3") + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.5") + androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") + implementation(project(":tauri-android")) +} diff --git a/plugins/haptics/android/proguard-rules.pro b/plugins/haptics/android/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/plugins/haptics/android/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/plugins/haptics/android/settings.gradle b/plugins/haptics/android/settings.gradle new file mode 100644 index 00000000..14a752e4 --- /dev/null +++ b/plugins/haptics/android/settings.gradle @@ -0,0 +1,2 @@ +include ':tauri-android' +project(':tauri-android').projectDir = new File('./.tauri/tauri-api') diff --git a/plugins/haptics/android/src/androidTest/java/ExampleInstrumentedTest.kt b/plugins/haptics/android/src/androidTest/java/ExampleInstrumentedTest.kt new file mode 100644 index 00000000..1b408ac8 --- /dev/null +++ b/plugins/haptics/android/src/androidTest/java/ExampleInstrumentedTest.kt @@ -0,0 +1,28 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package app.tauri.haptics + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("app.tauri.haptics", appContext.packageName) + } +} diff --git a/plugins/haptics/android/src/main/AndroidManifest.xml b/plugins/haptics/android/src/main/AndroidManifest.xml new file mode 100644 index 00000000..042e61a7 --- /dev/null +++ b/plugins/haptics/android/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + diff --git a/plugins/haptics/android/src/main/java/HapticsPlugin.kt b/plugins/haptics/android/src/main/java/HapticsPlugin.kt new file mode 100644 index 00000000..5a6bf1b8 --- /dev/null +++ b/plugins/haptics/android/src/main/java/HapticsPlugin.kt @@ -0,0 +1,143 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package app.tauri.haptics + +import android.app.Activity +import android.content.Context +import android.os.Build +import android.os.VibrationEffect +import android.os.Vibrator +import android.os.VibratorManager +import app.tauri.Logger +import app.tauri.annotation.Command +import app.tauri.annotation.InvokeArg +import app.tauri.annotation.TauriPlugin +import app.tauri.haptics.patterns.ImpactPatternHeavy +import app.tauri.haptics.patterns.ImpactPatternLight +import app.tauri.haptics.patterns.ImpactPatternMedium +import app.tauri.haptics.patterns.ImpactPatternRigid +import app.tauri.haptics.patterns.ImpactPatternSoft +import app.tauri.haptics.patterns.NotificationPatternError +import app.tauri.haptics.patterns.NotificationPatternSuccess +import app.tauri.haptics.patterns.NotificationPatternWarning +import app.tauri.haptics.patterns.Pattern +import app.tauri.haptics.patterns.SelectionPattern +import app.tauri.plugin.Invoke +import app.tauri.plugin.Plugin +import com.fasterxml.jackson.annotation.JsonProperty + +@InvokeArg +class HapticsOptions { + var duration: Long = 300 +} + +@InvokeArg +class NotificationFeedbackArgs { + val type: NotificationFeedbackType = NotificationFeedbackType.Success +} + +@InvokeArg +enum class NotificationFeedbackType { + @JsonProperty("success") + Success, + @JsonProperty("warning") + Warning, + @JsonProperty("error") + Error; + + fun into(): Pattern { + return when(this) { + Success -> NotificationPatternSuccess + Warning -> NotificationPatternWarning + Error -> NotificationPatternError + } + } +} + +@InvokeArg +class ImpactFeedbackArgs { + val style: ImpactFeedbackStyle = ImpactFeedbackStyle.Medium +} + +@InvokeArg +enum class ImpactFeedbackStyle { + @JsonProperty("light") + Light, + @JsonProperty("medium") + Medium, + @JsonProperty("heavy") + Heavy, + @JsonProperty("soft") + Soft, + @JsonProperty("rigid") + Rigid; + + fun into(): Pattern { + return when(this) { + Light -> ImpactPatternLight + Medium -> ImpactPatternMedium + Heavy -> ImpactPatternHeavy + Soft -> ImpactPatternSoft + Rigid -> ImpactPatternRigid + } + } +} + +@TauriPlugin +class HapticsPlugin(private val activity: Activity): Plugin(activity) { + private val vibrator: Vibrator = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + val vibManager = activity.applicationContext.getSystemService(Context.VIBRATOR_MANAGER_SERVICE) as VibratorManager + vibManager.defaultVibrator + } else { + @Suppress("DEPRECATION") + activity.applicationContext.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator + } + + // + // TAURI COMMANDS + // + + @Command + fun vibrate(invoke: Invoke) { + val args = invoke.parseArgs(HapticsOptions::class.java) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + vibrator.vibrate(VibrationEffect.createOneShot(args.duration, VibrationEffect.DEFAULT_AMPLITUDE)) + } else { + vibrator.vibrate(args.duration) + } + invoke.resolve() + } + + @Command + fun impactFeedback(invoke: Invoke) { + val args = invoke.parseArgs(ImpactFeedbackArgs::class.java) + vibratePattern(args.style.into()) + invoke.resolve() + } + + @Command + fun notificationFeedback(invoke: Invoke) { + val args = invoke.parseArgs(NotificationFeedbackArgs::class.java) + vibratePattern(args.type.into()) + invoke.resolve() + } + + // TODO: Consider breaking this up into Start,Change,End like capacitor + @Command + fun selectionFeedback(invoke: Invoke) { + vibratePattern(SelectionPattern) + invoke.resolve() + } + + // INTERNAL FUNCTIONS + + private fun vibratePattern(pattern: Pattern) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + vibrator.vibrate(VibrationEffect.createWaveform(pattern.timings, pattern.amplitudes, -1)) + } else { + vibrator.vibrate(pattern.oldSDKPattern, -1) + } + } +} diff --git a/plugins/haptics/android/src/main/java/patterns/Impact.kt b/plugins/haptics/android/src/main/java/patterns/Impact.kt new file mode 100644 index 00000000..d40e750d --- /dev/null +++ b/plugins/haptics/android/src/main/java/patterns/Impact.kt @@ -0,0 +1,35 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package app.tauri.haptics.patterns + +val ImpactPatternLight = Pattern( + longArrayOf(0, 50), + intArrayOf(0, 30), + longArrayOf(0, 20) +) + +val ImpactPatternMedium = Pattern( + longArrayOf(0, 43), + intArrayOf(0, 50), + longArrayOf(0, 43) +) + +val ImpactPatternHeavy = Pattern( + longArrayOf(0, 60), + intArrayOf(0, 70), + longArrayOf(0, 61) +) + +val ImpactPatternSoft = Pattern( + longArrayOf(0, 50), + intArrayOf(0, 30), + longArrayOf(0, 20) +) + +val ImpactPatternRigid = Pattern( + longArrayOf(0, 43), + intArrayOf(0, 50), + longArrayOf(0, 43) +) \ No newline at end of file diff --git a/plugins/haptics/android/src/main/java/patterns/Notification.kt b/plugins/haptics/android/src/main/java/patterns/Notification.kt new file mode 100644 index 00000000..2f70c23e --- /dev/null +++ b/plugins/haptics/android/src/main/java/patterns/Notification.kt @@ -0,0 +1,23 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package app.tauri.haptics.patterns + +val NotificationPatternSuccess = Pattern( + longArrayOf(0, 40, 100, 40), + intArrayOf(0, 50, 0, 60), + longArrayOf(0, 40, 100, 40) +) + +val NotificationPatternWarning = Pattern( + longArrayOf(0, 40, 120, 60), + intArrayOf(0, 40, 0, 60), + longArrayOf(0, 40, 120, 60) +) + +val NotificationPatternError = Pattern( + longArrayOf(0, 60, 100, 40, 80, 50), + intArrayOf(0, 50, 0, 40, 0, 50), + longArrayOf(0, 60, 100, 40, 80, 50) +) diff --git a/plugins/haptics/android/src/main/java/patterns/Pattern.kt b/plugins/haptics/android/src/main/java/patterns/Pattern.kt new file mode 100644 index 00000000..5f99b02c --- /dev/null +++ b/plugins/haptics/android/src/main/java/patterns/Pattern.kt @@ -0,0 +1,11 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package app.tauri.haptics.patterns + +class Pattern ( + val timings: LongArray, + val amplitudes: IntArray, + val oldSDKPattern: LongArray +) {} \ No newline at end of file diff --git a/plugins/haptics/android/src/main/java/patterns/Selection.kt b/plugins/haptics/android/src/main/java/patterns/Selection.kt new file mode 100644 index 00000000..02dce4c2 --- /dev/null +++ b/plugins/haptics/android/src/main/java/patterns/Selection.kt @@ -0,0 +1,11 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package app.tauri.haptics.patterns + +val SelectionPattern = Pattern ( + timings = longArrayOf(0, 50), + amplitudes = intArrayOf(0, 30), + oldSDKPattern = longArrayOf(0, 70) +) \ No newline at end of file diff --git a/plugins/haptics/android/src/test/java/ExampleUnitTest.kt b/plugins/haptics/android/src/test/java/ExampleUnitTest.kt new file mode 100644 index 00000000..562188f0 --- /dev/null +++ b/plugins/haptics/android/src/test/java/ExampleUnitTest.kt @@ -0,0 +1,21 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package app.tauri.haptics + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} diff --git a/plugins/haptics/api-iife.js b/plugins/haptics/api-iife.js new file mode 100644 index 00000000..5cccb15f --- /dev/null +++ b/plugins/haptics/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_HAPTICS__=function(r){"use strict";async function t(r,t={},e){return window.__TAURI_INTERNALS__.invoke(r,t,e)}var e;"function"==typeof SuppressedError&&SuppressedError,function(r){r.WINDOW_RESIZED="tauri://resize",r.WINDOW_MOVED="tauri://move",r.WINDOW_CLOSE_REQUESTED="tauri://close-requested",r.WINDOW_DESTROYED="tauri://destroyed",r.WINDOW_FOCUS="tauri://focus",r.WINDOW_BLUR="tauri://blur",r.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",r.WINDOW_THEME_CHANGED="tauri://theme-changed",r.WINDOW_CREATED="tauri://window-created",r.WEBVIEW_CREATED="tauri://webview-created",r.DRAG_ENTER="tauri://drag-enter",r.DRAG_OVER="tauri://drag-over",r.DRAG_DROP="tauri://drag-drop",r.DRAG_LEAVE="tauri://drag-leave"}(e||(e={}));const a={async vibrate(r){try{return{status:"ok",data:await t("plugin:haptics|vibrate",{duration:r})}}catch(r){if(r instanceof Error)throw r;return{status:"error",error:r}}},async impactFeedback(r){try{return{status:"ok",data:await t("plugin:haptics|impact_feedback",{style:r})}}catch(r){if(r instanceof Error)throw r;return{status:"error",error:r}}},async notificationFeedback(r){try{return{status:"ok",data:await t("plugin:haptics|notification_feedback",{type:r})}}catch(r){if(r instanceof Error)throw r;return{status:"error",error:r}}},async selectionFeedback(){try{return{status:"ok",data:await t("plugin:haptics|selection_feedback")}}catch(r){if(r instanceof Error)throw r;return{status:"error",error:r}}}},{vibrate:i,impactFeedback:c,notificationFeedback:n,selectionFeedback:o}=a;return r.impactFeedback=c,r.notificationFeedback=n,r.selectionFeedback=o,r.vibrate=i,r}({});Object.defineProperty(window.__TAURI__,"haptics",{value:__TAURI_PLUGIN_HAPTICS__})} diff --git a/plugins/haptics/build.rs b/plugins/haptics/build.rs new file mode 100644 index 00000000..2556cb67 --- /dev/null +++ b/plugins/haptics/build.rs @@ -0,0 +1,23 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +const COMMANDS: &[&str] = &[ + "vibrate", + "impact_feedback", + "notification_feedback", + "selection_feedback", +]; + +fn main() { + let result = tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .android_path("android") + .ios_path("ios") + .try_build(); + + // when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build + if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) { + result.unwrap(); + } +} diff --git a/plugins/haptics/contributors/crabnebula.svg b/plugins/haptics/contributors/crabnebula.svg new file mode 100644 index 00000000..40e24131 --- /dev/null +++ b/plugins/haptics/contributors/crabnebula.svg @@ -0,0 +1,31 @@ + \ No newline at end of file diff --git a/plugins/haptics/contributors/rescue.png b/plugins/haptics/contributors/rescue.png new file mode 100644 index 00000000..2b5916f4 Binary files /dev/null and b/plugins/haptics/contributors/rescue.png differ diff --git a/plugins/haptics/guest-js/bindings.ts b/plugins/haptics/guest-js/bindings.ts new file mode 100644 index 00000000..d12920d8 --- /dev/null +++ b/plugins/haptics/guest-js/bindings.ts @@ -0,0 +1,140 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +// @ts-nocheck +// This file was generated by [tauri-specta](https://github.com/oscartbeaumont/tauri-specta). Do not edit this file manually. + +/** user-defined commands **/ + +export const commands = { + async vibrate(duration: number): Promise> { + try { + return { + status: 'ok', + data: await TAURI_INVOKE('plugin:haptics|vibrate', { duration }) + } + } catch (e) { + if (e instanceof Error) throw e + else return { status: 'error', error: e as any } + } + }, + async impactFeedback( + style: ImpactFeedbackStyle + ): Promise> { + try { + return { + status: 'ok', + data: await TAURI_INVOKE('plugin:haptics|impact_feedback', { style }) + } + } catch (e) { + if (e instanceof Error) throw e + else return { status: 'error', error: e as any } + } + }, + async notificationFeedback( + type: NotificationFeedbackType + ): Promise> { + try { + return { + status: 'ok', + data: await TAURI_INVOKE('plugin:haptics|notification_feedback', { + type + }) + } + } catch (e) { + if (e instanceof Error) throw e + else return { status: 'error', error: e as any } + } + }, + async selectionFeedback(): Promise> { + try { + return { + status: 'ok', + data: await TAURI_INVOKE('plugin:haptics|selection_feedback') + } + } catch (e) { + if (e instanceof Error) throw e + else return { status: 'error', error: e as any } + } + } +} + +/** user-defined events **/ + +/* export const events = __makeEvents__<{ + randomNumber: RandomNumber; +}>({ + randomNumber: "plugin:haptics:random-number", +}); */ + +/** user-defined statics **/ + +/** user-defined types **/ + +export type Error = never +export type ImpactFeedbackStyle = + | 'light' + | 'medium' + | 'heavy' + | 'soft' + | 'rigid' +export type NotificationFeedbackType = 'success' | 'warning' | 'error' +//export type RandomNumber = number; + +/** tauri-specta globals **/ + +import { invoke as TAURI_INVOKE } from '@tauri-apps/api/core' +import * as TAURI_API_EVENT from '@tauri-apps/api/event' +import { type WebviewWindow as __WebviewWindow__ } from '@tauri-apps/api/webviewWindow' + +type __EventObj__ = { + listen: ( + cb: TAURI_API_EVENT.EventCallback + ) => ReturnType> + once: ( + cb: TAURI_API_EVENT.EventCallback + ) => ReturnType> + emit: T extends null + ? (payload?: T) => ReturnType + : (payload: T) => ReturnType +} + +export type Result = + | { status: 'ok'; data: T } + | { status: 'error'; error: E } + +function __makeEvents__>( + mappings: Record +) { + return new Proxy( + {} as unknown as { + [K in keyof T]: __EventObj__ & { + (handle: __WebviewWindow__): __EventObj__ + } + }, + { + get: (_, event) => { + const name = mappings[event as keyof T] + + return new Proxy((() => {}) as any, { + apply: (_, __, [window]: [__WebviewWindow__]) => ({ + listen: (arg: any) => window.listen(name, arg), + once: (arg: any) => window.once(name, arg), + emit: (arg: any) => window.emit(name, arg) + }), + get: (_, command: keyof __EventObj__) => { + switch (command) { + case 'listen': + return (arg: any) => TAURI_API_EVENT.listen(name, arg) + case 'once': + return (arg: any) => TAURI_API_EVENT.once(name, arg) + case 'emit': + return (arg: any) => TAURI_API_EVENT.emit(name, arg) + } + } + }) + } + } + ) +} diff --git a/plugins/haptics/guest-js/index.ts b/plugins/haptics/guest-js/index.ts new file mode 100644 index 00000000..23485bdf --- /dev/null +++ b/plugins/haptics/guest-js/index.ts @@ -0,0 +1,18 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +/* eslint-disable @typescript-eslint/unbound-method */ + +import { commands } from './bindings' + +export const { + vibrate, + impactFeedback, + notificationFeedback, + selectionFeedback +} = commands + +export { ImpactFeedbackStyle, NotificationFeedbackType } from './bindings' + +// export { events }; diff --git a/plugins/haptics/ios/.gitignore b/plugins/haptics/ios/.gitignore new file mode 100644 index 00000000..5922fdaa --- /dev/null +++ b/plugins/haptics/ios/.gitignore @@ -0,0 +1,10 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj +xcuserdata/ +DerivedData/ +.swiftpm/config/registries.json +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.netrc +Package.resolved diff --git a/plugins/haptics/ios/Package.swift b/plugins/haptics/ios/Package.swift new file mode 100644 index 00000000..a64b9890 --- /dev/null +++ b/plugins/haptics/ios/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version:5.3 +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import PackageDescription + +let package = Package( + name: "tauri-plugin-haptics", + platforms: [ + .macOS(.v10_13), + .iOS(.v13), + ], + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "tauri-plugin-haptics", + type: .static, + targets: ["tauri-plugin-haptics"]) + ], + dependencies: [ + .package(name: "Tauri", path: "../.tauri/tauri-api") + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "tauri-plugin-haptics", + dependencies: [ + .byName(name: "Tauri") + ], + path: "Sources") + ] +) diff --git a/plugins/haptics/ios/README.md b/plugins/haptics/ios/README.md new file mode 100644 index 00000000..3f7138b5 --- /dev/null +++ b/plugins/haptics/ios/README.md @@ -0,0 +1,3 @@ +# Tauri Plugin Haptics + +A description of this package. diff --git a/plugins/haptics/ios/Sources/HapticsPlugin.swift b/plugins/haptics/ios/Sources/HapticsPlugin.swift new file mode 100644 index 00000000..96e3f275 --- /dev/null +++ b/plugins/haptics/ios/Sources/HapticsPlugin.swift @@ -0,0 +1,133 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import SwiftRs +import Tauri +import UIKit +import WebKit +import CoreHaptics +import AudioToolbox + +class ImpactFeedbackOptions: Decodable { + let style: ImpactFeedbackStyle +} + +enum ImpactFeedbackStyle: String, Decodable { + case light, medium, heavy, soft, rigid + + func into() -> UIImpactFeedbackGenerator.FeedbackStyle { + switch self { + case .light: + return .light + case .medium: + return .medium + case .heavy: + return .heavy + case .soft: + return .soft + case .rigid: + return .rigid + } + } +} + +class NotificationFeedbackOptions: Decodable { + let type: NotificationFeedbackType +} + +enum NotificationFeedbackType: String, Decodable { + case success, warning, error + + func into() -> UINotificationFeedbackGenerator.FeedbackType { + switch self { + case .success: + return .success + case .warning: + return .warning + case .error: + return .error + } + } +} + +class VibrateOptions: Decodable { + // TODO: Array + let duration: Double +} + +class HapticsPlugin: Plugin { + // + // Tauri commands + // + + @objc public func vibrate(_ invoke: Invoke) throws { + let args = try invoke.parseArgs(VibrateOptions.self) + if CHHapticEngine.capabilitiesForHardware().supportsHaptics { + do { + let engine = try CHHapticEngine() + try engine.start() + engine.resetHandler = { [] in + do { + try engine.start() + } catch { + AudioServicesPlayAlertSound(kSystemSoundID_Vibrate) + } + } + // TODO: Make some of this (or all) configurable? + let intensity: CHHapticEventParameter = CHHapticEventParameter(parameterID: .hapticIntensity, value: 1.0) + let sharpness: CHHapticEventParameter = CHHapticEventParameter(parameterID: .hapticSharpness, value: 1.0) + let continuousEvent = CHHapticEvent( + eventType: .hapticContinuous, + parameters: [intensity, sharpness], + relativeTime: 0.0, + duration: args.duration/1000 + ) + let pattern = try CHHapticPattern(events: [continuousEvent], parameters: []) + let player = try engine.makePlayer(with: pattern) + + try player.start(atTime: 0) + } catch { + AudioServicesPlayAlertSound(kSystemSoundID_Vibrate) + } + } else { + AudioServicesPlayAlertSound(kSystemSoundID_Vibrate) + } + + Logger.error("VIBRATE END") + + invoke.resolve() + } + + @objc public func impactFeedback(_ invoke: Invoke) throws { + let args = try invoke.parseArgs(ImpactFeedbackOptions.self) + let generator = UIImpactFeedbackGenerator(style: args.style.into()) + generator.prepare() + generator.impactOccurred() + + invoke.resolve() + } + + @objc public func notificationFeedback(_ invoke: Invoke) throws { + let args = try invoke.parseArgs(NotificationFeedbackOptions.self) + let generator = UINotificationFeedbackGenerator() + generator.prepare() + generator.notificationOccurred(args.type.into()) + + invoke.resolve() + } + + // TODO: Consider breaking this up into Start,Change,End like capacitor + @objc public func selectionFeedback(_ invoke: Invoke) throws { + let generator = UISelectionFeedbackGenerator() + generator.prepare() + generator.selectionChanged() + + invoke.resolve() + } +} + +@_cdecl("init_plugin_haptics") +func initPlugin() -> Plugin { + return HapticsPlugin() +} diff --git a/plugins/haptics/ios/Tests/PluginTests/PluginTests.swift b/plugins/haptics/ios/Tests/PluginTests/PluginTests.swift new file mode 100644 index 00000000..99992ce4 --- /dev/null +++ b/plugins/haptics/ios/Tests/PluginTests/PluginTests.swift @@ -0,0 +1,12 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import XCTest +@testable import ExamplePlugin + +final class ExamplePluginTests: XCTestCase { + func testExample() throws { + let plugin = ExamplePlugin() + } +} diff --git a/plugins/haptics/package.json b/plugins/haptics/package.json new file mode 100644 index 00000000..f29bdc24 --- /dev/null +++ b/plugins/haptics/package.json @@ -0,0 +1,29 @@ +{ + "name": "@tauri-apps/plugin-haptics", + "version": "2.0.0", + "license": "MIT OR Apache-2.0", + "authors": [ + "Tauri Programme within The Commons Conservancy" + ], + "repository": "https://github.com/tauri-apps/plugins-workspace", + "type": "module", + "types": "./dist-js/index.d.ts", + "main": "./dist-js/index.cjs", + "module": "./dist-js/index.js", + "exports": { + "types": "./dist-js/index.d.ts", + "import": "./dist-js/index.js", + "require": "./dist-js/index.cjs" + }, + "scripts": { + "build": "rollup -c" + }, + "files": [ + "dist-js", + "README.md", + "LICENSE" + ], + "dependencies": { + "@tauri-apps/api": "^2.0.0" + } +} diff --git a/plugins/haptics/permissions/autogenerated/commands/impact_feedback.toml b/plugins/haptics/permissions/autogenerated/commands/impact_feedback.toml new file mode 100644 index 00000000..13fce392 --- /dev/null +++ b/plugins/haptics/permissions/autogenerated/commands/impact_feedback.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-impact-feedback" +description = "Enables the impact_feedback command without any pre-configured scope." +commands.allow = ["impact_feedback"] + +[[permission]] +identifier = "deny-impact-feedback" +description = "Denies the impact_feedback command without any pre-configured scope." +commands.deny = ["impact_feedback"] diff --git a/plugins/haptics/permissions/autogenerated/commands/notification_feedback.toml b/plugins/haptics/permissions/autogenerated/commands/notification_feedback.toml new file mode 100644 index 00000000..0c2782c5 --- /dev/null +++ b/plugins/haptics/permissions/autogenerated/commands/notification_feedback.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-notification-feedback" +description = "Enables the notification_feedback command without any pre-configured scope." +commands.allow = ["notification_feedback"] + +[[permission]] +identifier = "deny-notification-feedback" +description = "Denies the notification_feedback command without any pre-configured scope." +commands.deny = ["notification_feedback"] diff --git a/plugins/haptics/permissions/autogenerated/commands/selection_feedback.toml b/plugins/haptics/permissions/autogenerated/commands/selection_feedback.toml new file mode 100644 index 00000000..63e645d8 --- /dev/null +++ b/plugins/haptics/permissions/autogenerated/commands/selection_feedback.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-selection-feedback" +description = "Enables the selection_feedback command without any pre-configured scope." +commands.allow = ["selection_feedback"] + +[[permission]] +identifier = "deny-selection-feedback" +description = "Denies the selection_feedback command without any pre-configured scope." +commands.deny = ["selection_feedback"] diff --git a/plugins/haptics/permissions/autogenerated/commands/vibrate.toml b/plugins/haptics/permissions/autogenerated/commands/vibrate.toml new file mode 100644 index 00000000..4c2fe94e --- /dev/null +++ b/plugins/haptics/permissions/autogenerated/commands/vibrate.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-vibrate" +description = "Enables the vibrate command without any pre-configured scope." +commands.allow = ["vibrate"] + +[[permission]] +identifier = "deny-vibrate" +description = "Denies the vibrate command without any pre-configured scope." +commands.deny = ["vibrate"] diff --git a/plugins/haptics/permissions/autogenerated/reference.md b/plugins/haptics/permissions/autogenerated/reference.md new file mode 100644 index 00000000..c2d0dd5d --- /dev/null +++ b/plugins/haptics/permissions/autogenerated/reference.md @@ -0,0 +1,114 @@ + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`haptics:allow-impact-feedback` + + + +Enables the impact_feedback command without any pre-configured scope. + +
+ +`haptics:deny-impact-feedback` + + + +Denies the impact_feedback command without any pre-configured scope. + +
+ +`haptics:allow-notification-feedback` + + + +Enables the notification_feedback command without any pre-configured scope. + +
+ +`haptics:deny-notification-feedback` + + + +Denies the notification_feedback command without any pre-configured scope. + +
+ +`haptics:allow-selection-feedback` + + + +Enables the selection_feedback command without any pre-configured scope. + +
+ +`haptics:deny-selection-feedback` + + + +Denies the selection_feedback command without any pre-configured scope. + +
+ +`haptics:allow-vibrate` + + + +Enables the vibrate command without any pre-configured scope. + +
+ +`haptics:deny-vibrate` + + + +Denies the vibrate command without any pre-configured scope. + +
diff --git a/plugins/authenticator/permissions/schemas/schema.json b/plugins/haptics/permissions/schemas/schema.json similarity index 73% rename from plugins/authenticator/permissions/schemas/schema.json rename to plugins/haptics/permissions/schemas/schema.json index 55830d0c..763e0a72 100644 --- a/plugins/authenticator/permissions/schemas/schema.json +++ b/plugins/haptics/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,78 +251,88 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-init-auth -> Enables the init_auth command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-init-auth" + "macOS" ] }, { - "description": "deny-init-auth -> Denies the init_auth command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-init-auth" + "windows" ] }, { - "description": "allow-register -> Enables the register command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-register" + "linux" ] }, { - "description": "deny-register -> Denies the register command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-register" + "android" ] }, { - "description": "allow-sign -> Enables the sign command without any pre-configured scope.", + "description": "iOS.", "type": "string", "enum": [ - "allow-sign" + "iOS" ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the impact_feedback command without any pre-configured scope.", + "type": "string", + "const": "allow-impact-feedback" }, { - "description": "deny-sign -> Denies the sign command without any pre-configured scope.", + "description": "Denies the impact_feedback command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-sign" - ] + "const": "deny-impact-feedback" }, { - "description": "allow-verify-registration -> Enables the verify_registration command without any pre-configured scope.", + "description": "Enables the notification_feedback command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-verify-registration" - ] + "const": "allow-notification-feedback" }, { - "description": "deny-verify-registration -> Denies the verify_registration command without any pre-configured scope.", + "description": "Denies the notification_feedback command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-verify-registration" - ] + "const": "deny-notification-feedback" }, { - "description": "allow-verify-signature -> Enables the verify_signature command without any pre-configured scope.", + "description": "Enables the selection_feedback command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-verify-signature" - ] + "const": "allow-selection-feedback" }, { - "description": "deny-verify-signature -> Denies the verify_signature command without any pre-configured scope.", + "description": "Denies the selection_feedback command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-verify-signature" - ] + "const": "deny-selection-feedback" + }, + { + "description": "Enables the vibrate command without any pre-configured scope.", + "type": "string", + "const": "allow-vibrate" + }, + { + "description": "Denies the vibrate command without any pre-configured scope.", + "type": "string", + "const": "deny-vibrate" } ] } diff --git a/plugins/haptics/rollup.config.js b/plugins/haptics/rollup.config.js new file mode 100644 index 00000000..1f349ec8 --- /dev/null +++ b/plugins/haptics/rollup.config.js @@ -0,0 +1,7 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import { createConfig } from '../../shared/rollup.config.js' + +export default createConfig() diff --git a/plugins/haptics/src/commands.rs b/plugins/haptics/src/commands.rs new file mode 100644 index 00000000..b2bbd1b0 --- /dev/null +++ b/plugins/haptics/src/commands.rs @@ -0,0 +1,37 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use tauri::{command, AppHandle, Runtime}; + +use crate::{HapticsExt, ImpactFeedbackStyle, NotificationFeedbackType, Result}; + +#[command] +#[specta::specta] +pub(crate) async fn vibrate(app: AppHandle, duration: u32) -> Result<()> { + app.haptics().vibrate(duration) +} + +#[command] +#[specta::specta] +pub(crate) async fn impact_feedback( + app: AppHandle, + style: ImpactFeedbackStyle, +) -> Result<()> { + app.haptics().impact_feedback(style) +} + +#[command] +#[specta::specta] +pub(crate) async fn notification_feedback( + app: AppHandle, + r#type: NotificationFeedbackType, +) -> Result<()> { + app.haptics().notification_feedback(r#type) +} + +#[command] +#[specta::specta] +pub(crate) async fn selection_feedback(app: AppHandle) -> Result<()> { + app.haptics().selection_feedback() +} diff --git a/plugins/haptics/src/desktop.rs b/plugins/haptics/src/desktop.rs new file mode 100644 index 00000000..b04b7567 --- /dev/null +++ b/plugins/haptics/src/desktop.rs @@ -0,0 +1,36 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use serde::de::DeserializeOwned; +use tauri::{plugin::PluginApi, AppHandle, Runtime}; + +use crate::models::*; + +pub fn init( + app: &AppHandle, + _api: PluginApi, +) -> crate::Result> { + Ok(Haptics(app.clone())) +} + +/// Access to the haptics APIs. +pub struct Haptics(AppHandle); + +impl Haptics { + pub fn vibrate(&self, _duration: u32) -> crate::Result<()> { + Ok(()) + } + + pub fn impact_feedback(&self, _style: ImpactFeedbackStyle) -> crate::Result<()> { + Ok(()) + } + + pub fn notification_feedback(&self, _type: NotificationFeedbackType) -> crate::Result<()> { + Ok(()) + } + + pub fn selection_feedback(&self) -> crate::Result<()> { + Ok(()) + } +} diff --git a/plugins/haptics/src/error.rs b/plugins/haptics/src/error.rs new file mode 100644 index 00000000..30ff7f44 --- /dev/null +++ b/plugins/haptics/src/error.rs @@ -0,0 +1,30 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use serde::{ser::Serializer, Serialize}; +use specta::Type; + +pub type Result = std::result::Result; + +// TODO: Improve Error handling (different typed errors instead of one (stringified) PluginInvokeError for all mobile errors) + +#[derive(Debug, thiserror::Error, Type)] +pub enum Error { + #[cfg(mobile)] + #[error(transparent)] + PluginInvoke( + #[serde(skip)] + #[from] + tauri::plugin::mobile::PluginInvokeError, + ), +} + +impl Serialize for Error { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + serializer.serialize_str(self.to_string().as_ref()) + } +} diff --git a/plugins/haptics/src/lib.rs b/plugins/haptics/src/lib.rs new file mode 100644 index 00000000..0a727e14 --- /dev/null +++ b/plugins/haptics/src/lib.rs @@ -0,0 +1,98 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use tauri::{ + plugin::{Builder, TauriPlugin}, + Manager, Runtime, +}; + +//use tauri_specta::*; + +pub use models::*; + +#[cfg(desktop)] +mod desktop; +#[cfg(mobile)] +mod mobile; + +mod commands; +mod error; +mod models; + +pub use error::{Error, Result}; + +#[cfg(desktop)] +use desktop::Haptics; +#[cfg(mobile)] +use mobile::Haptics; + +/* macro_rules! specta_builder { + () => { + ts::builder() + .commands(collect_commands![ + commands::vibrate, + commands::impact_feedback, + commands::notification_feedback, + commands::selection_feedback + ]) + .header("// @ts-nocheck") + .config( + specta::ts::ExportConfig::default() + .bigint(specta::ts::BigIntExportBehavior::Number), + ) + }; +} */ + +/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the haptics APIs. +pub trait HapticsExt { + fn haptics(&self) -> &Haptics; +} + +impl> crate::HapticsExt for T { + fn haptics(&self) -> &Haptics { + self.state::>().inner() + } +} + +/// Initializes the plugin. +pub fn init() -> TauriPlugin { + /* let (invoke_handler, register_events) = + specta_builder!().build_plugin_utils("haptics").unwrap(); */ + + Builder::new("haptics") + .invoke_handler(tauri::generate_handler![ + commands::vibrate, + commands::impact_feedback, + commands::notification_feedback, + commands::selection_feedback + ]) + .setup(|app, api| { + #[cfg(mobile)] + let haptics = mobile::init(app, api)?; + #[cfg(desktop)] + let haptics = desktop::init(app, api)?; + app.manage(haptics); + Ok(()) + }) + .build() +} + +/* #[cfg(test)] +mod test { + use super::*; + + #[test] + fn export_types() { + specta_builder!() + .path("./guest-js/bindings.ts") + .config( + specta::ts::ExportConfig::default() + .formatter(specta::ts::formatter::prettier) + .bigint(specta::ts::BigIntExportBehavior::Number), + ) + .export_for_plugin("haptics") + .expect("failed to export specta types"); + } +} + */ diff --git a/plugins/haptics/src/mobile.rs b/plugins/haptics/src/mobile.rs new file mode 100644 index 00000000..2b1e2036 --- /dev/null +++ b/plugins/haptics/src/mobile.rs @@ -0,0 +1,76 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use serde::{de::DeserializeOwned, Serialize}; +use tauri::{ + plugin::{PluginApi, PluginHandle}, + AppHandle, Runtime, +}; + +use crate::models::*; + +#[cfg(target_os = "android")] +const PLUGIN_IDENTIFIER: &str = "app.tauri.haptics"; + +#[cfg(target_os = "ios")] +tauri::ios_plugin_binding!(init_plugin_haptics); + +// initializes the Kotlin or Swift plugin classes +pub fn init( + _app: &AppHandle, + api: PluginApi, +) -> crate::Result> { + #[cfg(target_os = "android")] + let handle = api.register_android_plugin(PLUGIN_IDENTIFIER, "HapticsPlugin")?; + #[cfg(target_os = "ios")] + let handle = api.register_ios_plugin(init_plugin_haptics)?; + Ok(Haptics(handle)) +} + +/// Access to the haptics APIs. +pub struct Haptics(PluginHandle); + +impl Haptics { + pub fn vibrate(&self, duration: u32) -> crate::Result<()> { + self.0 + .run_mobile_plugin("vibrate", VibratePayload { duration }) + .map_err(Into::into) + } + + pub fn impact_feedback(&self, style: ImpactFeedbackStyle) -> crate::Result<()> { + self.0 + .run_mobile_plugin("impactFeedback", ImpactFeedbackPayload { style }) + .map_err(Into::into) + } + + pub fn notification_feedback(&self, r#type: NotificationFeedbackType) -> crate::Result<()> { + self.0 + .run_mobile_plugin( + "notificationFeedback", + NotificationFeedbackPayload { r#type }, + ) + .map_err(Into::into) + } + + pub fn selection_feedback(&self) -> crate::Result<()> { + self.0 + .run_mobile_plugin("selectionFeedback", ()) + .map_err(Into::into) + } +} + +#[derive(Serialize)] +struct VibratePayload { + duration: u32, +} + +#[derive(Serialize)] +struct ImpactFeedbackPayload { + style: ImpactFeedbackStyle, +} + +#[derive(Serialize)] +struct NotificationFeedbackPayload { + r#type: NotificationFeedbackType, +} diff --git a/plugins/haptics/src/models.rs b/plugins/haptics/src/models.rs new file mode 100644 index 00000000..9f3b2035 --- /dev/null +++ b/plugins/haptics/src/models.rs @@ -0,0 +1,34 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use serde::{Deserialize, Serialize}; +use specta::Type; +/* +#[derive(Debug, Clone, Default, Serialize, Deserialize, Type)] +#[serde(rename_all = "camelCase")] +pub struct HapticsOptions { + // TODO: support array to match web api + pub duration: u32, +} + */ + +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, Type)] +#[serde(rename_all = "camelCase")] +pub enum ImpactFeedbackStyle { + Light, + #[default] + Medium, + Heavy, + Soft, + Rigid, +} + +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, Type)] +#[serde(rename_all = "camelCase")] +pub enum NotificationFeedbackType { + #[default] + Success, + Warning, + Error, +} diff --git a/plugins/haptics/tsconfig.json b/plugins/haptics/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/haptics/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/http/CHANGELOG.md b/plugins/http/CHANGELOG.md index 31e0250f..e814ddd9 100644 --- a/plugins/http/CHANGELOG.md +++ b/plugins/http/CHANGELOG.md @@ -1,5 +1,148 @@ # Changelog +## \[2.0.3] + +### Dependencies + +- Upgraded to `fs@2.0.3` + +## \[2.0.1] + +- [`cfd48b3b`](https://github.com/tauri-apps/plugins-workspace/commit/cfd48b3b2ec0fccfc162197518694ed59ceda22c) ([#1941](https://github.com/tauri-apps/plugins-workspace/pull/1941) by [@Nipsuli](https://github.com/tauri-apps/plugins-workspace/../../Nipsuli)) Allow skipping sending `Origin` header in HTTP requests by setting `Origin` header to an empty string when calling `fetch`. +- [`9b2840db`](https://github.com/tauri-apps/plugins-workspace/commit/9b2840db9464cf08db75806270e4441f0af81e5d) ([#1884](https://github.com/tauri-apps/plugins-workspace/pull/1884) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Retain headers order. + +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +### Dependencies + +- Upgraded to `fs@2.0.1` + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +### Dependencies + +- Upgraded to `fs@2.0.0` + +## \[2.0.0-rc.6] + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.6` + +## \[2.0.0-rc.5] + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.5` + +## \[2.0.0-rc.4] + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.4` + +## \[2.0.0-rc.3] + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.3` + +## \[2.0.0-rc.2] + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.2` + +## \[2.0.0-rc.2] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.1] + +- [`84f8bd5e`](https://github.com/tauri-apps/plugins-workspace/commit/84f8bd5e1ef22e664267380b5bbf756ebc5389c3) ([#1662](https://github.com/tauri-apps/plugins-workspace/pull/1662) by [@twlite](https://github.com/tauri-apps/plugins-workspace/../../twlite)) Fixed an issue with abort signal not aborting the fetch request. + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.0` + +## \[2.0.0-beta.9] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.8] + +- [`ac9a25cc`](https://github.com/tauri-apps/plugins-workspace/commit/ac9a25cc12ee2b325f00212ba74316da3369bde5) ([#1395](https://github.com/tauri-apps/plugins-workspace/pull/1395) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Fix cancelling requests using `AbortSignal`. +- [`a6654932`](https://github.com/tauri-apps/plugins-workspace/commit/a66549329c60dea35e3a06a38c357e368c9053a1) ([#1526](https://github.com/tauri-apps/plugins-workspace/pull/1526) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Fix missing `Set-Cookie` headers in the response which meant `request.headers.getSetCookie()` always returned empty array. +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.7] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.6] + +- [`0f739dbc`](https://github.com/tauri-apps/plugins-workspace/commit/0f739dbc483a1f091977cbe575c3862fd39f8cf1) ([#1392](https://github.com/tauri-apps/plugins-workspace/pull/1392) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Allow setting `Origin` header when `unsafe-headers` feature flag is active. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`9d7ae45b`](https://github.com/tauri-apps/plugins-workspace/commit/9d7ae45b0edf9b22c73e7d7c413a784bb35c3d77)([#1354](https://github.com/tauri-apps/plugins-workspace/pull/1354)) Include headers created by browser if not declared by user, which fixes missing headers like `Content-Type` when using `FormData`. +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[2.0.0-beta.6] + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.6` + +## \[2.0.0-beta.5] + +- [`500ff10`](https://github.com/tauri-apps/plugins-workspace/commit/500ff10fbd89fdfc73caf9d153029dad567b4ff1)([#1166](https://github.com/tauri-apps/plugins-workspace/pull/1166)) **Breaking change:** Removed the `default-tls` feature flag. The `rustls-tls`, `http2`, `macos-system-configuration`, and `charset` feature flags are now enabled by default. +- [`e3d41f4`](https://github.com/tauri-apps/plugins-workspace/commit/e3d41f4011bd3ea3ce281bb38bbe31d3709f8e0f)([#1191](https://github.com/tauri-apps/plugins-workspace/pull/1191)) Internally use the webview scoped resources table instead of the app one, so other webviews can't access other webviews resources. +- [`7e2fcc5`](https://github.com/tauri-apps/plugins-workspace/commit/7e2fcc5e74df7c3c718e40f75bfb0eafc7d69d8d)([#1146](https://github.com/tauri-apps/plugins-workspace/pull/1146)) Update dependencies to align with tauri 2.0.0-beta.14. +- [`e3d41f4`](https://github.com/tauri-apps/plugins-workspace/commit/e3d41f4011bd3ea3ce281bb38bbe31d3709f8e0f)([#1191](https://github.com/tauri-apps/plugins-workspace/pull/1191)) Update for tauri 2.0.0-beta.15. + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.5` + +## \[2.0.0-beta.4] + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.4` + +## \[2.0.0-beta.3] + +- [`c873e4d`](https://github.com/tauri-apps/plugins-workspace/commit/c873e4d6c74e759742f7c9a88e35cff10a75122a)([#1059](https://github.com/tauri-apps/plugins-workspace/pull/1059)) Fixes scope not allowing subpaths, query parameters and hash when those values are empty. +- [`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. +- [`753c7be`](https://github.com/tauri-apps/plugins-workspace/commit/753c7be0a6a78121d2e88ea0efc3040580c885b4)([#1050](https://github.com/tauri-apps/plugins-workspace/pull/1050)) Add `unsafe-headers` cargo feature flag to allow using [forbidden headers](https://fetch.spec.whatwg.org/#terminology-headers). + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.3` + +## \[2.0.0-beta.2] + +- [`ae56b13`](https://github.com/tauri-apps/plugins-workspace/commit/ae56b13a4d49dbf922b8a0fbb0d557bb63c1d72b)([#983](https://github.com/tauri-apps/plugins-workspace/pull/983)) Allow `User-Agent` header to be set. +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -72,11 +215,88 @@ 371\)) First v2 alpha release! ! 371\)) First v2 alpha release! -ace/pull/371)) First v2 alpha release! + ace/pull/371)) First v2 alpha release! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + 2 alpha release! + ! + 371\)) First v2 alpha release! + /717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + ace/pull/371)) First v2 alpha release! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + lpha release! + ! + 371\)) First v2 alpha release! + ub.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + ace/pull/371)) First v2 alpha release! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + lpha release! + ! + 371\)) First v2 alpha release! + lpha release! + ! + 371\)) First v2 alpha release! + t v2 alpha release! + ! + 371\)) First v2 alpha release! + ace/pull/371)) First v2 alpha release! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + ! + 371\)) First v2 alpha release! + lpha release! + ! + 371\)) First v2 alpha release! + lpha release! + ! + 371\)) First v2 alpha release! + lpha release! + ! + 371\)) First v2 alpha release! + lpha release! + lpha release! + ! 371\)) First v2 alpha release! + lpha release! ! 371\)) First v2 alpha release! + ha release! ! 371\)) First v2 alpha release! + lease! ! 371\)) First v2 alpha release! diff --git a/plugins/http/Cargo.toml b/plugins/http/Cargo.toml index 3b06c2a2..8c1801a3 100644 --- a/plugins/http/Cargo.toml +++ b/plugins/http/Cargo.toml @@ -1,53 +1,73 @@ [package] name = "tauri-plugin-http" -version = "2.0.0-beta.1" +version = "2.0.3" description = "Access an HTTP client written in Rust." edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-http" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "full", notes = "" } +ios = { level = "full", notes = "" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } schemars = { workspace = true } serde = { workspace = true } url = { workspace = true } -glob = "0.3" +urlpattern = "0.3" +regex = "1" [dependencies] serde = { workspace = true } serde_json = { workspace = true } tauri = { workspace = true } thiserror = { workspace = true } -tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.1" } -glob = "0.3" -http = "0.2" -reqwest = { version = "0.11", default-features = false } +tokio = { version = "1", features = ["sync", "macros"] } +tauri-plugin-fs = { path = "../fs", version = "2.0.3" } +urlpattern = "0.3" +regex = "1" +http = "1" +reqwest = { version = "0.12", default-features = false } url = { workspace = true } data-url = "0.3" [features] -multipart = [ "reqwest/multipart" ] -json = [ "reqwest/json" ] -stream = [ "reqwest/stream" ] -native-tls = [ "reqwest/native-tls" ] -native-tls-vendored = [ "reqwest/native-tls-vendored" ] -rustls-tls = [ "reqwest/rustls-tls" ] -default-tls = [ "reqwest/default-tls" ] -native-tls-alpn = [ "reqwest/native-tls-alpn" ] -rustls-tls-manual-roots = [ "reqwest/rustls-tls-manual-roots" ] -rustls-tls-webpki-roots = [ "reqwest/rustls-tls-webpki-roots" ] -rustls-tls-native-roots = [ "reqwest/rustls-tls-native-roots" ] -blocking = [ "reqwest/blocking" ] -cookies = [ "reqwest/cookies" ] -gzip = [ "reqwest/gzip" ] -brotli = [ "reqwest/brotli" ] -deflate = [ "reqwest/deflate" ] -trust-dns = [ "reqwest/trust-dns" ] -socks = [ "reqwest/socks" ] -http3 = [ "reqwest/http3" ] +default = [ + "rustls-tls", + "http2", + "charset", + "macos-system-configuration", + "cookies", +] +multipart = ["reqwest/multipart"] +json = ["reqwest/json"] +stream = ["reqwest/stream"] +native-tls = ["reqwest/native-tls"] +native-tls-vendored = ["reqwest/native-tls-vendored"] +native-tls-alpn = ["reqwest/native-tls-alpn"] +rustls-tls = ["reqwest/rustls-tls"] +rustls-tls-manual-roots = ["reqwest/rustls-tls-manual-roots"] +rustls-tls-webpki-roots = ["reqwest/rustls-tls-webpki-roots"] +rustls-tls-native-roots = ["reqwest/rustls-tls-native-roots"] +blocking = ["reqwest/blocking"] +cookies = ["reqwest/cookies"] +gzip = ["reqwest/gzip"] +brotli = ["reqwest/brotli"] +deflate = ["reqwest/deflate"] +trust-dns = ["reqwest/trust-dns"] +socks = ["reqwest/socks"] +http2 = ["reqwest/http2"] +charset = ["reqwest/charset"] +macos-system-configuration = ["reqwest/macos-system-configuration"] +unsafe-headers = [] diff --git a/plugins/http/README.md b/plugins/http/README.md index d1f9bfa1..c3fe92c0 100644 --- a/plugins/http/README.md +++ b/plugins/http/README.md @@ -2,9 +2,17 @@ Access the HTTP client written in Rust. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ✓ | +| iOS | ✓ | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-http = "2.0.0-beta" +tauri-plugin-http = "2.0.0" # alternatively with Git: tauri-plugin-http = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -60,11 +68,11 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { fetch } from "@tauri-apps/plugin-http"; -const response = await fetch("http://localhost:3003/users/2", { - method: "GET", - timeout: 30, -}); +import { fetch } from '@tauri-apps/plugin-http' +const response = await fetch('http://localhost:3003/users/2', { + method: 'GET', + timeout: 30 +}) ``` ## Contributing diff --git a/plugins/http/SECURITY.md b/plugins/http/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/http/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/http/api-iife.js b/plugins/http/api-iife.js new file mode 100644 index 00000000..0cfeb063 --- /dev/null +++ b/plugins/http/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_HTTP__=function(e){"use strict";async function t(e,t={},r){return window.__TAURI_INTERNALS__.invoke(e,t,r)}"function"==typeof SuppressedError&&SuppressedError;const r="Request canceled";return e.fetch=async function(e,n){const a=n?.signal;if(a?.aborted)throw new Error(r);const o=n?.maxRedirections,s=n?.connectTimeout,i=n?.proxy;n&&(delete n.maxRedirections,delete n.connectTimeout,delete n.proxy);const d=n?.headers?n.headers instanceof Headers?n.headers:new Headers(n.headers):new Headers,c=new Request(e,n),u=await c.arrayBuffer(),f=0!==u.byteLength?Array.from(new Uint8Array(u)):null;for(const[e,t]of c.headers)d.get(e)||d.set(e,t);const _=(d instanceof Headers?Array.from(d.entries()):Array.isArray(d)?d:Object.entries(d)).map((([e,t])=>[e,"string"==typeof t?t:t.toString()]));if(a?.aborted)throw new Error(r);const h=await t("plugin:http|fetch",{clientConfig:{method:c.method,url:c.url,headers:_,data:f,maxRedirections:o,connectTimeout:s,proxy:i}}),l=()=>t("plugin:http|fetch_cancel",{rid:h});if(a?.aborted)throw l(),new Error(r);a?.addEventListener("abort",(()=>{l()}));const{status:p,statusText:w,url:y,headers:T,rid:A}=await t("plugin:http|fetch_send",{rid:h}),g=await t("plugin:http|fetch_read_body",{rid:A}),R=new Response(g instanceof ArrayBuffer&&0!==g.byteLength?g:g instanceof Array&&g.length>0?new Uint8Array(g):null,{status:p,statusText:w});return Object.defineProperty(R,"url",{value:y}),Object.defineProperty(R,"headers",{value:new Headers(T)}),R},e}({});Object.defineProperty(window.__TAURI__,"http",{value:__TAURI_PLUGIN_HTTP__})} diff --git a/plugins/http/build.rs b/plugins/http/build.rs index 2eaf72ba..a4b802ad 100644 --- a/plugins/http/build.rs +++ b/plugins/http/build.rs @@ -8,33 +8,60 @@ mod scope; const COMMANDS: &[&str] = &["fetch", "fetch_cancel", "fetch_send", "fetch_read_body"]; -/// HTTP scope entry object definition. +/// HTTP scope entry. #[derive(schemars::JsonSchema)] -struct ScopeEntry { +#[serde(untagged)] +#[allow(unused)] +enum HttpScopeEntry { /// A URL that can be accessed by the webview when using the HTTP APIs. - /// The scoped URL is matched against the request URL using a glob pattern. + /// Wildcards can be used following the URL pattern standard. + /// + /// See [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information. /// /// Examples: /// - /// - "https://*" or "https://**" : allows all HTTPS urls + /// - "https://*" : allows all HTTPS origin on port 443 + /// + /// - "https://*:*" : allows all HTTPS origin on any port /// /// - "https://*.github.com/tauri-apps/tauri": allows any subdomain of "github.com" with the "tauri-apps/api" path /// /// - "https://myapi.service.com/users/*": allows access to any URLs that begins with "https://myapi.service.com/users/" - url: String, + Value(String), + Object { + /// A URL that can be accessed by the webview when using the HTTP APIs. + /// Wildcards can be used following the URL pattern standard. + /// + /// See [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information. + /// + /// Examples: + /// + /// - "https://*" : allows all HTTPS origin on port 443 + /// + /// - "https://*:*" : allows all HTTPS origin on any port + /// + /// - "https://*.github.com/tauri-apps/tauri": allows any subdomain of "github.com" with the "tauri-apps/api" path + /// + /// - "https://myapi.service.com/users/*": allows access to any URLs that begins with "https://myapi.service.com/users/" + url: String, + }, } -// ensure scope entry is up to date -impl From for scope::Entry { - fn from(value: ScopeEntry) -> Self { - scope::Entry { - url: value.url.parse().unwrap(), - } - } +// Ensure `HttpScopeEntry` and `scope::EntryRaw` is kept in sync +fn _f() { + match scope::EntryRaw::Value(String::new()) { + scope::EntryRaw::Value(url) => HttpScopeEntry::Value(url), + scope::EntryRaw::Object { url } => HttpScopeEntry::Object { url }, + }; + match HttpScopeEntry::Value(String::new()) { + HttpScopeEntry::Value(url) => scope::EntryRaw::Value(url), + HttpScopeEntry::Object { url } => scope::EntryRaw::Object { url }, + }; } fn main() { tauri_plugin::Builder::new(COMMANDS) - .global_scope_schema(schemars::schema_for!(ScopeEntry)) + .global_api_script_path("./api-iife.js") + .global_scope_schema(schemars::schema_for!(HttpScopeEntry)) .build(); } diff --git a/plugins/http/guest-js/index.ts b/plugins/http/guest-js/index.ts index a1a6d77a..4362e893 100644 --- a/plugins/http/guest-js/index.ts +++ b/plugins/http/guest-js/index.ts @@ -7,16 +7,18 @@ * * ## Security * - * This API has a scope configuration that forces you to restrict the URLs and paths that can be accessed using glob patterns. + * This API has a scope configuration that forces you to restrict the URLs that can be accessed using glob patterns. * - * For instance, this scope configuration only allows making HTTP requests to the GitHub API for the `tauri-apps` organization: + * For instance, this scope configuration only allows making HTTP requests to all subdomains for `tauri.app` except for `https://private.tauri.app`: * ```json * { - * "plugins": { - * "http": { - * "scope": ["https://api.github.com/repos/tauri-apps/*"] + * "permissions": [ + * { + * "identifier": "http:default", + * "allow": [{ "url": "https://*.tauri.app" }], + * "deny": [{ "url": "https://private.tauri.app" }] * } - * } + * ] * } * ``` * Trying to execute any API with a URL not configured on the scope results in a promise rejection due to denied access. @@ -24,45 +26,45 @@ * @module */ -import { invoke } from "@tauri-apps/api/core"; +import { invoke } from '@tauri-apps/api/core' /** * Configuration of a proxy that a Client should pass requests to. * * @since 2.0.0 */ -export type Proxy = { +export interface Proxy { /** * Proxy all traffic to the passed URL. */ - all?: string | ProxyConfig; + all?: string | ProxyConfig /** * Proxy all HTTP traffic to the passed URL. */ - http?: string | ProxyConfig; + http?: string | ProxyConfig /** * Proxy all HTTPS traffic to the passed URL. */ - https?: string | ProxyConfig; -}; + https?: string | ProxyConfig +} export interface ProxyConfig { /** * The URL of the proxy server. */ - url: string; + url: string /** * Set the `Proxy-Authorization` header using Basic auth. */ basicAuth?: { - username: string; - password: string; - }; + username: string + password: string + } /** - * A configuration for filtering out requests that shouldn’t be proxied. + * A configuration for filtering out requests that shouldn't be proxied. * Entries are expected to be comma-separated (whitespace between entries is ignored) */ - noProxy?: string; + noProxy?: string } /** @@ -75,15 +77,17 @@ export interface ClientOptions { * Defines the maximum number of redirects the client should follow. * If set to 0, no redirects will be followed. */ - maxRedirections?: number; + maxRedirections?: number /** Timeout in milliseconds */ - connectTimeout?: number; + connectTimeout?: number /** * Configuration of a proxy that a Client should pass requests to. */ - proxy?: Proxy; + proxy?: Proxy } +const ERROR_REQUEST_CANCELLED = 'Request canceled' + /** * Fetch a resource from the network. It returns a `Promise` that resolves to the * `Response` to that `Request`, whether it is successful or not. @@ -100,64 +104,96 @@ export interface ClientOptions { */ export async function fetch( input: URL | Request | string, - init?: RequestInit & ClientOptions, + init?: RequestInit & ClientOptions ): Promise { - const maxRedirections = init?.maxRedirections; - const connectTimeout = init?.connectTimeout; - const proxy = init?.proxy; + // abort early here if needed + const signal = init?.signal + if (signal?.aborted) { + throw new Error(ERROR_REQUEST_CANCELLED) + } + + const maxRedirections = init?.maxRedirections + const connectTimeout = init?.connectTimeout + const proxy = init?.proxy // Remove these fields before creating the request if (init) { - delete init.maxRedirections; - delete init.connectTimeout; - delete init.proxy; + delete init.maxRedirections + delete init.connectTimeout + delete init.proxy } - const signal = init?.signal; - - const headers = !init?.headers - ? [] - : init.headers instanceof Headers - ? Array.from(init.headers.entries()) - : Array.isArray(init.headers) - ? init.headers - : Object.entries(init.headers); - - const mappedHeaders: [string, string][] = headers.map(([name, val]) => [ - name, - // we need to ensure we have all values as strings - // eslint-disable-next-line - typeof val === "string" ? val : (val as any).toString(), - ]); + const headers = init?.headers + ? init.headers instanceof Headers + ? init.headers + : new Headers(init.headers) + : new Headers() + + const req = new Request(input, init) + const buffer = await req.arrayBuffer() + const data = + buffer.byteLength !== 0 ? Array.from(new Uint8Array(buffer)) : null + + // append new headers created by the browser `Request` implementation, + // if not already declared by the caller of this function + for (const [key, value] of req.headers) { + if (!headers.get(key)) { + headers.set(key, value) + } + } - const req = new Request(input, init); - const buffer = await req.arrayBuffer(); - const reqData = buffer.byteLength ? Array.from(new Uint8Array(buffer)) : null; + const headersArray = + headers instanceof Headers + ? Array.from(headers.entries()) + : Array.isArray(headers) + ? headers + : Object.entries(headers) + + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const mappedHeaders: Array<[string, string]> = headersArray.map( + ([name, val]) => [ + name, + // we need to ensure we have all header values as strings + // eslint-disable-next-line + typeof val === 'string' ? val : (val as any).toString() + ] + ) + + // abort early here if needed + if (signal?.aborted) { + throw new Error(ERROR_REQUEST_CANCELLED) + } - const rid = await invoke("plugin:http|fetch", { + const rid = await invoke('plugin:http|fetch', { clientConfig: { method: req.method, url: req.url, headers: mappedHeaders, - data: reqData, + data, maxRedirections, connectTimeout, - proxy, - }, - }); + proxy + } + }) + + const abort = () => invoke('plugin:http|fetch_cancel', { rid }) + + // abort early here if needed + if (signal?.aborted) { + // we don't care about the result of this proimse + // eslint-disable-next-line @typescript-eslint/no-floating-promises + abort() + throw new Error(ERROR_REQUEST_CANCELLED) + } - signal?.addEventListener("abort", () => { - invoke("plugin:http|fetch_cancel", { - rid, - }); - }); + signal?.addEventListener('abort', () => void abort()) interface FetchSendResponse { - status: number; - statusText: string; - headers: [[string, string]]; - url: string; - rid: number; + status: number + statusText: string + headers: [[string, string]] + url: string + rid: number } const { @@ -165,33 +201,40 @@ export async function fetch( statusText, url, headers: responseHeaders, - rid: responseRid, - } = await invoke("plugin:http|fetch_send", { - rid, - }); + rid: responseRid + } = await invoke('plugin:http|fetch_send', { + rid + }) const body = await invoke( - "plugin:http|fetch_read_body", + 'plugin:http|fetch_read_body', { - rid: responseRid, - }, - ); + rid: responseRid + } + ) const res = new Response( - body instanceof ArrayBuffer && body.byteLength + body instanceof ArrayBuffer && body.byteLength !== 0 ? body - : body instanceof Array && body.length + : body instanceof Array && body.length > 0 ? new Uint8Array(body) : null, { - headers: responseHeaders, status, - statusText, - }, - ); - - // url is read only but seems like we can do this - Object.defineProperty(res, "url", { value: url }); - - return res; + statusText + } + ) + + // url and headers are read only properties + // but seems like we can set them like this + // + // we define theme like this, because using `Response` + // constructor, it removes url and some headers + // like `set-cookie` headers + Object.defineProperty(res, 'url', { value: url }) + Object.defineProperty(res, 'headers', { + value: new Headers(responseHeaders) + }) + + return res } diff --git a/plugins/http/package.json b/plugins/http/package.json index ef615036..493caf75 100644 --- a/plugins/http/package.json +++ b/plugins/http/package.json @@ -1,10 +1,11 @@ { "name": "@tauri-apps/plugin-http", - "version": "2.0.0-beta.1", - "license": "MIT or APACHE-2.0", + "version": "2.0.1", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -23,6 +24,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/http/permissions/autogenerated/reference.md b/plugins/http/permissions/autogenerated/reference.md index 16508acb..4126f0b9 100644 --- a/plugins/http/permissions/autogenerated/reference.md +++ b/plugins/http/permissions/autogenerated/reference.md @@ -1,38 +1,133 @@ -# Permissions +## Default Permission -## allow-fetch +This permission set configures what kind of +fetch operations are available from the http plugin. + +This enables all fetch operations but does not +allow explicitly any origins to be fetched. This needs to +be manually configured before usage. + +#### Granted Permissions + +All fetch operations are enabled. + + + +- `allow-fetch` +- `allow-fetch-cancel` +- `allow-fetch-read-body` +- `allow-fetch-send` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -Denies the fetch_send command without any pre-configured scope. + + + + +
IdentifierDescription
+ +`http:allow-fetch` + + Enables the fetch command without any pre-configured scope. -## deny-fetch +
+ +`http:deny-fetch` + + Denies the fetch command without any pre-configured scope. -## allow-fetch-cancel +
+ +`http:allow-fetch-cancel` + + Enables the fetch_cancel command without any pre-configured scope. -## deny-fetch-cancel +
+ +`http:deny-fetch-cancel` + + Denies the fetch_cancel command without any pre-configured scope. -## allow-fetch-read-body +
+ +`http:allow-fetch-read-body` + + Enables the fetch_read_body command without any pre-configured scope. -## deny-fetch-read-body +
+ +`http:deny-fetch-read-body` + + Denies the fetch_read_body command without any pre-configured scope. -## allow-fetch-send +
+ +`http:allow-fetch-send` + + Enables the fetch_send command without any pre-configured scope. -## deny-fetch-send +
-## default +`http:deny-fetch-send` -Allows all fetch operations + + +Denies the fetch_send command without any pre-configured scope. +
diff --git a/plugins/http/permissions/default.toml b/plugins/http/permissions/default.toml index fd7802b4..b469536d 100644 --- a/plugins/http/permissions/default.toml +++ b/plugins/http/permissions/default.toml @@ -1,6 +1,19 @@ "$schema" = "schemas/schema.json" + [default] -description = "Allows all fetch operations" +description = """ +This permission set configures what kind of +fetch operations are available from the http plugin. + +This enables all fetch operations but does not +allow explicitly any origins to be fetched. This needs to +be manually configured before usage. + +#### Granted Permissions + +All fetch operations are enabled. + +""" permissions = [ "allow-fetch", "allow-fetch-cancel", diff --git a/plugins/http/permissions/schemas/schema.json b/plugins/http/permissions/schemas/schema.json index 69613c67..794ee204 100644 --- a/plugins/http/permissions/schemas/schema.json +++ b/plugins/http/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,71 +251,93 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-fetch -> Enables the fetch command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-fetch" + "macOS" ] }, { - "description": "deny-fetch -> Denies the fetch command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-fetch" + "windows" ] }, { - "description": "allow-fetch-cancel -> Enables the fetch_cancel command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-fetch-cancel" + "linux" ] }, { - "description": "deny-fetch-cancel -> Denies the fetch_cancel command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-fetch-cancel" + "android" ] }, { - "description": "allow-fetch-read-body -> Enables the fetch_read_body command without any pre-configured scope.", + "description": "iOS.", "type": "string", "enum": [ - "allow-fetch-read-body" + "iOS" ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the fetch command without any pre-configured scope.", + "type": "string", + "const": "allow-fetch" }, { - "description": "deny-fetch-read-body -> Denies the fetch_read_body command without any pre-configured scope.", + "description": "Denies the fetch command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-fetch-read-body" - ] + "const": "deny-fetch" }, { - "description": "allow-fetch-send -> Enables the fetch_send command without any pre-configured scope.", + "description": "Enables the fetch_cancel command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-fetch-send" - ] + "const": "allow-fetch-cancel" }, { - "description": "deny-fetch-send -> Denies the fetch_send command without any pre-configured scope.", + "description": "Denies the fetch_cancel command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-fetch-send" - ] + "const": "deny-fetch-cancel" }, { - "description": "default -> Allows all fetch operations", + "description": "Enables the fetch_read_body command without any pre-configured scope.", "type": "string", - "enum": [ - "default" - ] + "const": "allow-fetch-read-body" + }, + { + "description": "Denies the fetch_read_body command without any pre-configured scope.", + "type": "string", + "const": "deny-fetch-read-body" + }, + { + "description": "Enables the fetch_send command without any pre-configured scope.", + "type": "string", + "const": "allow-fetch-send" + }, + { + "description": "Denies the fetch_send command without any pre-configured scope.", + "type": "string", + "const": "deny-fetch-send" + }, + { + "description": "This permission set configures what kind of\nfetch operations are available from the http plugin.\n\nThis enables all fetch operations but does not\nallow explicitly any origins to be fetched. This needs to\nbe manually configured before usage.\n\n#### Granted Permissions\n\nAll fetch operations are enabled.\n\n", + "type": "string", + "const": "default" } ] } diff --git a/plugins/http/rollup.config.js b/plugins/http/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/http/rollup.config.js +++ b/plugins/http/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/http/src/api-iife.js b/plugins/http/src/api-iife.js deleted file mode 100644 index 40a09cb9..00000000 --- a/plugins/http/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_HTTP__=function(e){"use strict";async function t(e,t={},r){return window.__TAURI_INTERNALS__.invoke(e,t,r)}return"function"==typeof SuppressedError&&SuppressedError,e.fetch=async function(e,r){const n=r?.maxRedirections,a=r?.connectTimeout,i=r?.proxy;r&&(delete r.maxRedirections,delete r.connectTimeout,delete r.proxy);const s=r?.signal,o=(r?.headers?r.headers instanceof Headers?Array.from(r.headers.entries()):Array.isArray(r.headers)?r.headers:Object.entries(r.headers):[]).map((([e,t])=>[e,"string"==typeof t?t:t.toString()])),d=new Request(e,r),c=await d.arrayBuffer(),u=c.byteLength?Array.from(new Uint8Array(c)):null,_=await t("plugin:http|fetch",{clientConfig:{method:d.method,url:d.url,headers:o,data:u,maxRedirections:n,connectTimeout:a,proxy:i}});s?.addEventListener("abort",(()=>{t("plugin:http|fetch_cancel",{rid:_})}));const{status:f,statusText:h,url:p,headers:l,rid:y}=await t("plugin:http|fetch_send",{rid:_}),T=await t("plugin:http|fetch_read_body",{rid:y}),w=new Response(T instanceof ArrayBuffer&&T.byteLength?T:T instanceof Array&&T.length?new Uint8Array(T):null,{headers:l,status:f,statusText:h});return Object.defineProperty(w,"url",{value:p}),w},e}({});Object.defineProperty(window.__TAURI__,"http",{value:__TAURI_PLUGIN_HTTP__})} diff --git a/plugins/http/src/commands.rs b/plugins/http/src/commands.rs index d4b2469b..39a68973 100644 --- a/plugins/http/src/commands.rs +++ b/plugins/http/src/commands.rs @@ -2,38 +2,68 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use std::{collections::HashMap, future::Future, pin::Pin, sync::Arc, time::Duration}; +use std::{future::Future, pin::Pin, str::FromStr, sync::Arc, time::Duration}; -use http::{header, HeaderName, HeaderValue, Method, StatusCode}; +use http::{header, HeaderMap, HeaderName, HeaderValue, Method, StatusCode}; use reqwest::{redirect::Policy, NoProxy}; use serde::{Deserialize, Serialize}; use tauri::{ async_runtime::Mutex, command, ipc::{CommandScope, GlobalScope}, - AppHandle, Manager, ResourceId, Runtime, + Manager, ResourceId, ResourceTable, Runtime, State, Webview, }; +use tokio::sync::oneshot::{channel, Receiver, Sender}; use crate::{ scope::{Entry, Scope}, - Error, Result, + Error, Http, Result, }; +const HTTP_USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"),); + struct ReqwestResponse(reqwest::Response); +impl tauri::Resource for ReqwestResponse {} -type CancelableResponseResult = Result>; +type CancelableResponseResult = Result; type CancelableResponseFuture = Pin + Send + Sync>>; -struct FetchRequest(Mutex); -impl FetchRequest { - fn new(f: CancelableResponseFuture) -> Self { - Self(Mutex::new(f)) +struct FetchRequest { + fut: Mutex, + abort_tx_rid: ResourceId, + abort_rx_rid: ResourceId, +} +impl tauri::Resource for FetchRequest {} + +struct AbortSender(Sender<()>); +impl tauri::Resource for AbortRecveiver {} + +impl AbortSender { + fn abort(self) { + let _ = self.0.send(()); } } -impl tauri::Resource for FetchRequest {} -impl tauri::Resource for ReqwestResponse {} +struct AbortRecveiver(Receiver<()>); +impl tauri::Resource for AbortSender {} + +trait AddRequest { + fn add_request(&mut self, fut: CancelableResponseFuture) -> ResourceId; +} + +impl AddRequest for ResourceTable { + fn add_request(&mut self, fut: CancelableResponseFuture) -> ResourceId { + let (tx, rx) = channel::<()>(); + let (tx, rx) = (AbortSender(tx), AbortRecveiver(rx)); + let req = FetchRequest { + fut: Mutex::new(fut), + abort_tx_rid: self.add(tx), + abort_rx_rid: self.add(rx), + }; + self.add(req) + } +} #[derive(Serialize)] #[serde(rename_all = "camelCase")] @@ -45,7 +75,7 @@ pub struct FetchResponse { rid: ResourceId, } -#[derive(Deserialize)] +#[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ClientConfig { method: String, @@ -57,7 +87,7 @@ pub struct ClientConfig { proxy: Option, } -#[derive(Deserialize)] +#[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Proxy { all: Option, @@ -65,7 +95,7 @@ pub struct Proxy { https: Option, } -#[derive(Deserialize)] +#[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] #[serde(untagged)] pub enum UrlOrConfig { @@ -73,7 +103,7 @@ pub enum UrlOrConfig { Config(ProxyConfig), } -#[derive(Deserialize)] +#[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ProxyConfig { url: String, @@ -81,7 +111,7 @@ pub struct ProxyConfig { no_proxy: Option, } -#[derive(Deserialize)] +#[derive(Debug, Deserialize)] pub struct BasicAuth { username: String, password: String, @@ -137,7 +167,8 @@ fn attach_proxy( #[command] pub async fn fetch( - app: AppHandle, + webview: Webview, + state: State<'_, Http>, client_config: ClientConfig, command_scope: CommandScope, global_scope: GlobalScope, @@ -145,7 +176,7 @@ pub async fn fetch( let ClientConfig { method, url, - headers, + headers: headers_raw, data, connect_timeout, max_redirections, @@ -154,7 +185,17 @@ pub async fn fetch( let scheme = url.scheme(); let method = Method::from_bytes(method.as_bytes())?; - let headers: HashMap = HashMap::from_iter(headers); + + let mut headers = HeaderMap::new(); + for (h, v) in headers_raw { + let name = HeaderName::from_str(&h)?; + #[cfg(not(feature = "unsafe-headers"))] + if is_unsafe_header(&name) { + continue; + } + + headers.append(name, HeaderValue::from_str(&v)?); + } match scheme { "http" | "https" => { @@ -190,64 +231,56 @@ pub async fn fetch( builder = attach_proxy(proxy_config, builder)?; } - let mut request = builder.build()?.request(method.clone(), url); - - for (name, value) in &headers { - let name = HeaderName::from_bytes(name.as_bytes())?; - let value = HeaderValue::from_bytes(value.as_bytes())?; - if !matches!( - name, - // forbidden headers per fetch spec https://fetch.spec.whatwg.org/#terminology-headers - header::ACCEPT_CHARSET - | header::ACCEPT_ENCODING - | header::ACCESS_CONTROL_REQUEST_HEADERS - | header::ACCESS_CONTROL_REQUEST_METHOD - | header::CONNECTION - | header::CONTENT_LENGTH - | header::COOKIE - | header::DATE - | header::DNT - | header::EXPECT - | header::HOST - | header::ORIGIN - | header::REFERER - | header::SET_COOKIE - | header::TE - | header::TRAILER - | header::TRANSFER_ENCODING - | header::UPGRADE - | header::VIA - ) { - request = request.header(name, value); - } + #[cfg(feature = "cookies")] + { + builder = builder.cookie_provider(state.cookies_jar.clone()); } + let mut request = builder.build()?.request(method.clone(), url); + // POST and PUT requests should always have a 0 length content-length, // if there is no body. https://fetch.spec.whatwg.org/#http-network-or-cache-fetch if data.is_none() && matches!(method, Method::POST | Method::PUT) { - request = request.header(header::CONTENT_LENGTH, HeaderValue::from(0)); + headers.append(header::CONTENT_LENGTH, HeaderValue::from_str("0")?); } - if headers.contains_key(header::RANGE.as_str()) { + if headers.contains_key(header::RANGE) { // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch step 18 // If httpRequest’s header list contains `Range`, then append (`Accept-Encoding`, `identity`) - request = request.header( - header::ACCEPT_ENCODING, - HeaderValue::from_static("identity"), - ); + headers.append(header::ACCEPT_ENCODING, HeaderValue::from_str("identity")?); + } + + if !headers.contains_key(header::USER_AGENT) { + headers.append(header::USER_AGENT, HeaderValue::from_str(HTTP_USER_AGENT)?); } - if !headers.contains_key(header::USER_AGENT.as_str()) { - request = request.header(header::USER_AGENT, HeaderValue::from_static("tauri")); + // ensure we have an Origin header set + if cfg!(not(feature = "unsafe-headers")) || !headers.contains_key(header::ORIGIN) { + if let Ok(url) = webview.url() { + headers.append( + header::ORIGIN, + HeaderValue::from_str(&url.origin().ascii_serialization())?, + ); + } } + // In case empty origin is passed, remove it. Some services do not like Origin header + // so this way we can remove it in explicit way. The default behaviour is still to set it + if cfg!(feature = "unsafe-headers") + && headers.get(header::ORIGIN) == Some(&HeaderValue::from_static("")) + { + headers.remove(header::ORIGIN); + }; + if let Some(data) = data { request = request.body(data); } - let fut = async move { Ok(request.send().await.map_err(Into::into)) }; - let mut resources_table = app.resources_table(); - let rid = resources_table.add(FetchRequest::new(Box::pin(fut))); + request = request.headers(headers); + + let fut = async move { request.send().await.map_err(Into::into) }; + let mut resources_table = webview.resources_table(); + let rid = resources_table.add_request(Box::pin(fut)); Ok(rid) } else { @@ -266,9 +299,9 @@ pub async fn fetch( .header(header::CONTENT_TYPE, data_url.mime_type().to_string()) .body(reqwest::Body::from(body))?; - let fut = async move { Ok(Ok(reqwest::Response::from(response))) }; - let mut resources_table = app.resources_table(); - let rid = resources_table.add(FetchRequest::new(Box::pin(fut))); + let fut = async move { Ok(reqwest::Response::from(response)) }; + let mut resources_table = webview.resources_table(); + let rid = resources_table.add_request(Box::pin(fut)); Ok(rid) } _ => Err(Error::SchemeNotSupport(scheme.to_string())), @@ -276,30 +309,41 @@ pub async fn fetch( } #[command] -pub async fn fetch_cancel(app: AppHandle, rid: ResourceId) -> crate::Result<()> { - let req = { - let resources_table = app.resources_table(); - resources_table.get::(rid)? - }; - let mut req = req.0.lock().await; - *req = Box::pin(async { Err(Error::RequestCanceled) }); - +pub fn fetch_cancel(webview: Webview, rid: ResourceId) -> crate::Result<()> { + let mut resources_table = webview.resources_table(); + let req = resources_table.get::(rid)?; + let abort_tx = resources_table.take::(req.abort_tx_rid)?; + if let Some(abort_tx) = Arc::into_inner(abort_tx) { + abort_tx.abort(); + } Ok(()) } #[tauri::command] pub async fn fetch_send( - app: AppHandle, + webview: Webview, rid: ResourceId, ) -> crate::Result { - let req = { - let mut resources_table = app.resources_table(); - resources_table.take::(rid)? + let (req, abort_rx) = { + let mut resources_table = webview.resources_table(); + let req = resources_table.get::(rid)?; + let abort_rx = resources_table.take::(req.abort_rx_rid)?; + (req, abort_rx) }; - let res = match req.0.lock().await.as_mut().await { - Ok(Ok(res)) => res, - Ok(Err(e)) | Err(e) => return Err(e), + let Some(abort_rx) = Arc::into_inner(abort_rx) else { + return Err(Error::RequestCanceled); + }; + + let mut fut = req.fut.lock().await; + + let res = tokio::select! { + res = fut.as_mut() => res?, + _ = abort_rx.0 => { + let mut resources_table = webview.resources_table(); + resources_table.close(rid)?; + return Err(Error::RequestCanceled); + } }; let status = res.status(); @@ -312,7 +356,7 @@ pub async fn fetch_send( )); } - let mut resources_table = app.resources_table(); + let mut resources_table = webview.resources_table(); let rid = resources_table.add(ReqwestResponse(res)); Ok(FetchResponse { @@ -326,13 +370,43 @@ pub async fn fetch_send( #[tauri::command] pub(crate) async fn fetch_read_body( - app: AppHandle, + webview: Webview, rid: ResourceId, ) -> crate::Result { let res = { - let mut resources_table = app.resources_table(); + let mut resources_table = webview.resources_table(); resources_table.take::(rid)? }; let res = Arc::into_inner(res).unwrap().0; Ok(tauri::ipc::Response::new(res.bytes().await?.to_vec())) } + +// forbidden headers per fetch spec https://fetch.spec.whatwg.org/#terminology-headers +#[cfg(not(feature = "unsafe-headers"))] +fn is_unsafe_header(header: &HeaderName) -> bool { + matches!( + *header, + header::ACCEPT_CHARSET + | header::ACCEPT_ENCODING + | header::ACCESS_CONTROL_REQUEST_HEADERS + | header::ACCESS_CONTROL_REQUEST_METHOD + | header::CONNECTION + | header::CONTENT_LENGTH + | header::COOKIE + | header::DATE + | header::DNT + | header::EXPECT + | header::HOST + | header::ORIGIN + | header::REFERER + | header::SET_COOKIE + | header::TE + | header::TRAILER + | header::TRANSFER_ENCODING + | header::UPGRADE + | header::VIA + ) || { + let lower = header.as_str().to_lowercase(); + lower.starts_with("proxy-") || lower.starts_with("sec-") + } +} diff --git a/plugins/http/src/lib.rs b/plugins/http/src/lib.rs index e4aa7ba1..cdffeb6e 100644 --- a/plugins/http/src/lib.rs +++ b/plugins/http/src/lib.rs @@ -9,7 +9,7 @@ pub use reqwest; use tauri::{ plugin::{Builder, TauriPlugin}, - AppHandle, Manager, Runtime, + Manager, Runtime, }; pub use error::{Error, Result}; @@ -18,33 +18,28 @@ mod commands; mod error; mod scope; -struct Http { - #[allow(dead_code)] - app: AppHandle, -} - -trait HttpExt { - fn http(&self) -> &Http; -} - -impl> HttpExt for T { - fn http(&self) -> &Http { - self.state::>().inner() - } +pub(crate) struct Http { + #[cfg(feature = "cookies")] + cookies_jar: std::sync::Arc, } pub fn init() -> TauriPlugin { Builder::::new("http") - .js_init_script(include_str!("api-iife.js").to_string()) + .setup(|app, _| { + let state = Http { + #[cfg(feature = "cookies")] + cookies_jar: std::sync::Arc::new(reqwest::cookie::Jar::default()), + }; + + app.manage(state); + + Ok(()) + }) .invoke_handler(tauri::generate_handler![ commands::fetch, commands::fetch_cancel, commands::fetch_send, commands::fetch_read_body, ]) - .setup(|app, _api| { - app.manage(Http { app: app.clone() }); - Ok(()) - }) .build() } diff --git a/plugins/http/src/scope.rs b/plugins/http/src/scope.rs index d80a55fb..2123f215 100644 --- a/plugins/http/src/scope.rs +++ b/plugins/http/src/scope.rs @@ -2,13 +2,42 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT +use std::sync::Arc; + use serde::{Deserialize, Deserializer}; use url::Url; +use urlpattern::{UrlPattern, UrlPatternMatchInput}; #[allow(rustdoc::bare_urls)] #[derive(Debug)] pub struct Entry { - pub url: glob::Pattern, + pub url: UrlPattern, +} + +fn parse_url_pattern(s: &str) -> Result { + let mut init = urlpattern::UrlPatternInit::parse_constructor_string::(s, None)?; + if init.search.as_ref().map(|p| p.is_empty()).unwrap_or(true) { + init.search.replace("*".to_string()); + } + if init.hash.as_ref().map(|p| p.is_empty()).unwrap_or(true) { + init.hash.replace("*".to_string()); + } + if init + .pathname + .as_ref() + .map(|p| p.is_empty() || p == "/") + .unwrap_or(true) + { + init.pathname.replace("*".to_string()); + } + UrlPattern::parse(init, Default::default()) +} + +#[derive(Deserialize)] +#[serde(untagged)] +pub(crate) enum EntryRaw { + Value(String), + Object { url: String }, } impl<'de> Deserialize<'de> for Entry { @@ -16,18 +45,14 @@ impl<'de> Deserialize<'de> for Entry { where D: Deserializer<'de>, { - #[derive(Deserialize)] - struct EntryRaw { - url: String, - } - EntryRaw::deserialize(deserializer).and_then(|raw| { + let url = match raw { + EntryRaw::Value(url) => url, + EntryRaw::Object { url } => url, + }; Ok(Entry { - url: glob::Pattern::new(&raw.url).map_err(|e| { - serde::de::Error::custom(format!( - "URL `{}` is not a valid glob pattern: {e}", - raw.url - )) + url: parse_url_pattern(&url).map_err(|e| { + serde::de::Error::custom(format!("`{}` is not a valid URL pattern: {e}", url)) })?, }) }) @@ -37,32 +62,32 @@ impl<'de> Deserialize<'de> for Entry { /// Scope for filesystem access. #[derive(Debug)] pub struct Scope<'a> { - allowed: Vec<&'a Entry>, - denied: Vec<&'a Entry>, + allowed: Vec<&'a Arc>, + denied: Vec<&'a Arc>, } impl<'a> Scope<'a> { /// Creates a new scope from the scope configuration. - pub(crate) fn new(allowed: Vec<&'a Entry>, denied: Vec<&'a Entry>) -> Self { + pub(crate) fn new(allowed: Vec<&'a Arc>, denied: Vec<&'a Arc>) -> Self { Self { allowed, denied } } /// Determines if the given URL is allowed on this scope. pub fn is_allowed(&self, url: &Url) -> bool { let denied = self.denied.iter().any(|entry| { - entry.url.matches(url.as_str()) - || entry - .url - .matches(url.as_str().strip_suffix('/').unwrap_or_default()) + entry + .url + .test(UrlPatternMatchInput::Url(url.clone())) + .unwrap_or_default() }); if denied { false } else { self.allowed.iter().any(|entry| { - entry.url.matches(url.as_str()) - || entry - .url - .matches(url.as_str().strip_suffix('/').unwrap_or_default()) + entry + .url + .test(UrlPatternMatchInput::Url(url.clone())) + .unwrap_or_default() }) } } @@ -70,69 +95,137 @@ impl<'a> Scope<'a> { #[cfg(test)] mod tests { - use std::str::FromStr; + use std::{str::FromStr, sync::Arc}; use super::Entry; impl FromStr for Entry { - type Err = glob::PatternError; + type Err = urlpattern::quirks::Error; fn from_str(s: &str) -> Result { - let pattern = s.parse()?; + let pattern = super::parse_url_pattern(s)?; Ok(Self { url: pattern }) } } #[test] - fn is_allowed() { + fn denied_takes_precedence() { + let allow = Arc::new("http://localhost:8080/file.png".parse().unwrap()); + let deny = Arc::new("http://localhost:8080/*".parse().unwrap()); + let scope = super::Scope::new(vec![&allow], vec![&deny]); + assert!(!scope.is_allowed(&"http://localhost:8080/file.png".parse().unwrap())); + assert!(!scope.is_allowed(&"http://localhost:8080?framework=tauri".parse().unwrap())); + } + + #[test] + fn fixed_url() { // plain URL - let entry = "http://localhost:8080".parse().unwrap(); + let entry = Arc::new("http://localhost:8080".parse().unwrap()); let scope = super::Scope::new(vec![&entry], Vec::new()); assert!(scope.is_allowed(&"http://localhost:8080".parse().unwrap())); assert!(scope.is_allowed(&"http://localhost:8080/".parse().unwrap())); + assert!(scope.is_allowed(&"http://localhost:8080/file".parse().unwrap())); + assert!(scope.is_allowed(&"http://localhost:8080/path/to/asset.png".parse().unwrap())); + assert!(scope.is_allowed(&"http://localhost:8080/path/list?limit=50".parse().unwrap())); - assert!(!scope.is_allowed(&"http://localhost:8080/file".parse().unwrap())); - assert!(!scope.is_allowed(&"http://localhost:8080/path/to/asset.png".parse().unwrap())); assert!(!scope.is_allowed(&"https://localhost:8080".parse().unwrap())); assert!(!scope.is_allowed(&"http://localhost:8081".parse().unwrap())); assert!(!scope.is_allowed(&"http://local:8080".parse().unwrap())); + } - // deny takes precedence - let allow = "http://localhost:8080/file.png".parse().unwrap(); - let deny = "http://localhost:8080/*".parse().unwrap(); - let scope = super::Scope::new(vec![&allow], vec![&deny]); - assert!(!scope.is_allowed(&"http://localhost:8080/file.png".parse().unwrap())); - + #[test] + fn fixed_path() { // URL with fixed path - let entry = "http://localhost:8080/file.png".parse().unwrap(); + let entry = Arc::new("http://localhost:8080/file.png".parse().unwrap()); let scope = super::Scope::new(vec![&entry], Vec::new()); assert!(scope.is_allowed(&"http://localhost:8080/file.png".parse().unwrap())); + assert!(scope.is_allowed(&"http://localhost:8080/file.png?q=1".parse().unwrap())); assert!(!scope.is_allowed(&"http://localhost:8080".parse().unwrap())); assert!(!scope.is_allowed(&"http://localhost:8080/file".parse().unwrap())); assert!(!scope.is_allowed(&"http://localhost:8080/file.png/other.jpg".parse().unwrap())); + } - // URL with glob pattern - let entry = "http://localhost:8080/*.png".parse().unwrap(); + #[test] + fn pattern_wildcard() { + let entry = Arc::new("http://localhost:8080/*.png".parse().unwrap()); let scope = super::Scope::new(vec![&entry], Vec::new()); assert!(scope.is_allowed(&"http://localhost:8080/file.png".parse().unwrap())); + assert!(scope.is_allowed(&"http://localhost:8080/file.png#head".parse().unwrap())); assert!(scope.is_allowed(&"http://localhost:8080/assets/file.png".parse().unwrap())); + assert!(scope.is_allowed( + &"http://localhost:8080/assets/file.png?width=100&height=200" + .parse() + .unwrap() + )); assert!(!scope.is_allowed(&"http://localhost:8080/file.jpeg".parse().unwrap())); + } - let entry = "http://*".parse().unwrap(); + #[test] + fn domain_wildcard() { + let entry = Arc::new("http://*".parse().unwrap()); let scope = super::Scope::new(vec![&entry], Vec::new()); assert!(scope.is_allowed(&"http://something.else".parse().unwrap())); + assert!(scope.is_allowed(&"http://something.else#tauri".parse().unwrap())); assert!(scope.is_allowed(&"http://something.else/path/to/file".parse().unwrap())); + assert!(scope.is_allowed(&"http://something.else?rel=tauri".parse().unwrap())); + assert!(scope.is_allowed( + &"http://something.else/path/to/file.mp4?start=500" + .parse() + .unwrap() + )); + assert!(!scope.is_allowed(&"https://something.else".parse().unwrap())); - let entry = "http://**".parse().unwrap(); + let entry = Arc::new("http://*/*".parse().unwrap()); + let scope = super::Scope::new(vec![&entry], Vec::new()); + + assert!(scope.is_allowed(&"http://something.else".parse().unwrap())); + assert!(scope.is_allowed(&"http://something.else/path/to/file".parse().unwrap())); + } + + #[test] + fn scheme_wildcard() { + let entry = Arc::new("*://*".parse().unwrap()); + let scope = super::Scope::new(vec![&entry], Vec::new()); + + assert!(scope.is_allowed(&"http://something.else".parse().unwrap())); + assert!(scope.is_allowed(&"http://something.else/path/to/file".parse().unwrap())); + assert!(scope.is_allowed(&"file://path".parse().unwrap())); + assert!(scope.is_allowed(&"file://path/to/file".parse().unwrap())); + assert!(scope.is_allowed(&"https://something.else".parse().unwrap())); + assert!(scope.is_allowed(&"https://something.else?x=1#frag".parse().unwrap())); + + let entry = Arc::new("*://*/*".parse().unwrap()); let scope = super::Scope::new(vec![&entry], Vec::new()); assert!(scope.is_allowed(&"http://something.else".parse().unwrap())); assert!(scope.is_allowed(&"http://something.else/path/to/file".parse().unwrap())); + assert!(scope.is_allowed(&"file://path/to/file".parse().unwrap())); + assert!(scope.is_allowed(&"https://something.else".parse().unwrap())); + } + + #[test] + fn validate_query() { + let entry = Arc::new("https://tauri.app/path?x=*".parse().unwrap()); + let scope = super::Scope::new(vec![&entry], Vec::new()); + + assert!(scope.is_allowed(&"https://tauri.app/path?x=5".parse().unwrap())); + + assert!(!scope.is_allowed(&"https://tauri.app/path?y=5".parse().unwrap())); + } + + #[test] + fn validate_hash() { + let entry = Arc::new("https://tauri.app/path#frame*".parse().unwrap()); + let scope = super::Scope::new(vec![&entry], Vec::new()); + + assert!(scope.is_allowed(&"https://tauri.app/path#frame".parse().unwrap())); + + assert!(!scope.is_allowed(&"https://tauri.app/path#work".parse().unwrap())); } } diff --git a/plugins/localhost/CHANGELOG.md b/plugins/localhost/CHANGELOG.md index d69e3727..3a2bf060 100644 --- a/plugins/localhost/CHANGELOG.md +++ b/plugins/localhost/CHANGELOG.md @@ -1,5 +1,54 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.9] + +- [`e847cedc`](https://github.com/tauri-apps/plugins-workspace/commit/e847cedc1f46f3e7a2ad81ea579b620bc5b992d7) ([#1402](https://github.com/tauri-apps/plugins-workspace/pull/1402) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Use no default features on tauri for all plugins so that consumers can use `default-features = false` on tauri, note that this will still enable wry feature on iOS +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.8] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.7] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.6] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.5] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.4] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[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] + +- [`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. + ## \[2.0.0-beta.1] - [`14f381a`](https://github.com/tauri-apps/plugins-workspace/commit/14f381acf8fe690acecc676922c6f05939b95734) Update MSRV to 1.75. diff --git a/plugins/localhost/Cargo.toml b/plugins/localhost/Cargo.toml index e23343dc..3d9460d0 100644 --- a/plugins/localhost/Cargo.toml +++ b/plugins/localhost/Cargo.toml @@ -1,15 +1,23 @@ [package] name = "tauri-plugin-localhost" -version = "2.0.0-beta.1" +version = "2.0.1" description = "Expose your apps assets through a localhost server instead of the default custom protocol." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "none", notes = "" } +ios = { level = "none", notes = "" } [dependencies] serde = { workspace = true } diff --git a/plugins/localhost/README.md b/plugins/localhost/README.md index 0b21087e..4e23c038 100644 --- a/plugins/localhost/README.md +++ b/plugins/localhost/README.md @@ -2,11 +2,19 @@ Expose your apps assets through a localhost server instead of the default custom protocol. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ✓ | +| iOS | ✓ | + > Note: This plugins brings considerable security risks and you should only use it if you know what your are doing. If in doubt, use the default custom protocol implementation. ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -21,7 +29,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] portpicker = "0.1" # used in the example to pick a random free port -tauri-plugin-localhost = "2.0.0-beta" +tauri-plugin-localhost = "2.0.0" # alternatively with Git: tauri-plugin-localhost = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` diff --git a/plugins/localhost/SECURITY.md b/plugins/localhost/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/localhost/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/localhost/src/lib.rs b/plugins/localhost/src/lib.rs index c0b42a29..a0c4c794 100644 --- a/plugins/localhost/src/lib.rs +++ b/plugins/localhost/src/lib.rs @@ -74,7 +74,7 @@ impl Builder { let asset_resolver = app.asset_resolver(); std::thread::spawn(move || { let server = - Server::http(&format!("localhost:{port}")).expect("Unable to spawn server"); + Server::http(format!("localhost:{port}")).expect("Unable to spawn server"); for req in server.incoming_requests() { let path = req .url() @@ -102,16 +102,6 @@ impl Builder { on_request(&request, &mut response); } - #[cfg(target_os = "linux")] - if let Some(response_csp) = - response.headers.get("Content-Security-Policy") - { - let html = String::from_utf8_lossy(&asset.bytes); - let body = - html.replacen(tauri::utils::html::CSP_TOKEN, response_csp, 1); - asset.bytes = body.as_bytes().to_vec(); - } - let mut resp = HttpResponse::from_data(asset.bytes); for (header, value) in response.headers { if let Ok(h) = Header::from_bytes(header.as_bytes(), value) { diff --git a/plugins/log/.gitignore b/plugins/log/.gitignore deleted file mode 100644 index 28fd5eff..00000000 --- a/plugins/log/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -/.tauri diff --git a/plugins/log/CHANGELOG.md b/plugins/log/CHANGELOG.md index 2978fe21..f0177138 100644 --- a/plugins/log/CHANGELOG.md +++ b/plugins/log/CHANGELOG.md @@ -1,5 +1,66 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.1] + +- [`b9147758`](https://github.com/tauri-apps/plugins-workspace/commit/b914775898c2bee7ceb20bd17ee595005cd17a64) ([#1679](https://github.com/tauri-apps/plugins-workspace/pull/1679) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Explicitly set a minimum macOS version for the Swift package. + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.9] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.9] + +- [`20a1d24e`](https://github.com/tauri-apps/plugins-workspace/commit/20a1d24ee004e77c2d12a0e20d258ce120216ed1) ([#1579](https://github.com/tauri-apps/plugins-workspace/pull/1579) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Added `Builder::split` which returns the raw logger implementation so you can pipe to other loggers such as `multi_log` or `tauri-plugin-devtools`. + +## \[2.0.0-beta.8] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.7] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.6] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.5] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.4] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[2.0.0-beta.3] + +- [`ed46dca`](https://github.com/tauri-apps/plugins-workspace/commit/ed46dca74ff3947dbbcb26a7b571c129bf925698) Added `attachLogger` helper function to register a function that should be called for each log entry. + +## \[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] + +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -45,4 +106,5 @@ https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ase! 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! + com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/log/Cargo.toml b/plugins/log/Cargo.toml index 309431c7..4f7c34d4 100644 --- a/plugins/log/Cargo.toml +++ b/plugins/log/Cargo.toml @@ -1,19 +1,27 @@ [package] name = "tauri-plugin-log" -version = "2.0.0-beta.1" +version = "2.0.1" description = "Configurable logging for your Tauri app." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-log" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "unknown", notes = "" } +ios = { level = "unknown", notes = "" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -21,17 +29,18 @@ serde_json = { workspace = true } tauri = { workspace = true } serde_repr = "0.1" byte-unit = "5" -log = { workspace = true, features = [ "kv_unstable" ] } -time = { version = "0.3", features = [ "formatting", "local-offset" ] } +log = { workspace = true, features = ["kv_unstable"] } +time = { version = "0.3", features = ["formatting", "local-offset"] } fern = "0.6" +thiserror = "1" [target."cfg(target_os = \"android\")".dependencies] -android_logger = "0.11" +android_logger = "0.14" [target."cfg(target_os = \"ios\")".dependencies] -swift-rs = "1.0.1" +swift-rs = "1" objc = "0.2" -cocoa = "0.24" +cocoa = "0.26" [features] -colored = [ "fern/colored" ] +colored = ["fern/colored"] diff --git a/plugins/log/README.md b/plugins/log/README.md index 56c4beeb..1748d0c0 100644 --- a/plugins/log/README.md +++ b/plugins/log/README.md @@ -2,9 +2,17 @@ Configurable logging for your Tauri app. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ✓ | +| iOS | ✓ | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,12 +26,14 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-log = "2.0.0-beta" +tauri-plugin-log = "2.0.0" # alternatively with Git: tauri-plugin-log = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` -You can install the JavaScript Guest bindings using your preferred JavaScript package manager: +If you want the single instance mechanism to only trigger for semver compatible instances of your apps, for example if you expect users to have multiple installations of your app installed, you can add `features = ["semver"]` to the dependency declaration in `Cargo.toml`. + +Then you can install the JavaScript Guest bindings using your preferred JavaScript package manager: > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. @@ -66,17 +76,17 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { trace, info, error, attachConsole } from "@tauri-apps/plugin-log"; +import { trace, info, error, attachConsole } from '@tauri-apps/plugin-log' // with TargetKind::Webview enabled this function will print logs to the browser console -const detach = await attachConsole(); +const detach = await attachConsole() -trace("Trace"); -info("Info"); -error("Error"); +trace('Trace') +info('Info') +error('Error') // detach the browser console from the log stream -detach(); +detach() ``` To log from rust code, add the log crate to your `Cargo.toml`: diff --git a/plugins/log/SECURITY.md b/plugins/log/SECURITY.md index 072f2f09..d013f6a6 100644 --- a/plugins/log/SECURITY.md +++ b/plugins/log/SECURITY.md @@ -39,6 +39,7 @@ One possible threat you need to consider when using this plugin is that secrets in logs can theoretically be leaked when the application's frontend gets compromised. For this threat to be possible all of the following requirements need to be fulfilled: + - `TargetKind::Webview` enabled OR secrets stem from frontend logs - Frontend application is compromised via something like XSS (cross-site-scripting) OR logs are directly exposed - Logs contain secrets or sensitive information diff --git a/plugins/log/api-iife.js b/plugins/log/api-iife.js new file mode 100644 index 00000000..571b8566 --- /dev/null +++ b/plugins/log/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_LOG__=function(e){"use strict";function n(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}async function r(e,n={},r){return window.__TAURI_INTERNALS__.invoke(e,n,r)}var a,t;async function o(e,a,t){const o={kind:"Any"};return r("plugin:event|listen",{event:e,target:o,handler:n(a)}).then((n=>async()=>async function(e,n){await r("plugin:event|unlisten",{event:e,eventId:n})}(e,n)))}async function i(e,n,a){const t=(new Error).stack?.split("\n").map((e=>e.split("@"))),o=t?.filter((([e,n])=>e.length>0&&"[native code]"!==n)),{file:i,line:c,keyValues:u}=a??{};let l=o?.[0]?.filter((e=>e.length>0)).join("@");"Error"===l&&(l="webview::unknown"),await r("plugin:log|log",{level:e,message:n,location:l,file:i,line:c,keyValues:u})}async function c(e){return await o("log://log",(n=>{const{level:r}=n.payload;let{message:a}=n.payload;a=a.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,""),e({message:a,level:r})}))}return"function"==typeof SuppressedError&&SuppressedError,function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_CREATED="tauri://window-created",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG_ENTER="tauri://drag-enter",e.DRAG_OVER="tauri://drag-over",e.DRAG_DROP="tauri://drag-drop",e.DRAG_LEAVE="tauri://drag-leave"}(a||(a={})),function(e){e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warn=4]="Warn",e[e.Error=5]="Error"}(t||(t={})),e.attachConsole=async function(){return await c((({level:e,message:n})=>{switch(e){case t.Trace:console.log(n);break;case t.Debug:console.debug(n);break;case t.Info:console.info(n);break;case t.Warn:console.warn(n);break;case t.Error:console.error(n);break;default:throw new Error(`unknown log level ${e}`)}}))},e.attachLogger=c,e.debug=async function(e,n){await i(t.Debug,e,n)},e.error=async function(e,n){await i(t.Error,e,n)},e.info=async function(e,n){await i(t.Info,e,n)},e.trace=async function(e,n){await i(t.Trace,e,n)},e.warn=async function(e,n){await i(t.Warn,e,n)},e}({});Object.defineProperty(window.__TAURI__,"log",{value:__TAURI_PLUGIN_LOG__})} diff --git a/plugins/log/build.rs b/plugins/log/build.rs index f413529a..5969c1e9 100644 --- a/plugins/log/build.rs +++ b/plugins/log/build.rs @@ -5,5 +5,8 @@ const COMMANDS: &[&str] = &["log"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).ios_path("ios").build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .ios_path("ios") + .build(); } diff --git a/plugins/log/guest-js/index.ts b/plugins/log/guest-js/index.ts index 5aad73d5..bf9d7f98 100644 --- a/plugins/log/guest-js/index.ts +++ b/plugins/log/guest-js/index.ts @@ -2,15 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { listen, UnlistenFn } from "@tauri-apps/api/event"; +import { invoke } from '@tauri-apps/api/core' +import { listen, type UnlistenFn, type Event } from '@tauri-apps/api/event' -import { invoke } from "@tauri-apps/api/core"; - -export type LogOptions = { - file?: string; - line?: number; - keyValues?: Record; -}; +export interface LogOptions { + file?: string + line?: number + keyValues?: Record +} enum LogLevel { /** @@ -42,35 +41,35 @@ enum LogLevel { * * Designates very serious errors. */ - Error, + Error } async function log( level: LogLevel, message: string, - options?: LogOptions, + options?: LogOptions ): Promise { - const traces = new Error().stack?.split("\n").map((line) => line.split("@")); + const traces = new Error().stack?.split('\n').map((line) => line.split('@')) const filtered = traces?.filter(([name, location]) => { - return name.length > 0 && location !== "[native code]"; - }); + return name.length > 0 && location !== '[native code]' + }) - const { file, line, keyValues } = options ?? {}; + const { file, line, keyValues } = options ?? {} - let location = filtered?.[0]?.filter((v) => v.length > 0).join("@"); - if (location === "Error") { - location = "webview::unknown"; + let location = filtered?.[0]?.filter((v) => v.length > 0).join('@') + if (location === 'Error') { + location = 'webview::unknown' } - await invoke("plugin:log|log", { + await invoke('plugin:log|log', { level, message, location, file, line, - keyValues, - }); + keyValues + }) } /** @@ -91,9 +90,9 @@ async function log( */ export async function error( message: string, - options?: LogOptions, + options?: LogOptions ): Promise { - await log(LogLevel.Error, message, options); + await log(LogLevel.Error, message, options) } /** @@ -113,9 +112,9 @@ export async function error( */ export async function warn( message: string, - options?: LogOptions, + options?: LogOptions ): Promise { - await log(LogLevel.Warn, message, options); + await log(LogLevel.Warn, message, options) } /** @@ -135,9 +134,9 @@ export async function warn( */ export async function info( message: string, - options?: LogOptions, + options?: LogOptions ): Promise { - await log(LogLevel.Info, message, options); + await log(LogLevel.Info, message, options) } /** @@ -157,9 +156,9 @@ export async function info( */ export async function debug( message: string, - options?: LogOptions, + options?: LogOptions ): Promise { - await log(LogLevel.Debug, message, options); + await log(LogLevel.Debug, message, options) } /** @@ -179,47 +178,66 @@ export async function debug( */ export async function trace( message: string, - options?: LogOptions, + options?: LogOptions ): Promise { - await log(LogLevel.Trace, message, options); + await log(LogLevel.Trace, message, options) } interface RecordPayload { - level: LogLevel; - message: string; + level: LogLevel + message: string } -export async function attachConsole(): Promise { - return await listen("log://log", (event) => { - const payload = event.payload as RecordPayload; +type LoggerFn = (fn: RecordPayload) => void + +/** + * Attaches a listener for the log, and calls the passed function for each log entry. + * @param fn + * + * @returns a function to cancel the listener. + */ +export async function attachLogger(fn: LoggerFn): Promise { + return await listen('log://log', (event: Event) => { + const { level } = event.payload + let { message } = event.payload // Strip ANSI escape codes - const message = payload.message.replace( + message = message.replace( // TODO: Investigate security/detect-unsafe-regex // eslint-disable-next-line no-control-regex, security/detect-unsafe-regex /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, - "", - ); + '' + ) + fn({ message, level }) + }) +} - switch (payload.level) { +/** + * Attaches a listener that writes log entries to the console as they come in. + * + * @returns a function to cancel the listener. + */ +export async function attachConsole(): Promise { + return await attachLogger(({ level, message }: RecordPayload) => { + switch (level) { case LogLevel.Trace: - console.log(message); - break; + console.log(message) + break case LogLevel.Debug: - console.debug(message); - break; + console.debug(message) + break case LogLevel.Info: - console.info(message); - break; + console.info(message) + break case LogLevel.Warn: - console.warn(message); - break; + console.warn(message) + break case LogLevel.Error: - console.error(message); - break; + console.error(message) + break default: // eslint-disable-next-line @typescript-eslint/restrict-template-expressions - throw new Error(`unknown log level ${payload.level}`); + throw new Error(`unknown log level ${level}`) } - }); + }) } diff --git a/plugins/log/ios/Package.swift b/plugins/log/ios/Package.swift index 4afbbbdb..1571f22e 100644 --- a/plugins/log/ios/Package.swift +++ b/plugins/log/ios/Package.swift @@ -6,28 +6,29 @@ import PackageDescription let package = Package( - name: "tauri-plugin-log", - platforms: [ - .iOS(.v11), - ], - products: [ - // Products define the executables and libraries a package produces, and make them visible to other packages. - .library( - name: "tauri-plugin-log", - type: .static, - targets: ["tauri-plugin-log"]), - ], - dependencies: [ - .package(name: "Tauri", path: "../.tauri/tauri-api") - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages this package depends on. - .target( - name: "tauri-plugin-log", - dependencies: [ - .byName(name: "Tauri") - ], - path: "Sources") - ] + name: "tauri-plugin-log", + platforms: [ + .macOS(.v10_13), + .iOS(.v11), + ], + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "tauri-plugin-log", + type: .static, + targets: ["tauri-plugin-log"]) + ], + dependencies: [ + .package(name: "Tauri", path: "../.tauri/tauri-api") + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "tauri-plugin-log", + dependencies: [ + .byName(name: "Tauri") + ], + path: "Sources") + ] ) diff --git a/plugins/log/package.json b/plugins/log/package.json index 7f071e03..fd021701 100644 --- a/plugins/log/package.json +++ b/plugins/log/package.json @@ -1,11 +1,12 @@ { "name": "@tauri-apps/plugin-log", - "version": "2.0.0-beta.1", + "version": "2.0.0", "description": "Configurable logging for your Tauri app.", - "license": "MIT or APACHE-2.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -24,6 +25,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/log/permissions/autogenerated/reference.md b/plugins/log/permissions/autogenerated/reference.md index 7dd146d0..d59aefa0 100644 --- a/plugins/log/permissions/autogenerated/reference.md +++ b/plugins/log/permissions/autogenerated/reference.md @@ -1,14 +1,41 @@ -# Permissions +## Default Permission -## allow-log +Allows the log command + +- `allow-log` + +## Permission Table + + + + + + + + + + + + -Denies the log command without any pre-configured scope. + + + + +
IdentifierDescription
+ +`log:allow-log` + + Enables the log command without any pre-configured scope. -## deny-log +
-## default +`log:deny-log` -Allows the log command + + +Denies the log command without any pre-configured scope. +
diff --git a/plugins/log/permissions/schemas/schema.json b/plugins/log/permissions/schemas/schema.json index 47196663..78d88826 100644 --- a/plugins/log/permissions/schemas/schema.json +++ b/plugins/log/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,29 +251,63 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-log -> Enables the log command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-log" + "macOS" ] }, { - "description": "deny-log -> Denies the log command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-log" + "windows" ] }, { - "description": "default -> Allows the log command", + "description": "Linux.", "type": "string", "enum": [ - "default" + "linux" ] + }, + { + "description": "Android.", + "type": "string", + "enum": [ + "android" + ] + }, + { + "description": "iOS.", + "type": "string", + "enum": [ + "iOS" + ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the log command without any pre-configured scope.", + "type": "string", + "const": "allow-log" + }, + { + "description": "Denies the log command without any pre-configured scope.", + "type": "string", + "const": "deny-log" + }, + { + "description": "Allows the log command", + "type": "string", + "const": "default" } ] } diff --git a/plugins/log/rollup.config.js b/plugins/log/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/log/rollup.config.js +++ b/plugins/log/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/log/src/api-iife.js b/plugins/log/src/api-iife.js deleted file mode 100644 index ff5eb504..00000000 --- a/plugins/log/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_LOG__=function(e){"use strict";function n(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}async function r(e,n={},r){return window.__TAURI_INTERNALS__.invoke(e,n,r)}var a,t;async function o(e,a,t){const o="string"==typeof t?.target?{kind:"AnyLabel",label:t.target}:t?.target??{kind:"Any"};return r("plugin:event|listen",{event:e,target:o,handler:n(a)}).then((n=>async()=>async function(e,n){await r("plugin:event|unlisten",{event:e,eventId:n})}(e,n)))}async function i(e,n,a){const t=(new Error).stack?.split("\n").map((e=>e.split("@"))),o=t?.filter((([e,n])=>e.length>0&&"[native code]"!==n)),{file:i,line:c,keyValues:l}=a??{};let u=o?.[0]?.filter((e=>e.length>0)).join("@");"Error"===u&&(u="webview::unknown"),await r("plugin:log|log",{level:e,message:n,location:u,file:i,line:c,keyValues:l})}return"function"==typeof SuppressedError&&SuppressedError,function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WEBVIEW_CREATED="tauri://webview-created",e.FILE_DROP="tauri://file-drop",e.FILE_DROP_HOVER="tauri://file-drop-hover",e.FILE_DROP_CANCELLED="tauri://file-drop-cancelled"}(a||(a={})),function(e){e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warn=4]="Warn",e[e.Error=5]="Error"}(t||(t={})),e.attachConsole=async function(){return await o("log://log",(e=>{const n=e.payload,r=n.message.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,"");switch(n.level){case t.Trace:console.log(r);break;case t.Debug:console.debug(r);break;case t.Info:console.info(r);break;case t.Warn:console.warn(r);break;case t.Error:console.error(r);break;default:throw new Error(`unknown log level ${n.level}`)}}))},e.debug=async function(e,n){await i(t.Debug,e,n)},e.error=async function(e,n){await i(t.Error,e,n)},e.info=async function(e,n){await i(t.Info,e,n)},e.trace=async function(e,n){await i(t.Trace,e,n)},e.warn=async function(e,n){await i(t.Warn,e,n)},e}({});Object.defineProperty(window.__TAURI__,"log",{value:__TAURI_PLUGIN_LOG__})} diff --git a/plugins/log/src/lib.rs b/plugins/log/src/lib.rs index 5f564b2d..98035e4e 100644 --- a/plugins/log/src/lib.rs +++ b/plugins/log/src/lib.rs @@ -28,6 +28,7 @@ use tauri::{ plugin::{self, TauriPlugin}, Manager, Runtime, }; +use tauri::{AppHandle, Emitter}; pub use fern; use time::OffsetDateTime; @@ -74,6 +75,18 @@ const DEFAULT_LOG_TARGETS: [Target; 2] = [ Target::new(TargetKind::LogDir { file_name: None }), ]; +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error(transparent)] + Tauri(#[from] tauri::Error), + #[error(transparent)] + Io(#[from] std::io::Error), + #[error(transparent)] + TimeFormat(#[from] time::error::Format), + #[error(transparent)] + InvalidFormatDescription(#[from] time::error::InvalidFormatDescription), +} + /// An enum representing the available verbosity levels of the logger. /// /// It is very similar to the [`log::Level`], but serializes to unsigned ints instead of strings. @@ -167,15 +180,15 @@ pub enum TargetKind { path: PathBuf, file_name: Option, }, - /// Write logs to the OS specififc logs directory. + /// Write logs to the OS specific logs directory. /// /// ### Platform-specific /// - /// |Platform | Value | Example | - /// | ------- | --------------------------------------------- | ---------------------------------------------- | - /// | Linux | `{configDir}/{bundleIdentifier}` | `/home/alice/.config/com.tauri.dev` | - /// | macOS | `{homeDir}/Library/Logs/{bundleIdentifier}` | `/Users/Alice/Library/Logs/com.tauri.dev` | - /// | Windows | `{configDir}/{bundleIdentifier}` | `C:\Users\Alice\AppData\Roaming\com.tauri.dev` | + /// |Platform | Value | Example | + /// | ------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------- | + /// | Linux | `$XDG_DATA_HOME/{bundleIdentifier}/logs` or `$HOME/.local/share/{bundleIdentifier}/logs` | `/home/alice/.local/share/com.tauri.dev/logs` | + /// | macOS | `{homeDir}/Library/Logs/{bundleIdentifier}` | `/Users/Alice/Library/Logs/com.tauri.dev` | + /// | Windows | `{FOLDERID_LocalAppData}/{bundleIdentifier}/logs` | `C:\Users\Alice\AppData\Local\com.tauri.dev\logs` | LogDir { file_name: Option }, /// Forward logs to the webview (via the `log://log` event). /// @@ -394,98 +407,134 @@ impl Builder { }) } - pub fn build(mut self) -> TauriPlugin { - plugin::Builder::new("log") - .js_init_script(include_str!("api-iife.js").to_string()) - .invoke_handler(tauri::generate_handler![log]) - .setup(move |app_handle, _api| { - let app_name = &app_handle.package_info().name; + fn acquire_logger( + app_handle: &AppHandle, + mut dispatch: fern::Dispatch, + rotation_strategy: RotationStrategy, + timezone_strategy: TimezoneStrategy, + max_file_size: u128, + targets: Vec, + ) -> Result<(log::LevelFilter, Box), Error> { + let app_name = &app_handle.package_info().name; + + // setup targets + for target in targets { + let mut target_dispatch = fern::Dispatch::new(); + for filter in target.filters { + target_dispatch = target_dispatch.filter(filter); + } - // setup targets - for target in self.targets { - let mut target_dispatch = fern::Dispatch::new(); - for filter in target.filters { - target_dispatch = target_dispatch.filter(filter); + let logger = match target.kind { + #[cfg(target_os = "android")] + TargetKind::Stdout | TargetKind::Stderr => fern::Output::call(android_logger::log), + #[cfg(target_os = "ios")] + TargetKind::Stdout | TargetKind::Stderr => fern::Output::call(move |record| { + let message = format!("{}", record.args()); + unsafe { + ios::tauri_log( + match record.level() { + log::Level::Trace | log::Level::Debug => 1, + log::Level::Info => 2, + log::Level::Warn | log::Level::Error => 3, + }, + ios::NSString::new(message.as_str()).0 as _, + ); + } + }), + #[cfg(desktop)] + TargetKind::Stdout => std::io::stdout().into(), + #[cfg(desktop)] + TargetKind::Stderr => std::io::stderr().into(), + TargetKind::Folder { path, file_name } => { + if !path.exists() { + fs::create_dir_all(&path)?; } - let logger = match target.kind { - #[cfg(target_os = "android")] - TargetKind::Stdout | TargetKind::Stderr => { - fern::Output::call(android_logger::log) - } - #[cfg(target_os = "ios")] - TargetKind::Stdout | TargetKind::Stderr => { - fern::Output::call(move |record| { - let message = format!("{}", record.args()); - unsafe { - ios::tauri_log( - match record.level() { - log::Level::Trace | log::Level::Debug => 1, - log::Level::Info => 2, - log::Level::Warn | log::Level::Error => 3, - }, - ios::NSString::new(message.as_str()).0 as _, - ); - } - }) - } - #[cfg(desktop)] - TargetKind::Stdout => std::io::stdout().into(), - #[cfg(desktop)] - TargetKind::Stderr => std::io::stderr().into(), - TargetKind::Folder { path, file_name } => { - if !path.exists() { - fs::create_dir_all(&path).unwrap(); - } - - fern::log_file(get_log_file_path( - &path, - file_name.as_deref().unwrap_or(app_name), - &self.rotation_strategy, - &self.timezone_strategy, - self.max_file_size, - )?)? - .into() - } - #[cfg(mobile)] - TargetKind::LogDir { .. } => continue, - #[cfg(desktop)] - TargetKind::LogDir { file_name } => { - let path = app_handle.path().app_log_dir().unwrap(); - if !path.exists() { - fs::create_dir_all(&path).unwrap(); - } - - fern::log_file(get_log_file_path( - &path, - file_name.as_deref().unwrap_or(app_name), - &self.rotation_strategy, - &self.timezone_strategy, - self.max_file_size, - )?)? - .into() - } - TargetKind::Webview => { - let app_handle = app_handle.clone(); - - fern::Output::call(move |record| { - let payload = RecordPayload { - message: record.args().to_string(), - level: record.level().into(), - }; - let app_handle = app_handle.clone(); - tauri::async_runtime::spawn(async move { - app_handle.emit("log://log", payload).unwrap(); - }); - }) - } - }; - target_dispatch = target_dispatch.chain(logger); - - self.dispatch = self.dispatch.chain(target_dispatch); + fern::log_file(get_log_file_path( + &path, + file_name.as_deref().unwrap_or(app_name), + &rotation_strategy, + &timezone_strategy, + max_file_size, + )?)? + .into() } + #[cfg(mobile)] + TargetKind::LogDir { .. } => continue, + #[cfg(desktop)] + TargetKind::LogDir { file_name } => { + let path = app_handle.path().app_log_dir()?; + if !path.exists() { + fs::create_dir_all(&path)?; + } - self.dispatch.apply()?; + fern::log_file(get_log_file_path( + &path, + file_name.as_deref().unwrap_or(app_name), + &rotation_strategy, + &timezone_strategy, + max_file_size, + )?)? + .into() + } + TargetKind::Webview => { + let app_handle = app_handle.clone(); + + fern::Output::call(move |record| { + let payload = RecordPayload { + message: record.args().to_string(), + level: record.level().into(), + }; + let app_handle = app_handle.clone(); + tauri::async_runtime::spawn(async move { + let _ = app_handle.emit("log://log", payload); + }); + }) + } + }; + target_dispatch = target_dispatch.chain(logger); + + dispatch = dispatch.chain(target_dispatch); + } + + Ok(dispatch.into_log()) + } + + fn plugin_builder() -> plugin::Builder { + plugin::Builder::new("log").invoke_handler(tauri::generate_handler![log]) + } + + #[allow(clippy::type_complexity)] + pub fn split( + self, + app_handle: &AppHandle, + ) -> Result<(TauriPlugin, log::LevelFilter, Box), Error> { + let plugin = Self::plugin_builder(); + let (max_level, log) = Self::acquire_logger( + app_handle, + self.dispatch, + self.rotation_strategy, + self.timezone_strategy, + self.max_file_size, + self.targets, + )?; + + Ok((plugin.build(), max_level, log)) + } + + pub fn build(self) -> TauriPlugin { + Self::plugin_builder() + .setup(move |app_handle, _api| { + let (max_level, log) = Self::acquire_logger( + app_handle, + self.dispatch, + self.rotation_strategy, + self.timezone_strategy, + self.max_file_size, + self.targets, + )?; + + attach_logger(max_level, log)?; Ok(()) }) @@ -493,13 +542,23 @@ impl Builder { } } +/// Attaches the given logger +pub fn attach_logger( + max_level: log::LevelFilter, + log: Box, +) -> Result<(), log::SetLoggerError> { + log::set_boxed_logger(log)?; + log::set_max_level(max_level); + Ok(()) +} + fn get_log_file_path( dir: &impl AsRef, file_name: &str, rotation_strategy: &RotationStrategy, timezone_strategy: &TimezoneStrategy, max_file_size: u128, -) -> Result> { +) -> Result { let path = dir.as_ref().join(format!("{file_name}.log")); if path.exists() { @@ -512,13 +571,9 @@ fn get_log_file_path( file_name, timezone_strategy .get_now() - .format( - &time::format_description::parse( - "[year]-[month]-[day]_[hour]-[minute]-[second]" - ) - .unwrap() - ) - .unwrap(), + .format(&time::format_description::parse( + "[year]-[month]-[day]_[hour]-[minute]-[second]" + )?)?, )); if to.is_file() { // designated rotated log file name already exists @@ -526,7 +581,10 @@ fn get_log_file_path( let mut to_bak = to.clone(); to_bak.set_file_name(format!( "{}.bak", - to_bak.file_name().unwrap().to_string_lossy() + to_bak + .file_name() + .map(|f| f.to_string_lossy()) + .unwrap_or_default() )); fs::rename(&to, to_bak)?; } diff --git a/plugins/mirrors.txt b/plugins/mirrors.txt index 73f0816e..d346da18 100644 --- a/plugins/mirrors.txt +++ b/plugins/mirrors.txt @@ -1,4 +1,3 @@ -authenticator autostart cli clipboard-manager diff --git a/plugins/nfc/.gitignore b/plugins/nfc/.gitignore deleted file mode 100644 index 1b0b469d..00000000 --- a/plugins/nfc/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/.tauri diff --git a/plugins/nfc/CHANGELOG.md b/plugins/nfc/CHANGELOG.md index 0350c5d7..7960011f 100644 --- a/plugins/nfc/CHANGELOG.md +++ b/plugins/nfc/CHANGELOG.md @@ -1,5 +1,64 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.2] + +- [`b9147758`](https://github.com/tauri-apps/plugins-workspace/commit/b914775898c2bee7ceb20bd17ee595005cd17a64) ([#1679](https://github.com/tauri-apps/plugins-workspace/pull/1679) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Explicitly set a minimum macOS version for the Swift package. + +## \[2.0.0-rc.1] + +### changes + +- [`6b079cfd`](https://github.com/tauri-apps/plugins-workspace/commit/6b079cfdd107c94abc2c7300f6af00bac3ff4040) ([#1649](https://github.com/tauri-apps/plugins-workspace/pull/1649) by [@ahqsoftwares](https://github.com/tauri-apps/plugins-workspace/../../ahqsoftwares)) Remove targetSdk from build.kts files as it is deprecated and will be removed from DSL v9.0 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.8] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.7] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.6] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[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] + +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -12,4 +71,9 @@ ## \[2.0.0-alpha.0] - [`fe79adb`](https://github.com/tauri-apps/plugins-workspace/commit/fe79adb5c7febd0e912efb5581264d671709fbb0)([#830](https://github.com/tauri-apps/plugins-workspace/pull/830)) Initial release. -commit/fe79adb5c7febd0e912efb5581264d671709fbb0)([#830](https://github.com/tauri-apps/plugins-workspace/pull/830)) Initial release. + commit/fe79adb5c7febd0e912efb5581264d671709fbb0)([#830](https://github.com/tauri-apps/plugins-workspace/pull/830)) Initial release. + 30]\(https://github.com/tauri-apps/plugins-workspace/pull/830)) Initial release. + commit/fe79adb5c7febd0e912efb5581264d671709fbb0)([#830](https://github.com/tauri-apps/plugins-workspace/pull/830)) Initial release. + . + commit/fe79adb5c7febd0e912efb5581264d671709fbb0)([#830](https://github.com/tauri-apps/plugins-workspace/pull/830)) Initial release. + ithub.com/tauri-apps/plugins-workspace/pull/830)) Initial release. diff --git a/plugins/nfc/Cargo.toml b/plugins/nfc/Cargo.toml index 507fc519..5cf4f6c4 100644 --- a/plugins/nfc/Cargo.toml +++ b/plugins/nfc/Cargo.toml @@ -1,18 +1,27 @@ [package] name = "tauri-plugin-nfc" -version = "2.0.0-beta.1" +version = "2.0.1" description = "Read and write NFC tags on Android and iOS." edition = { workspace = true } authors = { workspace = true } license = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-nfc" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] +targets = ["x86_64-linux-android"] + +[package.metadata.platforms.support] +windows = { level = "none", notes = "" } +linux = { level = "none", notes = "" } +macos = { level = "none", notes = "" } +android = { level = "full", notes = "" } +ios = { level = "full", notes = "" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } diff --git a/plugins/nfc/README.md b/plugins/nfc/README.md index cf846783..e8a9e156 100644 --- a/plugins/nfc/README.md +++ b/plugins/nfc/README.md @@ -2,6 +2,14 @@ Read and write NFC tags on Android and iOS. +| Platform | Supported | +| -------- | --------- | +| Linux | x | +| Windows | x | +| macOS | x | +| Android | ✓ | +| iOS | ✓ | + ## Install _This plugin requires a Rust version of at least **1.65**_ @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-nfc = "2.0.0-beta" +tauri-plugin-nfc = "2.0.0" # alternatively with Git: tauri-plugin-nfc = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -62,9 +70,9 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { scan, textRecord, write } from "@tauri-apps/plugin-nfc"; -await scan({ type: "tag", keepSessionAlive: true }); -await write([textRecord("Tauri is awesome!")]); +import { scan, textRecord, write } from '@tauri-apps/plugin-nfc' +await scan({ type: 'tag', keepSessionAlive: true }) +await write([textRecord('Tauri is awesome!')]) ``` ## Contributing diff --git a/plugins/nfc/SECURITY.md b/plugins/nfc/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/nfc/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/nfc/android/build.gradle.kts b/plugins/nfc/android/build.gradle.kts index 66eb414f..595f9173 100644 --- a/plugins/nfc/android/build.gradle.kts +++ b/plugins/nfc/android/build.gradle.kts @@ -5,11 +5,10 @@ plugins { android { namespace = "app.tauri.nfc" - compileSdk = 33 + compileSdk = 34 defaultConfig { - minSdk = 24 - targetSdk = 33 + minSdk = 24 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") diff --git a/plugins/nfc/android/src/main/AndroidManifest.xml b/plugins/nfc/android/src/main/AndroidManifest.xml index a2c208e2..7603a356 100644 --- a/plugins/nfc/android/src/main/AndroidManifest.xml +++ b/plugins/nfc/android/src/main/AndroidManifest.xml @@ -1,9 +1,4 @@ - - - - - diff --git a/plugins/nfc/android/src/main/java/NfcPlugin.kt b/plugins/nfc/android/src/main/java/NfcPlugin.kt index 5aa33732..4deaab44 100644 --- a/plugins/nfc/android/src/main/java/NfcPlugin.kt +++ b/plugins/nfc/android/src/main/java/NfcPlugin.kt @@ -141,7 +141,6 @@ sealed class ScanKind { addDataFilters(intentFilter, uri, mimeType) arrayOf(intentFilter) } - else -> null } } @@ -163,7 +162,6 @@ sealed class ScanKind { null } } - else -> null } } } diff --git a/plugins/nfc/src/api-iife.js b/plugins/nfc/api-iife.js similarity index 75% rename from plugins/nfc/src/api-iife.js rename to plugins/nfc/api-iife.js index 1828f2b6..5939782f 100644 --- a/plugins/nfc/src/api-iife.js +++ b/plugins/nfc/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_NFC__=function(n){"use strict";async function e(n,e={},t){return window.__TAURI_INTERNALS__.invoke(n,e,t)}"function"==typeof SuppressedError&&SuppressedError;const t=[84],r=[85];var o,c;function a(n,e,t,r){return{format:n,kind:"string"==typeof e?Array.from((new TextEncoder).encode(e)):e,id:"string"==typeof t?Array.from((new TextEncoder).encode(t)):t,payload:"string"==typeof r?Array.from((new TextEncoder).encode(r)):r}}n.TechKind=void 0,(o=n.TechKind||(n.TechKind={}))[o.IsoDep=0]="IsoDep",o[o.MifareClassic=1]="MifareClassic",o[o.MifareUltralight=2]="MifareUltralight",o[o.Ndef=3]="Ndef",o[o.NdefFormatable=4]="NdefFormatable",o[o.NfcA=5]="NfcA",o[o.NfcB=6]="NfcB",o[o.NfcBarcode=7]="NfcBarcode",o[o.NfcF=8]="NfcF",o[o.NfcV=9]="NfcV",n.NFCTypeNameFormat=void 0,(c=n.NFCTypeNameFormat||(n.NFCTypeNameFormat={}))[c.Empty=0]="Empty",c[c.NfcWellKnown=1]="NfcWellKnown",c[c.Media=2]="Media",c[c.AbsoluteURI=3]="AbsoluteURI",c[c.NfcExternal=4]="NfcExternal",c[c.Unknown=5]="Unknown",c[c.Unchanged=6]="Unchanged";const i=["","http://www.","https://www.","http://","https://","tel:","mailto:","ftp://anonymous:anonymous@","ftp://ftp.","ftps://","sftp://","smb://","nfs://","ftp://","dav://","news:","telnet://","imap:","rtsp://","urn:","pop:","sip:","sips:","tftp:","btspp://","btl2cap://","btgoep://","tcpobex://","irdaobex://","file://","urn:epc:id:","urn:epc:tag:","urn:epc:pat:","urn:epc:raw:","urn:epc:","urn:nfc:"];function f(n){const{type:e,...t}=n;return{[e]:t}}return n.RTD_TEXT=t,n.RTD_URI=r,n.isAvailable=async function(){return await e("plugin:nfc|is_available")},n.record=a,n.scan=async function(n,t){return await e("plugin:nfc|scan",{kind:f(n),...t})},n.textRecord=function(e,r,o="en"){const c=Array.from((new TextEncoder).encode(o+e));return c.unshift(o.length),a(n.NFCTypeNameFormat.NfcWellKnown,t,r||[],c)},n.uriRecord=function(e,t){return a(n.NFCTypeNameFormat.NfcWellKnown,r,t||[],function(n){let e="";i.slice(1).forEach((function(t){e&&"urn:"!==e||0!==n.indexOf(t)||(e=t)})),e||(e="");const t=Array.from((new TextEncoder).encode(n.slice(e.length))),r=i.indexOf(e);return t.unshift(r),t}(e))},n.write=async function(n,t){const{kind:r,...o}=t||{};return r&&(o.kind=f(r)),await e("plugin:nfc|write",{records:n,...o})},n}({});Object.defineProperty(window.__TAURI__,"nfc",{value:__TAURI_PLUGIN_NFC__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_NFC__=function(n){"use strict";async function e(n,e={},t){return window.__TAURI_INTERNALS__.invoke(n,e,t)}"function"==typeof SuppressedError&&SuppressedError;const t=[84],r=[85];var o,c;function a(n,e,t,r){return{format:n,kind:"string"==typeof e?Array.from((new TextEncoder).encode(e)):e,id:"string"==typeof t?Array.from((new TextEncoder).encode(t)):t,payload:"string"==typeof r?Array.from((new TextEncoder).encode(r)):r}}n.TechKind=void 0,(o=n.TechKind||(n.TechKind={}))[o.IsoDep=0]="IsoDep",o[o.MifareClassic=1]="MifareClassic",o[o.MifareUltralight=2]="MifareUltralight",o[o.Ndef=3]="Ndef",o[o.NdefFormatable=4]="NdefFormatable",o[o.NfcA=5]="NfcA",o[o.NfcB=6]="NfcB",o[o.NfcBarcode=7]="NfcBarcode",o[o.NfcF=8]="NfcF",o[o.NfcV=9]="NfcV",n.NFCTypeNameFormat=void 0,(c=n.NFCTypeNameFormat||(n.NFCTypeNameFormat={}))[c.Empty=0]="Empty",c[c.NfcWellKnown=1]="NfcWellKnown",c[c.Media=2]="Media",c[c.AbsoluteURI=3]="AbsoluteURI",c[c.NfcExternal=4]="NfcExternal",c[c.Unknown=5]="Unknown",c[c.Unchanged=6]="Unchanged";const i=["","http://www.","https://www.","http://","https://","tel:","mailto:","ftp://anonymous:anonymous@","ftp://ftp.","ftps://","sftp://","smb://","nfs://","ftp://","dav://","news:","telnet://","imap:","rtsp://","urn:","pop:","sip:","sips:","tftp:","btspp://","btl2cap://","btgoep://","tcpobex://","irdaobex://","file://","urn:epc:id:","urn:epc:tag:","urn:epc:pat:","urn:epc:raw:","urn:epc:","urn:nfc:"];function f(n){const{type:e,...t}=n;return{[e]:t}}return n.RTD_TEXT=t,n.RTD_URI=r,n.isAvailable=async function(){return await e("plugin:nfc|is_available")},n.record=a,n.scan=async function(n,t){return await e("plugin:nfc|scan",{kind:f(n),...t})},n.textRecord=function(e,r,o="en"){const c=Array.from((new TextEncoder).encode(o+e));return c.unshift(o.length),a(n.NFCTypeNameFormat.NfcWellKnown,t,r??[],c)},n.uriRecord=function(e,t){return a(n.NFCTypeNameFormat.NfcWellKnown,r,t??[],function(n){let e="";i.slice(1).forEach((function(t){0!==e.length&&"urn:"!==e||0!==n.indexOf(t)||(e=t)})),0===e.length&&(e="");const t=Array.from((new TextEncoder).encode(n.slice(e.length))),r=i.indexOf(e);return t.unshift(r),t}(e))},n.write=async function(n,t){const{kind:r,...o}=t??{};r&&(o.kind=f(r)),await e("plugin:nfc|write",{records:n,...o})},n}({});Object.defineProperty(window.__TAURI__,"nfc",{value:__TAURI_PLUGIN_NFC__})} diff --git a/plugins/nfc/build.rs b/plugins/nfc/build.rs index 1d234371..bdcd84bf 100644 --- a/plugins/nfc/build.rs +++ b/plugins/nfc/build.rs @@ -5,10 +5,16 @@ const COMMANDS: &[&str] = &["is_available", "write", "scan"]; fn main() { - tauri_plugin::Builder::new(COMMANDS) + let result = tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .android_path("android") .ios_path("ios") - .build(); + .try_build(); + + // when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build + if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) { + result.unwrap(); + } // TODO: triple check if this can reference the plugin's xml as it expects rn // TODO: This has to be configurable if we want to support handling nfc tags when the app is not open. diff --git a/plugins/nfc/guest-js/index.ts b/plugins/nfc/guest-js/index.ts index b16c8a5c..96f7a72d 100644 --- a/plugins/nfc/guest-js/index.ts +++ b/plugins/nfc/guest-js/index.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { invoke } from "@tauri-apps/api/core"; +import { invoke } from '@tauri-apps/api/core' -export const RTD_TEXT = [0x54]; // "T" -export const RTD_URI = [0x55]; // "U" +export const RTD_TEXT = [0x54] // "T" +export const RTD_URI = [0x55] // "U" export interface UriFilter { - scheme?: string; - host?: string; - pathPrefix?: string; + scheme?: string + host?: string + pathPrefix?: string } export enum TechKind { @@ -23,19 +23,19 @@ export enum TechKind { NfcB, NfcBarcode, NfcF, - NfcV, + NfcV } export type ScanKind = | { - type: "tag"; - uri?: UriFilter; - mimeType?: string; + type: 'tag' + uri?: UriFilter + mimeType?: string } | { - type: "ndef"; - uri?: UriFilter; - mimeType?: string; + type: 'ndef' + uri?: UriFilter + mimeType?: string /** * Each of the tech-lists is considered independently and the activity is considered a match if * any single tech-list matches the tag that was discovered. @@ -56,25 +56,25 @@ export type ScanKind = * ] * ``` */ - techLists?: TechKind[][]; - }; + techLists?: TechKind[][] + } export interface ScanOptions { - keepSessionAlive?: boolean; + keepSessionAlive?: boolean /** Message displayed in the UI. iOS only. */ - message?: string; + message?: string /** Message displayed in the UI when the message has been read. iOS only. */ - successMessage?: string; + successMessage?: string } export interface WriteOptions { - kind?: ScanKind; + kind?: ScanKind /** Message displayed in the UI when reading the tag. iOS only. */ - message?: string; + message?: string /** Message displayed in the UI when the tag has been read. iOS only. */ - successfulReadMessage?: string; + successfulReadMessage?: string /** Message displayed in the UI when the message has been written. iOS only. */ - successMessage?: string; + successMessage?: string } export enum NFCTypeNameFormat { @@ -84,133 +84,134 @@ export enum NFCTypeNameFormat { AbsoluteURI = 3, NfcExternal = 4, Unknown = 5, - Unchanged = 6, + Unchanged = 6 } export interface TagRecord { - tnf: NFCTypeNameFormat; - kind: number[]; - id: number[]; - payload: number[]; + tnf: NFCTypeNameFormat + kind: number[] + id: number[] + payload: number[] } export interface Tag { - id: number[]; - kind: string[]; - records: TagRecord[]; + id: number[] + kind: string[] + records: TagRecord[] } export interface NFCRecord { - format: NFCTypeNameFormat; - kind: number[]; - id: number[]; - payload: number[]; + format: NFCTypeNameFormat + kind: number[] + id: number[] + payload: number[] } export function record( format: NFCTypeNameFormat, kind: string | number[], id: string | number[], - payload: string | number[], + payload: string | number[] ): NFCRecord { return { format, kind: - typeof kind === "string" + typeof kind === 'string' ? Array.from(new TextEncoder().encode(kind)) : kind, - id: typeof id === "string" ? Array.from(new TextEncoder().encode(id)) : id, + id: typeof id === 'string' ? Array.from(new TextEncoder().encode(id)) : id, payload: - typeof payload === "string" + typeof payload === 'string' ? Array.from(new TextEncoder().encode(payload)) - : payload, - }; + : payload + } } export function textRecord( text: string, id?: string | number[], - language: string = "en", + language: string = 'en' ): NFCRecord { - const payload = Array.from(new TextEncoder().encode(language + text)); - payload.unshift(language.length); - return record(NFCTypeNameFormat.NfcWellKnown, RTD_TEXT, id || [], payload); + const payload = Array.from(new TextEncoder().encode(language + text)) + payload.unshift(language.length) + return record(NFCTypeNameFormat.NfcWellKnown, RTD_TEXT, id ?? [], payload) } const protocols = [ - "", - "http://www.", - "https://www.", - "http://", - "https://", - "tel:", - "mailto:", - "ftp://anonymous:anonymous@", - "ftp://ftp.", - "ftps://", - "sftp://", - "smb://", - "nfs://", - "ftp://", - "dav://", - "news:", - "telnet://", - "imap:", - "rtsp://", - "urn:", - "pop:", - "sip:", - "sips:", - "tftp:", - "btspp://", - "btl2cap://", - "btgoep://", - "tcpobex://", - "irdaobex://", - "file://", - "urn:epc:id:", - "urn:epc:tag:", - "urn:epc:pat:", - "urn:epc:raw:", - "urn:epc:", - "urn:nfc:", -]; + '', + 'http://www.', + 'https://www.', + 'http://', + 'https://', + 'tel:', + 'mailto:', + 'ftp://anonymous:anonymous@', + 'ftp://ftp.', + 'ftps://', + 'sftp://', + 'smb://', + 'nfs://', + 'ftp://', + 'dav://', + 'news:', + 'telnet://', + 'imap:', + 'rtsp://', + 'urn:', + 'pop:', + 'sip:', + 'sips:', + 'tftp:', + 'btspp://', + 'btl2cap://', + 'btgoep://', + 'tcpobex://', + 'irdaobex://', + 'file://', + 'urn:epc:id:', + 'urn:epc:tag:', + 'urn:epc:pat:', + 'urn:epc:raw:', + 'urn:epc:', + 'urn:nfc:' +] function encodeURI(uri: string): number[] { - let prefix = ""; + let prefix = '' protocols.slice(1).forEach(function (protocol) { - if ((!prefix || prefix === "urn:") && uri.indexOf(protocol) === 0) { - prefix = protocol; + if ( + (prefix.length === 0 || prefix === 'urn:') && + uri.indexOf(protocol) === 0 + ) { + prefix = protocol } - }); + }) - if (!prefix) { - prefix = ""; + if (prefix.length === 0) { + prefix = '' } - const encoded = Array.from( - new TextEncoder().encode(uri.slice(prefix.length)), - ); - const protocolCode = protocols.indexOf(prefix); + const encoded = Array.from(new TextEncoder().encode(uri.slice(prefix.length))) + const protocolCode = protocols.indexOf(prefix) // prepend protocol code - encoded.unshift(protocolCode); + encoded.unshift(protocolCode) - return encoded; + return encoded } export function uriRecord(uri: string, id?: string | number[]): NFCRecord { return record( NFCTypeNameFormat.NfcWellKnown, RTD_URI, - id || [], - encodeURI(uri), - ); + id ?? [], + encodeURI(uri) + ) } function mapScanKind(kind: ScanKind): Record { - const { type: scanKind, ...kindOptions } = kind; - return { [scanKind]: kindOptions }; + const { type: scanKind, ...kindOptions } = kind + return { [scanKind]: kindOptions } } /** @@ -229,12 +230,12 @@ function mapScanKind(kind: ScanKind): Record { */ export async function scan( kind: ScanKind, - options?: ScanOptions, + options?: ScanOptions ): Promise { - return await invoke("plugin:nfc|scan", { + return await invoke('plugin:nfc|scan', { kind: mapScanKind(kind), - ...options, - }); + ...options + }) } /** @@ -254,19 +255,19 @@ export async function scan( */ export async function write( records: NFCRecord[], - options?: WriteOptions, + options?: WriteOptions ): Promise { - const { kind, ...opts } = options || {}; + const { kind, ...opts } = options ?? {} if (kind) { // @ts-expect-error map the property - opts.kind = mapScanKind(kind); + opts.kind = mapScanKind(kind) } - return await invoke("plugin:nfc|write", { + await invoke('plugin:nfc|write', { records, - ...opts, - }); + ...opts + }) } export async function isAvailable(): Promise { - return await invoke("plugin:nfc|is_available"); + return await invoke('plugin:nfc|is_available') } diff --git a/plugins/nfc/ios/Package.swift b/plugins/nfc/ios/Package.swift index e8f1f19a..a028db7d 100644 --- a/plugins/nfc/ios/Package.swift +++ b/plugins/nfc/ios/Package.swift @@ -8,7 +8,8 @@ import PackageDescription let package = Package( name: "tauri-plugin-nfc", platforms: [ - .iOS(.v13) + .macOS(.v10_13), + .iOS(.v13), ], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. diff --git a/plugins/nfc/ios/Sources/NfcPlugin.swift b/plugins/nfc/ios/Sources/NfcPlugin.swift index 21bb2606..58d69a84 100644 --- a/plugins/nfc/ios/Sources/NfcPlugin.swift +++ b/plugins/nfc/ios/Sources/NfcPlugin.swift @@ -16,24 +16,24 @@ enum ScanKind: Decodable { struct ScanOptions: Decodable { let kind: ScanKind - let keepSessionAlive: Bool? - let message: String? - let successMessage: String? + var keepSessionAlive: Bool? + var message: String? + var successMessage: String? } struct NDEFRecord: Decodable { - let format: UInt8? - let kind: [UInt8]? - let identifier: [UInt8]? - let payload: [UInt8]? + var format: UInt8? + var kind: [UInt8]? + var identifier: [UInt8]? + var payload: [UInt8]? } struct WriteOptions: Decodable { - let kind: ScanKind? + var kind: ScanKind? let records: [NDEFRecord] - let message: String? - let successMessage: String? - let successfulReadMessage: String? + var message: String? + var successMessage: String? + var successfulReadMessage: String? } enum TagProcessMode { diff --git a/plugins/nfc/package.json b/plugins/nfc/package.json index aeb4ac2d..e9c9ec8b 100644 --- a/plugins/nfc/package.json +++ b/plugins/nfc/package.json @@ -1,10 +1,11 @@ { "name": "@tauri-apps/plugin-nfc", - "version": "2.0.0-beta.1", - "license": "MIT or APACHE-2.0", + "version": "2.0.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -23,10 +24,7 @@ "README.md", "LICENSE" ], - "devDependencies": { - "tslib": "2.6.0" - }, "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/nfc/permissions/autogenerated/reference.md b/plugins/nfc/permissions/autogenerated/reference.md index 9b972b2b..bf425832 100644 --- a/plugins/nfc/permissions/autogenerated/reference.md +++ b/plugins/nfc/permissions/autogenerated/reference.md @@ -1,26 +1,103 @@ -# Permissions +## Default Permission -## allow-is-available +This permission set configures what kind of +operations are available from the nfc plugin. + +#### Granted Permissions + +Checking if the NFC functionality is available +and scanning nearby tags is allowed. +Writing to tags needs to be manually enabled. + + + +- `allow-is-available` +- `allow-scan` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`nfc:allow-is-available` + + Enables the is_available command without any pre-configured scope. -## deny-is-available +
+ +`nfc:deny-is-available` + + Denies the is_available command without any pre-configured scope. -## allow-scan +
+ +`nfc:allow-scan` + + Enables the scan command without any pre-configured scope. -## deny-scan +
+ +`nfc:deny-scan` + + Denies the scan command without any pre-configured scope. -## allow-write +
+ +`nfc:allow-write` + + Enables the write command without any pre-configured scope. -## deny-write +
+ +`nfc:deny-write` + + Denies the write command without any pre-configured scope. +
diff --git a/plugins/nfc/permissions/default.toml b/plugins/nfc/permissions/default.toml new file mode 100644 index 00000000..d69c7f1b --- /dev/null +++ b/plugins/nfc/permissions/default.toml @@ -0,0 +1,15 @@ +"$schema" = "schemas/schema.json" + +[default] +description = """ +This permission set configures what kind of +operations are available from the nfc plugin. + +#### Granted Permissions + +Checking if the NFC functionality is available +and scanning nearby tags is allowed. +Writing to tags needs to be manually enabled. + +""" +permissions = ["allow-is-available", "allow-scan"] diff --git a/plugins/nfc/permissions/schemas/schema.json b/plugins/nfc/permissions/schemas/schema.json index 6da1bce6..5fe3743c 100644 --- a/plugins/nfc/permissions/schemas/schema.json +++ b/plugins/nfc/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,50 +251,83 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-is-available -> Enables the is_available command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-is-available" + "macOS" ] }, { - "description": "deny-is-available -> Denies the is_available command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-is-available" + "windows" ] }, { - "description": "allow-scan -> Enables the scan command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-scan" + "linux" ] }, { - "description": "deny-scan -> Denies the scan command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-scan" + "android" ] }, { - "description": "allow-write -> Enables the write command without any pre-configured scope.", + "description": "iOS.", "type": "string", "enum": [ - "allow-write" + "iOS" ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the is_available command without any pre-configured scope.", + "type": "string", + "const": "allow-is-available" }, { - "description": "deny-write -> Denies the write command without any pre-configured scope.", + "description": "Denies the is_available command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-write" - ] + "const": "deny-is-available" + }, + { + "description": "Enables the scan command without any pre-configured scope.", + "type": "string", + "const": "allow-scan" + }, + { + "description": "Denies the scan command without any pre-configured scope.", + "type": "string", + "const": "deny-scan" + }, + { + "description": "Enables the write command without any pre-configured scope.", + "type": "string", + "const": "allow-write" + }, + { + "description": "Denies the write command without any pre-configured scope.", + "type": "string", + "const": "deny-write" + }, + { + "description": "This permission set configures what kind of\noperations are available from the nfc plugin.\n\n#### Granted Permissions\n\nChecking if the NFC functionality is available\nand scanning nearby tags is allowed.\nWriting to tags needs to be manually enabled.\n\n", + "type": "string", + "const": "default" } ] } diff --git a/plugins/nfc/rollup.config.js b/plugins/nfc/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/nfc/rollup.config.js +++ b/plugins/nfc/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/nfc/src/lib.rs b/plugins/nfc/src/lib.rs index 28d5160d..d8708c1d 100644 --- a/plugins/nfc/src/lib.rs +++ b/plugins/nfc/src/lib.rs @@ -57,7 +57,7 @@ impl Nfc { } } -/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the nfc APIs. +/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the NFC APIs. pub trait NfcExt { fn nfc(&self) -> &Nfc; } @@ -71,7 +71,6 @@ impl> crate::NfcExt for T { /// Initializes the plugin. pub fn init() -> TauriPlugin { Builder::new("nfc") - .js_init_script(include_str!("api-iife.js").to_string()) .setup(|app, api| { #[cfg(target_os = "android")] let handle = api.register_android_plugin(PLUGIN_IDENTIFIER, "NfcPlugin")?; diff --git a/plugins/notification/.gitignore b/plugins/notification/.gitignore deleted file mode 100644 index 1b0b469d..00000000 --- a/plugins/notification/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/.tauri diff --git a/plugins/notification/CHANGELOG.md b/plugins/notification/CHANGELOG.md index 0e8731dc..e8dc3380 100644 --- a/plugins/notification/CHANGELOG.md +++ b/plugins/notification/CHANGELOG.md @@ -1,5 +1,87 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.5] + +- [`fb85e5dd`](https://github.com/tauri-apps/plugins-workspace/commit/fb85e5dd76688f3ae836890160f9bde843b70167) ([#1785](https://github.com/tauri-apps/plugins-workspace/pull/1785)) Update to tauri 2.0.0-rc.12. + +## \[2.0.0-rc.4] + +- [`3d301c65`](https://github.com/tauri-apps/plugins-workspace/commit/3d301c654e6f5e7f343e0e0cbb57648002e98f04) ([#1737](https://github.com/tauri-apps/plugins-workspace/pull/1737) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) The notification body is now optional on iOS to match the other platforms. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Use `PermissionState` from the `tauri` crate, which now also includes a "prompt with rationale" variant for Android (returned when your app must explain to the user why it needs the permission). +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) **Breaking change**: The permission type when using the API is now `'granted' | 'denied' | 'prompt' | 'prompt-with-rationale'` instead of `'granted' | 'denied' | 'default'` for consistency with Rust types. When using the `window.Notification` API the type is unchanged to match the Web API type. +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.2] + +- [`b9147758`](https://github.com/tauri-apps/plugins-workspace/commit/b914775898c2bee7ceb20bd17ee595005cd17a64) ([#1679](https://github.com/tauri-apps/plugins-workspace/pull/1679) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Explicitly set a minimum macOS version for the Swift package. + +## \[2.0.0-rc.1] + +### changes + +- [`6b079cfd`](https://github.com/tauri-apps/plugins-workspace/commit/6b079cfdd107c94abc2c7300f6af00bac3ff4040) ([#1649](https://github.com/tauri-apps/plugins-workspace/pull/1649) by [@ahqsoftwares](https://github.com/tauri-apps/plugins-workspace/../../ahqsoftwares)) Remove targetSdk from build.kts files as it is deprecated and will be removed from DSL v9.0 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.8] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.11] + +- [`725ff429`](https://github.com/tauri-apps/plugins-workspace/commit/725ff4295e56df9c30c099813bd64b96fe61b945) ([#1556](https://github.com/tauri-apps/plugins-workspace/pull/1556) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fixed an issue that caused the `notification` plugin's initialization script to cause the WebView on Windows to throw a `STATUS_ACCESS_VIOLATION` error on remote websites. + +## \[2.0.0-beta.7] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.6] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.8] + +- [`3779fb50`](https://github.com/tauri-apps/plugins-workspace/commit/3779fb50634fba4d7e7eb0bfecc2216349b9d64d) ([#1432](https://github.com/tauri-apps/plugins-workspace/pull/1432) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Use notify_rust from crates.io instead of local fork. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[2.0.0-beta.4] + +- [`326df688`](https://github.com/tauri-apps/plugins-workspace/commit/326df6883998d416fc0837583ed972854628bb52)([#1236](https://github.com/tauri-apps/plugins-workspace/pull/1236)) Fixes command argument parsing on iOS. + +## \[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. +- [`62ce5df`](https://github.com/tauri-apps/plugins-workspace/commit/62ce5df52ca3c86786e711ef193a206e7b0dc0cf)([#1096](https://github.com/tauri-apps/plugins-workspace/pull/1096)) Fix development mode check to set the app ID on macOS. + +## \[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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -53,4 +135,14 @@ - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ithub.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! + workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + ithub.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! + /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! + com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/notification/Cargo.toml b/plugins/notification/Cargo.toml index eb5e6a86..02e5cce8 100644 --- a/plugins/notification/Cargo.toml +++ b/plugins/notification/Cargo.toml @@ -1,20 +1,28 @@ [package] name = "tauri-plugin-notification" -version = "2.0.0-beta.1" +version = "2.0.1" description = "Send desktop and mobile notifications on your Tauri application." edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-notification" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] -targets = [ "x86_64-unknown-linux-gnu", "x86_64-linux-android" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] +targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "full", notes = "" } +ios = { level = "full", notes = "" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -23,34 +31,24 @@ tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } rand = "0.8" -time = { version = "0.3", features = [ "serde", "parsing", "formatting" ] } -url = { version = "2", features = [ "serde" ] } +time = { version = "0.3", features = ["serde", "parsing", "formatting"] } +url = { version = "2", features = ["serde"] } serde_repr = "0.1" +[target.'cfg(target_os = "ios")'.dependencies] +tauri = { workspace = true, features = ["wry"] } + [target."cfg(windows)".dependencies] -win7-notifications = { version = "0.3.1", optional = true } +win7-notifications = { version = "0.4.5", optional = true } windows-version = { version = "0.1", optional = true } -[target."cfg(all(unix, not(target_os = \"macos\")))".dependencies] -lazy_static = { version = "1", optional = true } -image = { version = "0.24", optional = true } -zbus = { version = "4", optional = true } -log = "0.4" -env_logger = { version = "0.10", optional = true } - -[target."cfg(target_os=\"macos\")".dependencies] -mac-notification-sys = "0.6" -chrono = { version = "0.4", optional = true } - -[target."cfg(target_os=\"windows\")".dependencies] -winrt-notification = { package = "tauri-winrt-notification", version = "0.1" } +[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] +notify-rust = "4.11" [dev-dependencies] -color-backtrace = "0.5" +color-backtrace = "0.6" ctor = "0.2" -maplit = "1.0" +maplit = "1" [features] -default = [ "zbus", "async" ] -async = [ ] -windows7-compat = [ "win7-notifications", "windows-version" ] +windows7-compat = ["win7-notifications", "windows-version"] diff --git a/plugins/notification/README.md b/plugins/notification/README.md index 8d1f9637..e75ce540 100644 --- a/plugins/notification/README.md +++ b/plugins/notification/README.md @@ -2,9 +2,17 @@ Send message notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ✓ | +| iOS | ✓ | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-notification = "2.0.0-beta" +tauri-plugin-notification = "2.0.0" # alternatively with Git: tauri-plugin-notification = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -57,10 +65,43 @@ fn main() { } ``` +Then you need to add the permissions to your capabilities file: + +`src-tauri/capabilities/main.json` + +```json +{ + ... + "permissions": [ + ... + "notification:default" + ], + ... +} +``` + Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript +import { + isPermissionGranted, + requestPermission, + sendNotification +} from '@tauri-apps/plugin-notification' + +async function checkPermission() { + if (!(await isPermissionGranted())) { + return (await requestPermission()) === 'granted' + } + return true +} +export async function enqueueNotification(title, body) { + if (!(await checkPermission())) { + return + } + sendNotification({ title, body }) +} ``` ## Contributing diff --git a/plugins/notification/SECURITY.md b/plugins/notification/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/notification/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/notification/android/build.gradle.kts b/plugins/notification/android/build.gradle.kts index 6fe1c46a..0ac990e4 100644 --- a/plugins/notification/android/build.gradle.kts +++ b/plugins/notification/android/build.gradle.kts @@ -5,11 +5,10 @@ plugins { android { namespace = "app.tauri.notification" - compileSdk = 33 + compileSdk = 34 defaultConfig { - minSdk = 24 - targetSdk = 33 + minSdk = 24 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") diff --git a/plugins/notification/android/src/main/java/NotificationSchedule.kt b/plugins/notification/android/src/main/java/NotificationSchedule.kt index 459461b8..316ff909 100644 --- a/plugins/notification/android/src/main/java/NotificationSchedule.kt +++ b/plugins/notification/android/src/main/java/NotificationSchedule.kt @@ -135,7 +135,6 @@ internal class NotificationScheduleSerializer @JvmOverloads constructor(t: Class jgen.writeEndObject() } - else -> {} } jgen.writeEndObject() diff --git a/plugins/notification/api-iife.js b/plugins/notification/api-iife.js new file mode 100644 index 00000000..1f961120 --- /dev/null +++ b/plugins/notification/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_NOTIFICATION__=function(i){"use strict";function t(i,t,n,e){if("a"===n&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?i!==t||!e:!t.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?e:"a"===n?e.call(i):e?e.value:t.get(i)}function n(i,t,n,e,o){if("function"==typeof t?i!==t||!o:!t.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(i,n),n}var e,o,a,r,c,s;"function"==typeof SuppressedError&&SuppressedError;class l{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,e.set(this,(()=>{})),o.set(this,0),a.set(this,{}),this.id=function(i,t=!1){return window.__TAURI_INTERNALS__.transformCallback(i,t)}((({message:i,id:r})=>{if(r===t(this,o,"f")){n(this,o,r+1),t(this,e,"f").call(this,i);const c=Object.keys(t(this,a,"f"));if(c.length>0){let i=r+1;for(const n of c.sort()){if(parseInt(n)!==i)break;{const o=t(this,a,"f")[n];delete t(this,a,"f")[n],t(this,e,"f").call(this,o),i+=1}}n(this,o,i)}}else t(this,a,"f")[r.toString()]=i}))}set onmessage(i){n(this,e,i)}get onmessage(){return t(this,e,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}e=new WeakMap,o=new WeakMap,a=new WeakMap;class u{constructor(i,t,n){this.plugin=i,this.event=t,this.channelId=n}async unregister(){return d(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}}async function f(i,t,n){const e=new l;return e.onmessage=n,d(`plugin:${i}|register_listener`,{event:t,handler:e}).then((()=>new u(i,t,e.id)))}async function d(i,t={},n){return window.__TAURI_INTERNALS__.invoke(i,t,n)}i.ScheduleEvery=void 0,(r=i.ScheduleEvery||(i.ScheduleEvery={})).Year="year",r.Month="month",r.TwoWeeks="twoWeeks",r.Week="week",r.Day="day",r.Hour="hour",r.Minute="minute",r.Second="second";return i.Importance=void 0,(c=i.Importance||(i.Importance={}))[c.None=0]="None",c[c.Min=1]="Min",c[c.Low=2]="Low",c[c.Default=3]="Default",c[c.High=4]="High",i.Visibility=void 0,(s=i.Visibility||(i.Visibility={}))[s.Secret=-1]="Secret",s[s.Private=0]="Private",s[s.Public=1]="Public",i.Schedule=class{static at(i,t=!1,n=!1){return{at:{date:i,repeating:t,allowWhileIdle:n},interval:void 0,every:void 0}}static interval(i,t=!1){return{at:void 0,interval:{interval:i,allowWhileIdle:t},every:void 0}}static every(i,t,n=!1){return{at:void 0,interval:void 0,every:{interval:i,count:t,allowWhileIdle:n}}}},i.active=async function(){return await d("plugin:notification|get_active")},i.cancel=async function(i){await d("plugin:notification|cancel",{notifications:i})},i.cancelAll=async function(){await d("plugin:notification|cancel")},i.channels=async function(){return await d("plugin:notification|listChannels")},i.createChannel=async function(i){await d("plugin:notification|create_channel",{...i})},i.isPermissionGranted=async function(){return"default"!==window.Notification.permission?await Promise.resolve("granted"===window.Notification.permission):await d("plugin:notification|is_permission_granted")},i.onAction=async function(i){return await f("notification","actionPerformed",i)},i.onNotificationReceived=async function(i){return await f("notification","notification",i)},i.pending=async function(){return await d("plugin:notification|get_pending")},i.registerActionTypes=async function(i){await d("plugin:notification|register_action_types",{types:i})},i.removeActive=async function(i){await d("plugin:notification|remove_active",{notifications:i})},i.removeAllActive=async function(){await d("plugin:notification|remove_active")},i.removeChannel=async function(i){await d("plugin:notification|delete_channel",{id:i})},i.requestPermission=async function(){return await window.Notification.requestPermission()},i.sendNotification=function(i){"string"==typeof i?new window.Notification(i):new window.Notification(i.title,i)},i}({});Object.defineProperty(window.__TAURI__,"notification",{value:__TAURI_PLUGIN_NOTIFICATION__})} diff --git a/plugins/notification/build.rs b/plugins/notification/build.rs index 26d1f96e..4b24c755 100644 --- a/plugins/notification/build.rs +++ b/plugins/notification/build.rs @@ -2,18 +2,34 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -const COMMANDS: &[&str] = &["notify", "request_permission", "is_permission_granted"]; +const COMMANDS: &[&str] = &[ + "notify", + "request_permission", + "is_permission_granted", + "register_action_types", + "register_listener", + "cancel", + "get_pending", + "remove_active", + "get_active", + "check_permissions", + "show", + "batch", + "list_channels", + "delete_channel", + "create_channel", + "permission_state", +]; fn main() { - if let Err(error) = tauri_plugin::Builder::new(COMMANDS) + let result = tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .android_path("android") .ios_path("ios") - .try_build() - { - println!("{error:#}"); - // when building documentation for Android the plugin build result is irrelevant to the crate itself - if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) { - std::process::exit(1); - } + .try_build(); + + // when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build + if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) { + result.unwrap(); } } diff --git a/plugins/notification/guest-js/index.ts b/plugins/notification/guest-js/index.ts index b7bac7d7..9f81a1e1 100644 --- a/plugins/notification/guest-js/index.ts +++ b/plugins/notification/guest-js/index.ts @@ -11,9 +11,11 @@ import { invoke, - PluginListener, - addPluginListener, -} from "@tauri-apps/api/core"; + type PluginListener, + addPluginListener +} from '@tauri-apps/api/core' + +export type { PermissionState } from '@tauri-apps/api/core' /** * Options to send a notification. @@ -24,54 +26,54 @@ interface Options { /** * The notification identifier to reference this object later. Must be a 32-bit integer. */ - id?: number; + id?: number /** * Identifier of the {@link Channel} that deliveres this notification. * * If the channel does not exist, the notification won't fire. * Make sure the channel exists with {@link listChannels} and {@link createChannel}. */ - channelId?: string; + channelId?: string /** * Notification title. */ - title: string; + title: string /** * Optional notification body. * */ - body?: string; + body?: string /** * Schedule this notification to fire on a later time or a fixed interval. */ - schedule?: Schedule; + schedule?: Schedule /** * Multiline text. * Changes the notification style to big text. * Cannot be used with `inboxLines`. */ - largeBody?: string; + largeBody?: string /** * Detail text for the notification with `largeBody`, `inboxLines` or `groupSummary`. */ - summary?: string; + summary?: string /** * Defines an action type for this notification. */ - actionTypeId?: string; + actionTypeId?: string /** * Identifier used to group multiple notifications. * * https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent/1649872-threadidentifier */ - group?: string; + group?: string /** * Instructs the system that this notification is the summary of a group on Android. */ - groupSummary?: boolean; + groupSummary?: boolean /** * The sound resource name. Only available on mobile. */ - sound?: string; + sound?: string /** * List of lines to add to the notification. * Changes the notification style to inbox. @@ -79,31 +81,31 @@ interface Options { * * Only supports up to 5 lines. */ - inboxLines?: string[]; + inboxLines?: string[] /** * Notification icon. * * On Android the icon must be placed in the app's `res/drawable` folder. */ - icon?: string; + icon?: string /** * Notification large icon (Android). * * The icon must be placed in the app's `res/drawable` folder. */ - largeIcon?: string; + largeIcon?: string /** * Icon color on Android. */ - iconColor?: string; + iconColor?: string /** * Notification attachments. */ - attachments?: Attachment[]; + attachments?: Attachment[] /** * Extra payload to store in the notification. */ - extra?: { [key: string]: unknown }; + extra?: Record /** * If true, the notification cannot be dismissed by the user on Android. * @@ -111,29 +113,29 @@ interface Options { * It is typically used to indicate a background task that is pending (e.g. a file download) * or the user is engaged with (e.g. playing music). */ - ongoing?: boolean; + ongoing?: boolean /** * Automatically cancel the notification when the user clicks on it. */ - autoCancel?: boolean; + autoCancel?: boolean /** * Changes the notification presentation to be silent on iOS (no badge, no sound, not listed). */ - silent?: boolean; + silent?: boolean /** * Notification visibility. */ - visibility?: Visibility; + visibility?: Visibility /** * Sets the number of items this notification represents on Android. */ - number?: number; + number?: number } -type ScheduleInterval = { - year?: number; - month?: number; - day?: number; +interface ScheduleInterval { + year?: number + month?: number + day?: number /** * 1 - Sunday * 2 - Monday @@ -143,77 +145,79 @@ type ScheduleInterval = { * 6 - Friday * 7 - Saturday */ - weekday?: number; - hour?: number; - minute?: number; - second?: number; -}; + weekday?: number + hour?: number + minute?: number + second?: number +} enum ScheduleEvery { - Year = "year", - Month = "month", - TwoWeeks = "twoWeeks", - Week = "week", - Day = "day", - Hour = "hour", - Minute = "minute", + Year = 'year', + Month = 'month', + TwoWeeks = 'twoWeeks', + Week = 'week', + Day = 'day', + Hour = 'hour', + Minute = 'minute', /** * Not supported on iOS. */ - Second = "second", + Second = 'second' } class Schedule { at: | { - date: Date; - repeating: boolean; - allowWhileIdle: boolean; + date: Date + repeating: boolean + allowWhileIdle: boolean } - | undefined; + | undefined + interval: | { - interval: ScheduleInterval; - allowWhileIdle: boolean; + interval: ScheduleInterval + allowWhileIdle: boolean } - | undefined; + | undefined + every: | { - interval: ScheduleEvery; - count: number; - allowWhileIdle: boolean; + interval: ScheduleEvery + count: number + allowWhileIdle: boolean } - | undefined; + | undefined static at(date: Date, repeating = false, allowWhileIdle = false): Schedule { return { at: { date, repeating, allowWhileIdle }, interval: undefined, - every: undefined, - }; + every: undefined + } } static interval( interval: ScheduleInterval, - allowWhileIdle = false, + allowWhileIdle = false ): Schedule { return { at: undefined, interval: { interval, allowWhileIdle }, - every: undefined, - }; + every: undefined + } } static every( kind: ScheduleEvery, count: number, - allowWhileIdle = false, + allowWhileIdle = false ): Schedule { return { at: undefined, interval: undefined, - every: { interval: kind, count, allowWhileIdle }, - }; + every: { interval: kind, count, allowWhileIdle } + } } } @@ -222,58 +226,58 @@ class Schedule { */ interface Attachment { /** Attachment identifier. */ - id: string; + id: string /** Attachment URL. Accepts the `asset` and `file` protocols. */ - url: string; + url: string } interface Action { - id: string; - title: string; - requiresAuthentication?: boolean; - foreground?: boolean; - destructive?: boolean; - input?: boolean; - inputButtonTitle?: string; - inputPlaceholder?: string; + id: string + title: string + requiresAuthentication?: boolean + foreground?: boolean + destructive?: boolean + input?: boolean + inputButtonTitle?: string + inputPlaceholder?: string } interface ActionType { /** * The identifier of this action type */ - id: string; + id: string /** * The list of associated actions */ - actions: Action[]; - hiddenPreviewsBodyPlaceholder?: string; - customDismissAction?: boolean; - allowInCarPlay?: boolean; - hiddenPreviewsShowTitle?: boolean; - hiddenPreviewsShowSubtitle?: boolean; + actions: Action[] + hiddenPreviewsBodyPlaceholder?: string + customDismissAction?: boolean + allowInCarPlay?: boolean + hiddenPreviewsShowTitle?: boolean + hiddenPreviewsShowSubtitle?: boolean } interface PendingNotification { - id: number; - title?: string; - body?: string; - schedule: Schedule; + id: number + title?: string + body?: string + schedule: Schedule } interface ActiveNotification { - id: number; - tag?: string; - title?: string; - body?: string; - group?: string; - groupSummary: boolean; - data: Record; - extra: Record; - attachments: Attachment[]; - actionTypeId?: string; - schedule?: Schedule; - sound?: string; + id: number + tag?: string + title?: string + body?: string + group?: string + groupSummary: boolean + data: Record + extra: Record + attachments: Attachment[] + actionTypeId?: string + schedule?: Schedule + sound?: string } enum Importance { @@ -281,30 +285,27 @@ enum Importance { Min, Low, Default, - High, + High } enum Visibility { Secret = -1, Private, - Public, + Public } interface Channel { - id: string; - name: string; - description?: string; - sound?: string; - lights?: boolean; - lightColor?: string; - vibration?: boolean; - importance?: Importance; - visibility?: Visibility; + id: string + name: string + description?: string + sound?: string + lights?: boolean + lightColor?: string + vibration?: boolean + importance?: Importance + visibility?: Visibility } -/** Possible permission values. */ -type Permission = "granted" | "denied" | "default"; - /** * Checks if the permission to send notifications is granted. * @example @@ -316,10 +317,10 @@ type Permission = "granted" | "denied" | "default"; * @since 2.0.0 */ async function isPermissionGranted(): Promise { - if (window.Notification.permission !== "default") { - return Promise.resolve(window.Notification.permission === "granted"); + if (window.Notification.permission !== 'default') { + return await Promise.resolve(window.Notification.permission === 'granted') } - return invoke("plugin:notification|is_permission_granted"); + return await invoke('plugin:notification|is_permission_granted') } /** @@ -338,8 +339,8 @@ async function isPermissionGranted(): Promise { * * @since 2.0.0 */ -async function requestPermission(): Promise { - return window.Notification.requestPermission(); +async function requestPermission(): Promise { + return await window.Notification.requestPermission() } /** @@ -361,12 +362,10 @@ async function requestPermission(): Promise { * @since 2.0.0 */ function sendNotification(options: Options | string): void { - if (typeof options === "string") { - // eslint-disable-next-line no-new - new window.Notification(options); + if (typeof options === 'string') { + new window.Notification(options) } else { - // eslint-disable-next-line no-new - new window.Notification(options.title, options); + new window.Notification(options.title, options) } } @@ -390,7 +389,7 @@ function sendNotification(options: Options | string): void { * @since 2.0.0 */ async function registerActionTypes(types: ActionType[]): Promise { - return invoke("plugin:notification|register_action_types", { types }); + await invoke('plugin:notification|register_action_types', { types }) } /** @@ -407,7 +406,7 @@ async function registerActionTypes(types: ActionType[]): Promise { * @since 2.0.0 */ async function pending(): Promise { - return invoke("plugin:notification|get_pending"); + return await invoke('plugin:notification|get_pending') } /** @@ -424,7 +423,7 @@ async function pending(): Promise { * @since 2.0.0 */ async function cancel(notifications: number[]): Promise { - return invoke("plugin:notification|cancel", { notifications }); + await invoke('plugin:notification|cancel', { notifications }) } /** @@ -441,7 +440,7 @@ async function cancel(notifications: number[]): Promise { * @since 2.0.0 */ async function cancelAll(): Promise { - return invoke("plugin:notification|cancel"); + await invoke('plugin:notification|cancel') } /** @@ -458,7 +457,7 @@ async function cancelAll(): Promise { * @since 2.0.0 */ async function active(): Promise { - return invoke("plugin:notification|get_active"); + return await invoke('plugin:notification|get_active') } /** @@ -475,9 +474,9 @@ async function active(): Promise { * @since 2.0.0 */ async function removeActive( - notifications: { id: number; tag?: string }[], + notifications: Array<{ id: number; tag?: string }> ): Promise { - return invoke("plugin:notification|remove_active", { notifications }); + await invoke('plugin:notification|remove_active', { notifications }) } /** @@ -494,7 +493,7 @@ async function removeActive( * @since 2.0.0 */ async function removeAllActive(): Promise { - return invoke("plugin:notification|remove_active"); + await invoke('plugin:notification|remove_active') } /** @@ -518,7 +517,7 @@ async function removeAllActive(): Promise { * @since 2.0.0 */ async function createChannel(channel: Channel): Promise { - return invoke("plugin:notification|create_channel", { ...channel }); + await invoke('plugin:notification|create_channel', { ...channel }) } /** @@ -535,7 +534,7 @@ async function createChannel(channel: Channel): Promise { * @since 2.0.0 */ async function removeChannel(id: string): Promise { - return invoke("plugin:notification|delete_channel", { id }); + await invoke('plugin:notification|delete_channel', { id }) } /** @@ -552,32 +551,31 @@ async function removeChannel(id: string): Promise { * @since 2.0.0 */ async function channels(): Promise { - return invoke("plugin:notification|listChannels"); + return await invoke('plugin:notification|listChannels') } async function onNotificationReceived( - cb: (notification: Options) => void, + cb: (notification: Options) => void ): Promise { - return addPluginListener("notification", "notification", cb); + return await addPluginListener('notification', 'notification', cb) } async function onAction( - cb: (notification: Options) => void, + cb: (notification: Options) => void ): Promise { - return addPluginListener("notification", "actionPerformed", cb); + return await addPluginListener('notification', 'actionPerformed', cb) } export type { Attachment, Options, - Permission, Action, ActionType, PendingNotification, ActiveNotification, Channel, - ScheduleInterval, -}; + ScheduleInterval +} export { Importance, @@ -598,5 +596,5 @@ export { onNotificationReceived, onAction, Schedule, - ScheduleEvery, -}; + ScheduleEvery +} diff --git a/plugins/notification/guest-js/init.ts b/plugins/notification/guest-js/init.ts index 85c593fc..42d65fd9 100644 --- a/plugins/notification/guest-js/init.ts +++ b/plugins/notification/guest-js/init.ts @@ -2,82 +2,89 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { invoke } from "@tauri-apps/api/core"; -import type { Options } from "./index"; +import { invoke } from '@tauri-apps/api/core' +import type { PermissionState } from '@tauri-apps/api/core' +import type { Options } from './index' +;(function () { + let permissionSettable = false + let permissionValue = 'default' -(function () { - let permissionSettable = false; - let permissionValue = "default"; - - function isPermissionGranted() { - if (window.Notification.permission !== "default") { - return Promise.resolve(window.Notification.permission === "granted"); + async function isPermissionGranted(): Promise { + // @ts-expect-error __TEMPLATE_windows__ will be replaced in rust before it's injected. + if (window.Notification.permission !== 'default' || __TEMPLATE_windows__) { + return await Promise.resolve(window.Notification.permission === 'granted') } - return invoke("plugin:notification|is_permission_granted"); + return await invoke('plugin:notification|is_permission_granted') } - function setNotificationPermission(value: "granted" | "denied" | "default") { - permissionSettable = true; + function setNotificationPermission(value: NotificationPermission): void { + permissionSettable = true // @ts-expect-error we can actually set this value on the webview - window.Notification.permission = value; - permissionSettable = false; + window.Notification.permission = value + permissionSettable = false } - function requestPermission() { - return invoke<"prompt" | "default" | "granted" | "denied">( - "plugin:notification|request_permission", + async function requestPermission(): Promise { + return await invoke( + 'plugin:notification|request_permission' ).then((permission) => { setNotificationPermission( - permission === "prompt" ? "default" : permission, - ); - return permission; - }); + permission === 'prompt' || permission === 'prompt-with-rationale' + ? 'default' + : permission + ) + return permission + }) } - function sendNotification(options: string | Options) { - if (typeof options === "object") { - Object.freeze(options); + async function sendNotification(options: string | Options): Promise { + if (typeof options === 'object') { + Object.freeze(options) } - return invoke("plugin:notification|notify", { + await invoke('plugin:notification|notify', { options: - typeof options === "string" + typeof options === 'string' ? { - title: options, + title: options } - : options, - }); + : options + }) } // @ts-expect-error unfortunately we can't implement the whole type, so we overwrite it with our own version window.Notification = function (title, options) { - const opts = options || {}; - sendNotification( + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const opts = options || {} + void sendNotification( + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument Object.assign(opts, { - title, - }), - ); - }; + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + title + }) + ) + } // @ts-expect-error tauri does not have sync IPC :( - window.Notification.requestPermission = requestPermission; + window.Notification.requestPermission = requestPermission - Object.defineProperty(window.Notification, "permission", { + Object.defineProperty(window.Notification, 'permission', { enumerable: true, get: () => permissionValue, set: (v) => { if (!permissionSettable) { - throw new Error("Readonly property"); + throw new Error('Readonly property') } - permissionValue = v; - }, - }); + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + permissionValue = v + } + }) - isPermissionGranted().then(function (response) { + void isPermissionGranted().then(function (response) { if (response === null) { - setNotificationPermission("default"); + setNotificationPermission('default') } else { - setNotificationPermission(response ? "granted" : "denied"); + setNotificationPermission(response ? 'granted' : 'denied') } - }); -})(); + }) +})() diff --git a/plugins/notification/ios/Package.swift b/plugins/notification/ios/Package.swift index 9b681869..bbd6df9e 100644 --- a/plugins/notification/ios/Package.swift +++ b/plugins/notification/ios/Package.swift @@ -3,33 +3,32 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT - - import PackageDescription let package = Package( - name: "tauri-plugin-notification", - platforms: [ - .iOS(.v13), - ], - products: [ - // Products define the executables and libraries a package produces, and make them visible to other packages. - .library( - name: "tauri-plugin-notification", - type: .static, - targets: ["tauri-plugin-notification"]), - ], - dependencies: [ - .package(name: "Tauri", path: "../.tauri/tauri-api") - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages this package depends on. - .target( - name: "tauri-plugin-notification", - dependencies: [ - .byName(name: "Tauri") - ], - path: "Sources") - ] + name: "tauri-plugin-notification", + platforms: [ + .macOS(.v10_13), + .iOS(.v13), + ], + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "tauri-plugin-notification", + type: .static, + targets: ["tauri-plugin-notification"]) + ], + dependencies: [ + .package(name: "Tauri", path: "../.tauri/tauri-api") + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "tauri-plugin-notification", + dependencies: [ + .byName(name: "Tauri") + ], + path: "Sources") + ] ) diff --git a/plugins/notification/ios/Sources/Notification.swift b/plugins/notification/ios/Sources/Notification.swift index 0f572aa9..adba05ec 100644 --- a/plugins/notification/ios/Sources/Notification.swift +++ b/plugins/notification/ios/Sources/Notification.swift @@ -32,9 +32,11 @@ func makeNotificationContent(_ notification: Notification) throws -> UNNotificat let content = UNMutableNotificationContent() content.title = NSString.localizedUserNotificationString( forKey: notification.title, arguments: nil) - content.body = NSString.localizedUserNotificationString( - forKey: notification.body, - arguments: nil) + if let body = notification.body { + content.body = NSString.localizedUserNotificationString( + forKey: body, + arguments: nil) + } content.userInfo = [ "__EXTRA__": notification.extra as Any, diff --git a/plugins/notification/ios/Sources/NotificationCategory.swift b/plugins/notification/ios/Sources/NotificationCategory.swift index a5d4eea6..f796e03a 100644 --- a/plugins/notification/ios/Sources/NotificationCategory.swift +++ b/plugins/notification/ios/Sources/NotificationCategory.swift @@ -40,7 +40,7 @@ func makeActions(_ actions: [Action]) -> [UNNotificationAction] { for action in actions { var newAction: UNNotificationAction - if action.input { + if action.input ?? false { if action.inputButtonTitle != nil { newAction = UNTextInputNotificationAction( identifier: action.id, @@ -66,30 +66,30 @@ func makeActions(_ actions: [Action]) -> [UNNotificationAction] { } func makeActionOptions(_ action: Action) -> UNNotificationActionOptions { - if action.foreground { + if action.foreground ?? false { return .foreground } - if action.destructive { + if action.destructive ?? false { return .destructive } - if action.requiresAuthentication { + if action.requiresAuthentication ?? false { return .authenticationRequired } return UNNotificationActionOptions(rawValue: 0) } func makeCategoryOptions(_ type: ActionType) -> UNNotificationCategoryOptions { - if type.customDismissAction { + if type.customDismissAction ?? false { return .customDismissAction } - if type.allowInCarPlay { + if type.allowInCarPlay ?? false { return .allowInCarPlay } - if type.hiddenPreviewsShowTitle { + if type.hiddenPreviewsShowTitle ?? false { return .hiddenPreviewsShowTitle } - if type.hiddenPreviewsShowSubtitle { + if type.hiddenPreviewsShowSubtitle ?? false { return .hiddenPreviewsShowSubtitle } diff --git a/plugins/notification/ios/Sources/NotificationHandler.swift b/plugins/notification/ios/Sources/NotificationHandler.swift index 83ac0ae4..1bf134b6 100644 --- a/plugins/notification/ios/Sources/NotificationHandler.swift +++ b/plugins/notification/ios/Sources/NotificationHandler.swift @@ -34,7 +34,7 @@ public class NotificationHandler: NSObject, NotificationHandlerProtocol { try? self.plugin?.trigger("notification", data: notificationData) if let options = notificationsMap[notification.request.identifier] { - if options.silent { + if options.silent ?? false { return UNNotificationPresentationOptions.init(rawValue: 0) } } diff --git a/plugins/notification/ios/Sources/NotificationPlugin.swift b/plugins/notification/ios/Sources/NotificationPlugin.swift index 53c9788e..6d8391bc 100644 --- a/plugins/notification/ios/Sources/NotificationPlugin.swift +++ b/plugins/notification/ios/Sources/NotificationPlugin.swift @@ -34,13 +34,13 @@ enum ScheduleEveryKind: String, Decodable { } struct ScheduleInterval: Decodable { - let year: Int? - let month: Int? - let day: Int? - let weekday: Int? - let hour: Int? - let minute: Int? - let second: Int? + var year: Int? + var month: Int? + var day: Int? + var weekday: Int? + var hour: Int? + var minute: Int? + var second: Int? } enum NotificationSchedule: Decodable { @@ -64,16 +64,16 @@ struct NotificationAttachment: Codable { struct Notification: Decodable { let id: Int - var title: String = "" - var body: String = "" - var extra: [String: String] = [:] - let schedule: NotificationSchedule? - let attachments: [NotificationAttachment]? - let sound: String? - let group: String? - let actionTypeId: String? - let summary: String? - var silent = false + var title: String + var body: String? + var extra: [String: String]? + var schedule: NotificationSchedule? + var attachments: [NotificationAttachment]? + var sound: String? + var group: String? + var actionTypeId: String? + var summary: String? + var silent: Bool? } struct RemoveActiveNotification: Decodable { @@ -126,23 +126,23 @@ struct CancelArgs: Decodable { struct Action: Decodable { let id: String let title: String - var requiresAuthentication: Bool = false - var foreground: Bool = false - var destructive: Bool = false - var input: Bool = false - let inputButtonTitle: String? - let inputPlaceholder: String? + var requiresAuthentication: Bool? + var foreground: Bool? + var destructive: Bool? + var input: Bool? + var inputButtonTitle: String? + var inputPlaceholder: String? } struct ActionType: Decodable { let id: String let actions: [Action] - let hiddenPreviewsBodyPlaceholder: String? - var customDismissAction = false - var allowInCarPlay = false - var hiddenPreviewsShowTitle = false - var hiddenPreviewsShowSubtitle = false - let hiddenBodyPlaceholder: String? + var hiddenPreviewsBodyPlaceholder: String? + var customDismissAction: Bool? + var allowInCarPlay: Bool? + var hiddenPreviewsShowTitle: Bool? + var hiddenPreviewsShowSubtitle: Bool? + var hiddenBodyPlaceholder: String? } struct RegisterActionTypesArgs: Decodable { diff --git a/plugins/notification/package.json b/plugins/notification/package.json index cc16ce62..37bb5f97 100644 --- a/plugins/notification/package.json +++ b/plugins/notification/package.json @@ -1,10 +1,11 @@ { "name": "@tauri-apps/plugin-notification", - "version": "2.0.0-beta.1", - "license": "MIT or APACHE-2.0", + "version": "2.0.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -23,6 +24,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/notification/permissions/autogenerated/commands/batch.toml b/plugins/notification/permissions/autogenerated/commands/batch.toml new file mode 100644 index 00000000..c52cc16d --- /dev/null +++ b/plugins/notification/permissions/autogenerated/commands/batch.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-batch" +description = "Enables the batch command without any pre-configured scope." +commands.allow = ["batch"] + +[[permission]] +identifier = "deny-batch" +description = "Denies the batch command without any pre-configured scope." +commands.deny = ["batch"] diff --git a/plugins/notification/permissions/autogenerated/commands/cancel.toml b/plugins/notification/permissions/autogenerated/commands/cancel.toml new file mode 100644 index 00000000..91efeaa0 --- /dev/null +++ b/plugins/notification/permissions/autogenerated/commands/cancel.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-cancel" +description = "Enables the cancel command without any pre-configured scope." +commands.allow = ["cancel"] + +[[permission]] +identifier = "deny-cancel" +description = "Denies the cancel command without any pre-configured scope." +commands.deny = ["cancel"] diff --git a/plugins/notification/permissions/autogenerated/commands/check_permissions.toml b/plugins/notification/permissions/autogenerated/commands/check_permissions.toml new file mode 100644 index 00000000..f5af08b1 --- /dev/null +++ b/plugins/notification/permissions/autogenerated/commands/check_permissions.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-check-permissions" +description = "Enables the check_permissions command without any pre-configured scope." +commands.allow = ["check_permissions"] + +[[permission]] +identifier = "deny-check-permissions" +description = "Denies the check_permissions command without any pre-configured scope." +commands.deny = ["check_permissions"] diff --git a/plugins/notification/permissions/autogenerated/commands/create_channel.toml b/plugins/notification/permissions/autogenerated/commands/create_channel.toml new file mode 100644 index 00000000..2c931474 --- /dev/null +++ b/plugins/notification/permissions/autogenerated/commands/create_channel.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-create-channel" +description = "Enables the create_channel command without any pre-configured scope." +commands.allow = ["create_channel"] + +[[permission]] +identifier = "deny-create-channel" +description = "Denies the create_channel command without any pre-configured scope." +commands.deny = ["create_channel"] diff --git a/plugins/notification/permissions/autogenerated/commands/delete_channel.toml b/plugins/notification/permissions/autogenerated/commands/delete_channel.toml new file mode 100644 index 00000000..0adaf2bb --- /dev/null +++ b/plugins/notification/permissions/autogenerated/commands/delete_channel.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-delete-channel" +description = "Enables the delete_channel command without any pre-configured scope." +commands.allow = ["delete_channel"] + +[[permission]] +identifier = "deny-delete-channel" +description = "Denies the delete_channel command without any pre-configured scope." +commands.deny = ["delete_channel"] diff --git a/plugins/notification/permissions/autogenerated/commands/get_active.toml b/plugins/notification/permissions/autogenerated/commands/get_active.toml new file mode 100644 index 00000000..b841eb85 --- /dev/null +++ b/plugins/notification/permissions/autogenerated/commands/get_active.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-get-active" +description = "Enables the get_active command without any pre-configured scope." +commands.allow = ["get_active"] + +[[permission]] +identifier = "deny-get-active" +description = "Denies the get_active command without any pre-configured scope." +commands.deny = ["get_active"] diff --git a/plugins/notification/permissions/autogenerated/commands/get_pending.toml b/plugins/notification/permissions/autogenerated/commands/get_pending.toml new file mode 100644 index 00000000..f3bae7a8 --- /dev/null +++ b/plugins/notification/permissions/autogenerated/commands/get_pending.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-get-pending" +description = "Enables the get_pending command without any pre-configured scope." +commands.allow = ["get_pending"] + +[[permission]] +identifier = "deny-get-pending" +description = "Denies the get_pending command without any pre-configured scope." +commands.deny = ["get_pending"] diff --git a/plugins/notification/permissions/autogenerated/commands/list_channels.toml b/plugins/notification/permissions/autogenerated/commands/list_channels.toml new file mode 100644 index 00000000..cb20cd57 --- /dev/null +++ b/plugins/notification/permissions/autogenerated/commands/list_channels.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-list-channels" +description = "Enables the list_channels command without any pre-configured scope." +commands.allow = ["list_channels"] + +[[permission]] +identifier = "deny-list-channels" +description = "Denies the list_channels command without any pre-configured scope." +commands.deny = ["list_channels"] diff --git a/plugins/notification/permissions/autogenerated/commands/permission_state.toml b/plugins/notification/permissions/autogenerated/commands/permission_state.toml new file mode 100644 index 00000000..dddcd86f --- /dev/null +++ b/plugins/notification/permissions/autogenerated/commands/permission_state.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-permission-state" +description = "Enables the permission_state command without any pre-configured scope." +commands.allow = ["permission_state"] + +[[permission]] +identifier = "deny-permission-state" +description = "Denies the permission_state command without any pre-configured scope." +commands.deny = ["permission_state"] diff --git a/plugins/notification/permissions/autogenerated/commands/register_action_types.toml b/plugins/notification/permissions/autogenerated/commands/register_action_types.toml new file mode 100644 index 00000000..cb5aa89f --- /dev/null +++ b/plugins/notification/permissions/autogenerated/commands/register_action_types.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-register-action-types" +description = "Enables the register_action_types command without any pre-configured scope." +commands.allow = ["register_action_types"] + +[[permission]] +identifier = "deny-register-action-types" +description = "Denies the register_action_types command without any pre-configured scope." +commands.deny = ["register_action_types"] diff --git a/plugins/notification/permissions/autogenerated/commands/register_listener.toml b/plugins/notification/permissions/autogenerated/commands/register_listener.toml new file mode 100644 index 00000000..48363c0d --- /dev/null +++ b/plugins/notification/permissions/autogenerated/commands/register_listener.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-register-listener" +description = "Enables the register_listener command without any pre-configured scope." +commands.allow = ["register_listener"] + +[[permission]] +identifier = "deny-register-listener" +description = "Denies the register_listener command without any pre-configured scope." +commands.deny = ["register_listener"] diff --git a/plugins/notification/permissions/autogenerated/commands/remove_active.toml b/plugins/notification/permissions/autogenerated/commands/remove_active.toml new file mode 100644 index 00000000..9ad2add1 --- /dev/null +++ b/plugins/notification/permissions/autogenerated/commands/remove_active.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-remove-active" +description = "Enables the remove_active command without any pre-configured scope." +commands.allow = ["remove_active"] + +[[permission]] +identifier = "deny-remove-active" +description = "Denies the remove_active command without any pre-configured scope." +commands.deny = ["remove_active"] diff --git a/plugins/notification/permissions/autogenerated/commands/show.toml b/plugins/notification/permissions/autogenerated/commands/show.toml new file mode 100644 index 00000000..3d4cbf38 --- /dev/null +++ b/plugins/notification/permissions/autogenerated/commands/show.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-show" +description = "Enables the show command without any pre-configured scope." +commands.allow = ["show"] + +[[permission]] +identifier = "deny-show" +description = "Denies the show command without any pre-configured scope." +commands.deny = ["show"] diff --git a/plugins/notification/permissions/autogenerated/reference.md b/plugins/notification/permissions/autogenerated/reference.md index 44cbd31b..b6130d60 100644 --- a/plugins/notification/permissions/autogenerated/reference.md +++ b/plugins/notification/permissions/autogenerated/reference.md @@ -1,30 +1,453 @@ -# Permissions +## Default Permission -## allow-is-permission-granted +This permission set configures which +notification features are by default exposed. + +#### Granted Permissions + +It allows all notification related features. + + + +- `allow-is-permission-granted` +- `allow-request-permission` +- `allow-notify` +- `allow-register-action-types` +- `allow-register-listener` +- `allow-cancel` +- `allow-get-pending` +- `allow-remove-active` +- `allow-get-active` +- `allow-check-permissions` +- `allow-show` +- `allow-batch` +- `allow-list-channels` +- `allow-delete-channel` +- `allow-create-channel` +- `allow-permission-state` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`notification:allow-batch` + + + +Enables the batch command without any pre-configured scope. + +
+ +`notification:deny-batch` + + + +Denies the batch command without any pre-configured scope. + +
+ +`notification:allow-cancel` + + + +Enables the cancel command without any pre-configured scope. + +
+ +`notification:deny-cancel` + + + +Denies the cancel command without any pre-configured scope. + +
+ +`notification:allow-check-permissions` + + + +Enables the check_permissions command without any pre-configured scope. + +
+ +`notification:deny-check-permissions` + + + +Denies the check_permissions command without any pre-configured scope. + +
+ +`notification:allow-create-channel` + + + +Enables the create_channel command without any pre-configured scope. + +
+ +`notification:deny-create-channel` + + + +Denies the create_channel command without any pre-configured scope. + +
+ +`notification:allow-delete-channel` + + + +Enables the delete_channel command without any pre-configured scope. + +
+ +`notification:deny-delete-channel` + + + +Denies the delete_channel command without any pre-configured scope. + +
+ +`notification:allow-get-active` + + + +Enables the get_active command without any pre-configured scope. + +
+ +`notification:deny-get-active` + + + +Denies the get_active command without any pre-configured scope. + +
+ +`notification:allow-get-pending` + + + +Enables the get_pending command without any pre-configured scope. + +
+ +`notification:deny-get-pending` + + + +Denies the get_pending command without any pre-configured scope. + +
+ +`notification:allow-is-permission-granted` + + Enables the is_permission_granted command without any pre-configured scope. -## deny-is-permission-granted +
+ +`notification:deny-is-permission-granted` + + Denies the is_permission_granted command without any pre-configured scope. -## allow-notify +
+ +`notification:allow-list-channels` + + + +Enables the list_channels command without any pre-configured scope. + +
+ +`notification:deny-list-channels` + + + +Denies the list_channels command without any pre-configured scope. + +
+ +`notification:allow-notify` + + Enables the notify command without any pre-configured scope. -## deny-notify +
+ +`notification:deny-notify` + + Denies the notify command without any pre-configured scope. -## allow-request-permission +
+ +`notification:allow-permission-state` + + + +Enables the permission_state command without any pre-configured scope. + +
+ +`notification:deny-permission-state` + + + +Denies the permission_state command without any pre-configured scope. + +
+ +`notification:allow-register-action-types` + + + +Enables the register_action_types command without any pre-configured scope. + +
+ +`notification:deny-register-action-types` + + + +Denies the register_action_types command without any pre-configured scope. + +
+ +`notification:allow-register-listener` + + + +Enables the register_listener command without any pre-configured scope. + +
+ +`notification:deny-register-listener` + + + +Denies the register_listener command without any pre-configured scope. + +
+ +`notification:allow-remove-active` + + + +Enables the remove_active command without any pre-configured scope. + +
+ +`notification:deny-remove-active` + + + +Denies the remove_active command without any pre-configured scope. + +
+ +`notification:allow-request-permission` + + Enables the request_permission command without any pre-configured scope. -## deny-request-permission +
+ +`notification:deny-request-permission` + + Denies the request_permission command without any pre-configured scope. -## default +
+ +`notification:allow-show` + + + +Enables the show command without any pre-configured scope. + +
+ +`notification:deny-show` + + -Allows requesting permission, checking permission state and sending notifications +Denies the show command without any pre-configured scope. +
diff --git a/plugins/notification/permissions/default.toml b/plugins/notification/permissions/default.toml index 2bd85142..00b4e1d0 100644 --- a/plugins/notification/permissions/default.toml +++ b/plugins/notification/permissions/default.toml @@ -1,8 +1,30 @@ "$schema" = "schemas/schema.json" [default] -description = "Allows requesting permission, checking permission state and sending notifications" +description = """ +This permission set configures which +notification features are by default exposed. + +#### Granted Permissions + +It allows all notification related features. + +""" + permissions = [ "allow-is-permission-granted", "allow-request-permission", "allow-notify", + "allow-register-action-types", + "allow-register-listener", + "allow-cancel", + "allow-get-pending", + "allow-remove-active", + "allow-get-active", + "allow-check-permissions", + "allow-show", + "allow-batch", + "allow-list-channels", + "allow-delete-channel", + "allow-create-channel", + "allow-permission-state", ] diff --git a/plugins/notification/permissions/schemas/schema.json b/plugins/notification/permissions/schemas/schema.json index e3fda9bd..433f367f 100644 --- a/plugins/notification/permissions/schemas/schema.json +++ b/plugins/notification/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,57 +251,213 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-is-permission-granted -> Enables the is_permission_granted command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-is-permission-granted" + "macOS" ] }, { - "description": "deny-is-permission-granted -> Denies the is_permission_granted command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-is-permission-granted" + "windows" ] }, { - "description": "allow-notify -> Enables the notify command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-notify" + "linux" ] }, { - "description": "deny-notify -> Denies the notify command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-notify" + "android" ] }, { - "description": "allow-request-permission -> Enables the request_permission command without any pre-configured scope.", + "description": "iOS.", "type": "string", "enum": [ - "allow-request-permission" + "iOS" ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the batch command without any pre-configured scope.", + "type": "string", + "const": "allow-batch" }, { - "description": "deny-request-permission -> Denies the request_permission command without any pre-configured scope.", + "description": "Denies the batch command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-request-permission" - ] + "const": "deny-batch" }, { - "description": "default -> Allows requesting permission, checking permission state and sending notifications", + "description": "Enables the cancel command without any pre-configured scope.", "type": "string", - "enum": [ - "default" - ] + "const": "allow-cancel" + }, + { + "description": "Denies the cancel command without any pre-configured scope.", + "type": "string", + "const": "deny-cancel" + }, + { + "description": "Enables the check_permissions command without any pre-configured scope.", + "type": "string", + "const": "allow-check-permissions" + }, + { + "description": "Denies the check_permissions command without any pre-configured scope.", + "type": "string", + "const": "deny-check-permissions" + }, + { + "description": "Enables the create_channel command without any pre-configured scope.", + "type": "string", + "const": "allow-create-channel" + }, + { + "description": "Denies the create_channel command without any pre-configured scope.", + "type": "string", + "const": "deny-create-channel" + }, + { + "description": "Enables the delete_channel command without any pre-configured scope.", + "type": "string", + "const": "allow-delete-channel" + }, + { + "description": "Denies the delete_channel command without any pre-configured scope.", + "type": "string", + "const": "deny-delete-channel" + }, + { + "description": "Enables the get_active command without any pre-configured scope.", + "type": "string", + "const": "allow-get-active" + }, + { + "description": "Denies the get_active command without any pre-configured scope.", + "type": "string", + "const": "deny-get-active" + }, + { + "description": "Enables the get_pending command without any pre-configured scope.", + "type": "string", + "const": "allow-get-pending" + }, + { + "description": "Denies the get_pending command without any pre-configured scope.", + "type": "string", + "const": "deny-get-pending" + }, + { + "description": "Enables the is_permission_granted command without any pre-configured scope.", + "type": "string", + "const": "allow-is-permission-granted" + }, + { + "description": "Denies the is_permission_granted command without any pre-configured scope.", + "type": "string", + "const": "deny-is-permission-granted" + }, + { + "description": "Enables the list_channels command without any pre-configured scope.", + "type": "string", + "const": "allow-list-channels" + }, + { + "description": "Denies the list_channels command without any pre-configured scope.", + "type": "string", + "const": "deny-list-channels" + }, + { + "description": "Enables the notify command without any pre-configured scope.", + "type": "string", + "const": "allow-notify" + }, + { + "description": "Denies the notify command without any pre-configured scope.", + "type": "string", + "const": "deny-notify" + }, + { + "description": "Enables the permission_state command without any pre-configured scope.", + "type": "string", + "const": "allow-permission-state" + }, + { + "description": "Denies the permission_state command without any pre-configured scope.", + "type": "string", + "const": "deny-permission-state" + }, + { + "description": "Enables the register_action_types command without any pre-configured scope.", + "type": "string", + "const": "allow-register-action-types" + }, + { + "description": "Denies the register_action_types command without any pre-configured scope.", + "type": "string", + "const": "deny-register-action-types" + }, + { + "description": "Enables the register_listener command without any pre-configured scope.", + "type": "string", + "const": "allow-register-listener" + }, + { + "description": "Denies the register_listener command without any pre-configured scope.", + "type": "string", + "const": "deny-register-listener" + }, + { + "description": "Enables the remove_active command without any pre-configured scope.", + "type": "string", + "const": "allow-remove-active" + }, + { + "description": "Denies the remove_active command without any pre-configured scope.", + "type": "string", + "const": "deny-remove-active" + }, + { + "description": "Enables the request_permission command without any pre-configured scope.", + "type": "string", + "const": "allow-request-permission" + }, + { + "description": "Denies the request_permission command without any pre-configured scope.", + "type": "string", + "const": "deny-request-permission" + }, + { + "description": "Enables the show command without any pre-configured scope.", + "type": "string", + "const": "allow-show" + }, + { + "description": "Denies the show command without any pre-configured scope.", + "type": "string", + "const": "deny-show" + }, + { + "description": "This permission set configures which\nnotification features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all notification related features.\n\n", + "type": "string", + "const": "default" } ] } diff --git a/plugins/notification/rollup.config.js b/plugins/notification/rollup.config.js index 0aed70d6..a7dbd4f6 100644 --- a/plugins/notification/rollup.config.js +++ b/plugins/notification/rollup.config.js @@ -2,21 +2,21 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; -import { nodeResolve } from "@rollup/plugin-node-resolve"; -import typescript from "@rollup/plugin-typescript"; -import terser from "@rollup/plugin-terser"; +import { createConfig } from '../../shared/rollup.config.js' +import { nodeResolve } from '@rollup/plugin-node-resolve' +import typescript from '@rollup/plugin-typescript' +import terser from '@rollup/plugin-terser' export default createConfig({ additionalConfigs: { - input: "guest-js/init.ts", + input: 'guest-js/init.ts', output: { - file: "src/init-iife.js", - format: "iife", + file: 'src/init-iife.js', + format: 'iife' }, plugins: [typescript(), terser(), nodeResolve()], onwarn: (warning) => { - throw Object.assign(new Error(), warning); - }, - }, -}); + throw Object.assign(new Error(), warning) + } + } +}) diff --git a/plugins/notification/src/api-iife.js b/plugins/notification/src/api-iife.js deleted file mode 100644 index 3d8c020a..00000000 --- a/plugins/notification/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_NOTIFICATION__=function(n){"use strict";function e(n,e,i,t){if("a"===i&&!t)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?n!==e||!t:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?t:"a"===i?t.call(n):t?t.value:e.get(n)}var i,t,o,r;"function"==typeof SuppressedError&&SuppressedError;class a{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,i.set(this,(()=>{})),this.id=function(n,e=!1){return window.__TAURI_INTERNALS__.transformCallback(n,e)}((n=>{e(this,i,"f").call(this,n)}))}set onmessage(n){!function(n,e,i,t,o){if("m"===t)throw new TypeError("Private method is not writable");if("a"===t&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?n!==e||!o:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===t?o.call(n,i):o?o.value=i:e.set(n,i)}(this,i,n,"f")}get onmessage(){return e(this,i,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}i=new WeakMap;class c{constructor(n,e,i){this.plugin=n,this.event=e,this.channelId=i}async unregister(){return u(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}}async function s(n,e,i){const t=new a;return t.onmessage=i,u(`plugin:${n}|register_listener`,{event:e,handler:t}).then((()=>new c(n,e,t.id)))}async function u(n,e={},i){return window.__TAURI_INTERNALS__.invoke(n,e,i)}n.ScheduleEvery=void 0,(t=n.ScheduleEvery||(n.ScheduleEvery={})).Year="year",t.Month="month",t.TwoWeeks="twoWeeks",t.Week="week",t.Day="day",t.Hour="hour",t.Minute="minute",t.Second="second";return n.Importance=void 0,(o=n.Importance||(n.Importance={}))[o.None=0]="None",o[o.Min=1]="Min",o[o.Low=2]="Low",o[o.Default=3]="Default",o[o.High=4]="High",n.Visibility=void 0,(r=n.Visibility||(n.Visibility={}))[r.Secret=-1]="Secret",r[r.Private=0]="Private",r[r.Public=1]="Public",n.Schedule=class{static at(n,e=!1,i=!1){return{at:{date:n,repeating:e,allowWhileIdle:i},interval:void 0,every:void 0}}static interval(n,e=!1){return{at:void 0,interval:{interval:n,allowWhileIdle:e},every:void 0}}static every(n,e,i=!1){return{at:void 0,interval:void 0,every:{interval:n,count:e,allowWhileIdle:i}}}},n.active=async function(){return u("plugin:notification|get_active")},n.cancel=async function(n){return u("plugin:notification|cancel",{notifications:n})},n.cancelAll=async function(){return u("plugin:notification|cancel")},n.channels=async function(){return u("plugin:notification|listChannels")},n.createChannel=async function(n){return u("plugin:notification|create_channel",{...n})},n.isPermissionGranted=async function(){return"default"!==window.Notification.permission?Promise.resolve("granted"===window.Notification.permission):u("plugin:notification|is_permission_granted")},n.onAction=async function(n){return s("notification","actionPerformed",n)},n.onNotificationReceived=async function(n){return s("notification","notification",n)},n.pending=async function(){return u("plugin:notification|get_pending")},n.registerActionTypes=async function(n){return u("plugin:notification|register_action_types",{types:n})},n.removeActive=async function(n){return u("plugin:notification|remove_active",{notifications:n})},n.removeAllActive=async function(){return u("plugin:notification|remove_active")},n.removeChannel=async function(n){return u("plugin:notification|delete_channel",{id:n})},n.requestPermission=async function(){return window.Notification.requestPermission()},n.sendNotification=function(n){"string"==typeof n?new window.Notification(n):new window.Notification(n.title,n)},n}({});Object.defineProperty(window.__TAURI__,"notification",{value:__TAURI_PLUGIN_NOTIFICATION__})} diff --git a/plugins/notification/src/commands.rs b/plugins/notification/src/commands.rs index 4af85585..99b96c5b 100644 --- a/plugins/notification/src/commands.rs +++ b/plugins/notification/src/commands.rs @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use tauri::{command, AppHandle, Runtime, State}; +use tauri::{command, plugin::PermissionState, AppHandle, Runtime, State}; -use crate::{Notification, NotificationData, PermissionState, Result}; +use crate::{Notification, NotificationData, Result}; #[command] pub(crate) async fn is_permission_granted( @@ -15,7 +15,7 @@ pub(crate) async fn is_permission_granted( match state { PermissionState::Granted => Ok(Some(true)), PermissionState::Denied => Ok(Some(false)), - PermissionState::Unknown => Ok(None), + PermissionState::Prompt | PermissionState::PromptWithRationale => Ok(None), } } diff --git a/plugins/notification/src/desktop.rs b/plugins/notification/src/desktop.rs index be3c348e..092b8892 100644 --- a/plugins/notification/src/desktop.rs +++ b/plugins/notification/src/desktop.rs @@ -3,9 +3,12 @@ // SPDX-License-Identifier: MIT use serde::de::DeserializeOwned; -use tauri::{plugin::PluginApi, AppHandle, Runtime}; +use tauri::{ + plugin::{PermissionState, PluginApi}, + AppHandle, Runtime, +}; -use crate::{models::*, NotificationBuilder}; +use crate::NotificationBuilder; pub fn init( app: &AppHandle, @@ -156,11 +159,11 @@ mod imp { /// /// - **Windows**: Not supported on Windows 7. If your app targets it, enable the `windows7-compat` feature and use [`Self::notify`]. #[cfg_attr( - all(not(doc_cfg), feature = "windows7-compat"), + all(not(docsrs), feature = "windows7-compat"), deprecated = "This function does not work on Windows 7. Use `Self::notify` instead." )] pub fn show(self) -> crate::Result<()> { - let mut notification = crate::notify_rust::Notification::new(); + let mut notification = notify_rust::Notification::new(); if let Some(body) = self.body { notification.body(&body); } @@ -186,10 +189,10 @@ mod imp { } #[cfg(target_os = "macos")] { - let _ = crate::notify_rust::set_application(if cfg!(feature = "custom-protocol") { - &self.identifier - } else { + let _ = notify_rust::set_application(if tauri::is_dev() { "com.apple.Terminal" + } else { + &self.identifier }); } @@ -220,7 +223,7 @@ mod imp { /// .expect("error while running tauri application"); /// ``` #[cfg(feature = "windows7-compat")] - #[cfg_attr(doc_cfg, doc(cfg(feature = "windows7-compat")))] + #[cfg_attr(docsrs, doc(cfg(feature = "windows7-compat")))] #[allow(unused_variables)] pub fn notify(self, app: &tauri::AppHandle) -> crate::Result<()> { #[cfg(windows)] @@ -247,9 +250,8 @@ mod imp { #[cfg(all(windows, feature = "windows7-compat"))] fn notify_win7(self, app: &tauri::AppHandle) -> crate::Result<()> { - let app = app.clone(); - let default_window_icon = app.default_window_icon().cloned(); - let _ = app.run_on_main_thread(move || { + let app_ = app.clone(); + let _ = app.clone().run_on_main_thread(move || { let mut notification = win7_notifications::Notification::new(); if let Some(body) = self.body { notification.body(&body); @@ -257,13 +259,8 @@ mod imp { if let Some(title) = self.title { notification.summary(&title); } - if let Some(tauri::Icon::Rgba { - rgba, - width, - height, - }) = default_window_icon - { - notification.icon(rgba, width, height); + if let Some(icon) = app_.default_window_icon() { + notification.icon(icon.rgba().to_vec(), icon.width(), icon.height()); } let _ = notification.show(); }); diff --git a/plugins/notification/src/init-iife.js b/plugins/notification/src/init-iife.js index b7e206b0..30bff97d 100644 --- a/plugins/notification/src/init-iife.js +++ b/plugins/notification/src/init-iife.js @@ -1 +1 @@ -!function(){"use strict";async function i(i,n={},t){return window.__TAURI_INTERNALS__.invoke(i,n,t)}"function"==typeof SuppressedError&&SuppressedError,function(){let n=!1,t="default";function o(i){n=!0,window.Notification.permission=i,n=!1}window.Notification=function(n,t){const o=t||{};!function(n){"object"==typeof n&&Object.freeze(n),i("plugin:notification|notify",{options:"string"==typeof n?{title:n}:n})}(Object.assign(o,{title:n}))},window.Notification.requestPermission=function(){return i("plugin:notification|request_permission").then((i=>(o("prompt"===i?"default":i),i)))},Object.defineProperty(window.Notification,"permission",{enumerable:!0,get:()=>t,set:i=>{if(!n)throw new Error("Readonly property");t=i}}),("default"!==window.Notification.permission?Promise.resolve("granted"===window.Notification.permission):i("plugin:notification|is_permission_granted")).then((function(i){o(null===i?"default":i?"granted":"denied")}))}()}(); +!function(){"use strict";async function i(i,n={},t){return window.__TAURI_INTERNALS__.invoke(i,n,t)}"function"==typeof SuppressedError&&SuppressedError,function(){let n=!1,t="default";function o(i){n=!0,window.Notification.permission=i,n=!1}window.Notification=function(n,t){const o=t||{};!async function(n){"object"==typeof n&&Object.freeze(n),await i("plugin:notification|notify",{options:"string"==typeof n?{title:n}:n})}(Object.assign(o,{title:n}))},window.Notification.requestPermission=async function(){return await i("plugin:notification|request_permission").then((i=>(o("prompt"===i||"prompt-with-rationale"===i?"default":i),i)))},Object.defineProperty(window.Notification,"permission",{enumerable:!0,get:()=>t,set:i=>{if(!n)throw new Error("Readonly property");t=i}}),async function(){return"default"!==window.Notification.permission||__TEMPLATE_windows__?await Promise.resolve("granted"===window.Notification.permission):await i("plugin:notification|is_permission_granted")}().then((function(i){o(null===i?"default":i?"granted":"denied")}))}()}(); diff --git a/plugins/notification/src/lib.rs b/plugins/notification/src/lib.rs index 408a0f79..aa15cc93 100644 --- a/plugins/notification/src/lib.rs +++ b/plugins/notification/src/lib.rs @@ -22,6 +22,7 @@ use tauri::{ }; pub use models::*; +pub use tauri::plugin::PermissionState; #[cfg(desktop)] mod desktop; @@ -32,9 +33,6 @@ mod commands; mod error; mod models; -#[allow(dead_code, unused_imports, deprecated, clippy::derivable_impls)] -mod notify_rust; - pub use error::{Error, Result}; #[cfg(desktop)] @@ -211,7 +209,7 @@ impl NotificationBuilder { } } -/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the notification APIs. +/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the notification APIs. pub trait NotificationExt { fn notification(&self) -> &Notification; } @@ -224,15 +222,16 @@ impl> crate::NotificationExt for T { /// Initializes the plugin. pub fn init() -> TauriPlugin { - let mut init_script = include_str!("init-iife.js").to_string(); - init_script.push_str(include_str!("api-iife.js")); Builder::new("notification") .invoke_handler(tauri::generate_handler![ commands::notify, commands::request_permission, commands::is_permission_granted ]) - .js_init_script(init_script) + .js_init_script(include_str!("init-iife.js").replace( + "__TEMPLATE_windows__", + if cfg!(windows) { "true" } else { "false" }, + )) .setup(|app, api| { #[cfg(mobile)] let notification = mobile::init(app, api)?; diff --git a/plugins/notification/src/mobile.rs b/plugins/notification/src/mobile.rs index b786ed5c..9167dcc1 100644 --- a/plugins/notification/src/mobile.rs +++ b/plugins/notification/src/mobile.rs @@ -4,7 +4,7 @@ use serde::{de::DeserializeOwned, Deserialize}; use tauri::{ - plugin::{PluginApi, PluginHandle}, + plugin::{PermissionState, PluginApi, PluginHandle}, AppHandle, Runtime, }; diff --git a/plugins/notification/src/models.rs b/plugins/notification/src/models.rs index aa290dd3..02134e4d 100644 --- a/plugins/notification/src/models.rs +++ b/plugins/notification/src/models.rs @@ -209,51 +209,6 @@ impl Default for NotificationData { } } -/// Permission state. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum PermissionState { - /// Permission access has been granted. - Granted, - /// Permission access has been denied. - Denied, - /// Unknown state. Must request permission. - Unknown, -} - -impl Display for PermissionState { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::Granted => write!(f, "granted"), - Self::Denied => write!(f, "denied"), - Self::Unknown => write!(f, "Unknown"), - } - } -} - -impl Serialize for PermissionState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - serializer.serialize_str(self.to_string().as_ref()) - } -} - -impl<'de> Deserialize<'de> for PermissionState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - match s.to_lowercase().as_str() { - "granted" => Ok(Self::Granted), - "denied" => Ok(Self::Denied), - "prompt" => Ok(Self::Unknown), - _ => Err(DeError::custom(format!("unknown permission state '{s}'"))), - } - } -} - #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct PendingNotification { @@ -352,6 +307,7 @@ impl ActiveNotification { } } +#[cfg(mobile)] #[derive(Debug, Serialize)] #[serde(rename_all = "camelCase")] pub struct ActionType { @@ -364,6 +320,7 @@ pub struct ActionType { hidden_previews_show_subtitle: bool, } +#[cfg(mobile)] #[derive(Debug, Serialize)] #[serde(rename_all = "camelCase")] pub struct Action { diff --git a/plugins/notification/src/notify_rust/error.rs b/plugins/notification/src/notify_rust/error.rs deleted file mode 100644 index 923bf713..00000000 --- a/plugins/notification/src/notify_rust/error.rs +++ /dev/null @@ -1,161 +0,0 @@ -#![allow(missing_docs)] - -#[cfg(all(feature = "images", unix, not(target_os = "macos")))] -use super::image::ImageError; -use std::{fmt, num}; -/// Convenient wrapper around `std::Result`. -pub type Result = ::std::result::Result; - -#[cfg(target_os = "macos")] -pub use super::macos::{ApplicationError, MacOsError, NotificationError}; - -/// The Error type. -#[derive(Debug)] -pub struct Error { - kind: ErrorKind, -} - -/// The kind of an error. -#[derive(Debug)] -#[non_exhaustive] -pub enum ErrorKind { - /// only here for backwards compatibility - Msg(String), - - #[cfg(all(feature = "dbus", unix, not(target_os = "macos")))] - Dbus(dbus::Error), - - #[cfg(all(feature = "zbus", unix, not(target_os = "macos")))] - Zbus(zbus::Error), - - #[cfg(target_os = "macos")] - MacNotificationSys(mac_notification_sys::error::Error), - - Parse(num::ParseIntError), - - SpecVersion(String), - - Conversion(String), - - #[cfg(all(feature = "images", unix, not(target_os = "macos")))] - Image(ImageError), - - ImplementationMissing, -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self.kind { - #[cfg(all(feature = "dbus", unix, not(target_os = "macos")))] - ErrorKind::Dbus(ref e) => write!(f, "{}", e), - - #[cfg(all(feature = "zbus", unix, not(target_os = "macos")))] - ErrorKind::Zbus(ref e) => write!(f, "{}", e), - - #[cfg(target_os = "macos")] - ErrorKind::MacNotificationSys(ref e) => write!(f, "{}", e), - - ErrorKind::Parse(ref e) => write!(f, "Parsing Error: {}", e), - ErrorKind::Conversion(ref e) => write!(f, "Conversion Error: {}", e), - ErrorKind::SpecVersion(ref e) | ErrorKind::Msg(ref e) => write!(f, "{}", e), - #[cfg(all(feature = "images", unix, not(target_os = "macos")))] - ErrorKind::Image(ref e) => write!(f, "{}", e), - ErrorKind::ImplementationMissing => write!( - f, - r#"No Dbus implementation available, please compile with either feature ="z" or feature="d""# - ), - } - } -} - -impl std::error::Error for Error {} - -impl From<&str> for Error { - fn from(e: &str) -> Error { - Error { - kind: ErrorKind::Msg(e.into()), - } - } -} - -#[cfg(all(feature = "dbus", unix, not(target_os = "macos")))] -impl From for Error { - fn from(e: dbus::Error) -> Error { - Error { - kind: ErrorKind::Dbus(e), - } - } -} - -#[cfg(all(feature = "zbus", unix, not(target_os = "macos")))] -impl From for Error { - fn from(e: zbus::Error) -> Error { - Error { - kind: ErrorKind::Zbus(e), - } - } -} - -#[cfg(target_os = "macos")] -impl From for Error { - fn from(e: mac_notification_sys::error::Error) -> Error { - Error { - kind: ErrorKind::MacNotificationSys(e), - } - } -} - -#[cfg(all(feature = "images", unix, not(target_os = "macos")))] -impl From for Error { - fn from(e: ImageError) -> Error { - Error { - kind: ErrorKind::Image(e), - } - } -} - -impl From for Error { - fn from(e: num::ParseIntError) -> Error { - Error { - kind: ErrorKind::Parse(e), - } - } -} - -impl From for Error { - fn from(kind: ErrorKind) -> Error { - Error { kind } - } -} - -/// Just the usual bail macro -#[macro_export] -#[doc(hidden)] -macro_rules! bail { - ($e:expr) => { - return Err($e.into()); - }; - ($fmt:expr, $($arg:tt)+) => { - return Err(format!($fmt, $($arg)+).into()); - }; -} - -/// Exits a function early with an `Error` if the condition is not satisfied. -/// -/// Similar to `assert!`, `ensure!` takes a condition and exits the function -/// if the condition fails. Unlike `assert!`, `ensure!` returns an `Error`, -/// it does not panic. -#[macro_export(local_inner_macros)] -#[doc(hidden)] -macro_rules! ensure { - ($cond:expr, $e:expr) => { - if !($cond) { - bail!($e); - } - }; - ($cond:expr, $fmt:expr, $($arg:tt)*) => { - if !($cond) { - bail!($fmt, $($arg)*); - } - }; -} diff --git a/plugins/notification/src/notify_rust/hints.rs b/plugins/notification/src/notify_rust/hints.rs deleted file mode 100644 index 9513abeb..00000000 --- a/plugins/notification/src/notify_rust/hints.rs +++ /dev/null @@ -1,245 +0,0 @@ -#![cfg_attr(rustfmt, rustfmt_skip)] - -#[cfg(all(feature = "zbus", unix, not(target_os = "macos")))] -use zbus::zvariant; - -#[cfg(all(unix, not(target_os = "macos")))] -pub(crate) mod message; - -#[cfg(all(feature = "images", any(feature = "dbus", feature = "zbus"), unix, not(target_os = "macos")))] -use super::image::Image; - -#[cfg(all(feature = "images", feature = "zbus", unix, not(target_os = "macos")))] -use super::image::image_spec_str; -use super::Urgency; - -#[cfg(all(feature = "zbus", unix, not(target_os = "macos")))] use super::notification::Notification; -#[cfg(all(feature = "zbus", unix, not(target_os = "macos")))] use std::collections::HashMap; - -mod constants; - -#[cfg(all(unix, not(target_os = "macos")))] -#[derive(Eq, PartialEq, Hash, Clone, Debug)] -pub(crate) enum CustomHintType { - Int, - String, -} - -/// `Hints` allow you to pass extra information to the server. -/// -/// Many of these are standardized by either: -/// -/// * -/// * -/// -/// Which of these are actually implemented depends strongly on the Notification server you talk to. -/// Usually the [`get_capabilities()`](`crate::get_capabilities`) gives some clues, but the standards usually mention much more -/// than is actually available. -/// -/// you pass these to [`Notification::hint`] -#[derive(Eq, PartialEq, Hash, Clone, Debug)] -pub enum Hint { - /// If true, server may interpret action identifiers as named icons and display those. - ActionIcons(bool), - - /// Check out: - /// - /// * - /// * - Category(String), - - /// Name of the DesktopEntry representing the calling application. In case of "firefox.desktop" - /// use "firefox". May be used to retrieve the correct icon. - DesktopEntry(String), - - /// Image as raw data - #[cfg(all(feature = "images", unix, not(target_os = "macos")))] - ImageData(Image), - - /// Display the image at this path. - ImagePath(String), - - /// This does not work on all servers, however timeout=0 will do the job - Resident(bool), - - /// Play the sound at this path. - SoundFile(String), - - /// A themeable named sound from the freedesktop.org [sound naming specification](http://0pointer.de/public/sound-naming-spec.html) to play when the notification pops up. Similar to icon-name, only for sounds. An example would be "message-new-instant". - SoundName(String), - - /// Suppress the notification sound. - SuppressSound(bool), - - /// When set the server will treat the notification as transient and by-pass the server's persistence capability, if it should exist. - Transient(bool), - - /// Lets the notification point to a certain 'x' position on the screen. - /// Requires `Y`. - X(i32), - - /// Lets the notification point to a certain 'y' position on the screen. - /// Requires `X`. - Y(i32), - - /// Pass me a Urgency, either Low, Normal or Critical - Urgency(Urgency), - - /// If you want to pass something entirely different. - Custom(String, String), - - /// A custom numerical (integer) hint - CustomInt(String, i32), - - /// Only used by this NotificationServer implementation - Invalid // TODO find a better solution to this -} - -impl Hint { - /// Get the `bool` representation of this hint. - pub fn as_bool(&self) -> Option { - match *self { - | Hint::ActionIcons(inner) - | Hint::Resident(inner) - | Hint::SuppressSound(inner) - | Hint::Transient(inner) => Some(inner), - _ => None - } - } - - /// Get the `i32` representation of this hint. - pub fn as_i32(&self) -> Option { - match *self { - Hint::X(inner) | Hint::Y(inner) => Some(inner), - _ => None - } - } - - /// Get the `&str` representation of this hint. - pub fn as_str(&self) -> Option<&str> { - match *self { - Hint::DesktopEntry(ref inner) | - Hint::ImagePath(ref inner) | - Hint::SoundFile(ref inner) | - Hint::SoundName(ref inner) => Some(inner), - _ => None - } - } - - /// convenience converting a name and value into a hint - pub fn from_key_val(name: &str, value: &str) -> Result { - match (name,value){ - (constants::ACTION_ICONS,val) => val.parse::().map(Hint::ActionIcons).map_err(|e|e.to_string()), - (constants::CATEGORY, val) => Ok(Hint::Category(val.to_owned())), - (constants::DESKTOP_ENTRY, val) => Ok(Hint::DesktopEntry(val.to_owned())), - (constants::IMAGE_PATH, val) => Ok(Hint::ImagePath(val.to_owned())), - (constants::RESIDENT, val) => val.parse::().map(Hint::Resident).map_err(|e|e.to_string()), - (constants::SOUND_FILE, val) => Ok(Hint::SoundFile(val.to_owned())), - (constants::SOUND_NAME, val) => Ok(Hint::SoundName(val.to_owned())), - (constants::SUPPRESS_SOUND, val) => val.parse::().map(Hint::SuppressSound).map_err(|e|e.to_string()), - (constants::TRANSIENT, val) => val.parse::().map(Hint::Transient).map_err(|e|e.to_string()), - (constants::X, val) => val.parse::().map(Hint::X).map_err(|e|e.to_string()), - (constants::Y, val) => val.parse::().map(Hint::Y).map_err(|e|e.to_string()), - _ => Err(String::from("unknown name")) - } - } -} - -#[cfg(all(unix, not(target_os = "macos")))] -impl Hint {} - -#[cfg(all(feature = "zbus", unix, not(target_os = "macos")))] -#[test] -fn test_hints_to_map() { - - // custom value should only be there once if the names are identical - - let n1 = super::Notification::new() - .hint(Hint::Custom("foo".into(), "bar1".into())) - .hint(Hint::Custom("foo".into(), "bar2".into())) - .hint(Hint::Custom("f00".into(), "bar3".into())) - .finalize(); - - assert_eq!(hints_to_map(&n1), maplit::hashmap!{ - "foo" => zvariant::Value::Str("bar2".into()), - "f00" => zvariant::Value::Str("bar3".into()) - }); -} - -#[cfg(all(feature = "zbus", unix, not(target_os = "macos")))] -pub(crate) fn hints_to_map(notification: &Notification) -> HashMap::<&str, zvariant::Value<'_>> { - notification - .get_hints() - .map(Into::into) - .collect() -} - -#[cfg(all(feature = "zbus", unix, not(target_os = "macos")))] -impl<'a> From<&'a Hint> for (&'a str, zvariant::Value<'a>) { - fn from(val: &'a Hint) -> Self { - use self::constants::*; - match val { - Hint::ActionIcons(value) => (ACTION_ICONS , zvariant::Value::Bool(*value)), // bool - Hint::Category(value) => (CATEGORY , zvariant::Value::Str(value.as_str().into())), - Hint::DesktopEntry(value) => (DESKTOP_ENTRY , zvariant::Value::Str(value.as_str().into())), - - #[cfg(all(feature = "zbus", feature = "images", unix, not(target_os = "macos")))] - //Hint::ImageData(image) => (image_spec(*crate::SPEC_VERSION).as_str(), ImagePayload::from(*image).into()), - Hint::ImageData(image) => ( - image_spec_str(*crate::SPEC_VERSION), - zvariant::Value::Structure( - image.to_tuple().into() - ) - ), - - - Hint::ImagePath(value) => (IMAGE_PATH , zvariant::Value::Str(value.as_str().into())), - Hint::Resident(value) => (RESIDENT , zvariant::Value::Bool(*value)), // bool - Hint::SoundFile(value) => (SOUND_FILE , zvariant::Value::Str(value.as_str().into())), - Hint::SoundName(value) => (SOUND_NAME , zvariant::Value::Str(value.as_str().into())), - Hint::SuppressSound(value) => (SUPPRESS_SOUND , zvariant::Value::Bool(*value)), - Hint::Transient(value) => (TRANSIENT , zvariant::Value::Bool(*value)), - Hint::X(value) => (X , zvariant::Value::I32(*value)), - Hint::Y(value) => (Y , zvariant::Value::I32(*value)), - Hint::Urgency(value) => (URGENCY , zvariant::Value::U8(*value as u8)), - Hint::Custom(key, val) => (key.as_str() , zvariant::Value::Str(val.as_str().into())), - Hint::CustomInt(key, val) => (key.as_str() , zvariant::Value::I32(*val)), - Hint::Invalid => (INVALID , zvariant::Value::Str(INVALID.into())) - } - } -} - - -#[cfg(all(feature = "dbus", unix, not(target_os = "macos")))] -impl<'a, A: dbus::arg::RefArg> From<(&'a String, &'a A)> for Hint { - fn from(pair: (&String, &A)) -> Self { - - let (key, variant) = pair; - match (key.as_ref(), variant.as_u64(), variant.as_i64(), variant.as_str().map(String::from)) { - - (constants::ACTION_ICONS, Some(1), _, _ ) => Hint::ActionIcons(true), - (constants::ACTION_ICONS, _, _, _ ) => Hint::ActionIcons(false), - (constants::URGENCY, level, _, _ ) => Hint::Urgency(level.into()), - (constants::CATEGORY, _, _, Some(name) ) => Hint::Category(name), - - (constants::DESKTOP_ENTRY, _, _, Some(entry)) => Hint::DesktopEntry(entry), - (constants::IMAGE_PATH, _, _, Some(path) ) => Hint::ImagePath(path), - (constants::RESIDENT, Some(1), _, _ ) => Hint::Resident(true), - (constants::RESIDENT, _, _, _ ) => Hint::Resident(false), - - (constants::SOUND_FILE, _, _, Some(path) ) => Hint::SoundFile(path), - (constants::SOUND_NAME, _, _, Some(name) ) => Hint::SoundName(name), - (constants::SUPPRESS_SOUND, Some(1), _, _ ) => Hint::SuppressSound(true), - (constants::SUPPRESS_SOUND, _, _, _ ) => Hint::SuppressSound(false), - (constants::TRANSIENT, Some(1), _, _ ) => Hint::Transient(true), - (constants::TRANSIENT, _, _, _ ) => Hint::Transient(false), - (constants::X, _, Some(x), _ ) => Hint::X(x as i32), - (constants::Y, _, Some(y), _ ) => Hint::Y(y as i32), - - other => { - eprintln!("Invalid Hint {:#?} ", other); - Hint::Invalid - } - } - } -} diff --git a/plugins/notification/src/notify_rust/hints/constants.rs b/plugins/notification/src/notify_rust/hints/constants.rs deleted file mode 100644 index a7c666c1..00000000 --- a/plugins/notification/src/notify_rust/hints/constants.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![allow(dead_code)] - -pub const ACTION_ICONS: &str = "action-icons"; -pub const CATEGORY: &str = "category"; -pub const DESKTOP_ENTRY: &str = "desktop-entry"; -pub const IMAGE_PATH: &str = "image-path"; -pub const RESIDENT: &str = "resident"; -pub const SOUND_FILE: &str = "sound-file"; -pub const SOUND_NAME: &str = "sound-name"; -pub const SUPPRESS_SOUND: &str = "suppress-sound"; -pub const TRANSIENT: &str = "transient"; -pub const X: &str = "x"; -pub const Y: &str = "y"; -pub const URGENCY: &str = "urgency"; - - -pub const INVALID: &str = "invalid"; \ No newline at end of file diff --git a/plugins/notification/src/notify_rust/hints/message.rs b/plugins/notification/src/notify_rust/hints/message.rs deleted file mode 100644 index 4e8d0e70..00000000 --- a/plugins/notification/src/notify_rust/hints/message.rs +++ /dev/null @@ -1,159 +0,0 @@ -//! `Hints` allow you to pass extra information to the server. -//! -//! Many of these are standardized by either: -//! -//! [galago-project spec](http://www.galago-project.org/specs/notification/0.9/x344.html) or -//! [gnome notification-spec](https://developer.gnome.org/notification-spec/#hints) -//! -//! Which of these are actually implemented depends strongly on the Notification server you talk to. -//! Usually the `get_capabilities()` gives some clues, but the standards usually mention much more -//! than is actually available. -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(dead_code, unused_imports)] - - -use super::{Hint, constants::*}; -use super::Urgency; - -#[cfg(all(feature = "images", unix, not(target_os = "macos")))] -use super::image::*; - -use std::collections::{HashMap, HashSet}; -#[cfg(feature = "dbus")] -use dbus::arg::{messageitem::MessageItem, RefArg}; - -/// All currently implemented `Hints` that can be sent. -/// -/// as found on -#[derive(Eq, PartialEq, Hash, Clone, Debug)] -pub(crate) struct HintMessage(Hint); - -#[cfg(feature = "dbus")] -impl HintMessage { - pub fn wrap_hint(hint: Hint) -> (MessageItem, MessageItem) { - Self::from(hint).into() - } -} - -impl From for HintMessage { - fn from(hint: Hint) -> Self { - HintMessage(hint) - } -} - -impl std::ops::Deref for HintMessage { - type Target = Hint; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -#[cfg(feature = "dbus")] -impl<'a, A: RefArg> From<(&'a String, &'a A)> for HintMessage { - fn from(pair: (&String, &A)) -> Self { - - let (key, variant) = pair; - match (key.as_ref(), variant.as_u64(), variant.as_i64(), variant.as_str().map(String::from)) { - - (ACTION_ICONS, Some(1), _, _ ) => Hint::ActionIcons(true), - (ACTION_ICONS, _, _, _ ) => Hint::ActionIcons(false), - (URGENCY, level, _, _ ) => Hint::Urgency(level.into()), - (CATEGORY, _, _, Some(name) ) => Hint::Category(name), - - (DESKTOP_ENTRY, _, _, Some(entry)) => Hint::DesktopEntry(entry), - (IMAGE_PATH, _, _, Some(path) ) => Hint::ImagePath(path), - (RESIDENT, Some(1), _, _ ) => Hint::Resident(true), - (RESIDENT, _, _, _ ) => Hint::Resident(false), - - (SOUND_FILE, _, _, Some(path) ) => Hint::SoundFile(path), - (SOUND_NAME, _, _, Some(name) ) => Hint::SoundName(name), - (SUPPRESS_SOUND, Some(1), _, _ ) => Hint::SuppressSound(true), - (SUPPRESS_SOUND, _, _, _ ) => Hint::SuppressSound(false), - (TRANSIENT, Some(1), _, _ ) => Hint::Transient(true), - (TRANSIENT, _, _, _ ) => Hint::Transient(false), - (X, _, Some(x), _ ) => Hint::X(x as i32), - (Y, _, Some(y), _ ) => Hint::Y(y as i32), - - other => { - eprintln!("Invalid Hint{:#?} ", other); - Hint::Invalid - } - }.into() - } -} - -#[cfg(feature = "dbus")] -impl From for (MessageItem, MessageItem) { - fn from(hint: HintMessage) -> Self { - - let (key, value): (String, MessageItem) = match hint.0 { - Hint::ActionIcons(value) => (ACTION_ICONS .to_owned(), MessageItem::Bool(value)), // bool - Hint::Category(ref value) => (CATEGORY .to_owned(), MessageItem::Str(value.clone())), - Hint::DesktopEntry(ref value) => (DESKTOP_ENTRY .to_owned(), MessageItem::Str(value.clone())), - #[cfg(all(feature = "images", unix, not(target_os ="macos")))] - Hint::ImageData(image) => (image_spec(*crate::SPEC_VERSION), ImageMessage::from(image).into()), - Hint::ImagePath(ref value) => (IMAGE_PATH .to_owned(), MessageItem::Str(value.clone())), - Hint::Resident(value) => (RESIDENT .to_owned(), MessageItem::Bool(value)), // bool - Hint::SoundFile(ref value) => (SOUND_FILE .to_owned(), MessageItem::Str(value.clone())), - Hint::SoundName(ref value) => (SOUND_NAME .to_owned(), MessageItem::Str(value.clone())), - Hint::SuppressSound(value) => (SUPPRESS_SOUND .to_owned(), MessageItem::Bool(value)), - Hint::Transient(value) => (TRANSIENT .to_owned(), MessageItem::Bool(value)), - Hint::X(value) => (X .to_owned(), MessageItem::Int32(value)), - Hint::Y(value) => (Y .to_owned(), MessageItem::Int32(value)), - Hint::Urgency(value) => (URGENCY .to_owned(), MessageItem::Byte(value as u8)), - Hint::Custom(ref key, ref val) => (key .to_owned(), MessageItem::Str(val.to_owned ())), - Hint::CustomInt(ref key, val) => (key .to_owned(), MessageItem::Int32(val)), - Hint::Invalid => ("invalid" .to_owned(), MessageItem::Str("Invalid".to_owned())) - }; - - (MessageItem::Str(key), MessageItem::Variant(Box::new(value))) - } -} - - -// TODO: deprecated, Prefer the DBus Arg and RefArg APIs -#[cfg(feature = "dbus")] -impl From<(&MessageItem, &MessageItem)> for HintMessage { - fn from ((key, mut value): (&MessageItem, &MessageItem)) -> Self { - use Hint as Hint; - - // If this is a variant, consider the thing inside it - // If it's a nested variant, keep drilling down until we get a real value - while let MessageItem::Variant(inner) = value { - value = inner; - } - - let is_stringy = value.inner::<&str>().is_ok(); - - match key.inner::<&str>() { - Ok(CATEGORY) => value.inner::<&str>().map(String::from).map(Hint::Category), - Ok(ACTION_ICONS) => value.inner().map(Hint::ActionIcons), - Ok(DESKTOP_ENTRY) => value.inner::<&str>().map(String::from).map(Hint::DesktopEntry), - Ok(IMAGE_PATH) => value.inner::<&str>().map(String::from).map(Hint::ImagePath), - Ok(RESIDENT) => value.inner().map(Hint::Resident), - Ok(SOUND_FILE) => value.inner::<&str>().map(String::from).map(Hint::SoundFile), - Ok(SOUND_NAME) => value.inner::<&str>().map(String::from).map(Hint::SoundName), - Ok(SUPPRESS_SOUND) => value.inner().map(Hint::SuppressSound), - Ok(TRANSIENT) => value.inner().map(Hint::Transient), - Ok(X) => value.inner().map(Hint::X), - Ok(Y) => value.inner().map(Hint::Y), - Ok(URGENCY) => value.inner().map(|i| match i { - 0 => Urgency::Low, - 2 => Urgency::Critical, - _ => Urgency::Normal - }).map(Hint::Urgency), - Ok(k) if is_stringy => value.inner::<&str>().map(|v| Hint::Custom(k.to_string(), v.to_string())), - Ok(k) => value.inner().map(|v| Hint::CustomInt(k.to_string(), v)), - _ => Err(()), - }.unwrap_or(Hint::Invalid) - .into() - } -} - - -#[allow(missing_docs)] -#[cfg(feature = "dbus")] -pub(crate) fn hints_from_variants(hints: &HashMap) -> HashSet { - hints.iter().map(Into::into).collect() -} diff --git a/plugins/notification/src/notify_rust/hints/tests.rs b/plugins/notification/src/notify_rust/hints/tests.rs deleted file mode 100644 index 23759c4a..00000000 --- a/plugins/notification/src/notify_rust/hints/tests.rs +++ /dev/null @@ -1,85 +0,0 @@ -#![cfg(all(test, unix, not(target_os = "macos")))] - -use dbus::arg::messageitem::MessageItem as Item; -use ctor::ctor; - -use super::*; -use self::Hint as Hint; -use super::Urgency::*; - - -#[ctor] -fn init_color_backtrace() { - color_backtrace::install(); -} - -#[test] -fn hint_to_item() { - let category = &Hint::Category("test-me".to_owned()); - let (k, v) = category.into(); - - let test_k = Item::Str("category".into()); - let test_v = Item::Variant(Box::new(Item::Str("test-me".into()))); - - assert_eq!(k, test_k); - assert_eq!(v, test_v); -} - -#[test] -fn urgency() { - let low = &Hint::Urgency(Low); - let (k, v) = low.into(); - - let test_k = Item::Str("urgency".into()); - let test_v = Item::Variant(Box::new(Item::Byte(0))); - - assert_eq!(k, test_k); - assert_eq!(v, test_v); -} - -#[test] -fn simple_hint_to_item() { - let old_hint = &Hint::Custom("foo".into(), "bar".into()); - - let (k, v) = old_hint.into(); - let hint: Hint = (&k, &v).into(); - - assert_eq!(old_hint, &hint); -} - -#[test] -#[cfg(all(feature = "images", unix, not(target_os = "macos")))] -fn imagedata_hint_to_item() { - let hint = &Hint::ImageData(Image::from_rgb(1, 1, vec![0, 0, 0]).unwrap()); - let item: MessageItem = hint.into(); - let test_item = Item::DictEntry( - Box::new(Item::Str(image_spec(*::SPEC_VERSION))), - Box::new(Item::Variant(Box::new(Item::Struct(vec![ - Item::Int32(1), - Item::Int32(1), - Item::Int32(3), - Item::Bool(false), - Item::Int32(8), - Item::Int32(3), - Item::Array(dbus::MessageItemArray::new(vec![ - Item::Byte(0), - Item::Byte(0), - Item::Byte(0), - ],"ay".into()).unwrap()) - ])))) - ); - assert_eq!(item, test_item); -} - -#[test] -#[cfg(all(feature = "images", unix, not(target_os = "macos")))] -fn imagedata_hint_to_item_with_spec() { - let key = image_spec(Version::new(1, 0)); - assert_eq!(key, String::from("icon_data")); - - let key = image_spec(Version::new(1, 1)); - assert_eq!(key, String::from("image_data")); - - let key = image_spec(Version::new(1, 2)); - assert_eq!(key, String::from("image-data")); -} diff --git a/plugins/notification/src/notify_rust/image.rs b/plugins/notification/src/notify_rust/image.rs deleted file mode 100644 index 27e33038..00000000 --- a/plugins/notification/src/notify_rust/image.rs +++ /dev/null @@ -1,229 +0,0 @@ -#[cfg(feature = "dbus")] -use dbus::arg::messageitem::{MessageItem, MessageItemArray}; -pub use image::DynamicImage; - -use std::cmp::Ordering; -use std::convert::TryFrom; -use std::error::Error; -use std::fmt; -use std::path::Path; - -use super::miniver::Version; - -mod constants { - pub const IMAGE_DATA: &str = "image-data"; - pub const IMAGE_DATA_1_1: &str = "image_data"; - pub const IMAGE_DATA_1_0: &str = "icon_data"; -} - -/// Image representation for images. Send via `Notification::image_data()` -#[derive(PartialEq, Eq, Debug, Clone, Hash)] -pub struct Image { - width: i32, - height: i32, - rowstride: i32, - alpha: bool, - bits_per_sample: i32, - channels: i32, - data: Vec, -} - -impl Image { - fn from_raw_data( - width: i32, - height: i32, - data: Vec, - channels: i32, - bits_per_sample: i32, - alpha: bool, - ) -> Result { - const MAX_SIZE: i32 = 0x0fff_ffff; - if width > MAX_SIZE || height > MAX_SIZE { - return Err(ImageError::TooBig); - } - - if data.len() != (width * height * channels) as usize { - Err(ImageError::WrongDataSize) - } else { - Ok(Self { - width, - height, - bits_per_sample, - channels, - data, - rowstride: width * channels, - alpha, - }) - } - } - - /// Creates an image from a raw vector of bytes - pub fn from_rgb(width: i32, height: i32, data: Vec) -> Result { - let channels = 3i32; - let bits_per_sample = 8; - Self::from_raw_data(width, height, data, channels, bits_per_sample, false) - } - - /// Creates an image from a raw vector of bytes with alpha - pub fn from_rgba(width: i32, height: i32, data: Vec) -> Result { - let channels = 4i32; - let bits_per_sample = 8; - Self::from_raw_data(width, height, data, channels, bits_per_sample, true) - } - - /// Attempts to open the given path as image - pub fn open + Sized>(path: T) -> Result { - let dyn_img = image::open(&path).map_err(ImageError::CantOpen)?; - Image::try_from(dyn_img) - } - - #[cfg(all(feature = "images", feature = "zbus"))] - pub(crate) fn to_tuple(&self) -> (i32, i32, i32, bool, i32, i32, Vec) { - ( - self.width, - self.height, - self.rowstride, - self.alpha, - self.bits_per_sample, - self.channels, - self.data.clone(), - ) - } -} - -impl TryFrom for Image { - type Error = ImageError; - - fn try_from(dyn_img: DynamicImage) -> Result { - match dyn_img { - DynamicImage::ImageRgb8(img) => Self::try_from(img), - DynamicImage::ImageRgba8(img) => Self::try_from(img), - _ => Err(ImageError::CantConvert), - } - } -} - -impl TryFrom for Image { - type Error = ImageError; - - fn try_from(img: image::RgbImage) -> Result { - let (width, height) = img.dimensions(); - let image_data = img.into_raw(); - Image::from_rgb(width as i32, height as i32, image_data) - } -} - -impl TryFrom for Image { - type Error = ImageError; - - fn try_from(img: image::RgbaImage) -> Result { - let (width, height) = img.dimensions(); - let image_data = img.into_raw(); - Image::from_rgba(width as i32, height as i32, image_data) - } -} - -/// Errors that can occur when creating an Image -#[derive(Debug)] -pub enum ImageError { - /// The given image is too big. DBus only has 32 bits for width / height - TooBig, - /// The given bytes don't match the width, height and channel count - WrongDataSize, - /// Can't open given path - CantOpen(image::ImageError), - /// Can't convert from given input - CantConvert, -} - -impl Error for ImageError { - fn source(&self) -> Option<&(dyn Error + 'static)> { - use ImageError::*; - match self { - TooBig | WrongDataSize | CantConvert => None, - CantOpen(e) => Some(e), - } - } -} - -impl fmt::Display for ImageError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - use ImageError::*; - match self { - TooBig => writeln!( - f, - "The given image is too big. DBus only has 32 bits for width / height" - ), - WrongDataSize => writeln!( - f, - "The given bytes don't match the width, height and channel count" - ), - CantOpen(e) => writeln!(f, "Can't open given path {}", e), - CantConvert => writeln!(f, "Can't convert from given input"), - } - } -} - -/// matching image data key for each spec version -#[cfg(feature = "dbus")] -pub(crate) fn image_spec(version: Version) -> String { - match version.cmp(&Version::new(1, 1)) { - Ordering::Less => constants::IMAGE_DATA_1_0.to_owned(), - Ordering::Equal => constants::IMAGE_DATA_1_1.to_owned(), - Ordering::Greater => constants::IMAGE_DATA.to_owned(), - } -} - -/// matching image data key for each spec version -#[cfg(feature = "zbus")] -pub(crate) fn image_spec_str(version: Version) -> &'static str { - match version.cmp(&Version::new(1, 1)) { - Ordering::Less => constants::IMAGE_DATA_1_0, - Ordering::Equal => constants::IMAGE_DATA_1_1, - Ordering::Greater => constants::IMAGE_DATA, - } -} - -#[cfg(feature = "dbus")] -pub struct ImageMessage(Image); - -#[cfg(feature = "dbus")] -impl From for ImageMessage { - fn from(hint: Image) -> Self { - ImageMessage(hint) - } -} - -impl From for ImageError { - fn from(image_error: image::ImageError) -> Self { - ImageError::CantOpen(image_error) - } -} - -#[cfg(feature = "dbus")] -impl std::ops::Deref for ImageMessage { - type Target = Image; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -#[cfg(feature = "dbus")] -impl From for MessageItem { - fn from(img_msg: ImageMessage) -> Self { - let img = img_msg.0; - - let bytes = img.data.into_iter().map(MessageItem::Byte).collect(); - - MessageItem::Struct(vec![ - MessageItem::Int32(img.width), - MessageItem::Int32(img.height), - MessageItem::Int32(img.rowstride), - MessageItem::Bool(img.alpha), - MessageItem::Int32(img.bits_per_sample), - MessageItem::Int32(img.channels), - MessageItem::Array(MessageItemArray::new(bytes, "ay".into()).unwrap()), - ]) - } -} diff --git a/plugins/notification/src/notify_rust/macos.rs b/plugins/notification/src/notify_rust/macos.rs deleted file mode 100644 index c886c0a7..00000000 --- a/plugins/notification/src/notify_rust/macos.rs +++ /dev/null @@ -1,61 +0,0 @@ -use super::{error::*, notification::Notification}; - -pub use mac_notification_sys::error::{ApplicationError, Error as MacOsError, NotificationError}; - -use std::ops::{Deref, DerefMut}; - -/// A handle to a shown notification. -/// -/// This keeps a connection alive to ensure actions work on certain desktops. -#[derive(Debug)] -pub struct NotificationHandle { - notification: Notification, -} - -impl NotificationHandle { - #[allow(missing_docs)] - pub fn new(notification: Notification) -> NotificationHandle { - NotificationHandle { notification } - } -} - -impl Deref for NotificationHandle { - type Target = Notification; - - fn deref(&self) -> &Notification { - &self.notification - } -} - -/// Allow to easily modify notification properties -impl DerefMut for NotificationHandle { - fn deref_mut(&mut self) -> &mut Notification { - &mut self.notification - } -} - -pub(crate) fn show_notification(notification: &Notification) -> Result { - mac_notification_sys::Notification::default() - .title(notification.summary.as_str()) - .message(¬ification.body) - .maybe_subtitle(notification.subtitle.as_deref()) - .maybe_sound(notification.sound_name.as_deref()) - .send()?; - - Ok(NotificationHandle::new(notification.clone())) -} - -pub(crate) fn schedule_notification( - notification: &Notification, - delivery_date: f64, -) -> Result { - mac_notification_sys::Notification::default() - .title(notification.summary.as_str()) - .message(¬ification.body) - .maybe_subtitle(notification.subtitle.as_deref()) - .maybe_sound(notification.sound_name.as_deref()) - .delivery_date(delivery_date) - .send()?; - - Ok(NotificationHandle::new(notification.clone())) -} diff --git a/plugins/notification/src/notify_rust/miniver.rs b/plugins/notification/src/notify_rust/miniver.rs deleted file mode 100644 index 5c8deb83..00000000 --- a/plugins/notification/src/notify_rust/miniver.rs +++ /dev/null @@ -1,75 +0,0 @@ -use super::error::*; -use std::str::FromStr; - -#[derive(Copy, Clone, Eq, Debug)] -pub struct Version { - pub major: u64, - pub minor: u64, -} - -impl Version { - #[allow(dead_code)] - pub fn new(major: u64, minor: u64) -> Self { - Self { major, minor } - } -} - -impl FromStr for Version { - type Err = Error; - fn from_str(s: &str) -> Result { - let vv = s.split('.').collect::>(); - match (vv.first(), vv.get(1)) { - (Some(maj), Some(min)) => Ok(Version { - major: maj.parse()?, - minor: min.parse()?, - }), - _ => Err(ErrorKind::SpecVersion(s.into()).into()), - } - } -} - -use std::cmp; - -impl PartialOrd for Version { - fn partial_cmp(&self, other: &Version) -> Option { - Some(self.cmp(other)) - } -} - -impl PartialEq for Version { - fn eq(&self, other: &Version) -> bool { - self.major == other.major && self.minor == other.minor - } -} - -impl Ord for Version { - fn cmp(&self, other: &Version) -> cmp::Ordering { - match self.major.cmp(&other.major) { - cmp::Ordering::Equal => {} - r => return r, - } - match self.minor.cmp(&other.minor) { - cmp::Ordering::Equal => {} - r => return r, - } - cmp::Ordering::Equal - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn version_parsing() { - assert_eq!("1.3".parse::().unwrap(), Version::new(1, 3)); - } - - #[test] - fn version_comparison() { - assert!(Version::new(1, 3) >= Version::new(1, 2)); - assert!(Version::new(1, 2) >= Version::new(1, 2)); - assert!(Version::new(1, 2) == Version::new(1, 2)); - assert!(Version::new(1, 1) <= Version::new(1, 2)); - } -} diff --git a/plugins/notification/src/notify_rust/mod.rs b/plugins/notification/src/notify_rust/mod.rs deleted file mode 100644 index 6177db84..00000000 --- a/plugins/notification/src/notify_rust/mod.rs +++ /dev/null @@ -1,173 +0,0 @@ -//! Desktop Notifications for Rust. -//! -//! Desktop notifications are popup messages generated to notify the user of certain events. -//! -//! ## Platform Support -//! -//! This library was originally conceived with the [XDG](https://en.wikipedia.org/wiki/XDG) notification specification in mind. -//! Since version 3.3 this crate also builds on macOS, however the semantics of the [XDG](https://en.wikipedia.org/wiki/XDG) specification and macOS `NSNotifications` -//! are quite different. -//! Therefore only a very small subset of functions is supported on macOS. -//! Certain methods don't have any effect there, others will explicitly fail to compile, -//! in these cases you will have to add platform specific toggles to your code. -//! For more see [platform differences](#platform-differences) -//! -//! # Platform Differences -//!
-//! ✔︎ = works
-//! ❌ = will not compile -//! -//! ## `Notification` -//! | method | XDG | macOS | windows | -//! |---------------------|-------|-------|---------| -//! | `fn appname(...)` | ✔︎ | | | -//! | `fn summary(...)` | ✔︎ | ✔︎ | ✔︎ | -//! | `fn subtitle(...)` | | ✔︎ | ✔︎ | -//! | `fn body(...)` | ✔︎ | ✔︎ | ✔︎ | -//! | `fn icon(...)` | ✔︎ | | | -//! | `fn auto_icon(...)`| ✔︎ | | | -//! | `fn hint(...)` | ✔︎ | ❌ | ❌ | -//! | `fn timeout(...)` | ✔︎ | | ✔︎ | -//! | `fn urgency(...)` | ✔︎ | ❌ | ❌ | -//! | `fn action(...)` | ✔︎ | | | -//! | `fn id(...)` | ✔︎ | | | -//! | `fn finalize(...)` | ✔︎ | ✔︎ | ✔︎ | -//! | `fn show(...)` | ✔︎ | ✔︎ | ✔︎ | -//! -//! ## `NotificationHandle` -//! -//! | method | XDG | macOS | windows | -//! |--------------------------|-----|-------|---------| -//! | `fn wait_for_action(...)`| ✔︎ | ❌ | ❌ | -//! | `fn close(...)` | ✔︎ | ❌ | ❌ | -//! | `fn on_close(...)` | ✔︎ | ❌ | ❌ | -//! | `fn update(...)` | ✔︎ | ❌ | ❌ | -//! | `fn id(...)` | ✔︎ | ❌ | ❌ | -//! -//! ## Functions -//! -//! | | XDG | macOS | windows | -//! |--------------------------------------------|-----|-------|---------| -//! | `fn get_capabilities(...)` | ✔︎ | ❌ | ❌ | -//! | `fn get_server_information(...)` | ✔︎ | ❌ | ❌ | -//! | `fn set_application(...)` | ❌ | ✔︎ | ❌ | -//! | `fn get_bundle_identifier_or_default(...)` | ❌ | ✔︎ | ❌ | -//! -//! -//! ### Toggles -//! -//! Please use `target_os` toggles if you plan on using methods labeled with ❌. -//! -//! ```ignore -//! #[cfg(target_os = "macos")] -//! // or -//! // #### #[cfg(all(unix, not(target_os = "macos")))] -//! ``` -//!
-//! - -#![deny( - missing_copy_implementations, - trivial_casts, - trivial_numeric_casts, - unsafe_code, - unused_import_braces, - unused_qualifications -)] -#![warn( - missing_docs, - clippy::doc_markdown, - clippy::semicolon_if_nothing_returned, - clippy::single_match_else, - clippy::inconsistent_struct_constructor, - clippy::map_unwrap_or, - clippy::match_same_arms -)] - -#[cfg(all(feature = "dbus", unix, not(target_os = "macos")))] -extern crate dbus; - -#[cfg(target_os = "macos")] -extern crate mac_notification_sys; - -#[cfg(target_os = "windows")] -extern crate winrt_notification; - -#[macro_use] -#[cfg(all(feature = "images", unix, not(target_os = "macos")))] -extern crate lazy_static; - -pub mod error; -mod hints; -mod miniver; -mod notification; -mod timeout; -pub(crate) mod urgency; - -#[cfg(target_os = "macos")] -mod macos; - -#[cfg(target_os = "windows")] -mod windows; - -#[cfg(all(unix, not(target_os = "macos")))] -mod xdg; - -#[cfg(all(feature = "images", unix, not(target_os = "macos")))] -mod image; - -#[cfg(all(feature = "server", feature = "dbus", unix, not(target_os = "macos")))] -pub mod server; - -#[cfg(target_os = "macos")] -pub use mac_notification_sys::{get_bundle_identifier_or_default, set_application}; - -#[cfg(target_os = "macos")] -pub use macos::NotificationHandle; - -#[cfg(all( - any(feature = "dbus", feature = "zbus"), - unix, - not(target_os = "macos") -))] -pub use xdg::{ - dbus_stack, get_capabilities, get_server_information, handle_action, ActionResponse, - CloseHandler, CloseReason, DbusStack, NotificationHandle, -}; - -#[cfg(all(feature = "server", unix, not(target_os = "macos")))] -pub use xdg::stop_server; - -pub use hints::Hint; - -#[cfg(all(feature = "images", unix, not(target_os = "macos")))] -pub use image::{Image, ImageError}; - -#[cfg_attr( - target_os = "macos", - deprecated(note = "Urgency is not supported on macOS") -)] -pub use urgency::Urgency; - -pub use {notification::Notification, timeout::Timeout}; - -#[cfg(all(feature = "images", unix, not(target_os = "macos")))] -lazy_static! { - /// Read once at runtime. Needed for Images - pub static ref SPEC_VERSION: miniver::Version = - get_server_information() - .and_then(|info| info.spec_version.parse::()) - .unwrap_or_else(|_| miniver::Version::new(1,1)); -} -/// Return value of `get_server_information()`. -#[derive(Debug)] -pub struct ServerInformation { - /// The product name of the server. - pub name: String, - /// The vendor name. - pub vendor: String, - /// The server's version string. - pub version: String, - /// The specification version the server is compliant with. - pub spec_version: String, -} diff --git a/plugins/notification/src/notify_rust/notification.rs b/plugins/notification/src/notify_rust/notification.rs deleted file mode 100644 index 256941af..00000000 --- a/plugins/notification/src/notify_rust/notification.rs +++ /dev/null @@ -1,480 +0,0 @@ -#[cfg(all(unix, not(target_os = "macos")))] -use super::{ - hints::{CustomHintType, Hint}, - urgency::Urgency, - xdg, -}; - -#[cfg(all(unix, not(target_os = "macos"), feature = "images"))] -use super::image::Image; - -#[cfg(all(unix, target_os = "macos"))] -use super::macos; -#[cfg(target_os = "windows")] -use super::windows; - -use super::{error::*, timeout::Timeout}; - -#[cfg(all(unix, not(target_os = "macos")))] -use std::collections::{HashMap, HashSet}; - -// Returns the name of the current executable, used as a default for `Notification.appname`. -fn exe_name() -> String { - std::env::current_exe() - .unwrap() - .file_name() - .unwrap() - .to_str() - .unwrap() - .to_owned() -} - -/// Desktop notification. -/// -/// A desktop notification is configured via builder pattern, before it is launched with `show()`. -#[derive(Debug, Clone)] -#[non_exhaustive] -pub struct Notification { - /// Filled by default with executable name. - pub appname: String, - - /// Single line to summarize the content. - pub summary: String, - - /// Subtitle for macOS - pub subtitle: Option, - - /// Multiple lines possible, may support simple markup, - /// check out `get_capabilities()` -> `body-markup` and `body-hyperlinks`. - pub body: String, - - /// Use a file:// URI or a name in an icon theme, must be compliant freedesktop.org. - pub icon: String, - - /// Check out `Hint` - /// - /// # warning - /// this does not hold all hints, [`Hint::Custom`] and [`Hint::CustomInt`] are held elsewhere, - // /// please access hints via [`Notification::get_hints`]. - #[cfg(all(unix, not(target_os = "macos")))] - pub hints: HashSet, - - #[cfg(all(unix, not(target_os = "macos")))] - pub(crate) hints_unique: HashMap<(String, CustomHintType), Hint>, - - /// See `Notification::actions()` and `Notification::action()` - pub actions: Vec, - - #[cfg(target_os = "macos")] - pub(crate) sound_name: Option, - - #[cfg(target_os = "windows")] - pub(crate) sound_name: Option, - - #[cfg(target_os = "windows")] - pub(crate) path_to_image: Option, - - #[cfg(target_os = "windows")] - pub(crate) app_id: Option, - - #[cfg(all(unix, not(target_os = "macos")))] - pub(crate) bus: xdg::NotificationBus, - - /// Lifetime of the Notification in ms. Often not respected by server, sorry. - pub timeout: Timeout, // both gnome and galago want allow for -1 - - /// Only to be used on the receive end. Use Notification hand for updating. - pub(crate) id: Option, -} - -impl Notification { - /// Constructs a new Notification. - /// - /// Most fields are empty by default, only `appname` is initialized with the name of the current - /// executable. - /// The appname is used by some desktop environments to group notifications. - pub fn new() -> Notification { - Notification::default() - } - - /// This is for testing purposes only and will not work with actual implementations. - #[cfg(all(unix, not(target_os = "macos")))] - #[doc(hidden)] - #[deprecated(note = "this is a test only feature")] - pub fn at_bus(sub_bus: &str) -> Notification { - let bus = xdg::NotificationBus::custom(sub_bus) - .ok_or("invalid subpath") - .unwrap(); - Notification { - bus, - ..Notification::default() - } - } - - /// Overwrite the appname field used for Notification. - /// - /// # Platform Support - /// Please note that this method has no effect on macOS. Here you can only set the application via [`set_application()`](fn.set_application.html) - pub fn appname(&mut self, appname: &str) -> &mut Notification { - self.appname = appname.to_owned(); - self - } - - /// Set the `summary`. - /// - /// Often acts as title of the notification. For more elaborate content use the `body` field. - pub fn summary(&mut self, summary: &str) -> &mut Notification { - self.summary = summary.to_owned(); - self - } - - /// Set the `subtitle`. - /// - /// This is only useful on macOS, it's not part of the XDG specification and will therefore be eaten by gremlins under your CPU 😈🤘. - pub fn subtitle(&mut self, subtitle: &str) -> &mut Notification { - self.subtitle = Some(subtitle.to_owned()); - self - } - - /// Manual wrapper for `Hint::ImageData` - #[cfg(all(feature = "images", unix, not(target_os = "macos")))] - pub fn image_data(&mut self, image: Image) -> &mut Notification { - self.hint(Hint::ImageData(image)); - self - } - - /// Wrapper for `Hint::ImagePath` - #[cfg(all(unix, not(target_os = "macos")))] - pub fn image_path(&mut self, path: &str) -> &mut Notification { - self.hint(Hint::ImagePath(path.to_string())); - self - } - - /// Wrapper for `NotificationHint::ImagePath` - #[cfg(target_os = "windows")] - pub fn image_path(&mut self, path: &str) -> &mut Notification { - self.path_to_image = Some(path.to_string()); - self - } - - /// app's System.AppUserModel.ID - #[cfg(target_os = "windows")] - pub fn app_id(&mut self, app_id: &str) -> &mut Notification { - self.app_id = Some(app_id.to_string()); - self - } - - /// Wrapper for `Hint::ImageData` - #[cfg(all(feature = "images", unix, not(target_os = "macos")))] - pub fn image + Sized>( - &mut self, - path: T, - ) -> Result<&mut Notification> { - let img = Image::open(&path)?; - self.hint(Hint::ImageData(img)); - Ok(self) - } - - /// Wrapper for `Hint::SoundName` - #[cfg(all(unix, not(target_os = "macos")))] - pub fn sound_name(&mut self, name: &str) -> &mut Notification { - self.hint(Hint::SoundName(name.to_owned())); - self - } - - /// Set the `sound_name` for the `NSUserNotification` - #[cfg(any(target_os = "macos", target_os = "windows"))] - pub fn sound_name(&mut self, name: &str) -> &mut Notification { - self.sound_name = Some(name.to_owned()); - self - } - - /// Set the content of the `body` field. - /// - /// Multiline textual content of the notification. - /// Each line should be treated as a paragraph. - /// Simple html markup should be supported, depending on the server implementation. - pub fn body(&mut self, body: &str) -> &mut Notification { - self.body = body.to_owned(); - self - } - - /// Set the `icon` field. - /// - /// You can use common icon names here, usually those in `/usr/share/icons` - /// can all be used. - /// You can also use an absolute path to file. - /// - /// # Platform support - /// macOS does not have support manually setting the icon. However you can pretend to be another app using [`set_application()`](fn.set_application.html) - pub fn icon(&mut self, icon: &str) -> &mut Notification { - self.icon = icon.to_owned(); - self - } - - /// Set the `icon` field automatically. - /// - /// This looks at your binary's name and uses it to set the icon. - /// - /// # Platform support - /// macOS does not support manually setting the icon. However you can pretend to be another app using [`set_application()`](fn.set_application.html) - pub fn auto_icon(&mut self) -> &mut Notification { - self.icon = exe_name(); - self - } - - /// Adds a hint. - /// - /// This method will add a hint to the internal hint [`HashSet`]. - /// Hints must be of type [`Hint`]. - /// - /// Many of these are again wrapped by more convenient functions such as: - /// - /// * `sound_name(...)` - /// * `urgency(...)` - /// * [`image(...)`](#method.image) or - /// * [`image_data(...)`](#method.image_data) - /// * [`image_path(...)`](#method.image_path) - /// - /// # Platform support - /// Most of these hints don't even have an effect on the big XDG Desktops, they are completely tossed on macOS. - #[cfg(all(unix, not(target_os = "macos")))] - pub fn hint(&mut self, hint: Hint) -> &mut Notification { - match hint { - Hint::CustomInt(k, v) => { - self.hints_unique - .insert((k.clone(), CustomHintType::Int), Hint::CustomInt(k, v)); - } - Hint::Custom(k, v) => { - self.hints_unique - .insert((k.clone(), CustomHintType::String), Hint::Custom(k, v)); - } - _ => { - self.hints.insert(hint); - } - } - self - } - - #[cfg(all(unix, not(target_os = "macos")))] - pub(crate) fn get_hints(&self) -> impl Iterator { - self.hints.iter().chain(self.hints_unique.values()) - } - - /// Set the `timeout`. - /// - /// Accepts multiple types that implement `Into`. - /// - /// ## `i31` - /// - /// This sets the time (in milliseconds) from the time the notification is displayed until it is - /// closed again by the Notification Server. - /// According to [specification](https://developer.gnome.org/notification-spec/) - /// -1 will leave the timeout to be set by the server and - /// 0 will cause the notification never to expire. - - /// ## [Duration](`std::time::Duration`) - /// - /// When passing a [`Duration`](`std::time::Duration`) we will try convert it into milliseconds. - /// - /// # Platform support - /// This only works on XDG Desktops, macOS does not support manually setting the timeout. - pub fn timeout>(&mut self, timeout: T) -> &mut Notification { - self.timeout = timeout.into(); - self - } - - /// Set the `urgency`. - /// - /// Pick between Medium, Low and High. - /// - /// # Platform support - /// Most Desktops on linux and bsd are far too relaxed to pay any attention to this. - /// In macOS this does not exist - #[cfg(all(unix, not(target_os = "macos")))] - pub fn urgency(&mut self, urgency: Urgency) -> &mut Notification { - self.hint(Hint::Urgency(urgency)); // TODO impl as T where T: Into - self - } - - /// Set `actions`. - /// - /// To quote - /// - /// > Actions are sent over as a list of pairs. - /// > Each even element in the list (starting at index 0) represents the identifier for the action. - /// > Each odd element in the list is the localized string that will be displayed to the user.y - /// - /// There is nothing fancy going on here yet. - /// **Careful! This replaces the internal list of actions!** - /// - /// (xdg only) - #[deprecated(note = "please use .action() only")] - pub fn actions(&mut self, actions: Vec) -> &mut Notification { - self.actions = actions; - self - } - - /// Add an action. - /// - /// This adds a single action to the internal list of actions. - /// - /// (xdg only) - pub fn action(&mut self, identifier: &str, label: &str) -> &mut Notification { - self.actions.push(identifier.to_owned()); - self.actions.push(label.to_owned()); - self - } - - /// Set an Id ahead of time - /// - /// Setting the id ahead of time allows overriding a known other notification. - /// Though if you want to update a notification, it is easier to use the `update()` method of - /// the `NotificationHandle` object that `show()` returns. - /// - /// (xdg only) - pub fn id(&mut self, id: u32) -> &mut Notification { - self.id = Some(id); - self - } - - /// Finalizes a Notification. - /// - /// Part of the builder pattern, returns a complete copy of the built notification. - pub fn finalize(&self) -> Notification { - self.clone() - } - - /// Schedules a Notification - /// - /// Sends a Notification at the specified date. - #[cfg(all(target_os = "macos", feature = "chrono"))] - pub fn schedule( - &self, - delivery_date: chrono::DateTime, - ) -> Result { - macos::schedule_notification(self, delivery_date.timestamp() as f64) - } - - /// Schedules a Notification - /// - /// Sends a Notification at the specified timestamp. - /// This is a raw `f64`, if that is a bit too raw for you please activate the feature `"chrono"`, - /// then you can use `Notification::schedule()` instead, which accepts a `chrono::DateTime`. - #[cfg(target_os = "macos")] - pub fn schedule_raw(&self, timestamp: f64) -> Result { - macos::schedule_notification(self, timestamp) - } - - /// Sends Notification to D-Bus. - /// - /// Returns a handle to a notification - #[cfg(all(unix, not(target_os = "macos")))] - pub fn show(&self) -> Result { - xdg::show_notification(self) - } - - /// Sends Notification to D-Bus. - /// - /// Returns a handle to a notification - #[cfg(all(unix, not(target_os = "macos")))] - #[cfg(all(feature = "async", feature = "zbus"))] - pub async fn show_async(&self) -> Result { - xdg::show_notification_async(self).await - } - - /// Sends Notification to D-Bus. - /// - /// Returns a handle to a notification - #[cfg(all(unix, not(target_os = "macos")))] - #[cfg(feature = "async")] - // #[cfg(test)] - pub async fn show_async_at_bus(&self, sub_bus: &str) -> Result { - let bus = super::xdg::NotificationBus::custom(sub_bus).ok_or("invalid subpath")?; - super::xdg::show_notification_async_at_bus(self, bus).await - } - - /// Sends Notification to `NSUserNotificationCenter`. - /// - /// Returns an `Ok` no matter what, since there is currently no way of telling the success of - /// the notification. - #[cfg(target_os = "macos")] - pub fn show(&self) -> Result { - macos::show_notification(self) - } - - /// Sends Notification to `NSUserNotificationCenter`. - /// - /// Returns an `Ok` no matter what, since there is currently no way of telling the success of - /// the notification. - #[cfg(target_os = "windows")] - pub fn show(&self) -> Result<()> { - windows::show_notification(self) - } - - /// Wraps `show()` but prints notification to stdout. - #[cfg(all(unix, not(target_os = "macos")))] - #[deprecated = "this was never meant to be public API"] - pub fn show_debug(&mut self) -> Result { - println!( - "Notification:\n{appname}: ({icon}) {summary:?} {body:?}\nhints: [{hints:?}]\n", - appname = self.appname, - summary = self.summary, - body = self.body, - hints = self.hints, - icon = self.icon, - ); - self.show() - } -} - -impl Default for Notification { - #[cfg(all(unix, not(target_os = "macos")))] - fn default() -> Notification { - Notification { - appname: exe_name(), - summary: String::new(), - subtitle: None, - body: String::new(), - icon: String::new(), - hints: HashSet::new(), - hints_unique: HashMap::new(), - actions: Vec::new(), - timeout: Timeout::Default, - bus: Default::default(), - id: None, - } - } - - #[cfg(target_os = "macos")] - fn default() -> Notification { - Notification { - appname: exe_name(), - summary: String::new(), - subtitle: None, - body: String::new(), - icon: String::new(), - actions: Vec::new(), - timeout: Timeout::Default, - sound_name: Default::default(), - id: None, - } - } - - #[cfg(target_os = "windows")] - fn default() -> Notification { - Notification { - appname: exe_name(), - summary: String::new(), - subtitle: None, - body: String::new(), - icon: String::new(), - actions: Vec::new(), - timeout: Timeout::Default, - sound_name: Default::default(), - id: None, - path_to_image: None, - app_id: None, - } - } -} diff --git a/plugins/notification/src/notify_rust/server.rs b/plugins/notification/src/notify_rust/server.rs deleted file mode 100644 index c6802ece..00000000 --- a/plugins/notification/src/notify_rust/server.rs +++ /dev/null @@ -1,238 +0,0 @@ -//! **Experimental** server taking the place of your Desktop Environment's Notification Server. -//! -//! This is not nearly meant for anything but testing, as it only prints notifications to stdout. -//! It does not respond properly either yet. -//! -//! This server will not replace an already running notification server. -//! - -#![allow(unused_imports, unused_variables, dead_code)] - -use std::cell::Cell; -use std::collections::{HashMap, HashSet}; -use std::sync::{Arc, Mutex}; - -#[cfg(feature = "dbus")] -use dbus::{ - arg::{self, RefArg}, - ffidisp::{BusType, Connection, NameFlag}, - tree::{self, Factory, Interface, MTFn, MTSync, Tree}, - Path, -}; - -use super::xdg::{NOTIFICATION_NAMESPACE, NOTIFICATION_OBJECTPATH}; -use super::{Hint, Notification, Timeout}; - -static DBUS_ERROR_FAILED: &str = "org.freedesktop.DBus.Error.Failed"; -/// Version of the crate equals the version server. -pub const VERSION: &str = env!("CARGO_PKG_VERSION"); - -/// An **experimental** notification server. -/// See [the module level documentation](index.html) for more. -#[derive(Debug, Default)] -pub struct NotificationServer { - /// Counter for generating notification ids - counter: Mutex>, - - /// A flag that stops the server - stopped: Mutex>, -} - -impl NotificationServer { - fn count_up(&self) { - if let Ok(counter) = self.counter.lock() { - counter.set(counter.get() + 1); - } - } - - fn stop(&self) { - if let Ok(stop) = self.stopped.lock() { - stop.set(true); - } - } - - fn is_stopped(&self) -> bool { - if let Ok(stop) = self.stopped.lock() { - stop.get() - } else { - true - } - } - - /// Create a new `NotificationServer` instance. - pub fn create() -> Arc { - Arc::new(NotificationServer::default()) - } - // pub fn notify_mothod(&mut self, closure: F) - // -> Method - // where F: Fn(&Notification) - // { - - // fn handle_notification - - /// Start listening for incoming notifications - pub fn start(me: &Arc, closure: F) - where - F: Fn(&Notification), - { - let connection = Connection::get_private(BusType::Session).unwrap(); - - connection.release_name(NOTIFICATION_NAMESPACE).unwrap(); - connection - .register_name(NOTIFICATION_NAMESPACE, NameFlag::ReplaceExisting as u32) - .unwrap(); - connection - .register_object_path(NOTIFICATION_OBJECTPATH) - .unwrap(); - - let mytex = Arc::new(Mutex::new(me.clone())); - - let factory = Factory::new_fn::<()>(); // D::Tree = () - let tree = factory.tree(()).add( - factory - .object_path(NOTIFICATION_OBJECTPATH, ()) - .introspectable() - .add( - factory - .interface(NOTIFICATION_NAMESPACE, ()) - .add_m(method_notify(&factory, closure)) - .add_m(method_close_notification(&factory)) - .add_m(Self::stop_server(mytex.clone(), &factory)) - // .add_signal(method_notification_closed(&factory)) - // .add_signal(method_action_invoked(&factory)) - .add_m(method_get_capabilities(&factory)) - .add_m(method_get_server_information(&factory)), - ), - ); - - connection.add_handler(tree); - - while !me.is_stopped() { - // Wait for incoming messages. This will block up to one second. - // Discard the result - relevant messages have already been handled. - if let Some(received) = connection.incoming(1000).next() { - println!("RECEIVED {:?}", received); - } - } - } - - fn stop_server( - me: Arc>>, - factory: &Factory, - ) -> tree::Method, ()> { - factory - .method("Stop", (), move |minfo| { - if let Ok(me) = me.lock() { - me.stop(); - println!("STOPPING"); - Ok(vec![]) - } else { - Err(tree::MethodErr::failed(&String::from("nope!"))) - } - }) - .out_arg(("", "u")) - } -} - -fn hints_from_variants(hints: &HashMap) -> HashSet { - hints.iter().map(Into::into).collect() -} - -fn method_notify( - factory: &Factory, - on_notification: F, -) -> tree::Method, ()> -where - F: Fn(&Notification), -{ - factory - .method("Notify", (), move |minfo| { - let mut i = minfo.msg.iter_init(); - let appname: String = i.read()?; - let replaces_id: u32 = i.read()?; - let icon: String = i.read()?; - let summary: String = i.read()?; - let body: String = i.read()?; - let actions: Vec = i.read()?; - let hints: ::std::collections::HashMap>> = - i.read()?; - let timeout: i32 = i.read()?; - println!("hints {:?} ", hints); - - // let arg0 = try!(d.notify(app_name, replaces_id, app_icon, summary, body, actions, hints, timeout)); - let notification = Notification { - appname, - icon, - summary, - body, - actions, - hints: hints_from_variants(&hints), - timeout: Timeout::from(timeout), - id: if replaces_id == 0 { - None - } else { - Some(replaces_id) - }, - subtitle: None, - }; - - on_notification(¬ification); - - let arg0 = 43; - let rm = minfo.msg.method_return(); - let rm = rm.append1(arg0); - Ok(vec![rm]) - }) - .in_arg(("app_name", "s")) - .in_arg(("replaces_id", "u")) - .in_arg(("app_icon", "s")) - .in_arg(("summary", "s")) - .in_arg(("body", "s")) - .in_arg(("actions", "as")) - .in_arg(("hints", "a{sv}")) - .in_arg(("timeout", "i")) - .out_arg(("", "u")) -} - -fn method_close_notification(factory: &Factory) -> tree::Method, ()> { - factory - .method("CloseNotification", (), |minfo| { - let i = minfo.msg.iter_init(); - let rm = minfo.msg.method_return(); - Ok(vec![rm]) - }) - .in_arg(("id", "u")) -} - -fn method_get_capabilities(factory: &Factory) -> tree::Method, ()> { - factory - .method("GetCapabilities", (), |minfo| { - let caps: Vec = vec![]; - let rm = minfo.msg.method_return(); - let rm = rm.append1(caps); - Ok(vec![rm]) - }) - .out_arg(("caps", "as")) -} - -fn method_get_server_information(factory: &Factory) -> tree::Method, ()> { - factory - .method("GetServerInformation", (), |minfo| { - let (name, vendor, version, spec_version) = ( - "notify-rust", - "notify-rust", - env!("CARGO_PKG_VERSION"), - "0.0.0", - ); - let rm = minfo.msg.method_return(); - let rm = rm.append1(name); - let rm = rm.append1(vendor); - let rm = rm.append1(version); - let rm = rm.append1(spec_version); - Ok(vec![rm]) - }) - .out_arg(("name", "s")) - .out_arg(("vendor", "s")) - .out_arg(("version", "s")) - .out_arg(("spec_version", "s")) -} diff --git a/plugins/notification/src/notify_rust/timeout.rs b/plugins/notification/src/notify_rust/timeout.rs deleted file mode 100644 index 6b76a55a..00000000 --- a/plugins/notification/src/notify_rust/timeout.rs +++ /dev/null @@ -1,102 +0,0 @@ -use std::{convert::TryInto, num::ParseIntError, str::FromStr, time::Duration}; - -/// Describes the timeout of a notification -/// -/// # `FromStr` -/// You can also parse a `Timeout` from a `&str`. -#[derive(Debug, Copy, Clone, PartialEq, Eq)] -pub enum Timeout { - /// Expires according to server default. - /// - /// Whatever that might be... - Default, - - /// Do not expire, user will have to close this manually. - Never, - - /// Expire after n milliseconds. - Milliseconds(u32), -} - -impl Default for Timeout { - fn default() -> Self { - Timeout::Default - } -} - -#[test] -fn timeout_from_i32() { - assert_eq!(Timeout::from(234), Timeout::Milliseconds(234)); - assert_eq!(Timeout::from(-234), Timeout::Default); - assert_eq!(Timeout::from(0), Timeout::Never); -} - -impl From for Timeout { - fn from(int: i32) -> Timeout { - use std::cmp::Ordering::*; - match int.cmp(&0) { - Greater => Timeout::Milliseconds(int as u32), - Less => Timeout::Default, - Equal => Timeout::Never, - } - } -} - -impl From for Timeout { - fn from(duration: Duration) -> Timeout { - if duration.is_zero() { - Timeout::Never - } else if duration.as_millis() > u32::MAX.into() { - Timeout::Default - } else { - Timeout::Milliseconds(duration.as_millis().try_into().unwrap_or(u32::MAX)) - } - } -} - -impl From for i32 { - fn from(timeout: Timeout) -> Self { - match timeout { - Timeout::Default => -1, - Timeout::Never => 0, - Timeout::Milliseconds(ms) => ms as i32, - } - } -} - -impl FromStr for Timeout { - type Err = ParseIntError; - - fn from_str(s: &str) -> Result { - match s { - "default" => Ok(Timeout::Default), - "never" => Ok(Timeout::Never), - milliseconds => Ok(Timeout::Milliseconds(u32::from_str(milliseconds)?)), - } - } -} - -pub struct TimeoutMessage(Timeout); - -impl From for TimeoutMessage { - fn from(hint: Timeout) -> Self { - TimeoutMessage(hint) - } -} - -impl std::ops::Deref for TimeoutMessage { - type Target = Timeout; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -#[cfg(all(feature = "dbus", unix, not(target_os = "macos")))] -impl TryFrom<&dbus::arg::messageitem::MessageItem> for TimeoutMessage { - type Error = (); - - fn try_from(mi: &dbus::arg::messageitem::MessageItem) -> Result { - mi.inner::().map(|i| TimeoutMessage(i.into())) - } -} diff --git a/plugins/notification/src/notify_rust/urgency.rs b/plugins/notification/src/notify_rust/urgency.rs deleted file mode 100644 index eeddf763..00000000 --- a/plugins/notification/src/notify_rust/urgency.rs +++ /dev/null @@ -1,74 +0,0 @@ -use super::error::ErrorKind; -use std::convert::TryFrom; - -/// Levels of Urgency. -/// -/// # Specification -/// > Developers must use their own judgement when deciding the urgency of a notification. Typically, if the majority of programs are using the same level for a specific type of urgency, other applications should follow them. -/// > -/// > For low and normal urgencies, server implementations may display the notifications how they choose. They should, however, have a sane expiration timeout dependent on the urgency level. -/// > -/// > **Critical notifications should not automatically expire**, as they are things that the user will most likely want to know about. They should only be closed when the user dismisses them, for example, by clicking on the notification. -/// -/// — see [Galago](http://www.galago-project.org/specs/notification/0.9/x320.html) or [Gnome](https://developer.gnome.org/notification-spec/#urgency-levels) specification. -#[derive(Eq, PartialEq, Hash, Copy, Clone, Debug)] -pub enum Urgency { - /// The behavior for `Low` urgency depends on the notification server. - Low = 0, - /// The behavior for `Normal` urgency depends on the notification server. - Normal = 1, - /// A critical notification will not time out. - Critical = 2, -} - -impl TryFrom<&str> for Urgency { - type Error = super::error::Error; - - #[rustfmt::skip] - fn try_from(string: &str) -> Result { - match string.to_lowercase().as_ref() { - "low" | - "lo" => Ok(Urgency::Low), - "normal" | - "medium" => Ok(Urgency::Normal), - "critical" | - "high" | - "hi" => Ok(Urgency::Critical), - _ => Err(ErrorKind::Conversion(format!("invalid input {:?}", string)).into()) - } - } -} - -impl From> for Urgency { - fn from(maybe_int: Option) -> Urgency { - match maybe_int { - Some(0) => Urgency::Low, - Some(x) if x >= 2 => Urgency::Critical, - _ => Urgency::Normal, - } - } -} - -// TODO: remove this in v5.0 -#[cfg(not(feature = "server"))] -impl From for Urgency { - fn from(int: u64) -> Urgency { - match int { - 0 => Urgency::Low, - 1 => Urgency::Normal, - 2..=std::u64::MAX => Urgency::Critical, - } - } -} - -// TODO: make this the default in v5.0 -#[cfg(feature = "server")] -impl From for Urgency { - fn from(int: u8) -> Urgency { - match int { - 0 => Urgency::Low, - 1 => Urgency::Normal, - 2..=std::u8::MAX => Urgency::Critical, - } - } -} diff --git a/plugins/notification/src/notify_rust/windows.rs b/plugins/notification/src/notify_rust/windows.rs deleted file mode 100644 index 423aae99..00000000 --- a/plugins/notification/src/notify_rust/windows.rs +++ /dev/null @@ -1,40 +0,0 @@ -use winrt_notification::Toast; - -pub use super::{error::*, notification::Notification, timeout::Timeout}; - -use std::{path::Path, str::FromStr}; - -pub(crate) fn show_notification(notification: &Notification) -> Result<()> { - let sound = match ¬ification.sound_name { - Some(chosen_sound_name) => winrt_notification::Sound::from_str(chosen_sound_name).ok(), - None => None, - }; - - let duration = match notification.timeout { - Timeout::Default => winrt_notification::Duration::Short, - Timeout::Never => winrt_notification::Duration::Long, - Timeout::Milliseconds(t) => { - if t >= 25000 { - winrt_notification::Duration::Long - } else { - winrt_notification::Duration::Short - } - } - }; - - let powershell_app_id = &Toast::POWERSHELL_APP_ID.to_string(); - let app_id = ¬ification.app_id.as_ref().unwrap_or(powershell_app_id); - let mut toast = Toast::new(app_id) - .title(¬ification.summary) - .text1(notification.subtitle.as_ref().map_or("", AsRef::as_ref)) // subtitle - .text2(¬ification.body) - .sound(sound) - .duration(duration); - if let Some(image_path) = ¬ification.path_to_image { - toast = toast.image(Path::new(&image_path), ""); - } - - toast - .show() - .map_err(|e| Error::from(ErrorKind::Msg(format!("{:?}", e)))) -} diff --git a/plugins/notification/src/notify_rust/xdg/bus.rs b/plugins/notification/src/notify_rust/xdg/bus.rs deleted file mode 100644 index cd6c1cca..00000000 --- a/plugins/notification/src/notify_rust/xdg/bus.rs +++ /dev/null @@ -1,68 +0,0 @@ -use super::super::xdg::NOTIFICATION_DEFAULT_BUS; - -fn skip_first_slash(s: &str) -> &str { - if let Some('/') = s.chars().next() { - &s[1..] - } else { - s - } -} - -use std::path::PathBuf; - -type BusNameType = std::borrow::Cow<'static, str>; - -#[derive(Clone, Debug)] -pub struct NotificationBus(BusNameType); - -impl Default for NotificationBus { - #[cfg(feature = "zbus")] - fn default() -> Self { - Self( - zbus::names::WellKnownName::from_static_str(NOTIFICATION_DEFAULT_BUS) - .unwrap() - .to_string() - .into(), - ) - } - - #[cfg(all(feature = "dbus", not(feature = "zbus")))] - fn default() -> Self { - Self( - dbus::strings::BusName::from_slice(NOTIFICATION_DEFAULT_BUS) - .unwrap() - .to_string() - .into(), - ) - } -} - -impl NotificationBus { - fn namespaced_custom(custom_path: &str) -> Option { - // abusing path for semantic join - skip_first_slash( - PathBuf::from("/de/hoodie/Notification") - .join(custom_path) - .to_str()?, - ) - .replace('/', ".") - .into() - } - - #[cfg(feature = "zbus")] - pub fn custom(custom_path: &str) -> Option { - let name = - zbus::names::WellKnownName::try_from(Self::namespaced_custom(custom_path)?).ok()?; - Some(Self(name.to_string().into())) - } - - #[cfg(all(feature = "dbus", not(feature = "zbus")))] - pub fn custom(custom_path: &str) -> Option { - let name = dbus::strings::BusName::new(Self::namespaced_custom(custom_path)?).ok()?; - Some(Self(name.to_string().into())) - } - - pub fn into_name(self) -> BusNameType { - self.0 - } -} diff --git a/plugins/notification/src/notify_rust/xdg/dbus_rs.rs b/plugins/notification/src/notify_rust/xdg/dbus_rs.rs deleted file mode 100644 index b1658122..00000000 --- a/plugins/notification/src/notify_rust/xdg/dbus_rs.rs +++ /dev/null @@ -1,328 +0,0 @@ -use dbus::{ - arg::messageitem::{MessageItem, MessageItemArray}, - ffidisp::{BusType, Connection, ConnectionItem}, - Message, -}; - -use super::{ - bus::NotificationBus, ActionResponse, ActionResponseHandler, CloseReason, - NOTIFICATION_INTERFACE, -}; - -use super::super::{ - error::*, - hints::message::HintMessage, - notification::Notification, - xdg::{ServerInformation, NOTIFICATION_OBJECTPATH}, -}; - -pub mod bus { - - use super::super::super::xdg::NOTIFICATION_DEFAULT_BUS; - - fn skip_first_slash(s: &str) -> &str { - if let Some('/') = s.chars().next() { - &s[1..] - } else { - s - } - } - - use std::path::PathBuf; - - type BusNameType = dbus::strings::BusName<'static>; - - #[derive(Clone, Debug)] - pub struct NotificationBus(BusNameType); - - impl Default for NotificationBus { - fn default() -> Self { - Self(dbus::strings::BusName::from_slice(NOTIFICATION_DEFAULT_BUS).unwrap()) - } - } - - impl NotificationBus { - fn namespaced_custom(custom_path: &str) -> Option { - // abusing path for semantic join - skip_first_slash( - PathBuf::from("/de/hoodie/Notification") - .join(custom_path) - .to_str()?, - ) - .replace('/', ".") - .into() - } - - pub fn custom(custom_path: &str) -> Option { - let name = dbus::strings::BusName::new(Self::namespaced_custom(custom_path)?).ok()?; - Some(Self(name)) - } - - pub fn into_name(self) -> BusNameType { - self.0 - } - } -} - -/// A handle to a shown notification. -/// -/// This keeps a connection alive to ensure actions work on certain desktops. -#[derive(Debug)] -pub struct DbusNotificationHandle { - pub(crate) id: u32, - pub(crate) connection: Connection, - pub(crate) notification: Notification, -} - -impl DbusNotificationHandle { - pub(crate) fn new( - id: u32, - connection: Connection, - notification: Notification, - ) -> DbusNotificationHandle { - DbusNotificationHandle { - id, - connection, - notification, - } - } - - pub fn wait_for_action(self, invocation_closure: impl ActionResponseHandler) { - wait_for_action_signal(&self.connection, self.id, invocation_closure); - } - - pub fn close(self) { - let mut message = build_message("CloseNotification", Default::default()); - message.append_items(&[self.id.into()]); - let _ = self.connection.send(message); // If closing fails there's nothing we could do anyway - } - - pub fn on_close(self, closure: F) - where - F: FnOnce(CloseReason), - { - self.wait_for_action(|action: &ActionResponse| { - if let ActionResponse::Closed(reason) = action { - closure(*reason); - } - }); - } - - pub fn update(&mut self) { - self.id = send_notification_via_connection(&self.notification, self.id, &self.connection) - .unwrap(); - } -} - -pub fn send_notification_via_connection( - notification: &Notification, - id: u32, - connection: &Connection, -) -> Result { - send_notification_via_connection_at_bus(notification, id, connection, Default::default()) -} - -pub fn send_notification_via_connection_at_bus( - notification: &Notification, - id: u32, - connection: &Connection, - bus: NotificationBus, -) -> Result { - let mut message = build_message("Notify", bus); - let timeout: i32 = notification.timeout.into(); - message.append_items(&[ - notification.appname.to_owned().into(), // appname - id.into(), // notification to update - notification.icon.to_owned().into(), // icon - notification.summary.to_owned().into(), // summary (title) - notification.body.to_owned().into(), // body - pack_actions(notification), // actions - pack_hints(notification)?, // hints - timeout.into(), // timeout - ]); - - let reply = connection.send_with_reply_and_block(message, 2000)?; - - match reply.get_items().first() { - Some(MessageItem::UInt32(ref id)) => Ok(*id), - _ => Ok(0), - } -} - -pub fn connect_and_send_notification( - notification: &Notification, -) -> Result { - let bus = notification.bus.clone(); - connect_and_send_notification_at_bus(notification, bus) -} - -pub fn connect_and_send_notification_at_bus( - notification: &Notification, - bus: NotificationBus, -) -> Result { - let connection = Connection::get_private(BusType::Session)?; - let inner_id = notification.id.unwrap_or(0); - let id = send_notification_via_connection_at_bus(notification, inner_id, &connection, bus)?; - - Ok(DbusNotificationHandle::new( - id, - connection, - notification.clone(), - )) -} - -fn build_message(method_name: &str, bus: NotificationBus) -> Message { - Message::new_method_call( - bus.into_name(), - NOTIFICATION_OBJECTPATH, - NOTIFICATION_INTERFACE, - method_name, - ) - .unwrap_or_else(|_| panic!("Error building message call {:?}.", method_name)) -} - -pub fn pack_hints(notification: &Notification) -> Result { - if !notification.hints.is_empty() || !notification.hints_unique.is_empty() { - let hints = notification - .get_hints() - .cloned() - .map(HintMessage::wrap_hint) - .collect::>(); - - if let Ok(array) = MessageItem::new_dict(hints) { - return Ok(array); - } - } - - Ok(MessageItem::Array( - MessageItemArray::new(vec![], "a{sv}".into()).unwrap(), - )) -} - -pub fn pack_actions(notification: &Notification) -> MessageItem { - if !notification.actions.is_empty() { - let mut actions = vec![]; - for action in ¬ification.actions { - actions.push(action.to_owned().into()); - } - if let Ok(array) = MessageItem::new_array(actions) { - return array; - } - } - - MessageItem::Array(MessageItemArray::new(vec![], "as".into()).unwrap()) -} - -pub fn get_capabilities() -> Result> { - let mut capabilities = vec![]; - - let message = build_message("GetCapabilities", Default::default()); - let connection = Connection::get_private(BusType::Session)?; - let reply = connection.send_with_reply_and_block(message, 2000)?; - - if let Some(MessageItem::Array(items)) = reply.get_items().first() { - for item in items.iter() { - if let MessageItem::Str(ref cap) = *item { - capabilities.push(cap.clone()); - } - } - } - - Ok(capabilities) -} - -fn unwrap_message_string(item: Option<&MessageItem>) -> String { - match item { - Some(MessageItem::Str(value)) => value.to_owned(), - _ => "".to_owned(), - } -} - -#[allow(clippy::get_first)] -pub fn get_server_information() -> Result { - let message = build_message("GetServerInformation", Default::default()); - let connection = Connection::get_private(BusType::Session)?; - let reply = connection.send_with_reply_and_block(message, 2000)?; - - let items = reply.get_items(); - - Ok(ServerInformation { - name: unwrap_message_string(items.get(0)), - vendor: unwrap_message_string(items.get(1)), - version: unwrap_message_string(items.get(2)), - spec_version: unwrap_message_string(items.get(3)), - }) -} - -/// Listens for the `ActionInvoked(UInt32, String)` Signal. -/// -/// No need to use this, check out `Notification::show_and_wait_for_action(FnOnce(action:&str))` -pub fn handle_action(id: u32, func: impl ActionResponseHandler) { - let connection = Connection::get_private(BusType::Session).unwrap(); - wait_for_action_signal(&connection, id, func); -} - -// Listens for the `ActionInvoked(UInt32, String)` signal. -fn wait_for_action_signal(connection: &Connection, id: u32, handler: impl ActionResponseHandler) { - connection - .add_match(&format!( - "interface='{}',member='ActionInvoked'", - NOTIFICATION_INTERFACE - )) - .unwrap(); - connection - .add_match(&format!( - "interface='{}',member='NotificationClosed'", - NOTIFICATION_INTERFACE - )) - .unwrap(); - - for item in connection.iter(1000) { - if let ConnectionItem::Signal(message) = item { - let items = message.get_items(); - - let (path, interface, member) = ( - message.path().map_or_else(String::new, |p| { - p.into_cstring().to_string_lossy().into_owned() - }), - message.interface().map_or_else(String::new, |p| { - p.into_cstring().to_string_lossy().into_owned() - }), - message.member().map_or_else(String::new, |p| { - p.into_cstring().to_string_lossy().into_owned() - }), - ); - match (path.as_str(), interface.as_str(), member.as_str()) { - // match (protocol.unwrap(), iface.unwrap(), member.unwrap()) { - // Action Invoked - (path, interface, "ActionInvoked") - if path == NOTIFICATION_OBJECTPATH && interface == NOTIFICATION_INTERFACE => - { - if let (&MessageItem::UInt32(nid), MessageItem::Str(ref action)) = - (&items[0], &items[1]) - { - if nid == id { - handler.call(&ActionResponse::Custom(action)); - break; - } - } - } - - // Notification Closed - (path, interface, "NotificationClosed") - if path == NOTIFICATION_OBJECTPATH && interface == NOTIFICATION_INTERFACE => - { - if let (&MessageItem::UInt32(nid), &MessageItem::UInt32(reason)) = - (&items[0], &items[1]) - { - if nid == id { - handler.call(&ActionResponse::Closed(reason.into())); - break; - } - } - } - (..) => (), - } - } - } -} diff --git a/plugins/notification/src/notify_rust/xdg/mod.rs b/plugins/notification/src/notify_rust/xdg/mod.rs deleted file mode 100644 index 3012b570..00000000 --- a/plugins/notification/src/notify_rust/xdg/mod.rs +++ /dev/null @@ -1,544 +0,0 @@ -//! This module contains `XDG` and `DBus` specific code. -//! -//! it should not be available under any platform other than `(unix, not(target_os = "macos"))` - -#[cfg(feature = "dbus")] -use dbus::ffidisp::Connection as DbusConnection; -#[cfg(feature = "zbus")] -use zbus::{block_on, zvariant}; - -use super::{error::*, notification::Notification}; - -use std::ops::{Deref, DerefMut}; - -#[cfg(feature = "dbus")] -mod dbus_rs; -#[cfg(all(feature = "dbus", not(feature = "zbus")))] -use dbus_rs::bus; - -#[cfg(feature = "zbus")] -mod zbus_rs; -#[cfg(all(feature = "zbus", not(feature = "dbus")))] -use zbus_rs::bus; - -#[cfg(all(feature = "dbus", feature = "zbus"))] -mod bus; - -// #[cfg(all(feature = "server", feature = "dbus", unix, not(target_os = "macos")))] -// pub mod server_dbus; - -// #[cfg(all(feature = "server", feature = "zbus", unix, not(target_os = "macos")))] -// pub mod server_zbus; - -// #[cfg(all(feature = "server", unix, not(target_os = "macos")))] -// pub mod server; - -#[cfg(not(feature = "debug_namespace"))] -#[doc(hidden)] -pub static NOTIFICATION_DEFAULT_BUS: &str = "org.freedesktop.Notifications"; - -#[cfg(feature = "debug_namespace")] -#[doc(hidden)] -// #[deprecated] -pub static NOTIFICATION_DEFAULT_BUS: &str = "de.hoodie.Notifications"; - -#[doc(hidden)] -pub static NOTIFICATION_INTERFACE: &str = "org.freedesktop.Notifications"; - -#[doc(hidden)] -pub static NOTIFICATION_OBJECTPATH: &str = "/org/freedesktop/Notifications"; - -pub(crate) use bus::NotificationBus; - -#[derive(Debug)] -enum NotificationHandleInner { - #[cfg(feature = "dbus")] - Dbus(dbus_rs::DbusNotificationHandle), - - #[cfg(feature = "zbus")] - Zbus(zbus_rs::ZbusNotificationHandle), -} - -/// A handle to a shown notification. -/// -/// This keeps a connection alive to ensure actions work on certain desktops. -#[derive(Debug)] -pub struct NotificationHandle { - inner: NotificationHandleInner, -} - -#[allow(dead_code)] -impl NotificationHandle { - #[cfg(feature = "dbus")] - pub(crate) fn for_dbus( - id: u32, - connection: DbusConnection, - notification: Notification, - ) -> NotificationHandle { - NotificationHandle { - inner: dbus_rs::DbusNotificationHandle::new(id, connection, notification).into(), - } - } - - #[cfg(feature = "zbus")] - pub(crate) fn for_zbus( - id: u32, - connection: zbus::Connection, - notification: Notification, - ) -> NotificationHandle { - NotificationHandle { - inner: zbus_rs::ZbusNotificationHandle::new(id, connection, notification).into(), - } - } - - /// Waits for the user to act on a notification and then calls - /// `invocation_closure` with the name of the corresponding action. - pub fn wait_for_action(self, invocation_closure: F) - where - F: FnOnce(&str), - { - match self.inner { - #[cfg(feature = "dbus")] - NotificationHandleInner::Dbus(inner) => { - inner.wait_for_action(|action: &ActionResponse| match action { - ActionResponse::Custom(action) => invocation_closure(action), - ActionResponse::Closed(_reason) => invocation_closure("__closed"), // FIXME: remove backward compatibility with 5.0 - }); - } - - #[cfg(feature = "zbus")] - NotificationHandleInner::Zbus(inner) => { - block_on( - inner.wait_for_action(|action: &ActionResponse| match action { - ActionResponse::Custom(action) => invocation_closure(action), - ActionResponse::Closed(_reason) => invocation_closure("__closed"), // FIXME: remove backward compatibility with 5.0 - }), - ); - } - }; - } - - /// Manually close the notification - pub fn close(self) { - match self.inner { - #[cfg(feature = "dbus")] - NotificationHandleInner::Dbus(inner) => inner.close(), - #[cfg(feature = "zbus")] - NotificationHandleInner::Zbus(inner) => block_on(inner.close()), - } - } - - /// Executes a closure after the notification has closed. - pub fn on_close(self, handler: impl CloseHandler) { - match self.inner { - #[cfg(feature = "dbus")] - NotificationHandleInner::Dbus(inner) => { - inner.wait_for_action(|action: &ActionResponse| { - if let ActionResponse::Closed(reason) = action { - handler.call(*reason); - } - }); - } - #[cfg(feature = "zbus")] - NotificationHandleInner::Zbus(inner) => { - block_on(inner.wait_for_action(|action: &ActionResponse| { - if let ActionResponse::Closed(reason) = action { - handler.call(*reason); - } - })); - } - }; - } - - pub fn update(&mut self) { - match self.inner { - #[cfg(feature = "dbus")] - NotificationHandleInner::Dbus(ref mut inner) => inner.update(), - #[cfg(feature = "zbus")] - NotificationHandleInner::Zbus(ref mut inner) => inner.update(), - } - } - - /// Returns the Handle's id. - pub fn id(&self) -> u32 { - match self.inner { - #[cfg(feature = "dbus")] - NotificationHandleInner::Dbus(ref inner) => inner.id, - #[cfg(feature = "zbus")] - NotificationHandleInner::Zbus(ref inner) => inner.id, - } - } -} - -/// Required for `DerefMut` -impl Deref for NotificationHandle { - type Target = Notification; - - fn deref(&self) -> &Notification { - match self.inner { - #[cfg(feature = "dbus")] - NotificationHandleInner::Dbus(ref inner) => &inner.notification, - #[cfg(feature = "zbus")] - NotificationHandleInner::Zbus(ref inner) => &inner.notification, - } - } -} - -/// Allow you to easily modify notification properties -impl DerefMut for NotificationHandle { - fn deref_mut(&mut self) -> &mut Notification { - match self.inner { - #[cfg(feature = "dbus")] - NotificationHandleInner::Dbus(ref mut inner) => &mut inner.notification, - #[cfg(feature = "zbus")] - NotificationHandleInner::Zbus(ref mut inner) => &mut inner.notification, - } - } -} - -#[cfg(feature = "dbus")] -impl From for NotificationHandleInner { - fn from(handle: dbus_rs::DbusNotificationHandle) -> NotificationHandleInner { - NotificationHandleInner::Dbus(handle) - } -} - -#[cfg(feature = "zbus")] -impl From for NotificationHandleInner { - fn from(handle: zbus_rs::ZbusNotificationHandle) -> NotificationHandleInner { - NotificationHandleInner::Zbus(handle) - } -} - -#[cfg(feature = "dbus")] -impl From for NotificationHandle { - fn from(handle: dbus_rs::DbusNotificationHandle) -> NotificationHandle { - NotificationHandle { - inner: handle.into(), - } - } -} - -#[cfg(feature = "zbus")] -impl From for NotificationHandle { - fn from(handle: zbus_rs::ZbusNotificationHandle) -> NotificationHandle { - NotificationHandle { - inner: handle.into(), - } - } -} - -// here be public functions - -// TODO: breaking change, wait for 5.0 -// #[cfg(all(feature = "dbus", feature = "zbus"))] -//compile_error!("the z and d features are mutually exclusive"); - -#[cfg(all( - not(any(feature = "dbus", feature = "zbus")), - unix, - not(target_os = "macos") -))] -compile_error!("you have to build with either zbus or dbus turned on"); - -/// Which Dbus implementation are we using? -#[derive(Copy, Clone, Debug)] -pub enum DbusStack { - /// using [dbus-rs](https://docs.rs/dbus-rs) - Dbus, - /// using [zbus](https://docs.rs/zbus) - Zbus, -} - -#[cfg(all(feature = "dbus", feature = "zbus"))] -const DBUS_SWITCH_VAR: &str = "DBUSRS"; - -#[cfg(all(feature = "zbus", not(feature = "dbus")))] -pub(crate) fn show_notification(notification: &Notification) -> Result { - block_on(zbus_rs::connect_and_send_notification(notification)).map(Into::into) -} - -#[cfg(all(feature = "async", feature = "zbus"))] -pub(crate) async fn show_notification_async( - notification: &Notification, -) -> Result { - zbus_rs::connect_and_send_notification(notification) - .await - .map(Into::into) -} - -#[cfg(all(feature = "async", feature = "zbus"))] -pub(crate) async fn show_notification_async_at_bus( - notification: &Notification, - bus: NotificationBus, -) -> Result { - zbus_rs::connect_and_send_notification_at_bus(notification, bus) - .await - .map(Into::into) -} - -#[cfg(all(feature = "dbus", not(feature = "zbus")))] -pub(crate) fn show_notification(notification: &Notification) -> Result { - dbus_rs::connect_and_send_notification(notification).map(Into::into) -} - -#[cfg(all(feature = "dbus", feature = "zbus"))] -pub(crate) fn show_notification(notification: &Notification) -> Result { - if std::env::var(DBUS_SWITCH_VAR).is_ok() { - dbus_rs::connect_and_send_notification(notification).map(Into::into) - } else { - block_on(zbus_rs::connect_and_send_notification(notification)).map(Into::into) - } -} - -/// Get the currently used [`DbusStack`] -/// -/// (zbus only) -#[cfg(all(feature = "zbus", not(feature = "dbus")))] -pub fn dbus_stack() -> Option { - Some(DbusStack::Zbus) -} - -/// Get the currently used [`DbusStack`] -/// -/// (dbus-rs only) -#[cfg(all(feature = "dbus", not(feature = "zbus")))] -pub fn dbus_stack() -> Option { - Some(DbusStack::Dbus) -} - -/// Get the currently used [`DbusStack`] -/// -/// both dbus-rs and zbus, switch via `$ZBUS_NOTIFICATION` -#[cfg(all(feature = "dbus", feature = "zbus"))] -pub fn dbus_stack() -> Option { - Some(if std::env::var(DBUS_SWITCH_VAR).is_ok() { - DbusStack::Dbus - } else { - DbusStack::Zbus - }) -} - -/// Get the currently used [`DbusStack`] -/// -/// neither zbus nor dbus-rs are configured -#[cfg(all(not(feature = "dbus"), not(feature = "zbus")))] -pub fn dbus_stack() -> Option { - None -} - -/// Get list of all capabilities of the running notification server. -/// -/// (zbus only) -#[cfg(all(feature = "zbus", not(feature = "dbus")))] -pub fn get_capabilities() -> Result> { - block_on(zbus_rs::get_capabilities()) -} - -/// Get list of all capabilities of the running notification server. -/// -/// (dbus-rs only) -#[cfg(all(feature = "dbus", not(feature = "zbus")))] -pub fn get_capabilities() -> Result> { - dbus_rs::get_capabilities() -} - -/// Get list of all capabilities of the running notification server. -/// -/// both dbus-rs and zbus, switch via `$ZBUS_NOTIFICATION` -#[cfg(all(feature = "dbus", feature = "zbus"))] -pub fn get_capabilities() -> Result> { - if std::env::var(DBUS_SWITCH_VAR).is_ok() { - dbus_rs::get_capabilities() - } else { - block_on(zbus_rs::get_capabilities()) - } -} - -/// Returns a struct containing `ServerInformation`. -/// -/// This struct contains `name`, `vendor`, `version` and `spec_version` of the notification server -/// running. -/// -/// (zbus only) -#[cfg(all(feature = "zbus", not(feature = "dbus")))] -pub fn get_server_information() -> Result { - block_on(zbus_rs::get_server_information()) -} - -/// Returns a struct containing `ServerInformation`. -/// -/// This struct contains `name`, `vendor`, `version` and `spec_version` of the notification server -/// running. -/// -/// (dbus-rs only) -#[cfg(all(feature = "dbus", not(feature = "zbus")))] -pub fn get_server_information() -> Result { - dbus_rs::get_server_information() -} - -/// Returns a struct containing `ServerInformation`. -/// -/// This struct contains `name`, `vendor`, `version` and `spec_version` of the notification server -/// running. -/// -/// both dbus-rs and zbus, switch via `$ZBUS_NOTIFICATION` -#[cfg(all(feature = "dbus", feature = "zbus"))] -pub fn get_server_information() -> Result { - if std::env::var(DBUS_SWITCH_VAR).is_ok() { - dbus_rs::get_server_information() - } else { - block_on(zbus_rs::get_server_information()) - } -} - -/// Return value of `get_server_information()`. -#[derive(Debug, serde::Deserialize)] -#[cfg_attr(feature = "zbus", derive(zvariant::Type))] -pub struct ServerInformation { - /// The product name of the server. - pub name: String, - /// The vendor name. - pub vendor: String, - /// The server's version string. - pub version: String, - /// The specification version the server is compliant with. - pub spec_version: String, -} - -/// Strictly internal. -/// The NotificationServer implemented here exposes a "Stop" function. -/// stops the notification server -#[cfg(all(feature = "server", unix, not(target_os = "macos")))] -#[doc(hidden)] -pub fn stop_server() { - #[cfg(feature = "dbus")] - dbus_rs::stop_server() -} - -/// Listens for the `ActionInvoked(UInt32, String)` Signal. -/// -/// No need to use this, check out [`NotificationHandle::wait_for_action`] -/// (xdg only) -#[cfg(all(feature = "zbus", not(feature = "dbus")))] -// #[deprecated(note="please use [`NotificationHandle::wait_for_action`]")] -pub fn handle_action(id: u32, func: F) -where - F: FnOnce(&ActionResponse), -{ - block_on(zbus_rs::handle_action(id, func)); -} - -/// Listens for the `ActionInvoked(UInt32, String)` Signal. -/// -/// No need to use this, check out [`NotificationHandle::wait_for_action`] -/// (xdg only) -#[cfg(all(feature = "dbus", not(feature = "zbus")))] -// #[deprecated(note="please use `NotificationHandle::wait_for_action`")] -pub fn handle_action(id: u32, func: F) -where - F: FnOnce(&ActionResponse), -{ - dbus_rs::handle_action(id, func); -} - -/// Listens for the `ActionInvoked(UInt32, String)` Signal. -/// -/// No need to use this, check out [`NotificationHandle::wait_for_action`] -/// both dbus-rs and zbus, switch via `$ZBUS_NOTIFICATION` -#[cfg(all(feature = "dbus", feature = "zbus"))] -// #[deprecated(note="please use `NotificationHandle::wait_for_action`")] -pub fn handle_action(id: u32, func: F) -where - F: FnOnce(&ActionResponse), -{ - if std::env::var(DBUS_SWITCH_VAR).is_ok() { - dbus_rs::handle_action(id, func); - } else { - block_on(zbus_rs::handle_action(id, func)); - } -} - -/// Reason passed to `NotificationClosed` Signal -/// -/// ## Specification -/// As listed under [Table 8. `NotificationClosed` Parameters](https://specifications.freedesktop.org/notification-spec/latest/ar01s09.html#idm46350804042704) -#[derive(Copy, Clone, Debug)] -pub enum CloseReason { - /// The notification expired - Expired, - /// The notification was dismissed by the user - Dismissed, - /// The notification was closed by a call to `CloseNotification` - CloseAction, - /// Undefined/Reserved reason - Other(u32), -} - -impl From for CloseReason { - fn from(raw_reason: u32) -> Self { - match raw_reason { - 1 => CloseReason::Expired, - 2 => CloseReason::Dismissed, - 3 => CloseReason::CloseAction, - other => CloseReason::Other(other), - } - } -} - -/// Helper Trait implemented by `Fn()` -pub trait ActionResponseHandler { - fn call(self, response: &ActionResponse); -} - -// impl ActionResponseHandler for F -impl ActionResponseHandler for F -where - F: FnOnce(&ActionResponse), -{ - fn call(self, res: &ActionResponse) { - (self)(res); - } -} - -/// Response to an action -pub enum ActionResponse<'a> { - /// Custom Action configured by the Notification. - Custom(&'a str), - - /// The Notification was closed. - Closed(CloseReason), -} - -impl<'a> From<&'a str> for ActionResponse<'a> { - fn from(raw: &'a str) -> Self { - Self::Custom(raw) - } -} - -/// Your handy callback for the `Close` signal of your Notification. -/// -/// This is implemented by `Fn()` and `Fn(CloseReason)`, so there is probably no good reason for you to manually implement this trait. -/// Should you find one anyway, please notify me and I'll gladly remove this obviously redundant comment. -pub trait CloseHandler { - /// This is called with the [`CloseReason`]. - fn call(&self, reason: CloseReason); -} - -impl CloseHandler for F -where - F: Fn(CloseReason), -{ - fn call(&self, reason: CloseReason) { - self(reason); - } -} - -impl CloseHandler<()> for F -where - F: Fn(), -{ - fn call(&self, _: CloseReason) { - self(); - } -} diff --git a/plugins/notification/src/notify_rust/xdg/zbus_rs.rs b/plugins/notification/src/notify_rust/xdg/zbus_rs.rs deleted file mode 100644 index 7bf7017a..00000000 --- a/plugins/notification/src/notify_rust/xdg/zbus_rs.rs +++ /dev/null @@ -1,285 +0,0 @@ -use super::super::{error::*, notification::Notification, xdg}; -use zbus::{export::futures_util::TryStreamExt, MatchRule}; - -use super::{bus::NotificationBus, ActionResponse, ActionResponseHandler, CloseReason}; - -pub mod bus { - - use super::super::super::xdg::NOTIFICATION_DEFAULT_BUS; - - fn skip_first_slash(s: &str) -> &str { - if let Some('/') = s.chars().next() { - &s[1..] - } else { - s - } - } - - use std::path::PathBuf; - - type BusNameType = zbus::names::WellKnownName<'static>; - - #[derive(Clone, Debug)] - pub struct NotificationBus(BusNameType); - - impl Default for NotificationBus { - #[cfg(feature = "zbus")] - fn default() -> Self { - Self(zbus::names::WellKnownName::from_static_str(NOTIFICATION_DEFAULT_BUS).unwrap()) - } - } - - impl NotificationBus { - fn namespaced_custom(custom_path: &str) -> Option { - // abusing path for semantic join - skip_first_slash( - PathBuf::from("/de/hoodie/Notification") - .join(custom_path) - .to_str()?, - ) - .replace('/', ".") - .into() - } - - pub fn custom(custom_path: &str) -> Option { - let name = - zbus::names::WellKnownName::try_from(Self::namespaced_custom(custom_path)?).ok()?; - Some(Self(name)) - } - - pub fn into_name(self) -> BusNameType { - self.0 - } - } -} - -/// A handle to a shown notification. -/// -/// This keeps a connection alive to ensure actions work on certain desktops. -#[derive(Debug)] -pub struct ZbusNotificationHandle { - pub(crate) id: u32, - pub(crate) connection: zbus::Connection, - pub(crate) notification: Notification, -} - -impl ZbusNotificationHandle { - pub(crate) fn new( - id: u32, - connection: zbus::Connection, - notification: Notification, - ) -> ZbusNotificationHandle { - ZbusNotificationHandle { - id, - connection, - notification, - } - } - - pub async fn wait_for_action(self, invocation_closure: impl ActionResponseHandler) { - wait_for_action_signal(&self.connection, self.id, invocation_closure).await; - } - - pub async fn close_fallible(self) -> Result<()> { - self.connection - .call_method( - Some(self.notification.bus.clone().into_name()), - xdg::NOTIFICATION_OBJECTPATH, - Some(xdg::NOTIFICATION_INTERFACE), - "CloseNotification", - &(self.id), - ) - .await?; - Ok(()) - } - - pub async fn close(self) { - self.close_fallible().await.unwrap(); - } - - pub fn on_close(self, closure: F) - where - F: FnOnce(CloseReason), - { - zbus::block_on(self.wait_for_action(|action: &ActionResponse| { - if let ActionResponse::Closed(reason) = action { - closure(*reason); - } - })); - } - - pub fn update_fallible(&mut self) -> Result<()> { - self.id = zbus::block_on(send_notification_via_connection( - &self.notification, - self.id, - &self.connection, - ))?; - Ok(()) - } - - pub fn update(&mut self) { - self.update_fallible().unwrap(); - } -} - -async fn send_notification_via_connection( - notification: &Notification, - id: u32, - connection: &zbus::Connection, -) -> Result { - send_notification_via_connection_at_bus(notification, id, connection, Default::default()).await -} - -async fn send_notification_via_connection_at_bus( - notification: &Notification, - id: u32, - connection: &zbus::Connection, - bus: NotificationBus, -) -> Result { - let reply: u32 = connection - .call_method( - Some(bus.into_name()), - xdg::NOTIFICATION_OBJECTPATH, - Some(xdg::NOTIFICATION_INTERFACE), - "Notify", - &( - ¬ification.appname, - id, - ¬ification.icon, - ¬ification.summary, - ¬ification.body, - ¬ification.actions, - super::super::hints::hints_to_map(notification), - i32::from(notification.timeout), - ), - ) - .await? - .body() - .deserialize()?; - Ok(reply) -} - -pub async fn connect_and_send_notification( - notification: &Notification, -) -> Result { - let bus = notification.bus.clone(); - connect_and_send_notification_at_bus(notification, bus).await -} - -pub(crate) async fn connect_and_send_notification_at_bus( - notification: &Notification, - bus: NotificationBus, -) -> Result { - let connection = zbus::Connection::session().await?; - let inner_id = notification.id.unwrap_or(0); - let id = - send_notification_via_connection_at_bus(notification, inner_id, &connection, bus).await?; - - Ok(ZbusNotificationHandle::new( - id, - connection, - notification.clone(), - )) -} - -pub async fn get_capabilities_at_bus(bus: NotificationBus) -> Result> { - let connection = zbus::Connection::session().await?; - let info: Vec = connection - .call_method( - Some(bus.into_name()), - xdg::NOTIFICATION_OBJECTPATH, - Some(xdg::NOTIFICATION_INTERFACE), - "GetCapabilities", - &(), - ) - .await? - .body() - .deserialize()?; - Ok(info) -} - -pub async fn get_capabilities() -> Result> { - get_capabilities_at_bus(Default::default()).await -} - -pub async fn get_server_information_at_bus(bus: NotificationBus) -> Result { - let connection = zbus::Connection::session().await?; - let info: xdg::ServerInformation = connection - .call_method( - Some(bus.into_name()), - xdg::NOTIFICATION_OBJECTPATH, - Some(xdg::NOTIFICATION_INTERFACE), - "GetServerInformation", - &(), - ) - .await? - .body() - .deserialize()?; - - Ok(info) -} - -pub async fn get_server_information() -> Result { - get_server_information_at_bus(Default::default()).await -} - -/// Listens for the `ActionInvoked(UInt32, String)` Signal. -/// -/// No need to use this, check out `Notification::show_and_wait_for_action(FnOnce(action:&str))` -pub async fn handle_action(id: u32, func: impl ActionResponseHandler) { - let connection = zbus::Connection::session().await.unwrap(); - wait_for_action_signal(&connection, id, func).await; -} - -async fn wait_for_action_signal( - connection: &zbus::Connection, - id: u32, - handler: impl ActionResponseHandler, -) { - let action_signal_rule = MatchRule::builder() - .msg_type(zbus::MessageType::Signal) - .interface(xdg::NOTIFICATION_INTERFACE) - .unwrap() - .member("ActionInvoked") - .unwrap() - .build(); - - let proxy = zbus::fdo::DBusProxy::new(connection).await.unwrap(); - proxy.add_match_rule(action_signal_rule).await.unwrap(); - - let close_signal_rule = MatchRule::builder() - .msg_type(zbus::MessageType::Signal) - .interface(xdg::NOTIFICATION_INTERFACE) - .unwrap() - .member("NotificationClosed") - .unwrap() - .build(); - proxy.add_match_rule(close_signal_rule).await.unwrap(); - - while let Ok(Some(msg)) = zbus::MessageStream::from(connection).try_next().await { - let header = msg.header(); - if let zbus::MessageType::Signal = header.message_type() { - match header.member() { - Some(name) if name == "ActionInvoked" => { - match msg.body().deserialize::<(u32, String)>() { - Ok((nid, action)) if nid == id => { - handler.call(&ActionResponse::Custom(&action)); - break; - } - _ => {} - } - } - Some(name) if name == "NotificationClosed" => { - match msg.body().deserialize::<(u32, u32)>() { - Ok((nid, reason)) if nid == id => { - handler.call(&ActionResponse::Closed(reason.into())); - break; - } - _ => {} - } - } - _ => {} - } - } - } -} diff --git a/plugins/os/CHANGELOG.md b/plugins/os/CHANGELOG.md index 6355fe2e..42311804 100644 --- a/plugins/os/CHANGELOG.md +++ b/plugins/os/CHANGELOG.md @@ -1,5 +1,56 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.8] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.7] + +- [`40ef9a81`](https://github.com/tauri-apps/plugins-workspace/commit/40ef9a818fb03457819c1d72ea84de57fbf868ba) ([#1514](https://github.com/tauri-apps/plugins-workspace/pull/1514) by [@fynntang](https://github.com/tauri-apps/plugins-workspace/../../fynntang)) **Changed:** `platform`, `arch`, `type`, `family`, `version` and `exe_extension` functions in the documentation examples to better reflect that these functions are synchronous. +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.6] + +- [`0959fe37`](https://github.com/tauri-apps/plugins-workspace/commit/0959fe3757250c6dea6247edb20e6ab468f20511) ([#1353](https://github.com/tauri-apps/plugins-workspace/pull/1353) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) **Breaking** Changed `platform`, `arch`, `type`, `family`, `version` and `exe_extension` functions to be sync. +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[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] + +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -53,4 +104,5 @@ - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ae67\`]\(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! + om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/os/Cargo.toml b/plugins/os/Cargo.toml index 5be5846f..88cd5ceb 100644 --- a/plugins/os/Cargo.toml +++ b/plugins/os/Cargo.toml @@ -1,19 +1,27 @@ [package] name = "tauri-plugin-os" -version = "2.0.0-beta.1" +version = "2.0.1" description = "Read information about the operating system." edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-os" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "full", notes = "" } +ios = { level = "full", notes = "" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -23,5 +31,5 @@ log = { workspace = true } thiserror = { workspace = true } os_info = "3" sys-locale = "0.3" -gethostname = "0.4" +gethostname = "0.5" serialize-to-javascript = "=0.1.1" diff --git a/plugins/os/README.md b/plugins/os/README.md index 6e518911..aafda769 100644 --- a/plugins/os/README.md +++ b/plugins/os/README.md @@ -2,9 +2,17 @@ Read information about the operating system. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ✓ | +| iOS | ✓ | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-os = "2.0.0-beta" +tauri-plugin-os = "2.0.0" # alternatively with Git: tauri-plugin-os = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -60,8 +68,8 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { version } from "@tauri-apps/plugin-os"; -const osVersion = await version(); +import { version } from '@tauri-apps/plugin-os' +const osVersion = await version() ``` ## Contributing diff --git a/plugins/os/SECURITY.md b/plugins/os/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/os/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/os/api-iife.js b/plugins/os/api-iife.js new file mode 100644 index 00000000..2b7924de --- /dev/null +++ b/plugins/os/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_OS__=function(_){"use strict";async function n(_,n={},o){return window.__TAURI_INTERNALS__.invoke(_,n,o)}return"function"==typeof SuppressedError&&SuppressedError,_.arch=function(){return window.__TAURI_OS_PLUGIN_INTERNALS__.arch},_.eol=function(){return window.__TAURI_OS_PLUGIN_INTERNALS__.eol},_.exeExtension=function(){return window.__TAURI_OS_PLUGIN_INTERNALS__.exe_extension},_.family=function(){return window.__TAURI_OS_PLUGIN_INTERNALS__.family},_.hostname=async function(){return await n("plugin:os|hostname")},_.locale=async function(){return await n("plugin:os|locale")},_.platform=function(){return window.__TAURI_OS_PLUGIN_INTERNALS__.platform},_.type=function(){return window.__TAURI_OS_PLUGIN_INTERNALS__.os_type},_.version=function(){return window.__TAURI_OS_PLUGIN_INTERNALS__.version},_}({});Object.defineProperty(window.__TAURI__,"os",{value:__TAURI_PLUGIN_OS__})} diff --git a/plugins/os/build.rs b/plugins/os/build.rs index 91dca73e..f108f965 100644 --- a/plugins/os/build.rs +++ b/plugins/os/build.rs @@ -14,5 +14,7 @@ const COMMANDS: &[&str] = &[ ]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/os/guest-js/index.ts b/plugins/os/guest-js/index.ts index 152d0f72..697ae8ed 100644 --- a/plugins/os/guest-js/index.ts +++ b/plugins/os/guest-js/index.ts @@ -8,43 +8,49 @@ * @module */ -import { invoke } from "@tauri-apps/api/core"; +import { invoke } from '@tauri-apps/api/core' /** @ignore */ declare global { interface Window { __TAURI_OS_PLUGIN_INTERNALS__: { - eol: string; - }; + eol: string + os_type: OsType + platform: Platform + family: Family + version: string + arch: Arch + exe_extension: string + } } } type Platform = - | "linux" - | "macos" - | "ios" - | "freebsd" - | "dragonfly" - | "netbsd" - | "openbsd" - | "solaris" - | "android" - | "windows"; - -type OsType = "linux" | "windows" | "macos" | "ios" | "android"; + | 'linux' + | 'macos' + | 'ios' + | 'freebsd' + | 'dragonfly' + | 'netbsd' + | 'openbsd' + | 'solaris' + | 'android' + | 'windows' + +type OsType = 'linux' | 'windows' | 'macos' | 'ios' | 'android' type Arch = - | "x86" - | "x86_64" - | "arm" - | "aarch64" - | "mips" - | "mips64" - | "powerpc" - | "powerpc64" - | "riscv64" - | "s390x" - | "sparc64"; + | 'x86' + | 'x86_64' + | 'arm' + | 'aarch64' + | 'mips' + | 'mips64' + | 'powerpc' + | 'powerpc64' + | 'riscv64' + | 's390x' + | 'sparc64' /** * Returns the operating system-specific end-of-line marker. @@ -53,8 +59,8 @@ type Arch = * * @since 2.0.0 * */ -function eol() { - return window.__TAURI_OS_PLUGIN_INTERNALS__.eol; +function eol(): string { + return window.__TAURI_OS_PLUGIN_INTERNALS__.eol } /** @@ -64,14 +70,14 @@ function eol() { * @example * ```typescript * import { platform } from '@tauri-apps/plugin-os'; - * const platformName = await platform(); + * const platformName = platform(); * ``` * * @since 2.0.0 * */ -async function platform(): Promise { - return invoke("plugin:os|platform"); +function platform(): Platform { + return window.__TAURI_OS_PLUGIN_INTERNALS__.platform } /** @@ -79,29 +85,29 @@ async function platform(): Promise { * @example * ```typescript * import { version } from '@tauri-apps/plugin-os'; - * const osVersion = await version(); + * const osVersion = version(); * ``` * * @since 2.0.0 */ -async function version(): Promise { - return invoke("plugin:os|version"); +function version(): string { + return window.__TAURI_OS_PLUGIN_INTERNALS__.version } -type Family = "unix" | "windows"; +type Family = 'unix' | 'windows' /** * Returns the current operating system family. Possible values are `'unix'`, `'windows'`. * @example * ```typescript * import { family } from '@tauri-apps/plugin-os'; - * const family = await family(); + * const family = family(); * ``` * * @since 2.0.0 */ -async function family(): Promise { - return invoke("plugin:os|family"); +function family(): Family { + return window.__TAURI_OS_PLUGIN_INTERNALS__.family } /** @@ -109,13 +115,13 @@ async function family(): Promise { * @example * ```typescript * import { type } from '@tauri-apps/plugin-os'; - * const osType = await type(); + * const osType = type(); * ``` * * @since 2.0.0 */ -async function type(): Promise { - return invoke("plugin:os|os_type"); +function type(): OsType { + return window.__TAURI_OS_PLUGIN_INTERNALS__.os_type } /** @@ -124,44 +130,44 @@ async function type(): Promise { * @example * ```typescript * import { arch } from '@tauri-apps/plugin-os'; - * const archName = await arch(); + * const archName = arch(); * ``` * * @since 2.0.0 */ -async function arch(): Promise { - return invoke("plugin:os|arch"); +function arch(): Arch { + return window.__TAURI_OS_PLUGIN_INTERNALS__.arch } /** - * Returns a String with a `BCP-47` language tag inside. If the locale couldn’t be obtained, `null` is returned instead. + * Returns the file extension, if any, used for executable binaries on this platform. Possible values are `'exe'` and `''` (empty string). * @example * ```typescript - * import { locale } from '@tauri-apps/plugin-os'; - * const locale = await locale(); - * if (locale) { - * // use the locale string here - * } + * import { exeExtension } from '@tauri-apps/plugin-os'; + * const exeExt = exeExtension(); * ``` * * @since 2.0.0 */ -async function locale(): Promise { - return invoke("plugin:os|locale"); +function exeExtension(): string { + return window.__TAURI_OS_PLUGIN_INTERNALS__.exe_extension } /** - * Returns the file extension, if any, used for executable binaries on this platform. Possible values are `'exe'` and `''` (empty string). + * Returns a String with a `BCP-47` language tag inside. If the locale couldn’t be obtained, `null` is returned instead. * @example * ```typescript - * import { exeExtension } from '@tauri-apps/plugin-os'; - * const exeExt = await exeExtension(); + * import { locale } from '@tauri-apps/plugin-os'; + * const locale = await locale(); + * if (locale) { + * // use the locale string here + * } * ``` * * @since 2.0.0 */ -async function exeExtension(): Promise { - return invoke("plugin:os|exe_extension"); +async function locale(): Promise { + return await invoke('plugin:os|locale') } /** @@ -173,7 +179,7 @@ async function exeExtension(): Promise { * ``` */ async function hostname(): Promise { - return invoke("plugin:os|hostname"); + return await invoke('plugin:os|hostname') } export { @@ -185,6 +191,6 @@ export { arch, locale, exeExtension, - hostname, -}; -export type { Platform, OsType, Arch, Family }; + hostname +} +export type { Platform, OsType, Arch, Family } diff --git a/plugins/os/package.json b/plugins/os/package.json index 53fbd680..f255299a 100644 --- a/plugins/os/package.json +++ b/plugins/os/package.json @@ -1,10 +1,11 @@ { "name": "@tauri-apps/plugin-os", - "version": "2.0.0-beta.1", - "license": "MIT or APACHE-2.0", + "version": "2.0.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -23,6 +24,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/os/permissions/autogenerated/reference.md b/plugins/os/permissions/autogenerated/reference.md index f8d334fb..88fcd6fa 100644 --- a/plugins/os/permissions/autogenerated/reference.md +++ b/plugins/os/permissions/autogenerated/reference.md @@ -1,66 +1,237 @@ -# Permissions +## Default Permission -## allow-arch +This permission set configures which +operating system information are available +to gather from the frontend. + +#### Granted Permissions + +All information except the host name are available. + + + +- `allow-arch` +- `allow-exe-extension` +- `allow-family` +- `allow-locale` +- `allow-os-type` +- `allow-platform` +- `allow-version` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`os:allow-arch` + + Enables the arch command without any pre-configured scope. -## deny-arch +
+ +`os:deny-arch` + + Denies the arch command without any pre-configured scope. -## allow-exe-extension +
+ +`os:allow-exe-extension` + + Enables the exe_extension command without any pre-configured scope. -## deny-exe-extension +
+ +`os:deny-exe-extension` + + Denies the exe_extension command without any pre-configured scope. -## allow-family +
+ +`os:allow-family` + + Enables the family command without any pre-configured scope. -## deny-family +
+ +`os:deny-family` + + Denies the family command without any pre-configured scope. -## allow-hostname +
+ +`os:allow-hostname` + + Enables the hostname command without any pre-configured scope. -## deny-hostname +
+ +`os:deny-hostname` + + Denies the hostname command without any pre-configured scope. -## allow-locale +
+ +`os:allow-locale` + + Enables the locale command without any pre-configured scope. -## deny-locale +
+ +`os:deny-locale` + + Denies the locale command without any pre-configured scope. -## allow-os-type +
+ +`os:allow-os-type` + + Enables the os_type command without any pre-configured scope. -## deny-os-type +
+ +`os:deny-os-type` + + Denies the os_type command without any pre-configured scope. -## allow-platform +
+ +`os:allow-platform` + + Enables the platform command without any pre-configured scope. -## deny-platform +
+ +`os:deny-platform` + + Denies the platform command without any pre-configured scope. -## allow-version +
+ +`os:allow-version` + + Enables the version command without any pre-configured scope. -## deny-version +
+ +`os:deny-version` + + Denies the version command without any pre-configured scope. +
diff --git a/plugins/os/permissions/default.toml b/plugins/os/permissions/default.toml new file mode 100644 index 00000000..217b389c --- /dev/null +++ b/plugins/os/permissions/default.toml @@ -0,0 +1,23 @@ +"$schema" = "schemas/schema.json" + +[default] +description = """ +This permission set configures which +operating system information are available +to gather from the frontend. + +#### Granted Permissions + +All information except the host name are available. + +""" + +permissions = [ + "allow-arch", + "allow-exe-extension", + "allow-family", + "allow-locale", + "allow-os-type", + "allow-platform", + "allow-version", +] diff --git a/plugins/os/permissions/schemas/schema.json b/plugins/os/permissions/schemas/schema.json index f12b60e4..ad053532 100644 --- a/plugins/os/permissions/schemas/schema.json +++ b/plugins/os/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,120 +251,133 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-arch -> Enables the arch command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-arch" + "macOS" ] }, { - "description": "deny-arch -> Denies the arch command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-arch" + "windows" ] }, { - "description": "allow-exe-extension -> Enables the exe_extension command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-exe-extension" + "linux" ] }, { - "description": "deny-exe-extension -> Denies the exe_extension command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-exe-extension" + "android" ] }, { - "description": "allow-family -> Enables the family command without any pre-configured scope.", + "description": "iOS.", "type": "string", "enum": [ - "allow-family" + "iOS" ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the arch command without any pre-configured scope.", + "type": "string", + "const": "allow-arch" }, { - "description": "deny-family -> Denies the family command without any pre-configured scope.", + "description": "Denies the arch command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-family" - ] + "const": "deny-arch" }, { - "description": "allow-hostname -> Enables the hostname command without any pre-configured scope.", + "description": "Enables the exe_extension command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-hostname" - ] + "const": "allow-exe-extension" }, { - "description": "deny-hostname -> Denies the hostname command without any pre-configured scope.", + "description": "Denies the exe_extension command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-hostname" - ] + "const": "deny-exe-extension" }, { - "description": "allow-locale -> Enables the locale command without any pre-configured scope.", + "description": "Enables the family command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-locale" - ] + "const": "allow-family" }, { - "description": "deny-locale -> Denies the locale command without any pre-configured scope.", + "description": "Denies the family command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-locale" - ] + "const": "deny-family" }, { - "description": "allow-os-type -> Enables the os_type command without any pre-configured scope.", + "description": "Enables the hostname command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-os-type" - ] + "const": "allow-hostname" }, { - "description": "deny-os-type -> Denies the os_type command without any pre-configured scope.", + "description": "Denies the hostname command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-os-type" - ] + "const": "deny-hostname" }, { - "description": "allow-platform -> Enables the platform command without any pre-configured scope.", + "description": "Enables the locale command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-platform" - ] + "const": "allow-locale" }, { - "description": "deny-platform -> Denies the platform command without any pre-configured scope.", + "description": "Denies the locale command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-platform" - ] + "const": "deny-locale" }, { - "description": "allow-version -> Enables the version command without any pre-configured scope.", + "description": "Enables the os_type command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-version" - ] + "const": "allow-os-type" }, { - "description": "deny-version -> Denies the version command without any pre-configured scope.", + "description": "Denies the os_type command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-version" - ] + "const": "deny-os-type" + }, + { + "description": "Enables the platform command without any pre-configured scope.", + "type": "string", + "const": "allow-platform" + }, + { + "description": "Denies the platform command without any pre-configured scope.", + "type": "string", + "const": "deny-platform" + }, + { + "description": "Enables the version command without any pre-configured scope.", + "type": "string", + "const": "allow-version" + }, + { + "description": "Denies the version command without any pre-configured scope.", + "type": "string", + "const": "deny-version" + }, + { + "description": "This permission set configures which\noperating system information are available\nto gather from the frontend.\n\n#### Granted Permissions\n\nAll information except the host name are available.\n\n", + "type": "string", + "const": "default" } ] } diff --git a/plugins/os/rollup.config.js b/plugins/os/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/os/rollup.config.js +++ b/plugins/os/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/os/src/api-iife.js b/plugins/os/src/api-iife.js deleted file mode 100644 index ef02e2da..00000000 --- a/plugins/os/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_OS__=function(n){"use strict";async function o(n,o={},e){return window.__TAURI_INTERNALS__.invoke(n,o,e)}return"function"==typeof SuppressedError&&SuppressedError,n.arch=async function(){return o("plugin:os|arch")},n.eol=function(){return window.__TAURI_OS_PLUGIN_INTERNALS__.eol},n.exeExtension=async function(){return o("plugin:os|exe_extension")},n.family=async function(){return o("plugin:os|family")},n.hostname=async function(){return o("plugin:os|hostname")},n.locale=async function(){return o("plugin:os|locale")},n.platform=async function(){return o("plugin:os|platform")},n.type=async function(){return o("plugin:os|os_type")},n.version=async function(){return o("plugin:os|version")},n}({});Object.defineProperty(window.__TAURI__,"os",{value:__TAURI_PLUGIN_OS__})} diff --git a/plugins/os/src/commands.rs b/plugins/os/src/commands.rs index fdfa09a0..b10c7f5d 100644 --- a/plugins/os/src/commands.rs +++ b/plugins/os/src/commands.rs @@ -2,36 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -#[tauri::command] -pub fn platform() -> &'static str { - crate::platform() -} - -#[tauri::command] -pub fn version() -> String { - crate::version().to_string() -} - -#[tauri::command] -pub fn os_type() -> String { - crate::type_().to_string() -} - -#[tauri::command] -pub fn family() -> &'static str { - crate::family() -} - -#[tauri::command] -pub fn arch() -> &'static str { - crate::arch() -} - -#[tauri::command] -pub fn exe_extension() -> &'static str { - crate::exe_extension() -} - #[tauri::command] pub fn locale() -> Option { crate::locale() diff --git a/plugins/os/src/init.js b/plugins/os/src/init.js index a26d35aa..97eeab3a 100644 --- a/plugins/os/src/init.js +++ b/plugins/os/src/init.js @@ -3,10 +3,14 @@ // SPDX-License-Identifier: MIT // eslint-disable-next-line -Object.defineProperty(window, "__TAURI_OS_PLUGIN_INTERNALS__", { +Object.defineProperty(window, '__TAURI_OS_PLUGIN_INTERNALS__', { value: { eol: __TEMPLATE_eol__, - }, -}); - -__RAW_global_os_api__; + os_type: __TEMPLATE_os_type__, + platform: __TEMPLATE_platform__, + family: __TEMPLATE_family__, + version: __TEMPLATE_version__, + arch: __TEMPLATE_arch__, + exe_extension: __TEMPLATE_exe_extension__ + } +}) diff --git a/plugins/os/src/lib.rs b/plugins/os/src/lib.rs index fab629d5..98813578 100644 --- a/plugins/os/src/lib.rs +++ b/plugins/os/src/lib.rs @@ -102,33 +102,42 @@ pub fn hostname() -> String { #[derive(Template)] #[default_template("./init.js")] -struct InitJavascript { - #[raw] - global_os_api: &'static str, +struct InitJavascript<'a> { eol: &'static str, + os_type: String, + platform: &'a str, + family: &'a str, + version: String, + arch: &'a str, + exe_extension: &'a str, } -pub fn init() -> TauriPlugin { - let init_js = InitJavascript { - global_os_api: include_str!("api-iife.js"), - #[cfg(windows)] - eol: "\r\n", - #[cfg(not(windows))] - eol: "\n", +impl<'a> InitJavascript<'a> { + fn new() -> Self { + Self { + #[cfg(windows)] + eol: "\r\n", + #[cfg(not(windows))] + eol: "\n", + os_type: crate::type_().to_string(), + platform: crate::platform(), + family: crate::family(), + version: crate::version().to_string(), + arch: crate::arch(), + exe_extension: crate::exe_extension(), + } } - .render_default(&Default::default()) - // this will never fail with the above global_os_api eol values - .unwrap(); +} + +pub fn init() -> TauriPlugin { + let init_js = InitJavascript::new() + .render_default(&Default::default()) + // this will never fail with the above global_os_api values + .unwrap(); Builder::new("os") .js_init_script(init_js.to_string()) .invoke_handler(tauri::generate_handler![ - commands::platform, - commands::version, - commands::os_type, - commands::family, - commands::arch, - commands::exe_extension, commands::locale, commands::hostname ]) diff --git a/plugins/persisted-scope/CHANGELOG.md b/plugins/persisted-scope/CHANGELOG.md index 6d5c6514..b2c1628c 100644 --- a/plugins/persisted-scope/CHANGELOG.md +++ b/plugins/persisted-scope/CHANGELOG.md @@ -1,5 +1,162 @@ # Changelog +## \[2.0.3] + +### Dependencies + +- Upgraded to `fs@2.0.3` + +## \[2.0.2] + +### Dependencies + +- Upgraded to `fs@2.0.2` + +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +### Dependencies + +- Upgraded to `fs@2.0.1` + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +### Dependencies + +- Upgraded to `fs@2.0.0` + +## \[2.0.0-rc.6] + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.6` + +## \[2.0.0-rc.5] + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.5` + +## \[2.0.0-rc.4] + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.4` + +## \[2.0.0-rc.3] + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.3` + +## \[2.0.0-rc.2] + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.2` + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.1` + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +### Dependencies + +- Upgraded to `fs@2.0.0-rc.0` + +## \[2.0.0-beta.12] + +- [`e847cedc`](https://github.com/tauri-apps/plugins-workspace/commit/e847cedc1f46f3e7a2ad81ea579b620bc5b992d7) ([#1402](https://github.com/tauri-apps/plugins-workspace/pull/1402) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Use no default features on tauri for all plugins so that consumers can use `default-features = false` on tauri, note that this will still enable wry feature on iOS +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.12` + +## \[2.0.0-beta.11] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.11` + +## \[2.0.0-beta.10] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.10` + +## \[2.0.0-beta.9] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.9` + +## \[2.0.0-beta.8] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.8` + +## \[2.0.0-beta.7] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.7` + +## \[2.0.0-beta.6] + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.6` + +## \[2.0.0-beta.5] + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.5` + +## \[2.0.0-beta.4] + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.4` + +## \[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. + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.3` + +## \[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. + +### Dependencies + +- Upgraded to `fs@2.0.0-beta.2` + ## \[2.0.0-beta.1] - [`14f381a`](https://github.com/tauri-apps/plugins-workspace/commit/14f381acf8fe690acecc676922c6f05939b95734) Update MSRV to 1.75. diff --git a/plugins/persisted-scope/Cargo.toml b/plugins/persisted-scope/Cargo.toml index c8f75f0f..070cf21b 100644 --- a/plugins/persisted-scope/Cargo.toml +++ b/plugins/persisted-scope/Cargo.toml @@ -1,15 +1,23 @@ [package] name = "tauri-plugin-persisted-scope" -version = "2.0.0-beta.1" +version = "2.0.3" description = "Save filesystem and asset scopes and restore them when the app is reopened." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "full", notes = "" } +ios = { level = "full", notes = "" } [dependencies] serde = { workspace = true } @@ -19,7 +27,7 @@ log = { workspace = true } thiserror = { workspace = true } aho-corasick = "1" bincode = "1" -tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.1" } +tauri-plugin-fs = { path = "../fs", version = "2.0.3" } [features] -protocol-asset = [ "tauri/protocol-asset" ] +protocol-asset = ["tauri/protocol-asset"] diff --git a/plugins/persisted-scope/README.md b/plugins/persisted-scope/README.md index 9621b0f5..c45a1711 100644 --- a/plugins/persisted-scope/README.md +++ b/plugins/persisted-scope/README.md @@ -2,9 +2,17 @@ Save filesystem and asset scopes and restore them when the app is reopened. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ✓ | +| iOS | ✓ | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-persisted-scope = "2.0.0-beta" +tauri-plugin-persisted-scope = "2.0.0" # alternatively with Git: tauri-plugin-persisted-scope = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` diff --git a/plugins/persisted-scope/SECURITY.md b/plugins/persisted-scope/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/persisted-scope/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/positioner/.gitignore b/plugins/positioner/.gitignore deleted file mode 100644 index b512c09d..00000000 --- a/plugins/positioner/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/plugins/positioner/CHANGELOG.md b/plugins/positioner/CHANGELOG.md index ebf02bd3..acbc2cda 100644 --- a/plugins/positioner/CHANGELOG.md +++ b/plugins/positioner/CHANGELOG.md @@ -1,5 +1,66 @@ # Changelog +## \[2.0.1] + +- [`3c1f3874`](https://github.com/tauri-apps/plugins-workspace/commit/3c1f3874f4c828637b3aa983cba13c77427faf58) ([#1911](https://github.com/tauri-apps/plugins-workspace/pull/1911) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Added missing permission for `handleIconState` and fixed its event processing logic. + +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.2] + +- [`2f7e32b5`](https://github.com/tauri-apps/plugins-workspace/commit/2f7e32b5e07454d6c0cf3ab03f8af8da74c4a8a7) ([#1822](https://github.com/tauri-apps/plugins-workspace/pull/1822) by [@jbolda](https://github.com/tauri-apps/plugins-workspace/../../jbolda)) `handleIconState` function for use in JavaScript event handlers. This allows one to update the TrayIcon state through JavaScript and fully create and handle the TrayIcon without requiring Rust (and the side-effect of creating a TrayIcon). + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.8] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.7] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.6] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.5] + +- [`d9de5b19`](https://github.com/tauri-apps/plugins-workspace/commit/d9de5b19d1e950c06f0915ae92a862acb266d108)([#1283](https://github.com/tauri-apps/plugins-workspace/pull/1283)) Implement `WindowExt` for `WebviewWindow`. + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[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] + +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -36,6 +97,11 @@ - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! +## \[1.0.5] + +- `TrayLeft`, `TrayRight` and `TrayCenter` will now position the window according to the tray position relative to the monitor dimensions to prevent windows being displayed partially off-screen. + - [3d27909](https://github.com/tauri-apps/plugins-workspace/commit/3d279094d44be78cdc5d1de3938f1414e13db6b0) fix(positioner): Prevent tray relative windows from being moved off-screen ([#291](https://github.com/tauri-apps/plugins-workspace/pull/291)) on 2023-09-27 + ## \[0.2.7] - Update Tauri to v1.0.0 @@ -101,4 +167,5 @@ \-19 data on 2021-11-19 - [39e517c](https://www.github.com/JonasKruckenberg/tauri-plugin-positioner/commit/39e517c145a4a901839ae9b46e296370ce6ababf) Update update-metadata.md on 2021-11-19 -m/JonasKruckenberg/tauri-plugin-positioner/commit/39e517c145a4a901839ae9b46e296370ce6ababf) Update update-metadata.md on 2021-11-19 + m/JonasKruckenberg/tauri-plugin-positioner/commit/39e517c145a4a901839ae9b46e296370ce6ababf) Update update-metadata.md on 2021-11-19 + 01839ae9b46e296370ce6ababf) Update update-metadata.md on 2021-11-19 diff --git a/plugins/positioner/Cargo.toml b/plugins/positioner/Cargo.toml index 1e4b5730..2288999c 100644 --- a/plugins/positioner/Cargo.toml +++ b/plugins/positioner/Cargo.toml @@ -1,19 +1,27 @@ [package] name = "tauri-plugin-positioner" -version = "2.0.0-beta.1" +version = "2.0.2" description = "Position your windows at well-known locations." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-positioner" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "none", notes = "" } +ios = { level = "none", notes = "" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -24,4 +32,4 @@ thiserror = { workspace = true } serde_repr = "0.1" [features] -tray-icon = [ "tauri/tray-icon" ] +tray-icon = ["tauri/tray-icon"] diff --git a/plugins/positioner/README.md b/plugins/positioner/README.md index 4dd31413..1c766849 100644 --- a/plugins/positioner/README.md +++ b/plugins/positioner/README.md @@ -4,9 +4,17 @@ Position your windows at well-known locations. This plugin is a port of [electron-positioner](https://github.com/jenslind/electron-positioner) for Tauri. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | x | +| iOS | x | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -20,7 +28,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-positioner = "2.0.0-beta" +tauri-plugin-positioner = "2.0.0" # alternatively with Git: tauri-plugin-positioner = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -51,24 +59,66 @@ First you need to register the core plugin with Tauri: `src-tauri/src/main.rs` ```rust +use tauri::tray::TrayIconBuilder; + fn main() { tauri::Builder::default() .plugin(tauri_plugin_positioner::init()) // This is required to get tray-relative positions to work - .on_system_tray_event(|app, event| { - tauri_plugin_positioner::on_tray_event(app, &event); + .setup(|app| { + // note that this will create a new TrayIcon + TrayIconBuilder::new() + .on_tray_icon_event(|app, event| { + tauri_plugin_positioner::on_tray_event(app.app_handle(), &event); + }) + .build(app)?; + Ok(()) }) .run(tauri::generate_context!()) .expect("error while running tauri application"); } ``` +Alternatively, you may handle the tray events through JavaScript. Register the plugin as previously noted. + +```rust +fn main() { + tauri::Builder::default() + .plugin(tauri_plugin_positioner::init()) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} +``` + +And in JavaScript, the `action` passed to the TrayIcon should include the handler. + +```javascript +import { + moveWindow, + Position, + handleIconState, +} from "@tauri-apps/plugin-positioner"; + +const action = async (event: TrayIconEvent) => { + // add the handle in the action to update the state + await handleIconState(event); + + if (event.type === "Click") { + // note this option requires enabling the `tray-icon` + // feature in the Cargo.toml + await moveWindow(Position.TrayLeft); + } +}; + +const tray = await TrayIcon.new({ id: "main", action }); +``` + Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { move_window, Position } from "@tauri-apps/plugin-positioner"; +import { moveWindow, Position } from '@tauri-apps/plugin-positioner' -move_window(Position.TopRight); +moveWindow(Position.TopRight) ``` If you only intend on moving the window from rust code, you can import the Window trait extension instead of registering the plugin: diff --git a/plugins/positioner/SECURITY.md b/plugins/positioner/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/positioner/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/positioner/api-iife.js b/plugins/positioner/api-iife.js new file mode 100644 index 00000000..0b78572d --- /dev/null +++ b/plugins/positioner/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_POSITIONER__=function(t){"use strict";async function o(t,o={},e){return window.__TAURI_INTERNALS__.invoke(t,o,e)}var e;return"function"==typeof SuppressedError&&SuppressedError,t.Position=void 0,(e=t.Position||(t.Position={}))[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e[e.TopCenter=4]="TopCenter",e[e.BottomCenter=5]="BottomCenter",e[e.LeftCenter=6]="LeftCenter",e[e.RightCenter=7]="RightCenter",e[e.Center=8]="Center",e[e.TrayLeft=9]="TrayLeft",e[e.TrayBottomLeft=10]="TrayBottomLeft",e[e.TrayRight=11]="TrayRight",e[e.TrayBottomRight=12]="TrayBottomRight",e[e.TrayCenter=13]="TrayCenter",e[e.TrayBottomCenter=14]="TrayBottomCenter",t.handleIconState=async function(t){await o("plugin:positioner|set_tray_icon_state",{position:t.rect.position,size:t.rect.size})},t.moveWindow=async function(t){await o("plugin:positioner|move_window",{position:t})},t}({});Object.defineProperty(window.__TAURI__,"positioner",{value:__TAURI_PLUGIN_POSITIONER__})} diff --git a/plugins/positioner/build.rs b/plugins/positioner/build.rs index 1fc5acfb..896c81aa 100644 --- a/plugins/positioner/build.rs +++ b/plugins/positioner/build.rs @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -const COMMANDS: &[&str] = &["move_window"]; +const COMMANDS: &[&str] = &["move_window", "set_tray_icon_state"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/positioner/guest-js/index.ts b/plugins/positioner/guest-js/index.ts index aba39831..d8f6204f 100644 --- a/plugins/positioner/guest-js/index.ts +++ b/plugins/positioner/guest-js/index.ts @@ -3,7 +3,8 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { invoke } from "@tauri-apps/api/core"; +import { invoke } from '@tauri-apps/api/core' +import type { TrayIconEvent } from '@tauri-apps/api/tray' /** * Well known window positions. @@ -23,7 +24,7 @@ export enum Position { TrayRight, TrayBottomRight, TrayCenter, - TrayBottomCenter, + TrayBottomCenter } /** @@ -33,7 +34,14 @@ export enum Position { * @param to The {@link Position} to move to. */ export async function moveWindow(to: Position): Promise { - await invoke("plugin:positioner|move_window", { - position: to, - }); + await invoke('plugin:positioner|move_window', { + position: to + }) +} + +export async function handleIconState(event: TrayIconEvent): Promise { + await invoke('plugin:positioner|set_tray_icon_state', { + position: event.rect.position, + size: event.rect.size + }) } diff --git a/plugins/positioner/package.json b/plugins/positioner/package.json index d1ed0729..b738a342 100644 --- a/plugins/positioner/package.json +++ b/plugins/positioner/package.json @@ -1,11 +1,12 @@ { "name": "@tauri-apps/plugin-positioner", - "version": "2.0.0-beta.1", + "version": "2.0.1", "description": "Position your windows at well-known locations.", - "license": "MIT or APACHE-2.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -24,6 +25,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/positioner/permissions/autogenerated/commands/set_tray_icon_state.toml b/plugins/positioner/permissions/autogenerated/commands/set_tray_icon_state.toml new file mode 100644 index 00000000..6b85f635 --- /dev/null +++ b/plugins/positioner/permissions/autogenerated/commands/set_tray_icon_state.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-set-tray-icon-state" +description = "Enables the set_tray_icon_state command without any pre-configured scope." +commands.allow = ["set_tray_icon_state"] + +[[permission]] +identifier = "deny-set-tray-icon-state" +description = "Denies the set_tray_icon_state command without any pre-configured scope." +commands.deny = ["set_tray_icon_state"] diff --git a/plugins/positioner/permissions/autogenerated/reference.md b/plugins/positioner/permissions/autogenerated/reference.md index 60d18ba5..8dfe0466 100644 --- a/plugins/positioner/permissions/autogenerated/reference.md +++ b/plugins/positioner/permissions/autogenerated/reference.md @@ -1,14 +1,68 @@ -# Permissions +## Default Permission -## allow-move-window +Allows the moveWindow and handleIconState APIs + +- `allow-move-window` +- `set-tray-icon-state` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`positioner:allow-move-window` + + Enables the move_window command without any pre-configured scope. -## deny-move-window +
+ +`positioner:deny-move-window` + + Denies the move_window command without any pre-configured scope. -## default +
+ +`positioner:allow-set-tray-icon-state` + + + +Enables the set_tray_icon_state command without any pre-configured scope. + +
+ +`positioner:deny-set-tray-icon-state` + + -Allows the move_window command +Denies the set_tray_icon_state command without any pre-configured scope. +
diff --git a/plugins/positioner/permissions/default.toml b/plugins/positioner/permissions/default.toml index b0b3b3e2..bd8dc25e 100644 --- a/plugins/positioner/permissions/default.toml +++ b/plugins/positioner/permissions/default.toml @@ -1,4 +1,4 @@ "$schema" = "schemas/schema.json" [default] -description = "Allows the move_window command" -permissions = ["allow-move-window"] +description = "Allows the moveWindow and handleIconState APIs" +permissions = ["allow-move-window", "set-tray-icon-state"] diff --git a/plugins/positioner/permissions/schemas/schema.json b/plugins/positioner/permissions/schemas/schema.json index dedd7c20..c4d16966 100644 --- a/plugins/positioner/permissions/schemas/schema.json +++ b/plugins/positioner/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,31 +251,75 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-move-window -> Enables the move_window command without any pre-configured scope.", + "description": "MacOS.", + "type": "string", + "enum": [ + "macOS" + ] + }, + { + "description": "Windows.", + "type": "string", + "enum": [ + "windows" + ] + }, + { + "description": "Linux.", "type": "string", "enum": [ - "allow-move-window" + "linux" ] }, { - "description": "deny-move-window -> Denies the move_window command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-move-window" + "android" ] }, { - "description": "default -> Allows the move_window command", + "description": "iOS.", "type": "string", "enum": [ - "default" + "iOS" ] } ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the move_window command without any pre-configured scope.", + "type": "string", + "const": "allow-move-window" + }, + { + "description": "Denies the move_window command without any pre-configured scope.", + "type": "string", + "const": "deny-move-window" + }, + { + "description": "Enables the set_tray_icon_state command without any pre-configured scope.", + "type": "string", + "const": "allow-set-tray-icon-state" + }, + { + "description": "Denies the set_tray_icon_state command without any pre-configured scope.", + "type": "string", + "const": "deny-set-tray-icon-state" + }, + { + "description": "Allows the moveWindow and handleIconState APIs", + "type": "string", + "const": "default" + } + ] } } } \ No newline at end of file diff --git a/plugins/positioner/rollup.config.js b/plugins/positioner/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/positioner/rollup.config.js +++ b/plugins/positioner/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/positioner/src/api-iife.js b/plugins/positioner/src/api-iife.js deleted file mode 100644 index d0c8ba69..00000000 --- a/plugins/positioner/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_POSITIONER__=function(t){"use strict";var o;return"function"==typeof SuppressedError&&SuppressedError,t.Position=void 0,(o=t.Position||(t.Position={}))[o.TopLeft=0]="TopLeft",o[o.TopRight=1]="TopRight",o[o.BottomLeft=2]="BottomLeft",o[o.BottomRight=3]="BottomRight",o[o.TopCenter=4]="TopCenter",o[o.BottomCenter=5]="BottomCenter",o[o.LeftCenter=6]="LeftCenter",o[o.RightCenter=7]="RightCenter",o[o.Center=8]="Center",o[o.TrayLeft=9]="TrayLeft",o[o.TrayBottomLeft=10]="TrayBottomLeft",o[o.TrayRight=11]="TrayRight",o[o.TrayBottomRight=12]="TrayBottomRight",o[o.TrayCenter=13]="TrayCenter",o[o.TrayBottomCenter=14]="TrayBottomCenter",t.moveWindow=async function(t){await async function(t,o={},e){return window.__TAURI_INTERNALS__.invoke(t,o,e)}("plugin:positioner|move_window",{position:t})},t}({});Object.defineProperty(window.__TAURI__,"positioner",{value:__TAURI_PLUGIN_POSITIONER__})} diff --git a/plugins/positioner/src/ext.rs b/plugins/positioner/src/ext.rs index 36ec7f91..4688cd51 100644 --- a/plugins/positioner/src/ext.rs +++ b/plugins/positioner/src/ext.rs @@ -8,7 +8,7 @@ use crate::Tray; use serde_repr::Deserialize_repr; #[cfg(feature = "tray-icon")] use tauri::Manager; -use tauri::{PhysicalPosition, PhysicalSize, Result, Runtime, Window}; +use tauri::{PhysicalPosition, PhysicalSize, Result, Runtime, WebviewWindow, Window}; /// Well known window positions. #[derive(Debug, Deserialize_repr)] @@ -45,6 +45,11 @@ pub trait WindowExt { fn move_window(&self, position: Position) -> Result<()>; } +impl WindowExt for WebviewWindow { + fn move_window(&self, pos: Position) -> Result<()> { + self.as_ref().window().move_window(pos) + } +} impl WindowExt for Window { fn move_window(&self, pos: Position) -> Result<()> { use Position::*; diff --git a/plugins/positioner/src/lib.rs b/plugins/positioner/src/lib.rs index 6c5b735e..81bfaef8 100644 --- a/plugins/positioner/src/lib.rs +++ b/plugins/positioner/src/lib.rs @@ -35,14 +35,22 @@ struct Tray(std::sync::Mutex, PhysicalSize)>> #[cfg(feature = "tray-icon")] pub fn on_tray_event(app: &AppHandle, event: &TrayIconEvent) { - let position = PhysicalPosition { - x: event.x, - y: event.y, - }; - let size = PhysicalSize { - width: event.icon_rect.right - event.icon_rect.left, - height: event.icon_rect.bottom - event.icon_rect.top, + let (position, size) = { + match event { + TrayIconEvent::Click { rect, .. } + | TrayIconEvent::Enter { rect, .. } + | TrayIconEvent::Leave { rect, .. } + | TrayIconEvent::Move { rect, .. } => { + // tray-icon emits PhysicalSize so the scale factor should not matter. + let size = rect.size.to_physical(1.0); + let position = rect.position.to_physical(1.0); + (position, size) + } + + _ => return, + } }; + app.state::() .0 .lock() @@ -55,11 +63,27 @@ async fn move_window(window: tauri::Window, position: Position) - window.move_window(position) } +#[cfg(feature = "tray-icon")] +#[tauri::command] +fn set_tray_icon_state( + app: AppHandle, + position: PhysicalPosition, + size: PhysicalSize, +) { + app.state::() + .0 + .lock() + .unwrap() + .replace((position, size)); +} + /// The Tauri plugin that exposes [`WindowExt::move_window`] to the webview. pub fn init() -> TauriPlugin { - let plugin = plugin::Builder::new("positioner") - .js_init_script(include_str!("api-iife.js").to_string()) - .invoke_handler(tauri::generate_handler![move_window]); + let plugin = plugin::Builder::new("positioner").invoke_handler(tauri::generate_handler![ + move_window, + #[cfg(feature = "tray-icon")] + set_tray_icon_state + ]); #[cfg(feature = "tray-icon")] let plugin = plugin.setup(|app_handle, _api| { diff --git a/plugins/process/CHANGELOG.md b/plugins/process/CHANGELOG.md index 84b71e6f..8c69c695 100644 --- a/plugins/process/CHANGELOG.md +++ b/plugins/process/CHANGELOG.md @@ -1,5 +1,54 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.8] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.7] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.6] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[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] + +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -41,4 +90,5 @@ - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ae67\`]\(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! + om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/process/Cargo.toml b/plugins/process/Cargo.toml index 5d1b2e1a..4c679022 100644 --- a/plugins/process/Cargo.toml +++ b/plugins/process/Cargo.toml @@ -1,19 +1,27 @@ [package] name = "tauri-plugin-process" -version = "2.0.0-beta.1" +version = "2.0.1" description = "Access the current process of your Tauri application." edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-process" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "none", notes = "" } +ios = { level = "none", notes = "" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] tauri = { workspace = true } diff --git a/plugins/process/README.md b/plugins/process/README.md index 515539d3..ad7d53ab 100644 --- a/plugins/process/README.md +++ b/plugins/process/README.md @@ -2,9 +2,17 @@ This plugin provides APIs to access the current process. To spawn child processes, see the [`shell`](https://github.com/tauri-apps/tauri-plugin-shell) plugin. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | x | +| iOS | x | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-process = "2.0.0-beta" +tauri-plugin-process = "2.0.0" # alternatively with Git: tauri-plugin-process = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -60,11 +68,11 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { exit, relaunch } from "@tauri-apps/plugin-process"; +import { exit, relaunch } from '@tauri-apps/plugin-process' // exit the app with the given status code -await exit(0); +await exit(0) // restart the app -await relaunch(); +await relaunch() ``` ## Contributing diff --git a/plugins/process/SECURITY.md b/plugins/process/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/process/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/process/api-iife.js b/plugins/process/api-iife.js new file mode 100644 index 00000000..b214396e --- /dev/null +++ b/plugins/process/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_PROCESS__=function(_){"use strict";async function n(_,n={},e){return window.__TAURI_INTERNALS__.invoke(_,n,e)}return"function"==typeof SuppressedError&&SuppressedError,_.exit=async function(_=0){await n("plugin:process|exit",{code:_})},_.relaunch=async function(){await n("plugin:process|restart")},_}({});Object.defineProperty(window.__TAURI__,"process",{value:__TAURI_PLUGIN_PROCESS__})} diff --git a/plugins/process/build.rs b/plugins/process/build.rs index e9d6cfda..e412b34e 100644 --- a/plugins/process/build.rs +++ b/plugins/process/build.rs @@ -5,5 +5,7 @@ const COMMANDS: &[&str] = &["exit", "restart"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/process/guest-js/index.ts b/plugins/process/guest-js/index.ts index 2d30b346..da15831a 100644 --- a/plugins/process/guest-js/index.ts +++ b/plugins/process/guest-js/index.ts @@ -7,7 +7,7 @@ * @module */ -import { invoke } from "@tauri-apps/api/core"; +import { invoke } from '@tauri-apps/api/core' /** * Exits immediately with the given `exitCode`. @@ -23,7 +23,7 @@ import { invoke } from "@tauri-apps/api/core"; * @since 2.0.0 */ async function exit(code = 0): Promise { - return invoke("plugin:process|exit", { code }); + await invoke('plugin:process|exit', { code }) } /** @@ -39,7 +39,7 @@ async function exit(code = 0): Promise { * @since 2.0.0 */ async function relaunch(): Promise { - return invoke("plugin:process|restart"); + await invoke('plugin:process|restart') } -export { exit, relaunch }; +export { exit, relaunch } diff --git a/plugins/process/package.json b/plugins/process/package.json index eb7a8af5..bac14def 100644 --- a/plugins/process/package.json +++ b/plugins/process/package.json @@ -1,10 +1,11 @@ { "name": "@tauri-apps/plugin-process", - "version": "2.0.0-beta.1", - "license": "MIT or APACHE-2.0", + "version": "2.0.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -23,6 +24,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/process/permissions/autogenerated/reference.md b/plugins/process/permissions/autogenerated/reference.md index a5822a92..10b6a82b 100644 --- a/plugins/process/permissions/autogenerated/reference.md +++ b/plugins/process/permissions/autogenerated/reference.md @@ -1,18 +1,75 @@ -# Permissions +## Default Permission -## allow-exit +This permission set configures which +process feeatures are by default exposed. + +#### Granted Permissions + +This enables to quit via `allow-exit` and restart via `allow-restart` +the application. + + +- `allow-exit` +- `allow-restart` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`process:allow-exit` + + Enables the exit command without any pre-configured scope. -## deny-exit +
+ +`process:deny-exit` + + Denies the exit command without any pre-configured scope. -## allow-restart +
+ +`process:allow-restart` + + Enables the restart command without any pre-configured scope. -## deny-restart +
+ +`process:deny-restart` + + Denies the restart command without any pre-configured scope. +
diff --git a/plugins/process/permissions/default.toml b/plugins/process/permissions/default.toml new file mode 100644 index 00000000..619eb9d8 --- /dev/null +++ b/plugins/process/permissions/default.toml @@ -0,0 +1,14 @@ +"$schema" = "schemas/schema.json" + +[default] +description = """ +This permission set configures which +process feeatures are by default exposed. + +#### Granted Permissions + +This enables to quit via `allow-exit` and restart via `allow-restart` +the application. +""" + +permissions = ["allow-exit", "allow-restart"] diff --git a/plugins/process/permissions/schemas/schema.json b/plugins/process/permissions/schemas/schema.json index 145727d9..bb885bff 100644 --- a/plugins/process/permissions/schemas/schema.json +++ b/plugins/process/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,36 +251,73 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-exit -> Enables the exit command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-exit" + "macOS" ] }, { - "description": "deny-exit -> Denies the exit command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-exit" + "windows" ] }, { - "description": "allow-restart -> Enables the restart command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-restart" + "linux" ] }, { - "description": "deny-restart -> Denies the restart command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-restart" + "android" ] + }, + { + "description": "iOS.", + "type": "string", + "enum": [ + "iOS" + ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the exit command without any pre-configured scope.", + "type": "string", + "const": "allow-exit" + }, + { + "description": "Denies the exit command without any pre-configured scope.", + "type": "string", + "const": "deny-exit" + }, + { + "description": "Enables the restart command without any pre-configured scope.", + "type": "string", + "const": "allow-restart" + }, + { + "description": "Denies the restart command without any pre-configured scope.", + "type": "string", + "const": "deny-restart" + }, + { + "description": "This permission set configures which\nprocess feeatures are by default exposed.\n\n#### Granted Permissions\n\nThis enables to quit via `allow-exit` and restart via `allow-restart`\nthe application.\n", + "type": "string", + "const": "default" } ] } diff --git a/plugins/process/rollup.config.js b/plugins/process/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/process/rollup.config.js +++ b/plugins/process/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/process/src/api-iife.js b/plugins/process/src/api-iife.js deleted file mode 100644 index df87d8c9..00000000 --- a/plugins/process/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_PROCESS__=function(n){"use strict";async function r(n,r={},_){return window.__TAURI_INTERNALS__.invoke(n,r,_)}return"function"==typeof SuppressedError&&SuppressedError,n.exit=async function(n=0){return r("plugin:process|exit",{code:n})},n.relaunch=async function(){return r("plugin:process|restart")},n}({});Object.defineProperty(window.__TAURI__,"process",{value:__TAURI_PLUGIN_PROCESS__})} diff --git a/plugins/process/src/lib.rs b/plugins/process/src/lib.rs index 2de82914..e0e948fc 100644 --- a/plugins/process/src/lib.rs +++ b/plugins/process/src/lib.rs @@ -20,7 +20,6 @@ mod commands; pub fn init() -> TauriPlugin { Builder::new("process") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![commands::exit, commands::restart]) .build() } diff --git a/plugins/shell/CHANGELOG.md b/plugins/shell/CHANGELOG.md index 13d76c86..a1cfc195 100644 --- a/plugins/shell/CHANGELOG.md +++ b/plugins/shell/CHANGELOG.md @@ -1,5 +1,82 @@ # Changelog +## \[2.0.1] + +- [`51ddf6a7`](https://github.com/tauri-apps/plugins-workspace/commit/51ddf6a71544acfb261ffc9393dab1342da0a219) ([#1881](https://github.com/tauri-apps/plugins-workspace/pull/1881) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) On Windows, Fix `open` JS API hanging and freezing the app. + +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.4] + +- [`44273b98`](https://github.com/tauri-apps/plugins-workspace/commit/44273b988957a254eff715d6be7547d2ace882e1) ([#1839](https://github.com/tauri-apps/plugins-workspace/pull/1839) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Fix the plugin schema requiring to set `sidecar` property when it is in fact optional. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.2] + +- [`b9147758`](https://github.com/tauri-apps/plugins-workspace/commit/b914775898c2bee7ceb20bd17ee595005cd17a64) ([#1679](https://github.com/tauri-apps/plugins-workspace/pull/1679) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Explicitly set a minimum macOS version for the Swift package. + +## \[2.0.0-rc.1] + +### changes + +- [`6b079cfd`](https://github.com/tauri-apps/plugins-workspace/commit/6b079cfdd107c94abc2c7300f6af00bac3ff4040) ([#1649](https://github.com/tauri-apps/plugins-workspace/pull/1649) by [@ahqsoftwares](https://github.com/tauri-apps/plugins-workspace/../../ahqsoftwares)) Remove targetSdk from build.kts files as it is deprecated and will be removed from DSL v9.0 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. +- [`34df132f`](https://github.com/tauri-apps/plugins-workspace/commit/34df132fb14212ba7330adc9ccd64267751950c8) ([#1603](https://github.com/tauri-apps/plugins-workspace/pull/1603)) Change the `open` scope validator regex to match on the entire string. +- [`34df132f`](https://github.com/tauri-apps/plugins-workspace/commit/34df132fb14212ba7330adc9ccd64267751950c8) ([#1603](https://github.com/tauri-apps/plugins-workspace/pull/1603)) Change the `execute` scope argument validator regex to match on the entire string by default. + If this behavior is not desired check the `raw` boolean configuration option that is available along the `validator` string. + +## \[2.0.0-beta.9] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.8] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.7] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.6] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.5] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.4] + +- [`eb1679b9`](https://github.com/tauri-apps/plugins-workspace/commit/eb1679b99780e5d2b867f5649a1ccc2f3f70ab56)([#1299](https://github.com/tauri-apps/plugins-workspace/pull/1299)) Fix `Command.execute` API including extra new lines. +- [`eb1679b9`](https://github.com/tauri-apps/plugins-workspace/commit/eb1679b99780e5d2b867f5649a1ccc2f3f70ab56)([#1299](https://github.com/tauri-apps/plugins-workspace/pull/1299)) Improve the speed of the JS `Command.execute` API + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[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. +- [`040004a`](https://github.com/tauri-apps/plugins-workspace/commit/040004a6b9fbb89161d1b5764d79428dfe693776)([#1069](https://github.com/tauri-apps/plugins-workspace/pull/1069)) Change shell's schema property name `command` to `cmd`. + +## \[2.0.0-beta.2] + +- [`9586eab`](https://github.com/tauri-apps/plugins-workspace/commit/9586eabd5a96673e4d976757777f470ae358d68a)([#1021](https://github.com/tauri-apps/plugins-workspace/pull/1021)) On Windows, fix `open` can't open file if the file is being used by a program. +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -49,4 +126,21 @@ - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! .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! + .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! + f)([#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! + .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! + rkspace/pull/371)) First v2 alpha release! + 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + .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! + f)([#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! + .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! + com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/shell/Cargo.toml b/plugins/shell/Cargo.toml index 0f354207..fda626a3 100644 --- a/plugins/shell/Cargo.toml +++ b/plugins/shell/Cargo.toml @@ -1,17 +1,25 @@ [package] name = "tauri-plugin-shell" -version = "2.0.0-beta.1" +version = "2.0.2" description = "Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application." edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-shell" [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs"] +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "partial", notes = "Only allows to open URLs via `open`" } +ios = { level = "partial", notes = "Only allows to open URLs via `open`" } + [build-dependencies] tauri-plugin = { workspace = true, features = ["build"] } schemars = { workspace = true } @@ -19,14 +27,14 @@ serde = { workspace = true } [dependencies] serde = { workspace = true } -schemars = { workspace = true } serde_json = { workspace = true } tauri = { workspace = true } +tokio = { version = "1", features = ["time"] } log = { workspace = true } thiserror = { workspace = true } shared_child = "1" regex = "1" -open = "4" +open = { version = "5", features = ["shellexecute-on-windows"] } encoding_rs = "0.8" os_pipe = "1" @@ -38,3 +46,6 @@ features = [ "Win32_UI_WindowsAndMessaging", "Win32_System_Com", ] + +[target.'cfg(target_os = "ios")'.dependencies] +tauri = { workspace = true, features = ["wry"] } diff --git a/plugins/shell/README.md b/plugins/shell/README.md index d97899e2..2f6e5ad6 100644 --- a/plugins/shell/README.md +++ b/plugins/shell/README.md @@ -2,9 +2,17 @@ Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ✓ | +| iOS | ✓ | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-shell = "2.0.0-beta" +tauri-plugin-shell = "2.0.0" # alternatively with Git: tauri-plugin-shell = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -60,8 +68,8 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { Command } from "@tauri-apps/plugin-shell"; -Command.create("git", ["commit", "-m", "the commit message"]); +import { Command } from '@tauri-apps/plugin-shell' +Command.create('git', ['commit', '-m', 'the commit message']) ``` ## Contributing diff --git a/plugins/shell/SECURITY.md b/plugins/shell/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/shell/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/deep-link/.gitignore b/plugins/shell/android/.gitignore similarity index 53% rename from plugins/deep-link/.gitignore rename to plugins/shell/android/.gitignore index 1b0b469d..c0f21ec2 100644 --- a/plugins/deep-link/.gitignore +++ b/plugins/shell/android/.gitignore @@ -1 +1,2 @@ +/build /.tauri diff --git a/plugins/shell/android/build.gradle.kts b/plugins/shell/android/build.gradle.kts new file mode 100644 index 00000000..88082c65 --- /dev/null +++ b/plugins/shell/android/build.gradle.kts @@ -0,0 +1,39 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") +} + +android { + namespace = "app.tauri.shell" + compileSdk = 34 + + defaultConfig { + minSdk = 24 + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + implementation("androidx.core:core-ktx:1.9.0") + implementation("com.fasterxml.jackson.core:jackson-databind:2.15.3") + implementation(project(":tauri-android")) +} diff --git a/plugins/shell/android/proguard-rules.pro b/plugins/shell/android/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/plugins/shell/android/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/plugins/shell/android/settings.gradle b/plugins/shell/android/settings.gradle new file mode 100644 index 00000000..14a752e4 --- /dev/null +++ b/plugins/shell/android/settings.gradle @@ -0,0 +1,2 @@ +include ':tauri-android' +project(':tauri-android').projectDir = new File('./.tauri/tauri-api') diff --git a/plugins/shell/android/src/main/AndroidManifest.xml b/plugins/shell/android/src/main/AndroidManifest.xml new file mode 100644 index 00000000..9a40236b --- /dev/null +++ b/plugins/shell/android/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/plugins/shell/android/src/main/java/ShellPlugin.kt b/plugins/shell/android/src/main/java/ShellPlugin.kt new file mode 100644 index 00000000..2268bc26 --- /dev/null +++ b/plugins/shell/android/src/main/java/ShellPlugin.kt @@ -0,0 +1,30 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package app.tauri.shell + +import android.app.Activity +import android.content.Intent +import android.net.Uri +import app.tauri.annotation.Command +import app.tauri.annotation.TauriPlugin +import app.tauri.plugin.Invoke +import app.tauri.plugin.Plugin +import java.io.File + +@TauriPlugin +class ShellPlugin(private val activity: Activity) : Plugin(activity) { + @Command + fun open(invoke: Invoke) { + try { + val url = invoke.parseArgs(String::class.java) + val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + activity.applicationContext?.startActivity(intent) + invoke.resolve() + } catch (ex: Exception) { + invoke.reject(ex.message) + } + } +} \ No newline at end of file diff --git a/plugins/shell/api-iife.js b/plugins/shell/api-iife.js new file mode 100644 index 00000000..25ba6d3e --- /dev/null +++ b/plugins/shell/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_SHELL__=function(e){"use strict";function t(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)}function s(e,t,s,n,i){if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,s),s}var n,i,r;"function"==typeof SuppressedError&&SuppressedError;class o{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,n.set(this,(()=>{})),i.set(this,0),r.set(this,{}),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:e,id:o})=>{if(o===t(this,i,"f")){s(this,i,o+1),t(this,n,"f").call(this,e);const a=Object.keys(t(this,r,"f"));if(a.length>0){let e=o+1;for(const s of a.sort()){if(parseInt(s)!==e)break;{const i=t(this,r,"f")[s];delete t(this,r,"f")[s],t(this,n,"f").call(this,i),e+=1}}s(this,i,e)}}else t(this,r,"f")[o.toString()]=e}))}set onmessage(e){s(this,n,e)}get onmessage(){return t(this,n,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(e,t={},s){return window.__TAURI_INTERNALS__.invoke(e,t,s)}n=new WeakMap,i=new WeakMap,r=new WeakMap;class h{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){const s=n=>{this.removeListener(e,s),t(n)};return this.addListener(e,s)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter((e=>e!==t))),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,t){if(e in this.eventListeners){const s=this.eventListeners[e];for(const e of s)e(t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){const s=n=>{this.removeListener(e,s),t(n)};return this.prependListener(e,s)}}class c{constructor(e){this.pid=e}async write(e){await a("plugin:shell|stdin_write",{pid:this.pid,buffer:e})}async kill(){await a("plugin:shell|kill",{cmd:"killChild",pid:this.pid})}}class l extends h{constructor(e,t=[],s){super(),this.stdout=new h,this.stderr=new h,this.program=e,this.args="string"==typeof t?[t]:t,this.options=s??{}}static create(e,t=[],s){return new l(e,t,s)}static sidecar(e,t=[],s){const n=new l(e,t,s);return n.options.sidecar=!0,n}async spawn(){const e=this.program,t=this.args,s=this.options;"object"==typeof t&&Object.freeze(t);const n=new o;return n.onmessage=e=>{switch(e.event){case"Error":this.emit("error",e.payload);break;case"Terminated":this.emit("close",e.payload);break;case"Stdout":this.stdout.emit("data",e.payload);break;case"Stderr":this.stderr.emit("data",e.payload)}},await a("plugin:shell|spawn",{program:e,args:t,options:s,onEvent:n}).then((e=>new c(e)))}async execute(){const e=this.program,t=this.args,s=this.options;return"object"==typeof t&&Object.freeze(t),await a("plugin:shell|execute",{program:e,args:t,options:s})}}return e.Child=c,e.Command=l,e.EventEmitter=h,e.open=async function(e,t){await a("plugin:shell|open",{path:e,with:t})},e}({});Object.defineProperty(window.__TAURI__,"shell",{value:__TAURI_PLUGIN_SHELL__})} diff --git a/plugins/shell/build.rs b/plugins/shell/build.rs index f3ff751d..a4a74a99 100644 --- a/plugins/shell/build.rs +++ b/plugins/shell/build.rs @@ -2,13 +2,187 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT +use std::path::PathBuf; + +use schemars::JsonSchema; + #[path = "src/scope_entry.rs"] mod scope_entry; -const COMMANDS: &[&str] = &["execute", "stdin_write", "kill", "open"]; +/// A command argument allowed to be executed by the webview API. +#[derive(Debug, PartialEq, Eq, Clone, Hash, schemars::JsonSchema)] +#[serde(untagged, deny_unknown_fields)] +#[non_exhaustive] +pub enum ShellScopeEntryAllowedArg { + /// A non-configurable argument that is passed to the command in the order it was specified. + Fixed(String), + + /// A variable that is set while calling the command from the webview API. + /// + Var { + /// [regex] validator to require passed values to conform to an expected input. + /// + /// This will require the argument value passed to this variable to match the `validator` regex + /// before it will be executed. + /// + /// The regex string is by default surrounded by `^...$` to match the full string. + /// For example the `https?://\w+` regex would be registered as `^https?://\w+$`. + /// + /// [regex]: + validator: String, + + /// Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime. + /// + /// This means the regex will not match on the entire string by default, which might + /// be exploited if your regex allow unexpected input to be considered valid. + /// When using this option, make sure your regex is correct. + #[serde(default)] + raw: bool, + }, +} + +/// A set of command arguments allowed to be executed by the webview API. +/// +/// A value of `true` will allow any arguments to be passed to the command. `false` will disable all +/// arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to +/// be passed to the attached command configuration. +#[derive(Debug, PartialEq, Eq, Clone, Hash, JsonSchema)] +#[serde(untagged, deny_unknown_fields)] +#[non_exhaustive] +pub enum ShellScopeEntryAllowedArgs { + /// Use a simple boolean to allow all or disable all arguments to this command configuration. + Flag(bool), + + /// A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration. + List(Vec), +} + +impl Default for ShellScopeEntryAllowedArgs { + fn default() -> Self { + Self::Flag(false) + } +} + +/// Shell scope entry. +#[derive(JsonSchema)] +#[serde(untagged, deny_unknown_fields)] +#[allow(unused)] +pub(crate) enum ShellScopeEntry { + Command { + /// The name for this allowed shell command configuration. + /// + /// This name will be used inside of the webview API to call this command along with + /// any specified arguments. + name: String, + /// 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`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, + /// `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`. + // use default just so the schema doesn't flag it as required + #[serde(rename = "cmd")] + command: PathBuf, + /// The allowed arguments for the command execution. + #[serde(default)] + args: ShellScopeEntryAllowedArgs, + }, + Sidecar { + /// The name for this allowed shell command configuration. + /// + /// This name will be used inside of the webview API to call this command along with + /// any specified arguments. + name: String, + /// The allowed arguments for the command execution. + #[serde(default)] + args: ShellScopeEntryAllowedArgs, + /// If this command is a sidecar command. + sidecar: bool, + }, +} + +// Ensure `ShellScopeEntry` and `scope_entry::EntryRaw` +// and `ShellScopeEntryAllowedArg` and `ShellAllowedArg` +// and `ShellScopeEntryAllowedArgs` and `ShellAllowedArgs` +// are kept in sync +#[allow(clippy::unnecessary_operation)] +fn _f() { + match (ShellScopeEntry::Sidecar { + name: String::new(), + args: ShellScopeEntryAllowedArgs::Flag(false), + sidecar: true, + }) { + ShellScopeEntry::Command { + name, + command, + args, + } => scope_entry::EntryRaw { + name, + command: Some(command), + args: match args { + ShellScopeEntryAllowedArgs::Flag(flag) => scope_entry::ShellAllowedArgs::Flag(flag), + ShellScopeEntryAllowedArgs::List(vec) => scope_entry::ShellAllowedArgs::List( + vec.into_iter() + .map(|s| match s { + ShellScopeEntryAllowedArg::Fixed(fixed) => { + scope_entry::ShellAllowedArg::Fixed(fixed) + } + ShellScopeEntryAllowedArg::Var { validator, raw } => { + scope_entry::ShellAllowedArg::Var { validator, raw } + } + }) + .collect(), + ), + }, + sidecar: false, + }, + ShellScopeEntry::Sidecar { + name, + args, + sidecar, + } => scope_entry::EntryRaw { + name, + command: None, + args: match args { + ShellScopeEntryAllowedArgs::Flag(flag) => scope_entry::ShellAllowedArgs::Flag(flag), + ShellScopeEntryAllowedArgs::List(vec) => scope_entry::ShellAllowedArgs::List( + vec.into_iter() + .map(|s| match s { + ShellScopeEntryAllowedArg::Fixed(fixed) => { + scope_entry::ShellAllowedArg::Fixed(fixed) + } + ShellScopeEntryAllowedArg::Var { validator, raw } => { + scope_entry::ShellAllowedArg::Var { validator, raw } + } + }) + .collect(), + ), + }, + sidecar, + }, + }; +} + +const COMMANDS: &[&str] = &["execute", "spawn", "stdin_write", "kill", "open"]; fn main() { tauri_plugin::Builder::new(COMMANDS) - .global_scope_schema(schemars::schema_for!(scope_entry::Entry)) + .global_api_script_path("./api-iife.js") + .global_scope_schema(schemars::schema_for!(ShellScopeEntry)) + .android_path("android") + .ios_path("ios") .build(); + + let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); + let mobile = target_os == "ios" || target_os == "android"; + alias("desktop", !mobile); + alias("mobile", mobile); +} + +// creates a cfg alias if `has_feature` is true. +// `alias` must be a snake case string. +fn alias(alias: &str, has_feature: bool) { + if has_feature { + println!("cargo:rustc-cfg={alias}"); + } } diff --git a/plugins/shell/guest-js/index.ts b/plugins/shell/guest-js/index.ts index d532206b..1ed2ac5d 100644 --- a/plugins/shell/guest-js/index.ts +++ b/plugins/shell/guest-js/index.ts @@ -18,11 +18,11 @@ * * ### Restricting access to the {@link Command | `Command`} APIs * - * The plugin configuration object has a `scope` field that defines an array of CLIs that can be used. + * The plugin permissions object has a `scope` field that defines an array of CLIs that can be used. * Each CLI is a configuration object `{ name: string, cmd: string, sidecar?: bool, args?: boolean | Arg[] }`. * * - `name`: the unique identifier of the command, passed to the {@link Command.create | Command.create function}. - * If it's a sidecar, this must be the value defined on `tauri.conf.json > tauri > bundle > externalBin`. + * If it's a sidecar, this must be the value defined on `tauri.conf.json > bundle > externalBin`. * - `cmd`: the program that is executed on this configuration. If it's a sidecar, this value is ignored. * - `sidecar`: whether the object configures a sidecar or a system program. * - `args`: the arguments that can be passed to the program. By default no arguments are allowed. @@ -35,12 +35,13 @@ * * CLI: `git commit -m "the commit message"` * - * Configuration: + * Capability: * ```json * { - * "plugins": { - * "shell": { - * "scope": [ + * "permissions": [ + * { + * "identifier": "shell:allow-execute", + * "allow": [ * { * "name": "run-git-commit", * "cmd": "git", @@ -48,7 +49,7 @@ * } * ] * } - * } + * ] * } * ``` * Usage: @@ -62,27 +63,27 @@ * @module */ -import { invoke, Channel } from "@tauri-apps/api/core"; +import { invoke, Channel } from '@tauri-apps/api/core' /** * @since 2.0.0 */ interface SpawnOptions { /** Current working directory. */ - cwd?: string; + cwd?: string /** Environment variables. set to `null` to clear the process env. */ - env?: Record; + env?: Record /** * Character encoding for stdout/stderr * * @since 2.0.0 * */ - encoding?: string; + encoding?: string } /** @ignore */ interface InternalSpawnOptions extends SpawnOptions { - sidecar?: boolean; + sidecar?: boolean } /** @@ -90,46 +91,13 @@ interface InternalSpawnOptions extends SpawnOptions { */ interface ChildProcess { /** Exit code of the process. `null` if the process was terminated by a signal on Unix. */ - code: number | null; + code: number | null /** If the process was terminated by a signal, represents that signal. */ - signal: number | null; + signal: number | null /** The data that the process wrote to `stdout`. */ - stdout: O; + stdout: O /** The data that the process wrote to `stderr`. */ - stderr: O; -} - -/** - * Spawns a process. - * - * @ignore - * @param program The name of the scoped command. - * @param onEventHandler Event handler. - * @param args Program arguments. - * @param options Configuration for the process spawn. - * @returns A promise resolving to the process id. - * - * @since 2.0.0 - */ -async function execute( - onEventHandler: (event: CommandEvent) => void, - program: string, - args: string | string[] = [], - options?: InternalSpawnOptions, -): Promise { - if (typeof args === "object") { - Object.freeze(args); - } - - const onEvent = new Channel>(); - onEvent.onmessage = onEventHandler; - - return invoke("plugin:shell|execute", { - program, - args, - options, - onEvent, - }); + stderr: O } /** @@ -140,7 +108,7 @@ class EventEmitter> { /** @ignore */ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any private eventListeners: Record void>> = - Object.create(null); + Object.create(null) /** * Alias for `emitter.on(eventName, listener)`. @@ -149,9 +117,9 @@ class EventEmitter> { */ addListener( eventName: N, - listener: (arg: E[typeof eventName]) => void, + listener: (arg: E[typeof eventName]) => void ): this { - return this.on(eventName, listener); + return this.on(eventName, listener) } /** @@ -161,9 +129,9 @@ class EventEmitter> { */ removeListener( eventName: N, - listener: (arg: E[typeof eventName]) => void, + listener: (arg: E[typeof eventName]) => void ): this { - return this.off(eventName, listener); + return this.off(eventName, listener) } /** @@ -178,16 +146,16 @@ class EventEmitter> { */ on( eventName: N, - listener: (arg: E[typeof eventName]) => void, + listener: (arg: E[typeof eventName]) => void ): this { if (eventName in this.eventListeners) { // eslint-disable-next-line security/detect-object-injection - this.eventListeners[eventName].push(listener); + this.eventListeners[eventName].push(listener) } else { // eslint-disable-next-line security/detect-object-injection - this.eventListeners[eventName] = [listener]; + this.eventListeners[eventName] = [listener] } - return this; + return this } /** @@ -200,14 +168,13 @@ class EventEmitter> { */ once( eventName: N, - listener: (arg: E[typeof eventName]) => void, + listener: (arg: E[typeof eventName]) => void ): this { const wrapper = (arg: E[typeof eventName]): void => { - this.removeListener(eventName, wrapper); - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - listener(arg); - }; - return this.addListener(eventName, wrapper); + this.removeListener(eventName, wrapper) + listener(arg) + } + return this.addListener(eventName, wrapper) } /** @@ -218,15 +185,15 @@ class EventEmitter> { */ off( eventName: N, - listener: (arg: E[typeof eventName]) => void, + listener: (arg: E[typeof eventName]) => void ): this { if (eventName in this.eventListeners) { // eslint-disable-next-line security/detect-object-injection this.eventListeners[eventName] = this.eventListeners[eventName].filter( - (l) => l !== listener, - ); + (l) => l !== listener + ) } - return this; + return this } /** @@ -238,13 +205,13 @@ class EventEmitter> { */ removeAllListeners(event?: N): this { if (event) { - // eslint-disable-next-line @typescript-eslint/no-dynamic-delete,security/detect-object-injection - delete this.eventListeners[event]; + // eslint-disable-next-line security/detect-object-injection + delete this.eventListeners[event] } else { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - this.eventListeners = Object.create(null); + this.eventListeners = Object.create(null) } - return this; + return this } /** @@ -258,13 +225,12 @@ class EventEmitter> { */ emit(eventName: N, arg: E[typeof eventName]): boolean { if (eventName in this.eventListeners) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,security/detect-object-injection - const listeners = this.eventListeners[eventName]; - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - for (const listener of listeners) listener(arg); - return true; + // eslint-disable-next-line security/detect-object-injection + const listeners = this.eventListeners[eventName] + for (const listener of listeners) listener(arg) + return true } - return false; + return false } /** @@ -275,8 +241,8 @@ class EventEmitter> { listenerCount(eventName: N): number { if (eventName in this.eventListeners) // eslint-disable-next-line security/detect-object-injection - return this.eventListeners[eventName].length; - return 0; + return this.eventListeners[eventName].length + return 0 } /** @@ -291,16 +257,16 @@ class EventEmitter> { */ prependListener( eventName: N, - listener: (arg: E[typeof eventName]) => void, + listener: (arg: E[typeof eventName]) => void ): this { if (eventName in this.eventListeners) { // eslint-disable-next-line security/detect-object-injection - this.eventListeners[eventName].unshift(listener); + this.eventListeners[eventName].unshift(listener) } else { // eslint-disable-next-line security/detect-object-injection - this.eventListeners[eventName] = [listener]; + this.eventListeners[eventName] = [listener] } - return this; + return this } /** @@ -313,15 +279,15 @@ class EventEmitter> { */ prependOnceListener( eventName: N, - listener: (arg: E[typeof eventName]) => void, + listener: (arg: E[typeof eventName]) => void ): this { // eslint-disable-next-line @typescript-eslint/no-explicit-any const wrapper = (arg: any): void => { - this.removeListener(eventName, wrapper); + this.removeListener(eventName, wrapper) // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - listener(arg); - }; - return this.prependListener(eventName, wrapper); + listener(arg) + } + return this.prependListener(eventName, wrapper) } } @@ -330,10 +296,10 @@ class EventEmitter> { */ class Child { /** The child process `pid`. */ - pid: number; + pid: number constructor(pid: number) { - this.pid = pid; + this.pid = pid } /** @@ -353,12 +319,11 @@ class Child { * * @since 2.0.0 */ - async write(data: IOPayload): Promise { - return invoke("plugin:shell|stdin_write", { + async write(data: IOPayload | number[]): Promise { + await invoke('plugin:shell|stdin_write', { pid: this.pid, - // correctly serialize Uint8Arrays - buffer: typeof data === "string" ? data : Array.from(data), - }); + buffer: data + }) } /** @@ -369,20 +334,20 @@ class Child { * @since 2.0.0 */ async kill(): Promise { - return invoke("plugin:shell|kill", { - cmd: "killChild", - pid: this.pid, - }); + await invoke('plugin:shell|kill', { + cmd: 'killChild', + pid: this.pid + }) } } interface CommandEvents { - close: TerminatedPayload; - error: string; + close: TerminatedPayload + error: string } interface OutputEvents { - data: O; + data: O } /** @@ -408,15 +373,15 @@ interface OutputEvents { */ class Command extends EventEmitter { /** @ignore Program to execute. */ - private readonly program: string; + private readonly program: string /** @ignore Program arguments */ - private readonly args: string[]; + private readonly args: string[] /** @ignore Spawn options. */ - private readonly options: InternalSpawnOptions; + private readonly options: InternalSpawnOptions /** Event emitter for the `stdout`. Emits the `data` event. */ - readonly stdout = new EventEmitter>(); + readonly stdout = new EventEmitter>() /** Event emitter for the `stderr`. Emits the `data` event. */ - readonly stderr = new EventEmitter>(); + readonly stderr = new EventEmitter>() /** * @ignore @@ -430,25 +395,25 @@ class Command extends EventEmitter { private constructor( program: string, args: string | string[] = [], - options?: SpawnOptions, + options?: SpawnOptions ) { - super(); - this.program = program; - this.args = typeof args === "string" ? [args] : args; - this.options = options ?? {}; + super() + this.program = program + this.args = typeof args === 'string' ? [args] : args + this.options = options ?? {} } - static create(program: string, args?: string | string[]): Command; + static create(program: string, args?: string | string[]): Command static create( program: string, args?: string | string[], - options?: SpawnOptions & { encoding: "raw" }, - ): Command; + options?: SpawnOptions & { encoding: 'raw' } + ): Command static create( program: string, args?: string | string[], - options?: SpawnOptions, - ): Command; + options?: SpawnOptions + ): Command /** * Creates a command to execute the given program. @@ -465,22 +430,22 @@ class Command extends EventEmitter { static create( program: string, args: string | string[] = [], - options?: SpawnOptions, + options?: SpawnOptions ): Command { - return new Command(program, args, options); + return new Command(program, args, options) } - static sidecar(program: string, args?: string | string[]): Command; + static sidecar(program: string, args?: string | string[]): Command static sidecar( program: string, args?: string | string[], - options?: SpawnOptions & { encoding: "raw" }, - ): Command; + options?: SpawnOptions & { encoding: 'raw' } + ): Command static sidecar( program: string, args?: string | string[], - options?: SpawnOptions, - ): Command; + options?: SpawnOptions + ): Command /** * Creates a command to execute the given sidecar program. @@ -497,11 +462,11 @@ class Command extends EventEmitter { static sidecar( program: string, args: string | string[] = [], - options?: SpawnOptions, + options?: SpawnOptions ): Command { - const instance = new Command(program, args, options); - instance.options.sidecar = true; - return instance; + const instance = new Command(program, args, options) + instance.options.sidecar = true + return instance } /** @@ -512,27 +477,38 @@ class Command extends EventEmitter { * @since 2.0.0 */ async spawn(): Promise { - return execute( - (event) => { - switch (event.event) { - case "Error": - this.emit("error", event.payload); - break; - case "Terminated": - this.emit("close", event.payload); - break; - case "Stdout": - this.stdout.emit("data", event.payload); - break; - case "Stderr": - this.stderr.emit("data", event.payload); - break; - } - }, - this.program, - this.args, - this.options, - ).then((pid) => new Child(pid)); + const program = this.program + const args = this.args + const options = this.options + + if (typeof args === 'object') { + Object.freeze(args) + } + + const onEvent = new Channel>() + onEvent.onmessage = (event) => { + switch (event.event) { + case 'Error': + this.emit('error', event.payload) + break + case 'Terminated': + this.emit('close', event.payload) + break + case 'Stdout': + this.stdout.emit('data', event.payload) + break + case 'Stderr': + this.stderr.emit('data', event.payload) + break + } + } + + return await invoke('plugin:shell|spawn', { + program, + args, + options, + onEvent + }).then((pid) => new Child(pid)) } /** @@ -552,40 +528,19 @@ class Command extends EventEmitter { * @since 2.0.0 */ async execute(): Promise> { - return new Promise((resolve, reject) => { - this.on("error", reject); - - const stdout: O[] = []; - const stderr: O[] = []; - this.stdout.on("data", (line: O) => { - stdout.push(line); - }); - this.stderr.on("data", (line: O) => { - stderr.push(line); - }); - - this.on("close", (payload: TerminatedPayload) => { - resolve({ - code: payload.code, - signal: payload.signal, - stdout: this.collectOutput(stdout) as O, - stderr: this.collectOutput(stderr) as O, - }); - }); - - this.spawn().catch(reject); - }); - } + const program = this.program + const args = this.args + const options = this.options - /** @ignore */ - private collectOutput(events: O[]): string | Uint8Array { - if (this.options.encoding === "raw") { - return events.reduce((p, c) => { - return new Uint8Array([...p, ...(c as Uint8Array), 10]); - }, new Uint8Array()); - } else { - return events.join("\n"); + if (typeof args === 'object') { + Object.freeze(args) } + + return await invoke>('plugin:shell|execute', { + program, + args, + options + }) } } @@ -593,8 +548,8 @@ class Command extends EventEmitter { * Describes the event message received from the command. */ interface Event { - event: T; - payload: V; + event: T + payload: V } /** @@ -602,20 +557,20 @@ interface Event { */ interface TerminatedPayload { /** Exit code of the process. `null` if the process was terminated by a signal on Unix. */ - code: number | null; + code: number | null /** If the process was terminated by a signal, represents that signal. */ - signal: number | null; + signal: number | null } /** Event payload type */ -type IOPayload = string | Uint8Array; +type IOPayload = string | Uint8Array /** Events emitted by the child process. */ type CommandEvent = - | Event<"Stdout", O> - | Event<"Stderr", O> - | Event<"Terminated", TerminatedPayload> - | Event<"Error", string>; + | Event<'Stdout', O> + | Event<'Stderr', O> + | Event<'Terminated', TerminatedPayload> + | Event<'Error', string> /** * Opens a path or URL with the system's default app, @@ -644,18 +599,18 @@ type CommandEvent = * @since 2.0.0 */ async function open(path: string, openWith?: string): Promise { - return invoke("plugin:shell|open", { + await invoke('plugin:shell|open', { path, - with: openWith, - }); + with: openWith + }) } -export { Command, Child, EventEmitter, open }; +export { Command, Child, EventEmitter, open } export type { IOPayload, CommandEvents, TerminatedPayload, OutputEvents, ChildProcess, - SpawnOptions, -}; + SpawnOptions +} diff --git a/plugins/shell/guest-js/init.ts b/plugins/shell/guest-js/init.ts index 4f6eea2e..58d0001e 100644 --- a/plugins/shell/guest-js/init.ts +++ b/plugins/shell/guest-js/init.ts @@ -2,39 +2,39 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { invoke } from "@tauri-apps/api/core"; +import { invoke } from '@tauri-apps/api/core' // open links with the API -function openLinks() { - document.querySelector("body")?.addEventListener("click", function (e) { - let target = e.target as HTMLElement; - while (target != null) { - if (target.matches("a")) { - const t = target as HTMLAnchorElement; +function openLinks(): void { + document.querySelector('body')?.addEventListener('click', function (e) { + let target: HTMLElement | null = e.target as HTMLElement + while (target) { + if (target.matches('a')) { + const t = target as HTMLAnchorElement if ( - t.href && - ["http://", "https://", "mailto:", "tel:"].some((v) => - t.href.startsWith(v), + t.href !== '' && + ['http://', 'https://', 'mailto:', 'tel:'].some((v) => + t.href.startsWith(v) ) && - t.target === "_blank" + t.target === '_blank' ) { - invoke("plugin:shell|open", { - path: t.href, - }); - e.preventDefault(); + void invoke('plugin:shell|open', { + path: t.href + }) + e.preventDefault() } - break; + break } - target = target.parentElement as HTMLElement; + target = target.parentElement } - }); + }) } if ( - document.readyState === "complete" || - document.readyState === "interactive" + document.readyState === 'complete' || + document.readyState === 'interactive' ) { - openLinks(); + openLinks() } else { - window.addEventListener("DOMContentLoaded", openLinks, true); + window.addEventListener('DOMContentLoaded', openLinks, true) } diff --git a/plugins/shell/ios/Package.resolved b/plugins/shell/ios/Package.resolved new file mode 100644 index 00000000..5f998e0e --- /dev/null +++ b/plugins/shell/ios/Package.resolved @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "SwiftRs", + "repositoryURL": "https://github.com/Brendonovich/swift-rs", + "state": { + "branch": null, + "revision": "b5ed223fcdab165bc21219c1925dc1e77e2bef5e", + "version": "1.0.6" + } + } + ] + }, + "version": 1 +} diff --git a/plugins/shell/ios/Package.swift b/plugins/shell/ios/Package.swift new file mode 100644 index 00000000..c7b2a7aa --- /dev/null +++ b/plugins/shell/ios/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version:5.3 +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import PackageDescription + +let package = Package( + name: "tauri-plugin-shell", + platforms: [ + .macOS(.v10_13), + .iOS(.v13), + ], + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "tauri-plugin-shell", + type: .static, + targets: ["tauri-plugin-shell"]) + ], + dependencies: [ + .package(name: "Tauri", path: "../.tauri/tauri-api") + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "tauri-plugin-shell", + dependencies: [ + .byName(name: "Tauri") + ], + path: "Sources") + ] +) diff --git a/plugins/shell/ios/Sources/ShellPlugin.swift b/plugins/shell/ios/Sources/ShellPlugin.swift new file mode 100644 index 00000000..0fcb7dac --- /dev/null +++ b/plugins/shell/ios/Sources/ShellPlugin.swift @@ -0,0 +1,34 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import Foundation + +import SwiftRs +import Tauri +import UIKit +import WebKit + +class ShellPlugin: Plugin { + + @objc public func open(_ invoke: Invoke) throws { + do { + let urlString = try invoke.parseArgs(String.self) + if let url = URL(string: urlString) { + if #available(iOS 10, *) { + UIApplication.shared.open(url, options: [:]) + } else { + UIApplication.shared.openURL(url) + } + } + invoke.resolve() + } catch { + invoke.reject(error.localizedDescription) + } + } +} + +@_cdecl("init_plugin_shell") +func initPlugin() -> Plugin { + return ShellPlugin() +} diff --git a/plugins/shell/package.json b/plugins/shell/package.json index fbaecb14..abbc33ea 100644 --- a/plugins/shell/package.json +++ b/plugins/shell/package.json @@ -1,10 +1,11 @@ { "name": "@tauri-apps/plugin-shell", - "version": "2.0.0-beta.1", - "license": "MIT or APACHE-2.0", + "version": "2.0.1", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -23,6 +24,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/shell/permissions/autogenerated/commands/spawn.toml b/plugins/shell/permissions/autogenerated/commands/spawn.toml new file mode 100644 index 00000000..a3802d2a --- /dev/null +++ b/plugins/shell/permissions/autogenerated/commands/spawn.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-spawn" +description = "Enables the spawn command without any pre-configured scope." +commands.allow = ["spawn"] + +[[permission]] +identifier = "deny-spawn" +description = "Denies the spawn command without any pre-configured scope." +commands.deny = ["spawn"] diff --git a/plugins/shell/permissions/autogenerated/reference.md b/plugins/shell/permissions/autogenerated/reference.md index 93f94f3d..d88bf2d5 100644 --- a/plugins/shell/permissions/autogenerated/reference.md +++ b/plugins/shell/permissions/autogenerated/reference.md @@ -1,34 +1,153 @@ -# Permissions +## Default Permission -## allow-execute +This permission set configures which +shell functionality is exposed by default. + +#### Granted Permissions + +It allows to use the `open` functionality without any specific +scope pre-configured. It will allow opening `http(s)://`, +`tel:` and `mailto:` links. + + +- `allow-open` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`shell:allow-execute` + + Enables the execute command without any pre-configured scope. -## deny-execute +
+ +`shell:deny-execute` + + Denies the execute command without any pre-configured scope. -## allow-kill +
+ +`shell:allow-kill` + + Enables the kill command without any pre-configured scope. -## deny-kill +
+ +`shell:deny-kill` + + Denies the kill command without any pre-configured scope. -## allow-open +
+ +`shell:allow-open` + + Enables the open command without any pre-configured scope. -## deny-open +
+ +`shell:deny-open` + + Denies the open command without any pre-configured scope. -## allow-stdin-write +
+ +`shell:allow-spawn` + + + +Enables the spawn command without any pre-configured scope. + +
+ +`shell:deny-spawn` + + + +Denies the spawn command without any pre-configured scope. + +
+ +`shell:allow-stdin-write` + + Enables the stdin_write command without any pre-configured scope. -## deny-stdin-write +
+ +`shell:deny-stdin-write` + + Denies the stdin_write command without any pre-configured scope. +
diff --git a/plugins/shell/permissions/default.toml b/plugins/shell/permissions/default.toml new file mode 100644 index 00000000..4569b052 --- /dev/null +++ b/plugins/shell/permissions/default.toml @@ -0,0 +1,15 @@ +"$schema" = "schemas/schema.json" + +[default] +description = """ +This permission set configures which +shell functionality is exposed by default. + +#### Granted Permissions + +It allows to use the `open` functionality without any specific +scope pre-configured. It will allow opening `http(s)://`, +`tel:` and `mailto:` links. +""" + +permissions = ["allow-open"] diff --git a/plugins/shell/permissions/schemas/schema.json b/plugins/shell/permissions/schemas/schema.json index b9761573..e70c3926 100644 --- a/plugins/shell/permissions/schemas/schema.json +++ b/plugins/shell/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,64 +251,103 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-execute -> Enables the execute command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-execute" + "macOS" ] }, { - "description": "deny-execute -> Denies the execute command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-execute" + "windows" ] }, { - "description": "allow-kill -> Enables the kill command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-kill" + "linux" ] }, { - "description": "deny-kill -> Denies the kill command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-kill" + "android" ] }, { - "description": "allow-open -> Enables the open command without any pre-configured scope.", + "description": "iOS.", "type": "string", "enum": [ - "allow-open" + "iOS" ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the execute command without any pre-configured scope.", + "type": "string", + "const": "allow-execute" }, { - "description": "deny-open -> Denies the open command without any pre-configured scope.", + "description": "Denies the execute command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-open" - ] + "const": "deny-execute" }, { - "description": "allow-stdin-write -> Enables the stdin_write command without any pre-configured scope.", + "description": "Enables the kill command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-stdin-write" - ] + "const": "allow-kill" }, { - "description": "deny-stdin-write -> Denies the stdin_write command without any pre-configured scope.", + "description": "Denies the kill command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-stdin-write" - ] + "const": "deny-kill" + }, + { + "description": "Enables the open command without any pre-configured scope.", + "type": "string", + "const": "allow-open" + }, + { + "description": "Denies the open command without any pre-configured scope.", + "type": "string", + "const": "deny-open" + }, + { + "description": "Enables the spawn command without any pre-configured scope.", + "type": "string", + "const": "allow-spawn" + }, + { + "description": "Denies the spawn command without any pre-configured scope.", + "type": "string", + "const": "deny-spawn" + }, + { + "description": "Enables the stdin_write command without any pre-configured scope.", + "type": "string", + "const": "allow-stdin-write" + }, + { + "description": "Denies the stdin_write command without any pre-configured scope.", + "type": "string", + "const": "deny-stdin-write" + }, + { + "description": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality without any specific\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n", + "type": "string", + "const": "default" } ] } diff --git a/plugins/shell/rollup.config.js b/plugins/shell/rollup.config.js index 0aed70d6..a7dbd4f6 100644 --- a/plugins/shell/rollup.config.js +++ b/plugins/shell/rollup.config.js @@ -2,21 +2,21 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; -import { nodeResolve } from "@rollup/plugin-node-resolve"; -import typescript from "@rollup/plugin-typescript"; -import terser from "@rollup/plugin-terser"; +import { createConfig } from '../../shared/rollup.config.js' +import { nodeResolve } from '@rollup/plugin-node-resolve' +import typescript from '@rollup/plugin-typescript' +import terser from '@rollup/plugin-terser' export default createConfig({ additionalConfigs: { - input: "guest-js/init.ts", + input: 'guest-js/init.ts', output: { - file: "src/init-iife.js", - format: "iife", + file: 'src/init-iife.js', + format: 'iife' }, plugins: [typescript(), terser(), nodeResolve()], onwarn: (warning) => { - throw Object.assign(new Error(), warning); - }, - }, -}); + throw Object.assign(new Error(), warning) + } + } +}) diff --git a/plugins/shell/src/api-iife.js b/plugins/shell/src/api-iife.js deleted file mode 100644 index a64b8710..00000000 --- a/plugins/shell/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_SHELL__=function(e){"use strict";function t(e,t,s,r){if("a"===s&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?r:"a"===s?r.call(e):r?r.value:t.get(e)}var s;"function"==typeof SuppressedError&&SuppressedError;class r{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,s.set(this,(()=>{})),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((e=>{t(this,s,"f").call(this,e)}))}set onmessage(e){!function(e,t,s,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?n.call(e,s):n?n.value=s:t.set(e,s)}(this,s,e,"f")}get onmessage(){return t(this,s,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function n(e,t={},s){return window.__TAURI_INTERNALS__.invoke(e,t,s)}s=new WeakMap;class i{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){const s=r=>{this.removeListener(e,s),t(r)};return this.addListener(e,s)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter((e=>e!==t))),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,t){if(e in this.eventListeners){const s=this.eventListeners[e];for(const e of s)e(t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){const s=r=>{this.removeListener(e,s),t(r)};return this.prependListener(e,s)}}class o{constructor(e){this.pid=e}async write(e){return n("plugin:shell|stdin_write",{pid:this.pid,buffer:"string"==typeof e?e:Array.from(e)})}async kill(){return n("plugin:shell|kill",{cmd:"killChild",pid:this.pid})}}class a extends i{constructor(e,t=[],s){super(),this.stdout=new i,this.stderr=new i,this.program=e,this.args="string"==typeof t?[t]:t,this.options=s??{}}static create(e,t=[],s){return new a(e,t,s)}static sidecar(e,t=[],s){const r=new a(e,t,s);return r.options.sidecar=!0,r}async spawn(){return async function(e,t,s=[],i){"object"==typeof s&&Object.freeze(s);const o=new r;return o.onmessage=e,n("plugin:shell|execute",{program:t,args:s,options:i,onEvent:o})}((e=>{switch(e.event){case"Error":this.emit("error",e.payload);break;case"Terminated":this.emit("close",e.payload);break;case"Stdout":this.stdout.emit("data",e.payload);break;case"Stderr":this.stderr.emit("data",e.payload)}}),this.program,this.args,this.options).then((e=>new o(e)))}async execute(){return new Promise(((e,t)=>{this.on("error",t);const s=[],r=[];this.stdout.on("data",(e=>{s.push(e)})),this.stderr.on("data",(e=>{r.push(e)})),this.on("close",(t=>{e({code:t.code,signal:t.signal,stdout:this.collectOutput(s),stderr:this.collectOutput(r)})})),this.spawn().catch(t)}))}collectOutput(e){return"raw"===this.options.encoding?e.reduce(((e,t)=>new Uint8Array([...e,...t,10])),new Uint8Array):e.join("\n")}}return e.Child=o,e.Command=a,e.EventEmitter=i,e.open=async function(e,t){return n("plugin:shell|open",{path:e,with:t})},e}({});Object.defineProperty(window.__TAURI__,"shell",{value:__TAURI_PLUGIN_SHELL__})} diff --git a/plugins/shell/src/commands.rs b/plugins/shell/src/commands.rs index 050713a3..3345bb3a 100644 --- a/plugins/shell/src/commands.rs +++ b/plugins/shell/src/commands.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use std::{collections::HashMap, path::PathBuf, string::FromUtf8Error}; +use std::{collections::HashMap, future::Future, path::PathBuf, pin::Pin, string::FromUtf8Error}; use encoding_rs::Encoding; use serde::{Deserialize, Serialize}; @@ -23,7 +23,7 @@ type ChildId = u32; #[derive(Debug, Clone, Serialize)] #[serde(tag = "event", content = "payload")] #[non_exhaustive] -enum JSCommandEvent { +pub enum JSCommandEvent { /// Stderr bytes until a newline (\n) or carriage return (\r) is found. Stderr(Buffer), /// Stdout bytes until a newline (\n) or carriage return (\r) is found. @@ -94,18 +94,15 @@ fn default_env() -> Option> { Some(HashMap::default()) } -#[allow(clippy::too_many_arguments)] -#[tauri::command] -pub fn execute( +#[inline(always)] +fn prepare_cmd( window: Window, - shell: State<'_, Shell>, program: String, args: ExecuteArgs, - on_event: Channel, options: CommandOptions, command_scope: CommandScope, global_scope: GlobalScope, -) -> crate::Result { +) -> crate::Result<(crate::process::Command, EncodingWrapper)> { let scope = crate::scope::ShellScope { scopes: command_scope .allows() @@ -151,10 +148,14 @@ pub fn execute( } else { command = command.env_clear(); } + let encoding = match options.encoding { Option::None => EncodingWrapper::Text(None), Some(encoding) => match encoding.as_str() { - "raw" => EncodingWrapper::Raw, + "raw" => { + command = command.set_raw_out(true); + EncodingWrapper::Raw + } _ => { if let Some(text_encoding) = Encoding::for_label(encoding.as_bytes()) { EncodingWrapper::Text(Some(text_encoding)) @@ -165,6 +166,81 @@ pub fn execute( }, }; + Ok((command, encoding)) +} + +#[derive(Serialize)] +#[serde(untagged)] +enum Output { + String(String), + Raw(Vec), +} + +#[derive(Serialize)] +pub struct ChildProcessReturn { + code: Option, + signal: Option, + stdout: Output, + stderr: Output, +} + +#[allow(clippy::too_many_arguments)] +#[tauri::command] +pub async fn execute( + window: Window, + program: String, + args: ExecuteArgs, + options: CommandOptions, + command_scope: CommandScope, + global_scope: GlobalScope, +) -> crate::Result { + let (command, encoding) = + prepare_cmd(window, program, args, options, command_scope, global_scope)?; + + let mut command: std::process::Command = command.into(); + let output = command.output()?; + + let (stdout, stderr) = match encoding { + EncodingWrapper::Text(Some(encoding)) => ( + Output::String(encoding.decode_with_bom_removal(&output.stdout).0.into()), + Output::String(encoding.decode_with_bom_removal(&output.stderr).0.into()), + ), + EncodingWrapper::Text(None) => ( + Output::String(String::from_utf8(output.stdout)?), + Output::String(String::from_utf8(output.stderr)?), + ), + EncodingWrapper::Raw => (Output::Raw(output.stdout), Output::Raw(output.stderr)), + }; + + #[cfg(unix)] + use std::os::unix::process::ExitStatusExt; + + Ok(ChildProcessReturn { + code: output.status.code(), + #[cfg(windows)] + signal: None, + #[cfg(unix)] + signal: output.status.signal(), + stdout, + stderr, + }) +} + +#[allow(clippy::too_many_arguments)] +#[tauri::command] +pub fn spawn( + window: Window, + shell: State<'_, Shell>, + program: String, + args: ExecuteArgs, + on_event: Channel, + options: CommandOptions, + command_scope: CommandScope, + global_scope: GlobalScope, +) -> crate::Result { + let (command, encoding) = + prepare_cmd(window, program, args, options, command_scope, global_scope)?; + let (mut rx, child) = command.spawn()?; let pid = child.pid(); @@ -177,7 +253,21 @@ pub fn execute( children.lock().unwrap().remove(&pid); }; let js_event = JSCommandEvent::new(event, encoding); - let _ = on_event.send(&js_event); + + if on_event.send(js_event.clone()).is_err() { + fn send<'a>( + on_event: &'a Channel, + js_event: &'a JSCommandEvent, + ) -> Pin + Send + 'a>> { + Box::pin(async move { + tokio::time::sleep(std::time::Duration::from_millis(15)).await; + if on_event.send(js_event.clone()).is_err() { + send(on_event, js_event).await; + } + }) + } + send(&on_event, &js_event).await; + } } }); @@ -213,7 +303,7 @@ pub fn kill( } #[tauri::command] -pub fn open( +pub async fn open( _window: Window, shell: State<'_, Shell>, path: String, diff --git a/plugins/shell/src/config.rs b/plugins/shell/src/config.rs index 95390988..cad267a2 100644 --- a/plugins/shell/src/config.rs +++ b/plugins/shell/src/config.rs @@ -25,6 +25,9 @@ pub enum ShellAllowlistOpen { /// Enable the shell open API, with a custom regex that the opened path must match against. /// + /// The regex string is automatically surrounded by `^...$` to match the full string. + /// For example the `https?://\w+` regex would be registered as `^https?://\w+$`. + /// /// If using a custom regex to support a non-http(s) schema, care should be used to prevent values /// that allow flag-like strings to pass validation. e.g. `--enable-debugging`, `-i`, `/R`. Validate(String), diff --git a/plugins/shell/src/error.rs b/plugins/shell/src/error.rs index b3bde393..05eda7ed 100644 --- a/plugins/shell/src/error.rs +++ b/plugins/shell/src/error.rs @@ -8,6 +8,9 @@ use serde::{Serialize, Serializer}; #[derive(Debug, thiserror::Error)] pub enum Error { + #[cfg(mobile)] + #[error(transparent)] + PluginInvoke(#[from] tauri::plugin::mobile::PluginInvokeError), #[error(transparent)] Io(#[from] std::io::Error), #[error("current executable path has no parent")] @@ -17,7 +20,7 @@ pub enum Error { #[error(transparent)] Scope(#[from] crate::scope::Error), /// Sidecar not allowed by the configuration. - #[error("sidecar not configured under `tauri.conf.json > tauri > bundle > externalBin`: {0}")] + #[error("sidecar not configured under `tauri.conf.json > bundle > externalBin`: {0}")] SidecarNotAllowed(PathBuf), /// Program not allowed by the scope. #[error("program not allowed on the configured shell scope: {0}")] @@ -36,6 +39,9 @@ pub enum Error { /// Path doesn't have a parent. #[error("Path doesn't have a parent: {0}")] NoParent(PathBuf), + /// Utf8 error. + #[error(transparent)] + Utf8(#[from] std::string::FromUtf8Error), } impl Serialize for Error { diff --git a/plugins/shell/src/init-iife.js b/plugins/shell/src/init-iife.js index abc8a15f..3c91c81c 100644 --- a/plugins/shell/src/init-iife.js +++ b/plugins/shell/src/init-iife.js @@ -1 +1 @@ -!function(){"use strict";async function e(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}function t(){document.querySelector("body")?.addEventListener("click",(function(t){let n=t.target;for(;null!=n;){if(n.matches("a")){const r=n;r.href&&["http://","https://","mailto:","tel:"].some((e=>r.href.startsWith(e)))&&"_blank"===r.target&&(e("plugin:shell|open",{path:r.href}),t.preventDefault());break}n=n.parentElement}}))}"function"==typeof SuppressedError&&SuppressedError,"complete"===document.readyState||"interactive"===document.readyState?t():window.addEventListener("DOMContentLoaded",t,!0)}(); +!function(){"use strict";async function e(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}function t(){document.querySelector("body")?.addEventListener("click",(function(t){let n=t.target;for(;n;){if(n.matches("a")){const r=n;""!==r.href&&["http://","https://","mailto:","tel:"].some((e=>r.href.startsWith(e)))&&"_blank"===r.target&&(e("plugin:shell|open",{path:r.href}),t.preventDefault());break}n=n.parentElement}}))}"function"==typeof SuppressedError&&SuppressedError,"complete"===document.readyState||"interactive"===document.readyState?t():window.addEventListener("DOMContentLoaded",t,!0)}(); diff --git a/plugins/shell/src/lib.rs b/plugins/shell/src/lib.rs index 4de83dc4..1f3f5004 100644 --- a/plugins/shell/src/lib.rs +++ b/plugins/shell/src/lib.rs @@ -35,11 +35,21 @@ mod scope_entry; pub use error::Error; type Result = std::result::Result; + +#[cfg(mobile)] +use tauri::plugin::PluginHandle; +#[cfg(target_os = "android")] +const PLUGIN_IDENTIFIER: &str = "app.tauri.shell"; +#[cfg(target_os = "ios")] +tauri::ios_plugin_binding!(init_plugin_shell); + type ChildStore = Arc>>; pub struct Shell { #[allow(dead_code)] app: AppHandle, + #[cfg(mobile)] + mobile_plugin_handle: PluginHandle, open_scope: scope::OpenScope, children: ChildStore, } @@ -61,10 +71,21 @@ impl Shell { /// Open a (url) path with a default or specific browser opening program. /// /// See [`crate::open::open`] for how it handles security-related measures. + #[cfg(desktop)] pub fn open(&self, path: impl Into, with: Option) -> Result<()> { open::open(&self.open_scope, path.into(), with).map_err(Into::into) } + /// Open a (url) path with a default or specific browser opening program. + /// + /// See [`crate::open::open`] for how it handles security-related measures. + #[cfg(mobile)] + pub fn open(&self, path: impl Into, _with: Option) -> Result<()> { + self.mobile_plugin_handle + .run_mobile_plugin("open", path.into()) + .map_err(Into::into) + } + pub fn show_item_in_directory>(&self, p: P) -> Result<()> { open::show_item_in_directory(p) } @@ -81,13 +102,11 @@ impl> ShellExt for T { } pub fn init() -> TauriPlugin> { - let mut init_script = include_str!("init-iife.js").to_string(); - init_script.push_str(include_str!("api-iife.js")); - Builder::>::new("shell") - .js_init_script(init_script) + .js_init_script(include_str!("init-iife.js").to_string()) .invoke_handler(tauri::generate_handler![ commands::execute, + commands::spawn, commands::stdin_write, commands::kill, commands::open @@ -95,10 +114,19 @@ pub fn init() -> TauriPlugin> { .setup(|app, api| { let default_config = config::Config::default(); let config = api.config().as_ref().unwrap_or(&default_config); + + #[cfg(target_os = "android")] + let handle = api.register_android_plugin(PLUGIN_IDENTIFIER, "ShellPlugin")?; + #[cfg(target_os = "ios")] + let handle = api.register_ios_plugin(init_plugin_shell)?; + app.manage(Shell { app: app.clone(), children: Default::default(), open_scope: open_scope(&config.open), + + #[cfg(mobile)] + mobile_plugin_handle: handle, }); Ok(()) }) @@ -124,8 +152,9 @@ fn open_scope(open: &config::ShellAllowlistOpen) -> scope::OpenScope { Some(Regex::new(r"^((mailto:\w+)|(tel:\w+)|(https?://\w+)).+").unwrap()) } config::ShellAllowlistOpen::Validate(validator) => { + let regex = format!("^{validator}$"); let validator = - Regex::new(validator).unwrap_or_else(|e| panic!("invalid regex {validator}: {e}")); + Regex::new(®ex).unwrap_or_else(|e| panic!("invalid regex {regex}: {e}")); Some(validator) } }; diff --git a/plugins/shell/src/process/mod.rs b/plugins/shell/src/process/mod.rs index fdb26897..44f037b0 100644 --- a/plugins/shell/src/process/mod.rs +++ b/plugins/shell/src/process/mod.rs @@ -4,7 +4,7 @@ use std::{ ffi::OsStr, - io::{BufReader, Write}, + io::{BufRead, BufReader, Write}, path::{Path, PathBuf}, process::{Command as StdCommand, Stdio}, sync::{Arc, RwLock}, @@ -41,11 +41,13 @@ pub struct TerminatedPayload { #[derive(Debug, Clone)] #[non_exhaustive] pub enum CommandEvent { - /// Stderr bytes until a newline (\n) or carriage return (\r) is found. + /// If configured for raw output, all bytes written to stderr. + /// Otherwise, bytes until a newline (\n) or carriage return (\r) is found. Stderr(Vec), - /// Stdout bytes until a newline (\n) or carriage return (\r) is found. + /// If configured for raw output, all bytes written to stdout. + /// Otherwise, bytes until a newline (\n) or carriage return (\r) is found. Stdout(Vec), - /// An error happened waiting for the command to finish or converting the stdout/stderr bytes to an UTF-8 string. + /// An error happened waiting for the command to finish or converting the stdout/stderr bytes to a UTF-8 string. Error(String), /// Command process terminated. Terminated(TerminatedPayload), @@ -53,7 +55,10 @@ pub enum CommandEvent { /// The type to spawn commands. #[derive(Debug)] -pub struct Command(StdCommand); +pub struct Command { + cmd: StdCommand, + raw_out: bool, +} /// Spawned child process. #[derive(Debug)] @@ -122,7 +127,7 @@ fn relative_command_path(command: &Path) -> crate::Result { impl From for StdCommand { fn from(cmd: Command) -> StdCommand { - cmd.0 + cmd.cmd } } @@ -136,7 +141,10 @@ impl Command { #[cfg(windows)] command.creation_flags(CREATE_NO_WINDOW); - Self(command) + Self { + cmd: command, + raw_out: false, + } } pub(crate) fn new_sidecar>(program: S) -> crate::Result { @@ -146,7 +154,7 @@ impl Command { /// Appends an argument to the command. #[must_use] pub fn arg>(mut self, arg: S) -> Self { - self.0.arg(arg); + self.cmd.arg(arg); self } @@ -157,14 +165,14 @@ impl Command { I: IntoIterator, S: AsRef, { - self.0.args(args); + self.cmd.args(args); self } /// Clears the entire environment map for the child process. #[must_use] pub fn env_clear(mut self) -> Self { - self.0.env_clear(); + self.cmd.env_clear(); self } @@ -175,7 +183,7 @@ impl Command { K: AsRef, V: AsRef, { - self.0.env(key, value); + self.cmd.env(key, value); self } @@ -187,14 +195,20 @@ impl Command { K: AsRef, V: AsRef, { - self.0.envs(envs); + self.cmd.envs(envs); self } /// Sets the working directory for the child process. #[must_use] pub fn current_dir>(mut self, current_dir: P) -> Self { - self.0.current_dir(current_dir); + self.cmd.current_dir(current_dir); + self + } + + /// Configures the reader to output bytes from the child process exactly as received + pub fn set_raw_out(mut self, raw_out: bool) -> Self { + self.raw_out = raw_out; self } @@ -229,6 +243,7 @@ impl Command { /// }); /// ``` pub fn spawn(self) -> crate::Result<(Receiver, CommandChild)> { + let raw = self.raw_out; let mut command: StdCommand = self.into(); let (stdout_reader, stdout_writer) = pipe()?; let (stderr_reader, stderr_writer) = pipe()?; @@ -249,12 +264,14 @@ impl Command { guard.clone(), stdout_reader, CommandEvent::Stdout, + raw, ); spawn_pipe_reader( tx.clone(), guard.clone(), stderr_reader, CommandEvent::Stderr, + raw, ); spawn(move || { @@ -359,35 +376,74 @@ impl Command { } } +fn read_raw_bytes) -> CommandEvent + Send + Copy + 'static>( + mut reader: BufReader, + tx: Sender, + wrapper: F, +) { + loop { + let result = reader.fill_buf(); + match result { + Ok(buf) => { + let length = buf.len(); + if length == 0 { + break; + } + let tx_ = tx.clone(); + let _ = block_on_task(async move { tx_.send(wrapper(buf.to_vec())).await }); + reader.consume(length); + } + Err(e) => { + let tx_ = tx.clone(); + let _ = block_on_task( + async move { tx_.send(CommandEvent::Error(e.to_string())).await }, + ); + } + } + } +} + +fn read_line) -> CommandEvent + Send + Copy + 'static>( + mut reader: BufReader, + tx: Sender, + wrapper: F, +) { + loop { + let mut buf = Vec::new(); + match tauri::utils::io::read_line(&mut reader, &mut buf) { + Ok(n) => { + if n == 0 { + break; + } + let tx_ = tx.clone(); + let _ = block_on_task(async move { tx_.send(wrapper(buf)).await }); + } + Err(e) => { + let tx_ = tx.clone(); + let _ = block_on_task( + async move { tx_.send(CommandEvent::Error(e.to_string())).await }, + ); + break; + } + } + } +} + fn spawn_pipe_reader) -> CommandEvent + Send + Copy + 'static>( tx: Sender, guard: Arc>, pipe_reader: PipeReader, wrapper: F, + raw_out: bool, ) { spawn(move || { let _lock = guard.read().unwrap(); - let mut reader = BufReader::new(pipe_reader); - - loop { - let mut buf = Vec::new(); - match tauri::utils::io::read_line(&mut reader, &mut buf) { - Ok(n) => { - if n == 0 { - break; - } - let tx_ = tx.clone(); - let _ = block_on_task(async move { tx_.send(wrapper(buf)).await }); - } - Err(e) => { - let tx_ = tx.clone(); - let _ = - block_on_task( - async move { tx_.send(CommandEvent::Error(e.to_string())).await }, - ); - break; - } - } + let reader = BufReader::new(pipe_reader); + + if raw_out { + read_raw_bytes(reader, tx, wrapper); + } else { + read_line(reader, tx, wrapper); } }); } diff --git a/plugins/shell/src/scope.rs b/plugins/shell/src/scope.rs index 6351196b..8178ab10 100644 --- a/plugins/shell/src/scope.rs +++ b/plugins/shell/src/scope.rs @@ -2,6 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT +use std::sync::Arc; + use crate::open::Program; use crate::process::Command; @@ -86,9 +88,14 @@ impl ScopeObject for ScopeAllowedCommand { crate::scope_entry::ShellAllowedArg::Fixed(fixed) => { crate::scope::ScopeAllowedArg::Fixed(fixed) } - crate::scope_entry::ShellAllowedArg::Var { validator } => { - let validator = Regex::new(&validator) - .unwrap_or_else(|e| panic!("invalid regex {validator}: {e}")); + crate::scope_entry::ShellAllowedArg::Var { validator, raw } => { + let regex = if raw { + validator + } else { + format!("^{validator}$") + }; + let validator = Regex::new(®ex) + .unwrap_or_else(|e| panic!("invalid regex {regex}: {e}")); crate::scope::ScopeAllowedArg::Var { validator } } }); @@ -141,7 +148,7 @@ pub struct OpenScope { #[derive(Clone)] pub struct ShellScope<'a> { /// All allowed commands, using their unique command name as the keys. - pub scopes: Vec<&'a ScopeAllowedCommand>, + pub scopes: Vec<&'a Arc>, } /// All errors that can happen while validating a scoped command. diff --git a/plugins/shell/src/scope_entry.rs b/plugins/shell/src/scope_entry.rs index aac8e695..59839178 100644 --- a/plugins/shell/src/scope_entry.rs +++ b/plugins/shell/src/scope_entry.rs @@ -7,28 +7,23 @@ use serde::{de::Error as DeError, Deserialize, Deserializer}; use std::path::PathBuf; /// A command allowed to be executed by the webview API. -#[derive(Debug, Clone, PartialEq, Eq, Hash, schemars::JsonSchema)] -pub struct Entry { - /// The name for this allowed shell command configuration. - /// - /// This name will be used inside of the webview API to call this command along with - /// any specified arguments. - pub name: String, - - /// 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`. - // use default just so the schema doesn't flag it as required - pub command: PathBuf, - - /// The allowed arguments for the command execution. - pub args: ShellAllowedArgs, +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub(crate) struct Entry { + pub(crate) name: String, + pub(crate) command: PathBuf, + pub(crate) args: ShellAllowedArgs, + pub(crate) sidecar: bool, +} - /// If this command is a sidecar command. - pub sidecar: bool, +#[derive(Deserialize)] +pub(crate) struct EntryRaw { + pub(crate) name: String, + #[serde(rename = "cmd")] + pub(crate) command: Option, + #[serde(default)] + pub(crate) args: ShellAllowedArgs, + #[serde(default)] + pub(crate) sidecar: bool, } impl<'de> Deserialize<'de> for Entry { @@ -36,18 +31,7 @@ impl<'de> Deserialize<'de> for Entry { where D: Deserializer<'de>, { - #[derive(Deserialize)] - struct InnerEntry { - name: String, - #[serde(rename = "cmd")] - command: Option, - #[serde(default)] - args: ShellAllowedArgs, - #[serde(default)] - sidecar: bool, - } - - let config = InnerEntry::deserialize(deserializer)?; + let config = EntryRaw::deserialize(deserializer)?; if !config.sidecar && config.command.is_none() { return Err(DeError::custom( @@ -64,19 +48,11 @@ impl<'de> Deserialize<'de> for Entry { } } -/// A set of command arguments allowed to be executed by the webview API. -/// -/// A value of `true` will allow any arguments to be passed to the command. `false` will disable all -/// arguments. A list of [`ShellAllowedArg`] will set those arguments as the only valid arguments to -/// be passed to the attached command configuration. -#[derive(Debug, PartialEq, Eq, Clone, Hash, Deserialize, schemars::JsonSchema)] +#[derive(Debug, PartialEq, Eq, Clone, Hash, Deserialize)] #[serde(untagged, deny_unknown_fields)] #[non_exhaustive] pub enum ShellAllowedArgs { - /// Use a simple boolean to allow all or disable all arguments to this command configuration. Flag(bool), - - /// A specific set of [`ShellAllowedArg`] that are valid to call for the command configuration. List(Vec), } @@ -86,23 +62,14 @@ impl Default for ShellAllowedArgs { } } -/// A command argument allowed to be executed by the webview API. -#[derive(Debug, PartialEq, Eq, Clone, Hash, Deserialize, schemars::JsonSchema)] +#[derive(Debug, PartialEq, Eq, Clone, Hash, Deserialize)] #[serde(untagged, deny_unknown_fields)] #[non_exhaustive] pub enum ShellAllowedArg { - /// A non-configurable argument that is passed to the command in the order it was specified. Fixed(String), - - /// A variable that is set while calling the command from the webview API. - /// Var { - /// [regex] validator to require passed values to conform to an expected input. - /// - /// This will require the argument value passed to this variable to match the `validator` regex - /// before it will be executed. - /// - /// [regex]: https://docs.rs/regex/latest/regex/#syntax validator: String, + #[serde(default)] + raw: bool, }, } diff --git a/plugins/single-instance/CHANGELOG.md b/plugins/single-instance/CHANGELOG.md index f25e89a6..0724caad 100644 --- a/plugins/single-instance/CHANGELOG.md +++ b/plugins/single-instance/CHANGELOG.md @@ -1,5 +1,100 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +### Dependencies + +- Upgraded to `deep-link@2.0.1` + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +### Dependencies + +- Upgraded to `deep-link@2.0.0` + +## \[2.0.0-rc.5] + +### Dependencies + +- Upgraded to `deep-link@2.0.0-rc.7` + +## \[2.0.0-rc.4] + +### Dependencies + +- Upgraded to `deep-link@2.0.0-rc.6` + +## \[2.0.0-rc.3] + +- [`b2269333`](https://github.com/tauri-apps/plugins-workspace/commit/b2269333e39afe32629a11763a8e25d0b12b132b) ([#1766](https://github.com/tauri-apps/plugins-workspace/pull/1766) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Put deep link integration behined a feature + +### Dependencies + +- Upgraded to `deep-link@2.0.0-rc.5` + +## \[2.0.0-rc.2] + +- [`64a6240f`](https://github.com/tauri-apps/plugins-workspace/commit/64a6240f79fcd52267c8d721b727ae695055d7ff) ([#1759](https://github.com/tauri-apps/plugins-workspace/pull/1759) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Integrate with the deep link plugin out of the box. + +### Dependencies + +- Upgraded to `deep-link@2.0.0-rc.4` + +## \[2.0.0-rc.1] + +- [`3c52f30e`](https://github.com/tauri-apps/plugins-workspace/commit/3c52f30ea4ec29c51f7021aa7871614d72e43258) ([#1665](https://github.com/tauri-apps/plugins-workspace/pull/1665) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Updated `windows-sys` crate to `0.59` +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.12] + +- [`e847cedc`](https://github.com/tauri-apps/plugins-workspace/commit/e847cedc1f46f3e7a2ad81ea579b620bc5b992d7) ([#1402](https://github.com/tauri-apps/plugins-workspace/pull/1402) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Use no default features on tauri for all plugins so that consumers can use `default-features = false` on tauri, note that this will still enable wry feature on iOS +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.11] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.10] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.9] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.8] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.7] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[2.0.0-beta.6] + +- [`ed46dca`](https://github.com/tauri-apps/plugins-workspace/commit/ed46dca74ff3947dbbcb26a7b571c129bf925698) Added the `semver` feature flag to make the single instance mechanism only trigger for semver compatible versions. + +## \[2.0.0-beta.5] + +- [`dabac0e`](https://github.com/tauri-apps/plugins-workspace/commit/dabac0eedfd6e6d192c6c5a214e708b3c0223f6f)([#1035](https://github.com/tauri-apps/plugins-workspace/pull/1035)) Added implementation for MacOS. + +## \[2.0.0-beta.4] + +- [`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.3] + +- [`2397ec5`](https://github.com/tauri-apps/plugins-workspace/commit/2397ec5937e594397e533925ccd257cae30b4cd1)([#1019](https://github.com/tauri-apps/plugins-workspace/pull/1019)) Fix doesn't shutdown immediately. +- [`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. + ## \[2.0.0-beta.2] - [`6d1e621`](https://github.com/tauri-apps/plugins-workspace/commit/6d1e6218b5877ef91f589f790f7251acda9c9605)([#981](https://github.com/tauri-apps/plugins-workspace/pull/981)) Fix `zbus::blocking::connection::Builder` import. diff --git a/plugins/single-instance/Cargo.toml b/plugins/single-instance/Cargo.toml index 7a5fb072..666c0d04 100644 --- a/plugins/single-instance/Cargo.toml +++ b/plugins/single-instance/Cargo.toml @@ -1,16 +1,24 @@ [package] name = "tauri-plugin-single-instance" -version = "2.0.0-beta.2" +version = "2.0.1" description = "Ensure a single instance of your tauri app is running." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } -exclude = [ "/examples" ] +repository = { workspace = true } +exclude = ["/examples"] [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "none", notes = "" } +ios = { level = "none", notes = "" } [dependencies] serde = { workspace = true } @@ -18,9 +26,11 @@ serde_json = { workspace = true } tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } +tauri-plugin-deep-link = { path = "../deep-link", version = "2.0.1", optional = true } +semver = { version = "1", optional = true } [target."cfg(target_os = \"windows\")".dependencies.windows-sys] -version = "0.52" +version = "0.59" features = [ "Win32_System_Threading", "Win32_System_DataExchange", @@ -28,8 +38,12 @@ features = [ "Win32_UI_WindowsAndMessaging", "Win32_Security", "Win32_System_LibraryLoader", - "Win32_Graphics_Gdi" + "Win32_Graphics_Gdi", ] [target."cfg(target_os = \"linux\")".dependencies] zbus = "4" + +[features] +semver = ["dep:semver"] +deep-link = ["dep:tauri-plugin-deep-link"] diff --git a/plugins/single-instance/README.md b/plugins/single-instance/README.md index b72b7612..64224602 100644 --- a/plugins/single-instance/README.md +++ b/plugins/single-instance/README.md @@ -2,9 +2,17 @@ Ensure a single instance of your tauri app is running. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | x | +| iOS | x | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-single-instance = "2.0.0-beta" +tauri-plugin-single-instance = "2.0.0" # alternatively with Git: tauri-plugin-single-instance = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -34,22 +42,23 @@ use tauri::{Manager}; #[derive(Clone, serde::Serialize)] struct Payload { - args: Vec, - cwd: String, + args: Vec, + cwd: String, } fn main() { tauri::Builder::default() .plugin(tauri_plugin_single_instance::init(|app, argv, cwd| { println!("{}, {argv:?}, {cwd}", app.package_info().name); - - app.emit_all("single-instance", Payload { args: argv, cwd }).unwrap(); + app.emit("single-instance", Payload { args: argv, cwd }).unwrap(); })) .run(tauri::generate_context!()) .expect("error while running tauri application"); } ``` +Note that currently, plugins run in the order they were added in to the builder, so make sure that this plugin is registered first. + ## Contributing PRs accepted. Please make sure to read the Contributing Guide before making a pull request. diff --git a/plugins/single-instance/SECURITY.md b/plugins/single-instance/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/single-instance/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/single-instance/examples/vanilla/package.json b/plugins/single-instance/examples/vanilla/package.json index 0a0e8683..7b0d2c5d 100644 --- a/plugins/single-instance/examples/vanilla/package.json +++ b/plugins/single-instance/examples/vanilla/package.json @@ -4,11 +4,11 @@ "description": "", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "tauri": "tauri" }, "author": "", "license": "MIT", "devDependencies": { - "@tauri-apps/cli": "2.0.0-beta.3" + "@tauri-apps/cli": "2.0.3" } } diff --git a/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml b/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml index 13da3100..d764081c 100644 --- a/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml +++ b/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml @@ -2,19 +2,20 @@ name = "single-instance-example" version = "0.1.0" description = "A Tauri App" -authors = [ "You" ] +authors = ["You"] repository = "" edition = "2021" -rust-version = "1.75" +rust-version = "1.77.2" [dependencies] -serde_json = { workspace = true } serde = { workspace = true } -tauri = { workspace = true } +serde_json = { workspace = true } +tauri = { workspace = true, features = ["wry", "compression"] } tauri-plugin-single-instance = { path = "../../../" } +tauri-plugin-cli = { path = "../../../../cli" } [build-dependencies] tauri-build = { workspace = true } [features] -custom-protocol = [ "tauri/custom-protocol" ] +prod = ["tauri/custom-protocol"] diff --git a/plugins/single-instance/examples/vanilla/src-tauri/src/main.rs b/plugins/single-instance/examples/vanilla/src-tauri/src/main.rs index 0b93460d..49b1a5a6 100644 --- a/plugins/single-instance/examples/vanilla/src-tauri/src/main.rs +++ b/plugins/single-instance/examples/vanilla/src-tauri/src/main.rs @@ -9,6 +9,7 @@ fn main() { tauri::Builder::default() + .plugin(tauri_plugin_cli::init()) .plugin(tauri_plugin_single_instance::init(|app, argv, cwd| { println!("{}, {argv:?}, {cwd}", app.package_info().name); })) diff --git a/plugins/single-instance/examples/vanilla/src-tauri/tauri.conf.json b/plugins/single-instance/examples/vanilla/src-tauri/tauri.conf.json index 8f9a852d..41623cc5 100644 --- a/plugins/single-instance/examples/vanilla/src-tauri/tauri.conf.json +++ b/plugins/single-instance/examples/vanilla/src-tauri/tauri.conf.json @@ -29,5 +29,17 @@ "icons/icon.icns", "icons/icon.ico" ] + }, + "plugins": { + "cli": { + "description": "Testing single-instance on MacOS", + "args": [ + { + "name": "somearg", + "index": 1, + "takesValue": true + } + ] + } } } diff --git a/plugins/single-instance/src/lib.rs b/plugins/single-instance/src/lib.rs index 715c894e..ce7815e8 100644 --- a/plugins/single-instance/src/lib.rs +++ b/plugins/single-instance/src/lib.rs @@ -24,13 +24,22 @@ mod platform_impl; #[path = "platform_impl/macos.rs"] mod platform_impl; +#[cfg(feature = "semver")] +mod semver_compat; + pub(crate) type SingleInstanceCallback = dyn FnMut(&AppHandle, Vec, String) + Send + Sync + 'static; pub fn init, Vec, String) + Send + Sync + 'static>( - f: F, + mut f: F, ) -> TauriPlugin { - platform_impl::init(Box::new(f)) + platform_impl::init(Box::new(move |app, args, cwd| { + #[cfg(feature = "deep-link")] + if let Some(deep_link) = app.try_state::>() { + deep_link.handle_cli_arguments(args.iter()); + } + f(app, args, cwd) + })) } pub fn destroy>(manager: &M) { diff --git a/plugins/single-instance/src/platform_impl/linux.rs b/plugins/single-instance/src/platform_impl/linux.rs index c613a0d6..3136074f 100644 --- a/plugins/single-instance/src/platform_impl/linux.rs +++ b/plugins/single-instance/src/platform_impl/linux.rs @@ -2,7 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -#![cfg(target_os = "linux")] +#[cfg(feature = "semver")] +use crate::semver_compat::semver_compat_string; use crate::SingleInstanceCallback; use tauri::{ @@ -28,6 +29,15 @@ impl SingleInstanceDBus { } } +#[cfg(feature = "semver")] +fn dbus_id(config: &Config, version: semver::Version) -> String { + let mut id = config.identifier.replace(['.', '-'], "_"); + id.push('_'); + id.push_str(semver_compat_string(version).as_str()); + id +} + +#[cfg(not(feature = "semver"))] fn dbus_id(config: &Config) -> String { config.identifier.replace(['.', '-'], "_") } @@ -35,7 +45,11 @@ fn dbus_id(config: &Config) -> String { pub fn init(f: Box>) -> TauriPlugin { plugin::Builder::new("single-instance") .setup(|app, _api| { + #[cfg(feature = "semver")] + let id = dbus_id(app.config(), app.package_info().version.clone()); + #[cfg(not(feature = "semver"))] let id = dbus_id(app.config()); + let single_instance_dbus = SingleInstanceDBus { callback: f, app_handle: app.clone(), @@ -70,7 +84,8 @@ pub fn init(f: Box>) -> TauriPlugin { ), ); } - std::process::exit(0) + app.cleanup_before_exit(); + std::process::exit(0); } _ => {} } @@ -87,7 +102,15 @@ pub fn init(f: Box>) -> TauriPlugin { pub fn destroy>(manager: &M) { if let Some(connection) = manager.try_state::() { - let dbus_name = format!("org.{}.SingleInstance", dbus_id(manager.config())); + #[cfg(feature = "semver")] + let id = dbus_id( + manager.config(), + manager.app_handle().package_info().version.clone(), + ); + #[cfg(not(feature = "semver"))] + let id = dbus_id(manager.config()); + + let dbus_name = format!("org.{id}.SingleInstance",); let _ = connection.0.release_name(dbus_name); } } diff --git a/plugins/single-instance/src/platform_impl/macos.rs b/plugins/single-instance/src/platform_impl/macos.rs index 170ff0e0..8f35d76c 100644 --- a/plugins/single-instance/src/platform_impl/macos.rs +++ b/plugins/single-instance/src/platform_impl/macos.rs @@ -2,15 +2,128 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -#![cfg(target_os = "macos")] +use std::{ + io::{BufWriter, Error, ErrorKind, Read, Write}, + os::unix::net::{UnixListener, UnixStream}, + path::PathBuf, +}; +#[cfg(feature = "semver")] +use crate::semver_compat::semver_compat_string; use crate::SingleInstanceCallback; use tauri::{ plugin::{self, TauriPlugin}, - Manager, Runtime, + AppHandle, Config, Manager, RunEvent, Runtime, }; -pub fn init(_f: Box>) -> TauriPlugin { - plugin::Builder::new("single-instance").build() + +pub fn init(cb: Box>) -> TauriPlugin { + plugin::Builder::new("single-instance") + .setup(|app, _api| { + let socket = socket_path(app.config(), app.package_info()); + + // Notify the singleton which may or may not exist. + match notify_singleton(&socket) { + Ok(_) => { + std::process::exit(0); + } + Err(e) => { + match e.kind() { + ErrorKind::NotFound | ErrorKind::ConnectionRefused => { + // This process claims itself as singleton as likely none exists + socket_cleanup(&socket); + listen_for_other_instances(&socket, app.clone(), cb); + } + _ => { + log::debug!( + "single_instance failed to notify - launching normally: {}", + e + ); + } + } + } + } + Ok(()) + }) + .on_event(|app, event| { + if let RunEvent::Exit = event { + destroy(app); + } + }) + .build() +} + +pub fn destroy>(manager: &M) { + let socket = socket_path(manager.config(), manager.package_info()); + socket_cleanup(&socket); } -pub fn destroy>(_manager: &M) {} +fn socket_path(config: &Config, _package_info: &tauri::PackageInfo) -> PathBuf { + let identifier = config.identifier.replace(['.', '-'].as_ref(), "_"); + + #[cfg(feature = "semver")] + let identifier = format!( + "{identifier}_{}", + semver_compat_string(_package_info.version.clone()), + ); + + // Use /tmp as socket path must be shorter than 100 chars. + PathBuf::from(format!("/tmp/{}_si.sock", identifier)) +} + +fn socket_cleanup(socket: &PathBuf) { + let _ = std::fs::remove_file(socket); +} + +fn notify_singleton(socket: &PathBuf) -> Result<(), Error> { + let stream = UnixStream::connect(socket)?; + let mut bf = BufWriter::new(&stream); + let args_joined = std::env::args().collect::>().join("\0"); + bf.write_all(args_joined.as_bytes())?; + bf.flush()?; + drop(bf); + Ok(()) +} + +fn listen_for_other_instances( + socket: &PathBuf, + app: AppHandle, + mut cb: Box>, +) { + match UnixListener::bind(socket) { + Ok(listener) => { + let cwd = std::env::current_dir() + .unwrap_or_default() + .to_str() + .unwrap_or_default() + .to_string(); + + tauri::async_runtime::spawn(async move { + for stream in listener.incoming() { + match stream { + Ok(mut stream) => { + let mut s = String::new(); + match stream.read_to_string(&mut s) { + Ok(_) => { + let args: Vec = + s.split('\0').map(String::from).collect(); + cb(app.app_handle(), args, cwd.clone()); + } + Err(e) => log::debug!("single_instance failed to be notified: {e}"), + } + } + Err(err) => { + log::debug!("single_instance failed to be notified: {}", err); + continue; + } + } + } + }); + } + Err(err) => { + log::error!( + "single_instance failed to listen to other processes - launching normally: {}", + err + ); + } + } +} diff --git a/plugins/single-instance/src/platform_impl/windows.rs b/plugins/single-instance/src/platform_impl/windows.rs index f66b2d1a..e99f405d 100644 --- a/plugins/single-instance/src/platform_impl/windows.rs +++ b/plugins/single-instance/src/platform_impl/windows.rs @@ -2,7 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -#![cfg(target_os = "windows")] +#[cfg(feature = "semver")] +use crate::semver_compat::semver_compat_string; use crate::SingleInstanceCallback; use std::ffi::CStr; @@ -33,7 +34,13 @@ const WMCOPYDATA_SINGLE_INSTANCE_DATA: usize = 1542; pub fn init(f: Box>) -> TauriPlugin { plugin::Builder::new("single-instance") .setup(|app, _api| { - let id = &app.config().identifier; + #[allow(unused_mut)] + let mut id = app.config().identifier.clone(); + #[cfg(feature = "semver")] + { + id.push('_'); + id.push_str(semver_compat_string(app.package_info().version.clone()).as_str()); + } let class_name = encode_wide(format!("{id}-sic")); let window_name = encode_wide(format!("{id}-siw")); @@ -46,7 +53,7 @@ pub fn init(f: Box>) -> TauriPlugin { unsafe { let hwnd = FindWindowW(class_name.as_ptr(), window_name.as_ptr()); - if hwnd != 0 { + if !hwnd.is_null() { let data = format!( "{}|{}\0", std::env::current_dir() @@ -62,11 +69,12 @@ pub fn init(f: Box>) -> TauriPlugin { lpData: bytes.as_ptr() as _, }; SendMessageW(hwnd, WM_COPYDATA, 0, &cds as *const _ as _); - app.exit(0); + app.cleanup_before_exit(); + std::process::exit(0); } } } else { - app.manage(MutexHandle(hmutex)); + app.manage(MutexHandle(hmutex as _)); let hwnd = create_event_target_window::(&class_name, &window_name); unsafe { @@ -77,7 +85,7 @@ pub fn init(f: Box>) -> TauriPlugin { ) }; - app.manage(TargetWindowHandle(hwnd)); + app.manage(TargetWindowHandle(hwnd as _)); } Ok(()) @@ -93,12 +101,12 @@ pub fn init(f: Box>) -> TauriPlugin { pub fn destroy>(manager: &M) { if let Some(hmutex) = manager.try_state::() { unsafe { - ReleaseMutex(hmutex.0); - CloseHandle(hmutex.0); + ReleaseMutex(hmutex.0 as _); + CloseHandle(hmutex.0 as _); } } if let Some(hwnd) = manager.try_state::() { - unsafe { DestroyWindow(hwnd.0) }; + unsafe { DestroyWindow(hwnd.0 as _) }; } } @@ -142,12 +150,12 @@ fn create_event_target_window(class_name: &[u16], window_name: &[u16 cbClsExtra: 0, cbWndExtra: 0, hInstance: GetModuleHandleW(std::ptr::null()), - hIcon: 0, - hCursor: 0, - hbrBackground: 0, + hIcon: std::ptr::null_mut(), + hCursor: std::ptr::null_mut(), + hbrBackground: std::ptr::null_mut(), lpszMenuName: std::ptr::null(), lpszClassName: class_name.as_ptr(), - hIconSm: 0, + hIconSm: std::ptr::null_mut(), }; RegisterClassExW(&class); @@ -171,8 +179,8 @@ fn create_event_target_window(class_name: &[u16], window_name: &[u16 0, 0, 0, - 0, - 0, + std::ptr::null_mut(), + std::ptr::null_mut(), GetModuleHandleW(std::ptr::null()), std::ptr::null(), ); diff --git a/plugins/single-instance/src/semver_compat.rs b/plugins/single-instance/src/semver_compat.rs new file mode 100644 index 00000000..80487cae --- /dev/null +++ b/plugins/single-instance/src/semver_compat.rs @@ -0,0 +1,19 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +/// Takes a version and spits out a String with trailing _x, thus only considering the digits +/// relevant regarding semver compatibility +pub fn semver_compat_string(version: semver::Version) -> String { + // for pre-release always treat each version separately + if !version.pre.is_empty() { + return version.to_string().replace(['.', '-'], "_"); + } + match version.major { + 0 => match version.minor { + 0 => format!("0_0_{}", version.patch), + _ => format!("0_{}_x", version.minor), + }, + _ => format!("{}_x_x", version.major), + } +} diff --git a/plugins/sql/.gitignore b/plugins/sql/.gitignore deleted file mode 100644 index b512c09d..00000000 --- a/plugins/sql/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/plugins/sql/CHANGELOG.md b/plugins/sql/CHANGELOG.md index 57dc46dd..8fe92f86 100644 --- a/plugins/sql/CHANGELOG.md +++ b/plugins/sql/CHANGELOG.md @@ -1,5 +1,70 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.3] + +- [`30bcf5dc`](https://github.com/tauri-apps/plugins-workspace/commit/30bcf5dcc22e1bb1fb983a8d2887edc39404e6df) ([#1838](https://github.com/tauri-apps/plugins-workspace/pull/1838) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) It is now possible to enable multiple SQL backends at the same time. There will be no compile error anymore if no backends are enabled! + +## \[2.0.0-rc.2] + +- [`0dd97d91`](https://github.com/tauri-apps/plugins-workspace/commit/0dd97d911569cdedab07f504b708036d62ff83c1) ([#1375](https://github.com/tauri-apps/plugins-workspace/pull/1375) by [@KauanCurbani](https://github.com/tauri-apps/plugins-workspace/../../KauanCurbani)) Added support for `UUID` columns to the postgres implementation. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.8] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.10] + +- [`37cb9a66`](https://github.com/tauri-apps/plugins-workspace/commit/37cb9a6681b948908cd9443340f6b23401607df7) ([#1575](https://github.com/tauri-apps/plugins-workspace/pull/1575) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update sqlx to 0.8 - Check out their changelog for behavior changes: https://github.com/launchbadge/sqlx/blob/main/CHANGELOG.md#080---2024-07-22 + +## \[2.0.0-beta.7] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.6] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.7] + +- [`4216c051`](https://github.com/tauri-apps/plugins-workspace/commit/4216c0517fd1dcb29d0162dc2fc15291472a2b00) ([#1381](https://github.com/tauri-apps/plugins-workspace/pull/1381) by [@thewh1teagle](https://github.com/tauri-apps/plugins-workspace/../../thewh1teagle)) Made `DbInstances` public for managing database instances directly from `Rust`. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[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] + +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -51,4 +116,7 @@ - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ae67\`]\(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! + f2b9347f)([#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! + com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/sql/Cargo.toml b/plugins/sql/Cargo.toml index d74c3f86..8e6ed457 100644 --- a/plugins/sql/Cargo.toml +++ b/plugins/sql/Cargo.toml @@ -1,20 +1,28 @@ [package] name = "tauri-plugin-sql" -version = "2.0.0-beta.1" +version = "2.0.1" description = "Interface with SQL databases." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-sql" [package.metadata.docs.rs] -features = [ "sqlite" ] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +features = ["sqlite"] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "full", notes = "" } +ios = { level = "none", notes = "" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -23,11 +31,13 @@ tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } futures-core = "0.3" -sqlx = { version = "0.7", features = [ "json", "time" ] } +sqlx = { version = "0.8", features = ["json", "time"] } time = "0.3" -tokio = { version = "1", features = [ "sync" ] } +tokio = { version = "1", features = ["sync"] } +indexmap = { version = "2", features = ["serde"] } [features] -sqlite = [ "sqlx/sqlite", "sqlx/runtime-tokio" ] -mysql = [ "sqlx/mysql", "sqlx/runtime-tokio-rustls" ] -postgres = [ "sqlx/postgres", "sqlx/runtime-tokio-rustls" ] +sqlite = ["sqlx/sqlite", "sqlx/runtime-tokio"] +mysql = ["sqlx/mysql", "sqlx/runtime-tokio-rustls"] +postgres = ["sqlx/postgres", "sqlx/runtime-tokio-rustls"] +# TODO: bundled-cipher etc diff --git a/plugins/sql/README.md b/plugins/sql/README.md index 770db6b1..85318cff 100644 --- a/plugins/sql/README.md +++ b/plugins/sql/README.md @@ -2,9 +2,17 @@ Interface with SQL databases through [sqlx](https://github.com/launchbadge/sqlx). It supports the `sqlite`, `mysql` and `postgres` drivers, enabled by a Cargo feature. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ✓ | +| iOS | x | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -19,7 +27,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies.tauri-plugin-sql] features = ["sqlite"] # or "postgres", or "mysql" -version = "2.0.0-beta" +version = "2.0.0" # alternatively with Git git = "https://github.com/tauri-apps/plugins-workspace" branch = "v2" @@ -62,16 +70,16 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import Database from "@tauri-apps/plugin-sql"; +import Database from '@tauri-apps/plugin-sql' -// sqlite. The path is relative to `tauri::api::path::BaseDirectory::App`. -const db = await Database.load("sqlite:test.db"); +// sqlite. The path is relative to `tauri::api::path::BaseDirectory::AppConfig`. +const db = await Database.load('sqlite:test.db') // mysql -const db = await Database.load("mysql://user:pass@host/database"); +const db = await Database.load('mysql://user:pass@host/database') // postgres -const db = await Database.load("postgres://postgres:password@localhost/test"); +const db = await Database.load('postgres://postgres:password@localhost/test') -await db.execute("INSERT INTO ..."); +await db.execute('INSERT INTO ...') ``` ## Syntax @@ -84,25 +92,25 @@ We use sqlx as our underlying library, adopting their query syntax: ```javascript // INSERT and UPDATE examples for sqlite and postgres const result = await db.execute( - "INSERT into todos (id, title, status) VALUES ($1, $2, $3)", - [todos.id, todos.title, todos.status], -); + 'INSERT into todos (id, title, status) VALUES ($1, $2, $3)', + [todos.id, todos.title, todos.status] +) const result = await db.execute( - "UPDATE todos SET title = $1, completed = $2 WHERE id = $3", - [todos.title, todos.status, todos.id], -); + 'UPDATE todos SET title = $1, status = $2 WHERE id = $3', + [todos.title, todos.status, todos.id] +) // INSERT and UPDATE examples for mysql const result = await db.execute( - "INSERT into todos (id, title, status) VALUES (?, ?, ?)", - [todos.id, todos.title, todos.status], -); + 'INSERT into todos (id, title, status) VALUES (?, ?, ?)', + [todos.id, todos.title, todos.status] +) const result = await db.execute( - "UPDATE todos SET title = ?, completed = ? WHERE id = ?", - [todos.title, todos.status, todos.id], -); + 'UPDATE todos SET title = ?, status = ? WHERE id = ?', + [todos.title, todos.status, todos.id] +) ``` ## Migrations @@ -158,7 +166,26 @@ fn main() { ### Applying Migrations -Migrations are applied automatically when the plugin is initialized. The plugin runs these migrations against the database specified by the connection string. Ensure that the migrations are defined in the correct order and are idempotent (safe to run multiple times). +To apply the migrations when the plugin is initialized, add the connection string to the `tauri.conf.json` file: + +```json +{ + "plugins": { + "sql": { + "preload": ["sqlite:mydatabase.db"] + } + } +} +``` + +Alternatively, the client side `load()` also runs the migrations for a given connection string: + +```ts +import Database from '@tauri-apps/plugin-sql' +const db = await Database.load('sqlite:mydatabase.db') +``` + +Ensure that the migrations are defined in the correct order and are safe to run multiple times. ### Migration Management diff --git a/plugins/sql/SECURITY.md b/plugins/sql/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/sql/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/sql/src/api-iife.js b/plugins/sql/api-iife.js similarity index 100% rename from plugins/sql/src/api-iife.js rename to plugins/sql/api-iife.js diff --git a/plugins/sql/build.rs b/plugins/sql/build.rs index e74fdb42..fbbca422 100644 --- a/plugins/sql/build.rs +++ b/plugins/sql/build.rs @@ -5,5 +5,7 @@ const COMMANDS: &[&str] = &["load", "execute", "select", "close"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/sql/guest-js/index.ts b/plugins/sql/guest-js/index.ts index 9e96f3db..05eed0e3 100644 --- a/plugins/sql/guest-js/index.ts +++ b/plugins/sql/guest-js/index.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { invoke } from "@tauri-apps/api/core"; +import { invoke } from '@tauri-apps/api/core' export interface QueryResult { /** The number of rows affected by the query. */ - rowsAffected: number; + rowsAffected: number /** * The last inserted `id`. * @@ -15,7 +15,7 @@ export interface QueryResult { * must be used, with a `RETURNING` clause * (`INSERT INTO todos (title) VALUES ($1) RETURNING id`). */ - lastInsertId: number; + lastInsertId: number } /** @@ -25,9 +25,9 @@ export interface QueryResult { * communicating with the rust side of the sql plugin. */ export default class Database { - path: string; + path: string constructor(path: string) { - this.path = path; + this.path = path } /** @@ -46,11 +46,11 @@ export default class Database { * ``` */ static async load(path: string): Promise { - const _path = await invoke("plugin:sql|load", { - db: path, - }); + const _path = await invoke('plugin:sql|load', { + db: path + }) - return new Database(_path); + return new Database(_path) } /** @@ -70,7 +70,7 @@ export default class Database { * ``` */ static get(path: string): Database { - return new Database(path); + return new Database(path) } /** @@ -107,18 +107,19 @@ export default class Database { */ async execute(query: string, bindValues?: unknown[]): Promise { const [rowsAffected, lastInsertId] = await invoke<[number, number]>( - "plugin:sql|execute", + 'plugin:sql|execute', { db: this.path, query, - values: bindValues ?? [], - }, - ); + values: bindValues ?? [] + } + ) return { lastInsertId, - rowsAffected, - }; + rowsAffected + } } + /** * **select** * @@ -138,13 +139,13 @@ export default class Database { * ``` */ async select(query: string, bindValues?: unknown[]): Promise { - const result = await invoke("plugin:sql|select", { + const result = await invoke('plugin:sql|select', { db: this.path, query, - values: bindValues ?? [], - }); + values: bindValues ?? [] + }) - return result; + return result } /** @@ -159,9 +160,9 @@ export default class Database { * @param db - Optionally state the name of a database if you are managing more than one. Otherwise, all database pools will be in scope. */ async close(db?: string): Promise { - const success = await invoke("plugin:sql|close", { - db, - }); - return success; + const success = await invoke('plugin:sql|close', { + db + }) + return success } } diff --git a/plugins/sql/package.json b/plugins/sql/package.json index 211988bc..db2c6d2a 100644 --- a/plugins/sql/package.json +++ b/plugins/sql/package.json @@ -1,11 +1,12 @@ { "name": "@tauri-apps/plugin-sql", - "version": "2.0.0-beta.1", + "version": "2.0.0", "description": "Interface with SQL databases", - "license": "MIT or APACHE-2.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -24,6 +25,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/sql/permissions/autogenerated/reference.md b/plugins/sql/permissions/autogenerated/reference.md index a9734e01..2a70f7b3 100644 --- a/plugins/sql/permissions/autogenerated/reference.md +++ b/plugins/sql/permissions/autogenerated/reference.md @@ -1,34 +1,131 @@ -# Permissions +## Default Permission -## allow-close +### Default Permissions + +This permission set configures what kind of +database operations are available from the sql plugin. + +### Granted Permissions + +All reading related operations are enabled. +Also allows to load or close a connection. + + + +- `allow-close` +- `allow-load` +- `allow-select` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`sql:allow-close` + + Enables the close command without any pre-configured scope. -## deny-close +
+ +`sql:deny-close` + + Denies the close command without any pre-configured scope. -## allow-execute +
+ +`sql:allow-execute` + + Enables the execute command without any pre-configured scope. -## deny-execute +
+ +`sql:deny-execute` + + Denies the execute command without any pre-configured scope. -## allow-load +
+ +`sql:allow-load` + + Enables the load command without any pre-configured scope. -## deny-load +
+ +`sql:deny-load` + + Denies the load command without any pre-configured scope. -## allow-select +
+ +`sql:allow-select` + + Enables the select command without any pre-configured scope. -## deny-select +
+ +`sql:deny-select` + + Denies the select command without any pre-configured scope. +
diff --git a/plugins/sql/permissions/default.toml b/plugins/sql/permissions/default.toml new file mode 100644 index 00000000..eb5fa555 --- /dev/null +++ b/plugins/sql/permissions/default.toml @@ -0,0 +1,16 @@ +"$schema" = "schemas/schema.json" + +[default] +description = """ +### Default Permissions + +This permission set configures what kind of +database operations are available from the sql plugin. + +### Granted Permissions + +All reading related operations are enabled. +Also allows to load or close a connection. + +""" +permissions = ["allow-close", "allow-load", "allow-select"] diff --git a/plugins/sql/permissions/schemas/schema.json b/plugins/sql/permissions/schemas/schema.json index 8fdfc250..e3add537 100644 --- a/plugins/sql/permissions/schemas/schema.json +++ b/plugins/sql/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,64 +251,93 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-close -> Enables the close command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-close" + "macOS" ] }, { - "description": "deny-close -> Denies the close command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-close" + "windows" ] }, { - "description": "allow-execute -> Enables the execute command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-execute" + "linux" ] }, { - "description": "deny-execute -> Denies the execute command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-execute" + "android" ] }, { - "description": "allow-load -> Enables the load command without any pre-configured scope.", + "description": "iOS.", "type": "string", "enum": [ - "allow-load" + "iOS" ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the close command without any pre-configured scope.", + "type": "string", + "const": "allow-close" }, { - "description": "deny-load -> Denies the load command without any pre-configured scope.", + "description": "Denies the close command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-load" - ] + "const": "deny-close" }, { - "description": "allow-select -> Enables the select command without any pre-configured scope.", + "description": "Enables the execute command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-select" - ] + "const": "allow-execute" }, { - "description": "deny-select -> Denies the select command without any pre-configured scope.", + "description": "Denies the execute command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-select" - ] + "const": "deny-execute" + }, + { + "description": "Enables the load command without any pre-configured scope.", + "type": "string", + "const": "allow-load" + }, + { + "description": "Denies the load command without any pre-configured scope.", + "type": "string", + "const": "deny-load" + }, + { + "description": "Enables the select command without any pre-configured scope.", + "type": "string", + "const": "allow-select" + }, + { + "description": "Denies the select command without any pre-configured scope.", + "type": "string", + "const": "deny-select" + }, + { + "description": "### Default Permissions\n\nThis permission set configures what kind of\ndatabase operations are available from the sql plugin.\n\n### Granted Permissions\n\nAll reading related operations are enabled.\nAlso allows to load or close a connection.\n\n", + "type": "string", + "const": "default" } ] } diff --git a/plugins/sql/rollup.config.js b/plugins/sql/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/sql/rollup.config.js +++ b/plugins/sql/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/sql/src/commands.rs b/plugins/sql/src/commands.rs new file mode 100644 index 00000000..760d00b2 --- /dev/null +++ b/plugins/sql/src/commands.rs @@ -0,0 +1,80 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use indexmap::IndexMap; +use serde_json::Value as JsonValue; +use sqlx::migrate::Migrator; +use tauri::{command, AppHandle, Runtime, State}; + +use crate::{DbInstances, DbPool, Error, LastInsertId, Migrations}; + +#[command] +pub(crate) async fn load( + app: AppHandle, + db_instances: State<'_, DbInstances>, + migrations: State<'_, Migrations>, + db: String, +) -> Result { + let pool = DbPool::connect(&db, &app).await?; + + if let Some(migrations) = migrations.0.lock().await.remove(&db) { + let migrator = Migrator::new(migrations).await?; + pool.migrate(&migrator).await?; + } + + db_instances.0.write().await.insert(db.clone(), pool); + + Ok(db) +} + +/// Allows the database connection(s) to be closed; if no database +/// name is passed in then _all_ database connection pools will be +/// shut down. +#[command] +pub(crate) async fn close( + db_instances: State<'_, DbInstances>, + db: Option, +) -> Result { + let instances = db_instances.0.read().await; + + let pools = if let Some(db) = db { + vec![db] + } else { + instances.keys().cloned().collect() + }; + + for pool in pools { + let db = instances.get(&pool).ok_or(Error::DatabaseNotLoaded(pool))?; + db.close().await; + } + + Ok(true) +} + +/// Execute a command against the database +#[command] +pub(crate) async fn execute( + db_instances: State<'_, DbInstances>, + db: String, + query: String, + values: Vec, +) -> Result<(u64, LastInsertId), crate::Error> { + let instances = db_instances.0.read().await; + + let db = instances.get(&db).ok_or(Error::DatabaseNotLoaded(db))?; + db.execute(query, values).await +} + +#[command] +pub(crate) async fn select( + db_instances: State<'_, DbInstances>, + db: String, + query: String, + values: Vec, +) -> Result>, crate::Error> { + let instances = db_instances.0.read().await; + + let db = instances.get(&db).ok_or(Error::DatabaseNotLoaded(db))?; + db.select(query, values).await +} diff --git a/plugins/sql/src/decode/mod.rs b/plugins/sql/src/decode/mod.rs index 50fb3c78..0a2d2cdd 100644 --- a/plugins/sql/src/decode/mod.rs +++ b/plugins/sql/src/decode/mod.rs @@ -3,17 +3,8 @@ // SPDX-License-Identifier: MIT #[cfg(feature = "mysql")] -mod mysql; +pub(crate) mod mysql; #[cfg(feature = "postgres")] -mod postgres; +pub(crate) mod postgres; #[cfg(feature = "sqlite")] -mod sqlite; - -#[cfg(feature = "mysql")] -pub(crate) use mysql::to_json; - -#[cfg(feature = "postgres")] -pub(crate) use postgres::to_json; - -#[cfg(feature = "sqlite")] -pub(crate) use sqlite::to_json; +pub(crate) mod sqlite; diff --git a/plugins/sql/src/decode/postgres.rs b/plugins/sql/src/decode/postgres.rs index e38ad025..6f689dce 100644 --- a/plugins/sql/src/decode/postgres.rs +++ b/plugins/sql/src/decode/postgres.rs @@ -14,7 +14,7 @@ pub(crate) fn to_json(v: PgValueRef) -> Result { } let res = match v.type_info().name() { - "CHAR" | "VARCHAR" | "TEXT" | "NAME" => { + "CHAR" | "VARCHAR" | "TEXT" | "NAME" | "UUID" => { if let Ok(v) = ValueRef::to_owned(&v).try_decode() { JsonValue::String(v) } else { diff --git a/plugins/authenticator/src/error.rs b/plugins/sql/src/error.rs similarity index 62% rename from plugins/authenticator/src/error.rs rename to plugins/sql/src/error.rs index 214706e6..5ac845b8 100644 --- a/plugins/authenticator/src/error.rs +++ b/plugins/sql/src/error.rs @@ -7,13 +7,15 @@ use serde::{Serialize, Serializer}; #[derive(Debug, thiserror::Error)] pub enum Error { #[error(transparent)] - Base64Decode(#[from] base64::DecodeError), + Sql(#[from] sqlx::Error), #[error(transparent)] - JSON(#[from] serde_json::Error), - #[error(transparent)] - U2F(#[from] crate::u2f_crate::u2ferror::U2fError), - #[error(transparent)] - Auth(#[from] authenticator::errors::AuthenticatorError), + Migration(#[from] sqlx::migrate::MigrateError), + #[error("invalid connection url: {0}")] + InvalidDbUrl(String), + #[error("database {0} not loaded")] + DatabaseNotLoaded(String), + #[error("unsupported datatype: {0}")] + UnsupportedDatatype(String), } impl Serialize for Error { diff --git a/plugins/sql/src/lib.rs b/plugins/sql/src/lib.rs index f25ede21..352ffbec 100644 --- a/plugins/sql/src/lib.rs +++ b/plugins/sql/src/lib.rs @@ -11,20 +11,170 @@ html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png" )] -#[cfg(any( - all(feature = "sqlite", feature = "mysql"), - all(feature = "sqlite", feature = "postgres"), - all(feature = "mysql", feature = "postgres") -))] -compile_error!( - "Only one database driver can be enabled. Set the feature flag for the driver of your choice." -); - -#[cfg(not(any(feature = "sqlite", feature = "mysql", feature = "postgres")))] -compile_error!( - "Database driver not defined. Please set the feature flag for the driver of your choice." -); - +mod commands; mod decode; -mod plugin; -pub use plugin::*; +mod error; +mod wrapper; + +pub use error::Error; +pub use wrapper::DbPool; + +use futures_core::future::BoxFuture; +use serde::{Deserialize, Serialize}; +use sqlx::{ + error::BoxDynError, + migrate::{Migration as SqlxMigration, MigrationSource, MigrationType, Migrator}, +}; +use tauri::{ + plugin::{Builder as PluginBuilder, TauriPlugin}, + Manager, RunEvent, Runtime, +}; +use tokio::sync::{Mutex, RwLock}; + +use std::collections::HashMap; + +#[derive(Default)] +pub struct DbInstances(pub RwLock>); + +#[derive(Serialize)] +#[serde(untagged)] +pub(crate) enum LastInsertId { + #[cfg(feature = "sqlite")] + Sqlite(i64), + #[cfg(feature = "mysql")] + MySql(u64), + #[cfg(feature = "postgres")] + Postgres(()), + #[cfg(not(any(feature = "sqlite", feature = "mysql", feature = "postgres")))] + None, +} + +struct Migrations(Mutex>); + +#[derive(Default, Clone, Deserialize)] +pub struct PluginConfig { + #[serde(default)] + preload: Vec, +} + +#[derive(Debug)] +pub enum MigrationKind { + Up, + Down, +} + +impl From for MigrationType { + fn from(kind: MigrationKind) -> Self { + match kind { + MigrationKind::Up => Self::ReversibleUp, + MigrationKind::Down => Self::ReversibleDown, + } + } +} + +/// A migration definition. +#[derive(Debug)] +pub struct Migration { + pub version: i64, + pub description: &'static str, + pub sql: &'static str, + pub kind: MigrationKind, +} + +#[derive(Debug)] +struct MigrationList(Vec); + +impl MigrationSource<'static> for MigrationList { + fn resolve(self) -> BoxFuture<'static, std::result::Result, BoxDynError>> { + Box::pin(async move { + let mut migrations = Vec::new(); + for migration in self.0 { + if matches!(migration.kind, MigrationKind::Up) { + migrations.push(SqlxMigration::new( + migration.version, + migration.description.into(), + migration.kind.into(), + migration.sql.into(), + false, + )); + } + } + Ok(migrations) + }) + } +} + +/// Tauri SQL plugin builder. +#[derive(Default)] +pub struct Builder { + migrations: Option>, +} + +impl Builder { + pub fn new() -> Self { + #[cfg(not(any(feature = "sqlite", feature = "mysql", feature = "postgres")))] + eprintln!("No sql driver enabled. Please set at least one of the \"sqlite\", \"mysql\", \"postgres\" feature flags."); + + Self::default() + } + + /// Add migrations to a database. + #[must_use] + pub fn add_migrations(mut self, db_url: &str, migrations: Vec) -> Self { + self.migrations + .get_or_insert(Default::default()) + .insert(db_url.to_string(), MigrationList(migrations)); + self + } + + pub fn build(mut self) -> TauriPlugin> { + PluginBuilder::>::new("sql") + .invoke_handler(tauri::generate_handler![ + commands::load, + commands::execute, + commands::select, + commands::close + ]) + .setup(|app, api| { + let config = api.config().clone().unwrap_or_default(); + + tauri::async_runtime::block_on(async move { + let instances = DbInstances::default(); + let mut lock = instances.0.write().await; + + for db in config.preload { + let pool = DbPool::connect(&db, app).await?; + + if let Some(migrations) = + self.migrations.as_mut().and_then(|mm| mm.remove(&db)) + { + let migrator = Migrator::new(migrations).await?; + pool.migrate(&migrator).await?; + } + + lock.insert(db, pool); + } + drop(lock); + + app.manage(instances); + app.manage(Migrations(Mutex::new( + self.migrations.take().unwrap_or_default(), + ))); + + Ok(()) + }) + }) + .on_event(|app, event| { + if let RunEvent::Exit = event { + tauri::async_runtime::block_on(async move { + let instances = &*app.state::(); + let instances = instances.0.read().await; + for value in instances.values() { + value.close().await; + } + }); + } + }) + .build() + } +} diff --git a/plugins/sql/src/plugin.rs b/plugins/sql/src/plugin.rs deleted file mode 100644 index f2a95279..00000000 --- a/plugins/sql/src/plugin.rs +++ /dev/null @@ -1,342 +0,0 @@ -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -use futures_core::future::BoxFuture; -use serde::{ser::Serializer, Deserialize, Serialize}; -use serde_json::Value as JsonValue; -use sqlx::{ - error::BoxDynError, - migrate::{ - MigrateDatabase, Migration as SqlxMigration, MigrationSource, MigrationType, Migrator, - }, - Column, Pool, Row, -}; -use tauri::{ - command, - plugin::{Builder as PluginBuilder, TauriPlugin}, - AppHandle, Manager, RunEvent, Runtime, State, -}; -use tokio::sync::Mutex; - -use std::collections::HashMap; - -#[cfg(feature = "sqlite")] -use std::{fs::create_dir_all, path::PathBuf}; - -#[cfg(feature = "sqlite")] -type Db = sqlx::sqlite::Sqlite; -#[cfg(feature = "mysql")] -type Db = sqlx::mysql::MySql; -#[cfg(feature = "postgres")] -type Db = sqlx::postgres::Postgres; - -#[cfg(feature = "sqlite")] -type LastInsertId = i64; -#[cfg(not(feature = "sqlite"))] -type LastInsertId = u64; - -#[derive(Debug, thiserror::Error)] -pub enum Error { - #[error(transparent)] - Sql(#[from] sqlx::Error), - #[error(transparent)] - Migration(#[from] sqlx::migrate::MigrateError), - #[error("database {0} not loaded")] - DatabaseNotLoaded(String), - #[error("unsupported datatype: {0}")] - UnsupportedDatatype(String), -} - -impl Serialize for Error { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - serializer.serialize_str(self.to_string().as_ref()) - } -} - -type Result = std::result::Result; - -#[cfg(feature = "sqlite")] -/// Resolves the App's **file path** from the `AppHandle` context -/// object -fn app_path(app: &AppHandle) -> PathBuf { - app.path().app_config_dir().expect("No App path was found!") -} - -#[cfg(feature = "sqlite")] -/// Maps the user supplied DB connection string to a connection string -/// with a fully qualified file path to the App's designed "app_path" -fn path_mapper(mut app_path: PathBuf, connection_string: &str) -> String { - app_path.push( - connection_string - .split_once(':') - .expect("Couldn't parse the connection string for DB!") - .1, - ); - - format!( - "sqlite:{}", - app_path - .to_str() - .expect("Problem creating fully qualified path to Database file!") - ) -} - -#[derive(Default)] -struct DbInstances(Mutex>>); - -struct Migrations(Mutex>); - -#[derive(Default, Clone, Deserialize)] -pub struct PluginConfig { - #[serde(default)] - preload: Vec, -} - -#[derive(Debug)] -pub enum MigrationKind { - Up, - Down, -} - -impl From for MigrationType { - fn from(kind: MigrationKind) -> Self { - match kind { - MigrationKind::Up => Self::ReversibleUp, - MigrationKind::Down => Self::ReversibleDown, - } - } -} - -/// A migration definition. -#[derive(Debug)] -pub struct Migration { - pub version: i64, - pub description: &'static str, - pub sql: &'static str, - pub kind: MigrationKind, -} - -#[derive(Debug)] -struct MigrationList(Vec); - -impl MigrationSource<'static> for MigrationList { - fn resolve(self) -> BoxFuture<'static, std::result::Result, BoxDynError>> { - Box::pin(async move { - let mut migrations = Vec::new(); - for migration in self.0 { - if matches!(migration.kind, MigrationKind::Up) { - migrations.push(SqlxMigration::new( - migration.version, - migration.description.into(), - migration.kind.into(), - migration.sql.into(), - )); - } - } - Ok(migrations) - }) - } -} - -#[command] -async fn load( - #[allow(unused_variables)] app: AppHandle, - db_instances: State<'_, DbInstances>, - migrations: State<'_, Migrations>, - db: String, -) -> Result { - #[cfg(feature = "sqlite")] - let fqdb = path_mapper(app_path(&app), &db); - #[cfg(not(feature = "sqlite"))] - let fqdb = db.clone(); - - #[cfg(feature = "sqlite")] - create_dir_all(app_path(&app)).expect("Problem creating App directory!"); - - if !Db::database_exists(&fqdb).await.unwrap_or(false) { - Db::create_database(&fqdb).await?; - } - let pool = Pool::connect(&fqdb).await?; - - if let Some(migrations) = migrations.0.lock().await.remove(&db) { - let migrator = Migrator::new(migrations).await?; - migrator.run(&pool).await?; - } - - db_instances.0.lock().await.insert(db.clone(), pool); - Ok(db) -} - -/// Allows the database connection(s) to be closed; if no database -/// name is passed in then _all_ database connection pools will be -/// shut down. -#[command] -async fn close(db_instances: State<'_, DbInstances>, db: Option) -> Result { - let mut instances = db_instances.0.lock().await; - - let pools = if let Some(db) = db { - vec![db] - } else { - instances.keys().cloned().collect() - }; - - for pool in pools { - let db = instances - .get_mut(&pool) // - .ok_or(Error::DatabaseNotLoaded(pool))?; - db.close().await; - } - - Ok(true) -} - -/// Execute a command against the database -#[command] -async fn execute( - db_instances: State<'_, DbInstances>, - db: String, - query: String, - values: Vec, -) -> Result<(u64, LastInsertId)> { - let mut instances = db_instances.0.lock().await; - - let db = instances.get_mut(&db).ok_or(Error::DatabaseNotLoaded(db))?; - let mut query = sqlx::query(&query); - for value in values { - if value.is_null() { - query = query.bind(None::); - } else if value.is_string() { - query = query.bind(value.as_str().unwrap().to_owned()) - } else if let Some(number) = value.as_number() { - query = query.bind(number.as_f64().unwrap_or_default()) - } else { - query = query.bind(value); - } - } - let result = query.execute(&*db).await?; - #[cfg(feature = "sqlite")] - let r = Ok((result.rows_affected(), result.last_insert_rowid())); - #[cfg(feature = "mysql")] - let r = Ok((result.rows_affected(), result.last_insert_id())); - #[cfg(feature = "postgres")] - let r = Ok((result.rows_affected(), 0)); - r -} - -#[command] -async fn select( - db_instances: State<'_, DbInstances>, - db: String, - query: String, - values: Vec, -) -> Result>> { - let mut instances = db_instances.0.lock().await; - let db = instances.get_mut(&db).ok_or(Error::DatabaseNotLoaded(db))?; - let mut query = sqlx::query(&query); - for value in values { - if value.is_null() { - query = query.bind(None::); - } else if value.is_string() { - query = query.bind(value.as_str().unwrap().to_owned()) - } else if let Some(number) = value.as_number() { - query = query.bind(number.as_f64().unwrap_or_default()) - } else { - query = query.bind(value); - } - } - let rows = query.fetch_all(&*db).await?; - let mut values = Vec::new(); - for row in rows { - let mut value = HashMap::default(); - for (i, column) in row.columns().iter().enumerate() { - let v = row.try_get_raw(i)?; - - let v = crate::decode::to_json(v)?; - - value.insert(column.name().to_string(), v); - } - - values.push(value); - } - - Ok(values) -} - -/// Tauri SQL plugin builder. -#[derive(Default)] -pub struct Builder { - migrations: Option>, -} - -impl Builder { - pub fn new() -> Self { - Self::default() - } - - /// Add migrations to a database. - #[must_use] - pub fn add_migrations(mut self, db_url: &str, migrations: Vec) -> Self { - self.migrations - .get_or_insert(Default::default()) - .insert(db_url.to_string(), MigrationList(migrations)); - self - } - - pub fn build(mut self) -> TauriPlugin> { - PluginBuilder::>::new("sql") - .js_init_script(include_str!("api-iife.js").to_string()) - .invoke_handler(tauri::generate_handler![load, execute, select, close]) - .setup(|app, api| { - let config = api.config().clone().unwrap_or_default(); - - #[cfg(feature = "sqlite")] - create_dir_all(app_path(app)).expect("problems creating App directory!"); - - tauri::async_runtime::block_on(async move { - let instances = DbInstances::default(); - let mut lock = instances.0.lock().await; - for db in config.preload { - #[cfg(feature = "sqlite")] - let fqdb = path_mapper(app_path(app), &db); - #[cfg(not(feature = "sqlite"))] - let fqdb = db.clone(); - - if !Db::database_exists(&fqdb).await.unwrap_or(false) { - Db::create_database(&fqdb).await?; - } - let pool = Pool::connect(&fqdb).await?; - - if let Some(migrations) = self.migrations.as_mut().unwrap().remove(&db) { - let migrator = Migrator::new(migrations).await?; - migrator.run(&pool).await?; - } - lock.insert(db, pool); - } - drop(lock); - - app.manage(instances); - app.manage(Migrations(Mutex::new( - self.migrations.take().unwrap_or_default(), - ))); - - Ok(()) - }) - }) - .on_event(|app, event| { - if let RunEvent::Exit = event { - tauri::async_runtime::block_on(async move { - let instances = &*app.state::(); - let instances = instances.0.lock().await; - for value in instances.values() { - value.close().await; - } - }); - } - }) - .build() - } -} diff --git a/plugins/sql/src/wrapper.rs b/plugins/sql/src/wrapper.rs new file mode 100644 index 00000000..90631dac --- /dev/null +++ b/plugins/sql/src/wrapper.rs @@ -0,0 +1,328 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +#[cfg(feature = "sqlite")] +use std::fs::create_dir_all; + +use indexmap::IndexMap; +use serde_json::Value as JsonValue; +#[cfg(any(feature = "sqlite", feature = "mysql", feature = "postgres"))] +use sqlx::{migrate::MigrateDatabase, Column, Executor, Pool, Row}; +#[cfg(any(feature = "sqlite", feature = "mysql", feature = "postgres"))] +use tauri::Manager; +use tauri::{AppHandle, Runtime}; + +#[cfg(feature = "mysql")] +use sqlx::MySql; +#[cfg(feature = "postgres")] +use sqlx::Postgres; +#[cfg(feature = "sqlite")] +use sqlx::Sqlite; + +use crate::LastInsertId; + +pub enum DbPool { + #[cfg(feature = "sqlite")] + Sqlite(Pool), + #[cfg(feature = "mysql")] + MySql(Pool), + #[cfg(feature = "postgres")] + Postgres(Pool), + #[cfg(not(any(feature = "sqlite", feature = "mysql", feature = "postgres")))] + None, +} + +// public methods +/* impl DbPool { + /// Get the inner Sqlite Pool. Returns None for MySql and Postgres pools. + #[cfg(feature = "sqlite")] + pub fn sqlite(&self) -> Option<&Pool> { + match self { + DbPool::Sqlite(pool) => Some(pool), + _ => None, + } + } + + /// Get the inner MySql Pool. Returns None for Sqlite and Postgres pools. + #[cfg(feature = "mysql")] + pub fn mysql(&self) -> Option<&Pool> { + match self { + DbPool::MySql(pool) => Some(pool), + _ => None, + } + } + + /// Get the inner Postgres Pool. Returns None for MySql and Sqlite pools. + #[cfg(feature = "postgres")] + pub fn postgres(&self) -> Option<&Pool> { + match self { + DbPool::Postgres(pool) => Some(pool), + _ => None, + } + } +} */ + +// private methods +impl DbPool { + pub(crate) async fn connect( + conn_url: &str, + _app: &AppHandle, + ) -> Result { + match conn_url + .split_once(':') + .ok_or_else(|| crate::Error::InvalidDbUrl(conn_url.to_string()))? + .0 + { + #[cfg(feature = "sqlite")] + "sqlite" => { + let app_path = _app + .path() + .app_config_dir() + .expect("No App config path was found!"); + + create_dir_all(&app_path).expect("Couldn't create app config dir"); + + let conn_url = &path_mapper(app_path, conn_url); + + if !Sqlite::database_exists(conn_url).await.unwrap_or(false) { + Sqlite::create_database(conn_url).await?; + } + Ok(Self::Sqlite(Pool::connect(conn_url).await?)) + } + #[cfg(feature = "mysql")] + "mysql" => { + if !MySql::database_exists(conn_url).await.unwrap_or(false) { + MySql::create_database(conn_url).await?; + } + Ok(Self::MySql(Pool::connect(conn_url).await?)) + } + #[cfg(feature = "postgres")] + "postgres" => { + if !Postgres::database_exists(conn_url).await.unwrap_or(false) { + Postgres::create_database(conn_url).await?; + } + Ok(Self::Postgres(Pool::connect(conn_url).await?)) + } + _ => Err(crate::Error::InvalidDbUrl(conn_url.to_string())), + } + } + + pub(crate) async fn migrate( + &self, + _migrator: &sqlx::migrate::Migrator, + ) -> Result<(), crate::Error> { + match self { + #[cfg(feature = "sqlite")] + DbPool::Sqlite(pool) => _migrator.run(pool).await?, + #[cfg(feature = "mysql")] + DbPool::MySql(pool) => _migrator.run(pool).await?, + #[cfg(feature = "postgres")] + DbPool::Postgres(pool) => _migrator.run(pool).await?, + #[cfg(not(any(feature = "sqlite", feature = "mysql", feature = "postgres")))] + DbPool::None => (), + } + Ok(()) + } + + pub(crate) async fn close(&self) { + match self { + #[cfg(feature = "sqlite")] + DbPool::Sqlite(pool) => pool.close().await, + #[cfg(feature = "mysql")] + DbPool::MySql(pool) => pool.close().await, + #[cfg(feature = "postgres")] + DbPool::Postgres(pool) => pool.close().await, + #[cfg(not(any(feature = "sqlite", feature = "mysql", feature = "postgres")))] + DbPool::None => (), + } + } + + pub(crate) async fn execute( + &self, + _query: String, + _values: Vec, + ) -> Result<(u64, LastInsertId), crate::Error> { + Ok(match self { + #[cfg(feature = "sqlite")] + DbPool::Sqlite(pool) => { + let mut query = sqlx::query(&_query); + for value in _values { + if value.is_null() { + query = query.bind(None::); + } else if value.is_string() { + query = query.bind(value.as_str().unwrap().to_owned()) + } else if let Some(number) = value.as_number() { + query = query.bind(number.as_f64().unwrap_or_default()) + } else { + query = query.bind(value); + } + } + let result = pool.execute(query).await?; + ( + result.rows_affected(), + LastInsertId::Sqlite(result.last_insert_rowid()), + ) + } + #[cfg(feature = "mysql")] + DbPool::MySql(pool) => { + let mut query = sqlx::query(&_query); + for value in _values { + if value.is_null() { + query = query.bind(None::); + } else if value.is_string() { + query = query.bind(value.as_str().unwrap().to_owned()) + } else if let Some(number) = value.as_number() { + query = query.bind(number.as_f64().unwrap_or_default()) + } else { + query = query.bind(value); + } + } + let result = pool.execute(query).await?; + ( + result.rows_affected(), + LastInsertId::MySql(result.last_insert_id()), + ) + } + #[cfg(feature = "postgres")] + DbPool::Postgres(pool) => { + let mut query = sqlx::query(&_query); + for value in _values { + if value.is_null() { + query = query.bind(None::); + } else if value.is_string() { + query = query.bind(value.as_str().unwrap().to_owned()) + } else if let Some(number) = value.as_number() { + query = query.bind(number.as_f64().unwrap_or_default()) + } else { + query = query.bind(value); + } + } + let result = pool.execute(query).await?; + (result.rows_affected(), LastInsertId::Postgres(())) + } + #[cfg(not(any(feature = "sqlite", feature = "mysql", feature = "postgres")))] + DbPool::None => (0, LastInsertId::None), + }) + } + + pub(crate) async fn select( + &self, + _query: String, + _values: Vec, + ) -> Result>, crate::Error> { + Ok(match self { + #[cfg(feature = "sqlite")] + DbPool::Sqlite(pool) => { + let mut query = sqlx::query(&_query); + for value in _values { + if value.is_null() { + query = query.bind(None::); + } else if value.is_string() { + query = query.bind(value.as_str().unwrap().to_owned()) + } else if let Some(number) = value.as_number() { + query = query.bind(number.as_f64().unwrap_or_default()) + } else { + query = query.bind(value); + } + } + let rows = pool.fetch_all(query).await?; + let mut values = Vec::new(); + for row in rows { + let mut value = IndexMap::default(); + for (i, column) in row.columns().iter().enumerate() { + let v = row.try_get_raw(i)?; + + let v = crate::decode::sqlite::to_json(v)?; + + value.insert(column.name().to_string(), v); + } + + values.push(value); + } + values + } + #[cfg(feature = "mysql")] + DbPool::MySql(pool) => { + let mut query = sqlx::query(&_query); + for value in _values { + if value.is_null() { + query = query.bind(None::); + } else if value.is_string() { + query = query.bind(value.as_str().unwrap().to_owned()) + } else if let Some(number) = value.as_number() { + query = query.bind(number.as_f64().unwrap_or_default()) + } else { + query = query.bind(value); + } + } + let rows = pool.fetch_all(query).await?; + let mut values = Vec::new(); + for row in rows { + let mut value = IndexMap::default(); + for (i, column) in row.columns().iter().enumerate() { + let v = row.try_get_raw(i)?; + + let v = crate::decode::mysql::to_json(v)?; + + value.insert(column.name().to_string(), v); + } + + values.push(value); + } + values + } + #[cfg(feature = "postgres")] + DbPool::Postgres(pool) => { + let mut query = sqlx::query(&_query); + for value in _values { + if value.is_null() { + query = query.bind(None::); + } else if value.is_string() { + query = query.bind(value.as_str().unwrap().to_owned()) + } else if let Some(number) = value.as_number() { + query = query.bind(number.as_f64().unwrap_or_default()) + } else { + query = query.bind(value); + } + } + let rows = pool.fetch_all(query).await?; + let mut values = Vec::new(); + for row in rows { + let mut value = IndexMap::default(); + for (i, column) in row.columns().iter().enumerate() { + let v = row.try_get_raw(i)?; + + let v = crate::decode::postgres::to_json(v)?; + + value.insert(column.name().to_string(), v); + } + + values.push(value); + } + values + } + #[cfg(not(any(feature = "sqlite", feature = "mysql", feature = "postgres")))] + DbPool::None => Vec::new(), + }) + } +} + +#[cfg(feature = "sqlite")] +/// Maps the user supplied DB connection string to a connection string +/// with a fully qualified file path to the App's designed "app_path" +fn path_mapper(mut app_path: std::path::PathBuf, connection_string: &str) -> String { + app_path.push( + connection_string + .split_once(':') + .expect("Couldn't parse the connection string for DB!") + .1, + ); + + format!( + "sqlite:{}", + app_path + .to_str() + .expect("Problem creating fully qualified path to Database file!") + ) +} diff --git a/plugins/store/.gitignore b/plugins/store/.gitignore deleted file mode 100644 index b512c09d..00000000 --- a/plugins/store/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/plugins/store/CHANGELOG.md b/plugins/store/CHANGELOG.md index c71ad4c8..51ac5ed2 100644 --- a/plugins/store/CHANGELOG.md +++ b/plugins/store/CHANGELOG.md @@ -1,5 +1,84 @@ # Changelog +## \[2.1.0] + +### feat + +- [`8c67d44a`](https://github.com/tauri-apps/plugins-workspace/commit/8c67d44aef60b1427019538d8420787ef35bd3d5) ([#1860](https://github.com/tauri-apps/plugins-workspace/pull/1860) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) - Add `getStore` + - Add an option to use pre-stored (de)serialize functions (registered on rust) + - Add `LazyStore` + +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.2] + +- [`f12d3560`](https://github.com/tauri-apps/plugins-workspace/commit/f12d35609ab84f536c0f087665fdc1f978af3093) ([#1550](https://github.com/tauri-apps/plugins-workspace/pull/1550) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) **Breaking change**: Removed the `Store` constructor and added the `createStore` API. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.2] + +- [`b9147758`](https://github.com/tauri-apps/plugins-workspace/commit/b914775898c2bee7ceb20bd17ee595005cd17a64) ([#1679](https://github.com/tauri-apps/plugins-workspace/pull/1679) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Explicitly set a minimum macOS version for the Swift package. + +## \[2.0.0-rc.1] + +### changes + +- [`6b079cfd`](https://github.com/tauri-apps/plugins-workspace/commit/6b079cfdd107c94abc2c7300f6af00bac3ff4040) ([#1649](https://github.com/tauri-apps/plugins-workspace/pull/1649) by [@ahqsoftwares](https://github.com/tauri-apps/plugins-workspace/../../ahqsoftwares)) Remove targetSdk from build.kts files as it is deprecated and will be removed from DSL v9.0 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.8] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.7] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.6] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[2.0.0-beta.5] + +- [`bb51a41`](https://github.com/tauri-apps/plugins-workspace/commit/bb51a41d67ebf989e8aedf10c4b1a7f9514d1bdf)([#1168](https://github.com/tauri-apps/plugins-workspace/pull/1168)) **Breaking Change:** All apis that return paths to the frontend will now remove the `\\?\` UNC prefix on Windows. + +## \[2.0.0-beta.4] + +- [`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.3] + +- [`79691e9`](https://github.com/tauri-apps/plugins-workspace/commit/79691e93e04b820e44dce1c7d91b8865fa6ccb14)([#1040](https://github.com/tauri-apps/plugins-workspace/pull/1040)) Fix `with_store` and `StoreCollection` changed to private in #1011 + +## \[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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -44,4 +123,21 @@ - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ae67\`]\(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! + ps://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! + com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + eb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + ps://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! + com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + plugins-workspace/pull/371)) First v2 alpha release! + com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! +) First v2 alpha release! + com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + eb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + ps://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! + com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + plugins-workspace/pull/371)) First v2 alpha release! + com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/store/Cargo.toml b/plugins/store/Cargo.toml index a91d96e4..ff181ea4 100644 --- a/plugins/store/Cargo.toml +++ b/plugins/store/Cargo.toml @@ -1,19 +1,27 @@ [package] name = "tauri-plugin-store" -version = "2.0.0-beta.1" +version = "2.1.0" description = "Simple, persistent key-value store." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-store" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "full", notes = "" } +ios = { level = "full", notes = "" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -21,3 +29,11 @@ serde_json = { workspace = true } tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } +dunce = { workspace = true } +tokio = { version = "1", features = ["sync", "time", "macros"] } + +[target.'cfg(target_os = "ios")'.dependencies] +tauri = { workspace = true, features = ["wry"] } + +[dev-dependencies] +tauri = { workspace = true, features = ["wry"] } diff --git a/plugins/store/README.md b/plugins/store/README.md index ad746854..7ab63fd4 100644 --- a/plugins/store/README.md +++ b/plugins/store/README.md @@ -2,9 +2,17 @@ Simple, persistent key-value store. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ✓ | +| iOS | ✓ | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-store = "2.0.0-beta" +tauri-plugin-store = "2.0.0" # alternatively with Git: tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -59,58 +67,76 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: -```javascript -import { Store } from "@tauri-apps/plugin-store"; +```typescript +import { Store } from '@tauri-apps/plugin-store' -const store = new Store(".settings.dat"); +const store = await Store.load('settings.json') -await store.set("some-key", { value: 5 }); +await store.set('some-key', { value: 5 }) -const val = await store.get("some-key"); -assert(val, { value: 5 }); +const val = await store.get<{ value: number }>('some-key') -await store.save(); // this manually saves the store, otherwise the store is only saved when your app is closed +if (val) { + console.log(val) +} else { + console.log('val is null') +} ``` -### Persisting values +### Persisting Values + +Modifications made to the store are automatically saved by default + +You can manually save a store with: -Values added to the store are not persisted between application loads unless: +```javascript +await store.save() +``` + +Stores are loaded automatically when used from the JavaScript bindings. +However, you can also load them manually later like so: -1. The application is closed gracefully (plugin automatically saves) -2. The store is manually saved (using `store.save()`) +```javascript +await store.load() +``` + +### LazyStore + +There's also a high level API `LazyStore` which only loads the store on first access, note that the options will be ignored if a `Store` with that path has already been created + +```typescript +import { LazyStore } from '@tauri-apps/plugin-store' + +const store = new LazyStore('settings.json') +``` ## Usage from Rust -You can also access Stores from Rust, you can create new stores: +You can also create `Store` instances directly in Rust: ```rust -use tauri_plugin_store::StoreBuilder; +use tauri_plugin_store::StoreExt; use serde_json::json; fn main() { tauri::Builder::default() .plugin(tauri_plugin_store::Builder::default().build()) .setup(|app| { - let mut store = StoreBuilder::new(app.handle(), "path/to/store.bin".parse()?).build(); + // This loads the store from disk + let store = app.store("app_data.json")?; - store.insert("a".to_string(), json!("b")) // note that values must be serd_json::Value to be compatible with JS + // Note that values must be serde_json::Value instances, + // otherwise, they will not be compatible with the JavaScript bindings. + store.set("a".to_string(), json!("b")); }) .run(tauri::generate_context!()) .expect("error while running tauri application"); } ``` -As you may have noticed, the Store crated above isn't accessible to the frontend. To interoperate with stores created by JS use the exported `with_store` method: +### Frontend Interoperability -```rust -use tauri::Wry; -use tauri_plugin_store::with_store; - -let stores = app.state::>(); -let path = PathBuf::from("path/to/the/storefile"); - -with_store(app_handle, stores, path, |store| store.insert("a".to_string(), json!("b"))) -``` +The store created from both Rust side and JavaScript side are stored in the app's resource table and can be accessed by both sides, you can access it by using the same path, with `getStore` and `LazyStore` in the JavaScript side and `get_store` and `store` in the Rust side ## Contributing diff --git a/plugins/store/SECURITY.md b/plugins/store/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/store/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/store/api-iife.js b/plugins/store/api-iife.js new file mode 100644 index 00000000..fc04ff00 --- /dev/null +++ b/plugins/store/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_STORE__=function(t){"use strict";var e,a;function r(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}async function s(t,e={},a){return window.__TAURI_INTERNALS__.invoke(t,e,a)}"function"==typeof SuppressedError&&SuppressedError;class i{get rid(){return function(t,e,a,r){if("a"===a&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===a?r:"a"===a?r.call(t):r?r.value:e.get(t)}(this,e,"f")}constructor(t){e.set(this,void 0),function(t,e,a,r,s){if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,a)}(this,e,t)}async close(){return s("plugin:resources|close",{rid:this.rid})}}async function n(t,e,a){const i={kind:"Any"};return s("plugin:event|listen",{event:t,target:i,handler:r(e)}).then((e=>async()=>async function(t,e){await s("plugin:event|unlisten",{event:t,eventId:e})}(t,e)))}async function o(t,e){return await u.load(t,e)}e=new WeakMap,function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_CREATED="tauri://window-created",t.WEBVIEW_CREATED="tauri://webview-created",t.DRAG_ENTER="tauri://drag-enter",t.DRAG_OVER="tauri://drag-over",t.DRAG_DROP="tauri://drag-drop",t.DRAG_LEAVE="tauri://drag-leave"}(a||(a={}));class u extends i{constructor(t){super(t)}static async load(t,e){const a=await s("plugin:store|load",{path:t,...e});return new u(a)}static async get(t){return await s("plugin:store|get_store",{path:t}).then((t=>t?new u(t):null))}async set(t,e){await s("plugin:store|set",{rid:this.rid,key:t,value:e})}async get(t){const[e,a]=await s("plugin:store|get",{rid:this.rid,key:t});return a?e:void 0}async has(t){return await s("plugin:store|has",{rid:this.rid,key:t})}async delete(t){return await s("plugin:store|delete",{rid:this.rid,key:t})}async clear(){await s("plugin:store|clear",{rid:this.rid})}async reset(){await s("plugin:store|reset",{rid:this.rid})}async keys(){return await s("plugin:store|keys",{rid:this.rid})}async values(){return await s("plugin:store|values",{rid:this.rid})}async entries(){return await s("plugin:store|entries",{rid:this.rid})}async length(){return await s("plugin:store|length",{rid:this.rid})}async reload(){await s("plugin:store|reload",{rid:this.rid})}async save(){await s("plugin:store|save",{rid:this.rid})}async onKeyChange(t,e){return await n("store://change",(a=>{a.payload.resourceId===this.rid&&a.payload.key===t&&e(a.payload.exists?a.payload.value:void 0)}))}async onChange(t){return await n("store://change",(e=>{e.payload.resourceId===this.rid&&t(e.payload.key,e.payload.exists?e.payload.value:void 0)}))}}return t.LazyStore=class{get store(){return this._store||(this._store=o(this.path,this.options)),this._store}constructor(t,e){this.path=t,this.options=e}async init(){await this.store}async set(t,e){return(await this.store).set(t,e)}async get(t){return(await this.store).get(t)}async has(t){return(await this.store).has(t)}async delete(t){return(await this.store).delete(t)}async clear(){await(await this.store).clear()}async reset(){await(await this.store).reset()}async keys(){return(await this.store).keys()}async values(){return(await this.store).values()}async entries(){return(await this.store).entries()}async length(){return(await this.store).length()}async reload(){await(await this.store).reload()}async save(){await(await this.store).save()}async onKeyChange(t,e){return(await this.store).onKeyChange(t,e)}async onChange(t){return(await this.store).onChange(t)}async close(){this._store&&await(await this._store).close()}},t.Store=u,t.getStore=async function(t){return await u.get(t)},t.load=o,t}({});Object.defineProperty(window.__TAURI__,"store",{value:__TAURI_PLUGIN_STORE__})} diff --git a/plugins/store/build.rs b/plugins/store/build.rs index 30ed3968..2e88d59a 100644 --- a/plugins/store/build.rs +++ b/plugins/store/build.rs @@ -3,10 +3,24 @@ // SPDX-License-Identifier: MIT const COMMANDS: &[&str] = &[ - "set", "get", "has", "delete", "clear", "reset", "keys", "values", "length", "entries", "load", + "load", + "get_store", + "set", + "get", + "has", + "delete", + "clear", + "reset", + "keys", + "values", + "entries", + "length", + "reload", "save", ]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/store/examples/AppSettingsManager/.gitignore b/plugins/store/examples/AppSettingsManager/.gitignore new file mode 100644 index 00000000..a9b26d1f --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +#dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/plugins/store/examples/AppSettingsManager/.vscode/extensions.json b/plugins/store/examples/AppSettingsManager/.vscode/extensions.json new file mode 100644 index 00000000..24d7cc6d --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"] +} diff --git a/plugins/store/examples/AppSettingsManager/README.md b/plugins/store/examples/AppSettingsManager/README.md new file mode 100644 index 00000000..b381dcf5 --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/README.md @@ -0,0 +1,7 @@ +# Tauri + Vanilla TS + +This template should help get you started developing with Tauri in vanilla HTML, CSS and Typescript. + +## Recommended IDE Setup + +- [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) diff --git a/plugins/deep-link/examples/app/src-tauri/gen/apple/assets/.gitkeep b/plugins/store/examples/AppSettingsManager/dist/.gitkeep similarity index 100% rename from plugins/deep-link/examples/app/src-tauri/gen/apple/assets/.gitkeep rename to plugins/store/examples/AppSettingsManager/dist/.gitkeep diff --git a/plugins/store/examples/AppSettingsManager/index.html b/plugins/store/examples/AppSettingsManager/index.html new file mode 100644 index 00000000..7c268692 --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/index.html @@ -0,0 +1,54 @@ + + + + + + + Tauri App + + + + + + + + diff --git a/plugins/store/examples/AppSettingsManager/package.json b/plugins/store/examples/AppSettingsManager/package.json new file mode 100644 index 00000000..cd2cb198 --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/package.json @@ -0,0 +1,15 @@ +{ + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc && vite build", + "preview": "vite preview", + "tauri": "tauri" + }, + "devDependencies": { + "@tauri-apps/cli": "2.0.3", + "vite": "^5.0.12", + "typescript": "^5.4.7" + } +} diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/.gitignore b/plugins/store/examples/AppSettingsManager/src-tauri/.gitignore new file mode 100644 index 00000000..043cc4af --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/src-tauri/.gitignore @@ -0,0 +1,4 @@ +# Generated by Cargo +# will have compiled files and executables +/target/ +gen/schemas diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/Cargo.toml b/plugins/store/examples/AppSettingsManager/src-tauri/Cargo.toml new file mode 100644 index 00000000..7c60d516 --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/src-tauri/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "app_settings_manager" +version = "0.0.0" +description = "A Tauri App" +authors = ["you"] +license = "" +repository = "" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[build-dependencies] +tauri-build = { workspace = true } + +[dependencies] +tauri = { workspace = true, features = ["wry", "compression"] } +serde = { workspace = true } +serde_json = { workspace = true } +tauri-plugin-store = { path = "../../../" } + +[features] +# this feature is used for production builds or when `devPath` points to the filesystem +# DO NOT REMOVE!! +prod = ["tauri/custom-protocol"] diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/build.rs b/plugins/store/examples/AppSettingsManager/src-tauri/build.rs new file mode 100644 index 00000000..5ebf8d2f --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/src-tauri/build.rs @@ -0,0 +1,7 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +fn main() { + tauri_build::build() +} diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/icons/128x128.png b/plugins/store/examples/AppSettingsManager/src-tauri/icons/128x128.png new file mode 100644 index 00000000..6be5e50e Binary files /dev/null and b/plugins/store/examples/AppSettingsManager/src-tauri/icons/128x128.png differ diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/icons/128x128@2x.png b/plugins/store/examples/AppSettingsManager/src-tauri/icons/128x128@2x.png new file mode 100644 index 00000000..e81becee Binary files /dev/null and b/plugins/store/examples/AppSettingsManager/src-tauri/icons/128x128@2x.png differ diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/icons/32x32.png b/plugins/store/examples/AppSettingsManager/src-tauri/icons/32x32.png new file mode 100644 index 00000000..a437dd51 Binary files /dev/null and b/plugins/store/examples/AppSettingsManager/src-tauri/icons/32x32.png differ diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square107x107Logo.png b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square107x107Logo.png new file mode 100644 index 00000000..0ca4f271 Binary files /dev/null and b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square107x107Logo.png differ diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square142x142Logo.png b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square142x142Logo.png new file mode 100644 index 00000000..b81f8203 Binary files /dev/null and b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square142x142Logo.png differ diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square150x150Logo.png b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square150x150Logo.png new file mode 100644 index 00000000..624c7bfb Binary files /dev/null and b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square150x150Logo.png differ diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square284x284Logo.png b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square284x284Logo.png new file mode 100644 index 00000000..c021d2ba Binary files /dev/null and b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square284x284Logo.png differ diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square30x30Logo.png b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square30x30Logo.png new file mode 100644 index 00000000..62197002 Binary files /dev/null and b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square30x30Logo.png differ diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square310x310Logo.png b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square310x310Logo.png new file mode 100644 index 00000000..f9bc0483 Binary files /dev/null and b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square310x310Logo.png differ diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square44x44Logo.png b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square44x44Logo.png new file mode 100644 index 00000000..d5fbfb2a Binary files /dev/null and b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square44x44Logo.png differ diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square71x71Logo.png b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square71x71Logo.png new file mode 100644 index 00000000..63440d79 Binary files /dev/null and b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square71x71Logo.png differ diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square89x89Logo.png b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square89x89Logo.png new file mode 100644 index 00000000..f3f705af Binary files /dev/null and b/plugins/store/examples/AppSettingsManager/src-tauri/icons/Square89x89Logo.png differ diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/icons/StoreLogo.png b/plugins/store/examples/AppSettingsManager/src-tauri/icons/StoreLogo.png new file mode 100644 index 00000000..45563882 Binary files /dev/null and b/plugins/store/examples/AppSettingsManager/src-tauri/icons/StoreLogo.png differ diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/icons/icon.icns b/plugins/store/examples/AppSettingsManager/src-tauri/icons/icon.icns new file mode 100644 index 00000000..12a5bcee Binary files /dev/null and b/plugins/store/examples/AppSettingsManager/src-tauri/icons/icon.icns differ diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/icons/icon.ico b/plugins/store/examples/AppSettingsManager/src-tauri/icons/icon.ico new file mode 100644 index 00000000..b3636e4b Binary files /dev/null and b/plugins/store/examples/AppSettingsManager/src-tauri/icons/icon.ico differ diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/icons/icon.png b/plugins/store/examples/AppSettingsManager/src-tauri/icons/icon.png new file mode 100644 index 00000000..e1cd2619 Binary files /dev/null and b/plugins/store/examples/AppSettingsManager/src-tauri/icons/icon.png differ diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/src/app/mod.rs b/plugins/store/examples/AppSettingsManager/src-tauri/src/app/mod.rs new file mode 100644 index 00000000..e8c1bb01 --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/src-tauri/src/app/mod.rs @@ -0,0 +1,5 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +pub mod settings; diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/src/app/settings.rs b/plugins/store/examples/AppSettingsManager/src-tauri/src/app/settings.rs new file mode 100644 index 00000000..30514a00 --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/src-tauri/src/app/settings.rs @@ -0,0 +1,32 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use tauri_plugin_store::Store; + +#[derive(Debug, Clone)] +pub struct AppSettings { + pub launch_at_login: bool, + pub theme: String, +} + +impl AppSettings { + pub fn load_from_store( + store: &Store, + ) -> Result> { + let launch_at_login = store + .get("appSettings.launchAtLogin") + .and_then(|v| v.as_bool()) + .unwrap_or(false); + + let theme = store + .get("appSettings.theme") + .and_then(|v| v.as_str().map(String::from)) + .unwrap_or_else(|| "dark".to_owned()); + + Ok(AppSettings { + launch_at_login, + theme, + }) + } +} diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/src/main.rs b/plugins/store/examples/AppSettingsManager/src-tauri/src/main.rs new file mode 100644 index 00000000..f20db4fc --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/src-tauri/src/main.rs @@ -0,0 +1,47 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +// Prevents additional console window on Windows in release, DO NOT REMOVE!! +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] + +use serde_json::json; +use tauri::Listener; +use tauri_plugin_store::StoreExt; + +mod app; +use app::settings::AppSettings; + +fn main() { + tauri::Builder::default() + .plugin(tauri_plugin_store::Builder::new().build()) + .setup(|app| { + // Init store and load it from disk + let store = app.store("settings.json")?; + app.listen("store://change", |event| { + dbg!(event); + }); + let app_settings = AppSettings::load_from_store(&store); + match app_settings { + Ok(app_settings) => { + let theme = app_settings.theme; + let launch_at_login = app_settings.launch_at_login; + + println!("theme {theme}"); + println!("launch_at_login {launch_at_login}"); + store.set( + "appSettings", + json!({ "theme": theme, "launchAtLogin": launch_at_login }), + ); + } + Err(err) => { + eprintln!("Error loading settings: {err}"); + // Handle the error case if needed + return Err(err); // Convert the error to a Box and return Err(err) here + } + } + Ok(()) + }) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/tauri.conf.json b/plugins/store/examples/AppSettingsManager/src-tauri/tauri.conf.json new file mode 100644 index 00000000..d3f60daa --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/src-tauri/tauri.conf.json @@ -0,0 +1,34 @@ +{ + "productName": "app", + "version": "0.1.0", + "identifier": "com.tauri.app-settings-manager", + "build": { + "devUrl": "http://localhost:1420", + "frontendDist": "../dist" + }, + "app": { + "windows": [ + { + "title": "app", + "width": 800, + "height": 600, + "resizable": true, + "fullscreen": false + } + ], + "security": { + "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: http://tauri.localhost 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'" + } + }, + "bundle": { + "active": true, + "targets": "all", + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.icns", + "icons/icon.ico" + ] + } +} diff --git a/plugins/store/examples/AppSettingsManager/src/assets/tauri.svg b/plugins/store/examples/AppSettingsManager/src/assets/tauri.svg new file mode 100644 index 00000000..31b62c92 --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/src/assets/tauri.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/plugins/store/examples/AppSettingsManager/src/assets/typescript.svg b/plugins/store/examples/AppSettingsManager/src/assets/typescript.svg new file mode 100644 index 00000000..30a5edd3 --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/src/assets/typescript.svg @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/plugins/store/examples/AppSettingsManager/src/assets/vite.svg b/plugins/store/examples/AppSettingsManager/src/assets/vite.svg new file mode 100644 index 00000000..e7b8dfb1 --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/src/assets/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/store/examples/AppSettingsManager/src/main.ts b/plugins/store/examples/AppSettingsManager/src/main.ts new file mode 100644 index 00000000..57cbe4b7 --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/src/main.ts @@ -0,0 +1,9 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +window.addEventListener('DOMContentLoaded', () => { + document.querySelector('#greet-form')?.addEventListener('submit', (e) => { + e.preventDefault() + }) +}) diff --git a/plugins/store/examples/AppSettingsManager/src/styles.css b/plugins/store/examples/AppSettingsManager/src/styles.css new file mode 100644 index 00000000..f7de85bf --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/src/styles.css @@ -0,0 +1,109 @@ +:root { + font-family: Inter, Avenir, Helvetica, Arial, sans-serif; + font-size: 16px; + line-height: 24px; + font-weight: 400; + + color: #0f0f0f; + background-color: #f6f6f6; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + +.container { + margin: 0; + padding-top: 10vh; + display: flex; + flex-direction: column; + justify-content: center; + text-align: center; +} + +.logo { + height: 6em; + padding: 1.5em; + will-change: filter; + transition: 0.75s; +} + +.logo.tauri:hover { + filter: drop-shadow(0 0 2em #24c8db); +} + +.row { + display: flex; + justify-content: center; +} + +a { + font-weight: 500; + color: #646cff; + text-decoration: inherit; +} + +a:hover { + color: #535bf2; +} + +h1 { + text-align: center; +} + +input, +button { + border-radius: 8px; + border: 1px solid transparent; + padding: 0.6em 1.2em; + font-size: 1em; + font-weight: 500; + font-family: inherit; + color: #0f0f0f; + background-color: #ffffff; + transition: border-color 0.25s; + box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2); +} + +button { + cursor: pointer; +} + +button:hover { + border-color: #396cd8; +} +button:active { + border-color: #396cd8; + background-color: #e8e8e8; +} + +input, +button { + outline: none; +} + +#greet-input { + margin-right: 5px; +} + +@media (prefers-color-scheme: dark) { + :root { + color: #f6f6f6; + background-color: #2f2f2f; + } + + a:hover { + color: #24c8db; + } + + input, + button { + color: #ffffff; + background-color: #0f0f0f98; + } + button:active { + background-color: #0f0f0f69; + } +} diff --git a/plugins/store/examples/AppSettingsManager/tsconfig.json b/plugins/store/examples/AppSettingsManager/tsconfig.json new file mode 100644 index 00000000..75abdef2 --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/plugins/store/examples/AppSettingsManager/vite.config.ts b/plugins/store/examples/AppSettingsManager/vite.config.ts new file mode 100644 index 00000000..661eb233 --- /dev/null +++ b/plugins/store/examples/AppSettingsManager/vite.config.ts @@ -0,0 +1,21 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import { defineConfig } from 'vite' + +// https://vitejs.dev/config/ +export default defineConfig(async () => ({ + // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build` + // + // 1. prevent vite from obscuring rust errors + clearScreen: false, + // 2. tauri expects a fixed port, fail if that port is not available + server: { + port: 1420, + strictPort: true + }, + // 3. to make use of `TAURI_DEBUG` and other env variables + // https://tauri.studio/v1/api/config#buildconfig.beforedevcommand + envPrefix: ['VITE_', 'TAURI_'] +})) diff --git a/plugins/store/guest-js/index.ts b/plugins/store/guest-js/index.ts index e567f8eb..1df89fd5 100644 --- a/plugins/store/guest-js/index.ts +++ b/plugins/store/guest-js/index.ts @@ -2,25 +2,318 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { listen, UnlistenFn } from "@tauri-apps/api/event"; +import { listen, type UnlistenFn } from '@tauri-apps/api/event' -import { invoke } from "@tauri-apps/api/core"; +import { invoke, Resource } from '@tauri-apps/api/core' interface ChangePayload { - path: string; - key: string; - value: T | null; + path: string + resourceId?: number + key: string + value: T + exists: boolean +} + +/** + * Options to create a store + */ +export type StoreOptions = { + /** + * Auto save on modification with debounce duration in milliseconds, it's 100ms by default, pass in `false` to disable it + */ + autoSave?: boolean | number + /** + * Name of a serialize function registered in the rust side plugin builder + */ + serializeFnName?: string + /** + * Name of a deserialize function registered in the rust side plugin builder + */ + deserializeFnName?: string + /** + * Force create a new store with default values even if it already exists. + */ + createNew?: boolean +} + +/** + * Create a new Store or load the existing store with the path. + * + * @example + * ```typescript + * import { Store } from '@tauri-apps/api/store'; + * const store = await Store.load('store.json'); + * ``` + * + * @param path Path to save the store in `app_data_dir` + * @param options Store configuration options + */ +export async function load( + path: string, + options?: StoreOptions +): Promise { + return await Store.load(path, options) +} + +/** + * Gets an already loaded store. + * + * If the store is not loaded, returns `null`. In this case you must {@link Store.load load} it. + * + * This function is more useful when you already know the store is loaded + * and just need to access its instance. Prefer {@link Store.load} otherwise. + * + * @example + * ```typescript + * import { getStore } from '@tauri-apps/api/store'; + * const store = await getStore('store.json'); + * ``` + * + * @param path Path of the store. + */ +export async function getStore(path: string): Promise { + return await Store.get(path) +} + +/** + * A lazy loaded key-value store persisted by the backend layer. + */ +export class LazyStore implements IStore { + private _store?: Promise + + private get store(): Promise { + if (!this._store) { + this._store = load(this.path, this.options) + } + return this._store + } + + /** + * Note that the options are not applied if someone else already created the store + * @param path Path to save the store in `app_data_dir` + * @param options Store configuration options + */ + constructor( + private readonly path: string, + private readonly options?: StoreOptions + ) {} + + /** + * Init/load the store if it's not loaded already + */ + async init(): Promise { + await this.store + } + + async set(key: string, value: unknown): Promise { + return (await this.store).set(key, value) + } + + async get(key: string): Promise { + return (await this.store).get(key) + } + + async has(key: string): Promise { + return (await this.store).has(key) + } + + async delete(key: string): Promise { + return (await this.store).delete(key) + } + + async clear(): Promise { + await (await this.store).clear() + } + + async reset(): Promise { + await (await this.store).reset() + } + + async keys(): Promise { + return (await this.store).keys() + } + + async values(): Promise { + return (await this.store).values() + } + + async entries(): Promise> { + return (await this.store).entries() + } + + async length(): Promise { + return (await this.store).length() + } + + async reload(): Promise { + await (await this.store).reload() + } + + async save(): Promise { + await (await this.store).save() + } + + async onKeyChange( + key: string, + cb: (value: T | undefined) => void + ): Promise { + return (await this.store).onKeyChange(key, cb) + } + + async onChange( + cb: (key: string, value: T | undefined) => void + ): Promise { + return (await this.store).onChange(cb) + } + + async close(): Promise { + if (this._store) { + await (await this._store).close() + } + } } /** * A key-value store persisted by the backend layer. */ -export class Store { - path: string; - constructor(path: string) { - this.path = path; +export class Store extends Resource implements IStore { + private constructor(rid: number) { + super(rid) } + /** + * Create a new Store or load the existing store with the path. + * + * @example + * ```typescript + * import { Store } from '@tauri-apps/api/store'; + * const store = await Store.load('store.json'); + * ``` + * + * @param path Path to save the store in `app_data_dir` + * @param options Store configuration options + */ + static async load(path: string, options?: StoreOptions): Promise { + const rid = await invoke('plugin:store|load', { + path, + ...options + }) + return new Store(rid) + } + + /** + * Gets an already loaded store. + * + * If the store is not loaded, returns `null`. In this case you must {@link Store.load load} it. + * + * This function is more useful when you already know the store is loaded + * and just need to access its instance. Prefer {@link Store.load} otherwise. + * + * @example + * ```typescript + * import { Store } from '@tauri-apps/api/store'; + * let store = await Store.get('store.json'); + * if (!store) { + * store = await Store.load('store.json'); + * } + * ``` + * + * @param path Path of the store. + */ + static async get(path: string): Promise { + return await invoke('plugin:store|get_store', { path }).then( + (rid) => (rid ? new Store(rid) : null) + ) + } + + async set(key: string, value: unknown): Promise { + await invoke('plugin:store|set', { + rid: this.rid, + key, + value + }) + } + + async get(key: string): Promise { + const [value, exists] = await invoke<[T, boolean]>('plugin:store|get', { + rid: this.rid, + key + }) + return exists ? value : undefined + } + + async has(key: string): Promise { + return await invoke('plugin:store|has', { + rid: this.rid, + key + }) + } + + async delete(key: string): Promise { + return await invoke('plugin:store|delete', { + rid: this.rid, + key + }) + } + + async clear(): Promise { + await invoke('plugin:store|clear', { rid: this.rid }) + } + + async reset(): Promise { + await invoke('plugin:store|reset', { rid: this.rid }) + } + + async keys(): Promise { + return await invoke('plugin:store|keys', { rid: this.rid }) + } + + async values(): Promise { + return await invoke('plugin:store|values', { rid: this.rid }) + } + + async entries(): Promise> { + return await invoke('plugin:store|entries', { rid: this.rid }) + } + + async length(): Promise { + return await invoke('plugin:store|length', { rid: this.rid }) + } + + async reload(): Promise { + await invoke('plugin:store|reload', { rid: this.rid }) + } + + async save(): Promise { + await invoke('plugin:store|save', { rid: this.rid }) + } + + async onKeyChange( + key: string, + cb: (value: T | undefined) => void + ): Promise { + return await listen>('store://change', (event) => { + if (event.payload.resourceId === this.rid && event.payload.key === key) { + cb(event.payload.exists ? event.payload.value : undefined) + } + }) + } + + async onChange( + cb: (key: string, value: T | undefined) => void + ): Promise { + return await listen>('store://change', (event) => { + if (event.payload.resourceId === this.rid) { + cb( + event.payload.key, + event.payload.exists ? event.payload.value : undefined + ) + } + }) + } +} + +interface IStore { /** * Inserts a key-value pair into the store. * @@ -28,26 +321,15 @@ export class Store { * @param value * @returns */ - async set(key: string, value: unknown): Promise { - return await invoke("plugin:store|set", { - path: this.path, - key, - value, - }); - } + set(key: string, value: unknown): Promise /** - * Returns the value for the given `key` or `null` the key does not exist. + * Returns the value for the given `key` or `undefined` if the key does not exist. * * @param key * @returns */ - async get(key: string): Promise { - return await invoke("plugin:store|get", { - path: this.path, - key, - }); - } + get(key: string): Promise /** * Returns `true` if the given `key` exists in the store. @@ -55,12 +337,7 @@ export class Store { * @param key * @returns */ - async has(key: string): Promise { - return await invoke("plugin:store|has", { - path: this.path, - key, - }); - } + has(key: string): Promise /** * Removes a key-value pair from the store. @@ -68,107 +345,67 @@ export class Store { * @param key * @returns */ - async delete(key: string): Promise { - return await invoke("plugin:store|delete", { - path: this.path, - key, - }); - } + delete(key: string): Promise /** * Clears the store, removing all key-value pairs. * - * Note: To clear the storage and reset it to it's `default` value, use `reset` instead. + * Note: To clear the storage and reset it to its `default` value, use {@linkcode reset} instead. * @returns */ - async clear(): Promise { - return await invoke("plugin:store|clear", { - path: this.path, - }); - } + clear(): Promise /** - * Resets the store to it's `default` value. + * Resets the store to its `default` value. * - * If no default value has been set, this method behaves identical to `clear`. + * If no default value has been set, this method behaves identical to {@linkcode clear}. * @returns */ - async reset(): Promise { - return await invoke("plugin:store|reset", { - path: this.path, - }); - } + reset(): Promise /** - * Returns a list of all key in the store. + * Returns a list of all keys in the store. * * @returns */ - async keys(): Promise { - return await invoke("plugin:store|keys", { - path: this.path, - }); - } + keys(): Promise /** * Returns a list of all values in the store. * * @returns */ - async values(): Promise { - return await invoke("plugin:store|values", { - path: this.path, - }); - } + values(): Promise /** * Returns a list of all entries in the store. * * @returns */ - async entries(): Promise> { - return await invoke("plugin:store|entries", { - path: this.path, - }); - } + entries(): Promise> /** * Returns the number of key-value pairs in the store. * * @returns */ - async length(): Promise { - return await invoke("plugin:store|length", { - path: this.path, - }); - } + length(): Promise /** - * Attempts to load the on-disk state at the stores `path` into memory. + * Attempts to load the on-disk state at the store's `path` into memory. * * This method is useful if the on-disk state was edited by the user and you want to synchronize the changes. * * Note: This method does not emit change events. * @returns */ - async load(): Promise { - return await invoke("plugin:store|load", { - path: this.path, - }); - } + reload(): Promise /** - * Saves the store to disk at the stores `path`. - * - * As the store is only persisted to disk before the apps exit, changes might be lost in a crash. - * This method lets you persist the store to disk whenever you deem necessary. + * Saves the store to disk at the store's `path`. * @returns */ - async save(): Promise { - return await invoke("plugin:store|save", { - path: this.path, - }); - } + save(): Promise /** * Listen to changes on a store key. @@ -178,16 +415,10 @@ export class Store { * * @since 2.0.0 */ - async onKeyChange( + onKeyChange( key: string, - cb: (value: T | null) => void, - ): Promise { - return await listen>("store://change", (event) => { - if (event.payload.path === this.path && event.payload.key === key) { - cb(event.payload.value); - } - }); - } + cb: (value: T | undefined) => void + ): Promise /** * Listen to changes on the store. @@ -196,13 +427,13 @@ export class Store { * * @since 2.0.0 */ - async onChange( - cb: (key: string, value: T | null) => void, - ): Promise { - return await listen>("store://change", (event) => { - if (event.payload.path === this.path) { - cb(event.payload.key, event.payload.value); - } - }); - } + onChange( + cb: (key: string, value: T | undefined) => void + ): Promise + + /** + * Close the store and cleans up this resource from memory. + * **You should not call any method on this object anymore and should drop any reference to it.** + */ + close(): Promise } diff --git a/plugins/store/package.json b/plugins/store/package.json index 3f92f163..e310463c 100644 --- a/plugins/store/package.json +++ b/plugins/store/package.json @@ -1,11 +1,12 @@ { "name": "@tauri-apps/plugin-store", - "version": "2.0.0-beta.1", + "version": "2.1.0", "description": "Simple, persistent key-value store.", - "license": "MIT or APACHE-2.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -24,6 +25,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/store/permissions/autogenerated/commands/get_store.toml b/plugins/store/permissions/autogenerated/commands/get_store.toml new file mode 100644 index 00000000..7c19173a --- /dev/null +++ b/plugins/store/permissions/autogenerated/commands/get_store.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-get-store" +description = "Enables the get_store command without any pre-configured scope." +commands.allow = ["get_store"] + +[[permission]] +identifier = "deny-get-store" +description = "Denies the get_store command without any pre-configured scope." +commands.deny = ["get_store"] diff --git a/plugins/store/permissions/autogenerated/commands/reload.toml b/plugins/store/permissions/autogenerated/commands/reload.toml new file mode 100644 index 00000000..92e25253 --- /dev/null +++ b/plugins/store/permissions/autogenerated/commands/reload.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-reload" +description = "Enables the reload command without any pre-configured scope." +commands.allow = ["reload"] + +[[permission]] +identifier = "deny-reload" +description = "Denies the reload command without any pre-configured scope." +commands.deny = ["reload"] diff --git a/plugins/store/permissions/autogenerated/reference.md b/plugins/store/permissions/autogenerated/reference.md index fd626ff7..5640415d 100644 --- a/plugins/store/permissions/autogenerated/reference.md +++ b/plugins/store/permissions/autogenerated/reference.md @@ -1,98 +1,399 @@ -# Permissions +## Default Permission -## allow-clear +This permission set configures what kind of +operations are available from the store plugin. + +#### Granted Permissions + +All operations are enabled by default. + + + +- `allow-load` +- `allow-get-store` +- `allow-set` +- `allow-get` +- `allow-has` +- `allow-delete` +- `allow-clear` +- `allow-reset` +- `allow-keys` +- `allow-values` +- `allow-entries` +- `allow-length` +- `allow-reload` +- `allow-save` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`store:allow-clear` + + Enables the clear command without any pre-configured scope. -## deny-clear +
+ +`store:deny-clear` + + Denies the clear command without any pre-configured scope. -## allow-delete +
+ +`store:allow-delete` + + Enables the delete command without any pre-configured scope. -## deny-delete +
+ +`store:deny-delete` + + Denies the delete command without any pre-configured scope. -## allow-entries +
+ +`store:allow-entries` + + Enables the entries command without any pre-configured scope. -## deny-entries +
+ +`store:deny-entries` + + Denies the entries command without any pre-configured scope. -## allow-get +
+ +`store:allow-get` + + Enables the get command without any pre-configured scope. -## deny-get +
+ +`store:deny-get` + + Denies the get command without any pre-configured scope. -## allow-has +
+ +`store:allow-get-store` + + + +Enables the get_store command without any pre-configured scope. + +
+ +`store:deny-get-store` + + + +Denies the get_store command without any pre-configured scope. + +
+ +`store:allow-has` + + Enables the has command without any pre-configured scope. -## deny-has +
+ +`store:deny-has` + + Denies the has command without any pre-configured scope. -## allow-keys +
+ +`store:allow-keys` + + Enables the keys command without any pre-configured scope. -## deny-keys +
+ +`store:deny-keys` + + Denies the keys command without any pre-configured scope. -## allow-length +
+ +`store:allow-length` + + Enables the length command without any pre-configured scope. -## deny-length +
+ +`store:deny-length` + + Denies the length command without any pre-configured scope. -## allow-load +
+ +`store:allow-load` + + Enables the load command without any pre-configured scope. -## deny-load +
+ +`store:deny-load` + + Denies the load command without any pre-configured scope. -## allow-reset +
+ +`store:allow-reload` + + + +Enables the reload command without any pre-configured scope. + +
+ +`store:deny-reload` + + + +Denies the reload command without any pre-configured scope. + +
+ +`store:allow-reset` + + Enables the reset command without any pre-configured scope. -## deny-reset +
+ +`store:deny-reset` + + Denies the reset command without any pre-configured scope. -## allow-save +
+ +`store:allow-save` + + Enables the save command without any pre-configured scope. -## deny-save +
+ +`store:deny-save` + + Denies the save command without any pre-configured scope. -## allow-set +
+ +`store:allow-set` + + Enables the set command without any pre-configured scope. -## deny-set +
+ +`store:deny-set` + + Denies the set command without any pre-configured scope. -## allow-values +
+ +`store:allow-values` + + Enables the values command without any pre-configured scope. -## deny-values +
+ +`store:deny-values` + + Denies the values command without any pre-configured scope. +
diff --git a/plugins/store/permissions/default.toml b/plugins/store/permissions/default.toml new file mode 100644 index 00000000..3a3e4b3a --- /dev/null +++ b/plugins/store/permissions/default.toml @@ -0,0 +1,28 @@ +"$schema" = "schemas/schema.json" + +[default] +description = """ +This permission set configures what kind of +operations are available from the store plugin. + +#### Granted Permissions + +All operations are enabled by default. + +""" +permissions = [ + "allow-load", + "allow-get-store", + "allow-set", + "allow-get", + "allow-has", + "allow-delete", + "allow-clear", + "allow-reset", + "allow-keys", + "allow-values", + "allow-entries", + "allow-length", + "allow-reload", + "allow-save", +] diff --git a/plugins/store/permissions/schemas/schema.json b/plugins/store/permissions/schemas/schema.json index 96bf93fe..4237bc62 100644 --- a/plugins/store/permissions/schemas/schema.json +++ b/plugins/store/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,176 +251,193 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-clear -> Enables the clear command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-clear" + "macOS" ] }, { - "description": "deny-clear -> Denies the clear command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-clear" + "windows" ] }, { - "description": "allow-delete -> Enables the delete command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-delete" + "linux" ] }, { - "description": "deny-delete -> Denies the delete command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-delete" + "android" ] }, { - "description": "allow-entries -> Enables the entries command without any pre-configured scope.", + "description": "iOS.", "type": "string", "enum": [ - "allow-entries" + "iOS" ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the clear command without any pre-configured scope.", + "type": "string", + "const": "allow-clear" }, { - "description": "deny-entries -> Denies the entries command without any pre-configured scope.", + "description": "Denies the clear command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-entries" - ] + "const": "deny-clear" }, { - "description": "allow-get -> Enables the get command without any pre-configured scope.", + "description": "Enables the delete command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-get" - ] + "const": "allow-delete" }, { - "description": "deny-get -> Denies the get command without any pre-configured scope.", + "description": "Denies the delete command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-get" - ] + "const": "deny-delete" }, { - "description": "allow-has -> Enables the has command without any pre-configured scope.", + "description": "Enables the entries command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-has" - ] + "const": "allow-entries" }, { - "description": "deny-has -> Denies the has command without any pre-configured scope.", + "description": "Denies the entries command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-has" - ] + "const": "deny-entries" }, { - "description": "allow-keys -> Enables the keys command without any pre-configured scope.", + "description": "Enables the get command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-keys" - ] + "const": "allow-get" }, { - "description": "deny-keys -> Denies the keys command without any pre-configured scope.", + "description": "Denies the get command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-keys" - ] + "const": "deny-get" }, { - "description": "allow-length -> Enables the length command without any pre-configured scope.", + "description": "Enables the get_store command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-length" - ] + "const": "allow-get-store" }, { - "description": "deny-length -> Denies the length command without any pre-configured scope.", + "description": "Denies the get_store command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-length" - ] + "const": "deny-get-store" }, { - "description": "allow-load -> Enables the load command without any pre-configured scope.", + "description": "Enables the has command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-load" - ] + "const": "allow-has" }, { - "description": "deny-load -> Denies the load command without any pre-configured scope.", + "description": "Denies the has command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-load" - ] + "const": "deny-has" }, { - "description": "allow-reset -> Enables the reset command without any pre-configured scope.", + "description": "Enables the keys command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-reset" - ] + "const": "allow-keys" }, { - "description": "deny-reset -> Denies the reset command without any pre-configured scope.", + "description": "Denies the keys command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-reset" - ] + "const": "deny-keys" }, { - "description": "allow-save -> Enables the save command without any pre-configured scope.", + "description": "Enables the length command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-save" - ] + "const": "allow-length" }, { - "description": "deny-save -> Denies the save command without any pre-configured scope.", + "description": "Denies the length command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-save" - ] + "const": "deny-length" }, { - "description": "allow-set -> Enables the set command without any pre-configured scope.", + "description": "Enables the load command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-set" - ] + "const": "allow-load" }, { - "description": "deny-set -> Denies the set command without any pre-configured scope.", + "description": "Denies the load command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-set" - ] + "const": "deny-load" }, { - "description": "allow-values -> Enables the values command without any pre-configured scope.", + "description": "Enables the reload command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-values" - ] + "const": "allow-reload" }, { - "description": "deny-values -> Denies the values command without any pre-configured scope.", + "description": "Denies the reload command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-values" - ] + "const": "deny-reload" + }, + { + "description": "Enables the reset command without any pre-configured scope.", + "type": "string", + "const": "allow-reset" + }, + { + "description": "Denies the reset command without any pre-configured scope.", + "type": "string", + "const": "deny-reset" + }, + { + "description": "Enables the save command without any pre-configured scope.", + "type": "string", + "const": "allow-save" + }, + { + "description": "Denies the save command without any pre-configured scope.", + "type": "string", + "const": "deny-save" + }, + { + "description": "Enables the set command without any pre-configured scope.", + "type": "string", + "const": "allow-set" + }, + { + "description": "Denies the set command without any pre-configured scope.", + "type": "string", + "const": "deny-set" + }, + { + "description": "Enables the values command without any pre-configured scope.", + "type": "string", + "const": "allow-values" + }, + { + "description": "Denies the values command without any pre-configured scope.", + "type": "string", + "const": "deny-values" + }, + { + "description": "This permission set configures what kind of\noperations are available from the store plugin.\n\n#### Granted Permissions\n\nAll operations are enabled by default.\n\n", + "type": "string", + "const": "default" } ] } diff --git a/plugins/store/rollup.config.js b/plugins/store/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/store/rollup.config.js +++ b/plugins/store/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/store/src/api-iife.js b/plugins/store/src/api-iife.js deleted file mode 100644 index 15eaf751..00000000 --- a/plugins/store/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_STORE__=function(t){"use strict";function a(t,a=!1){return window.__TAURI_INTERNALS__.transformCallback(t,a)}async function e(t,a={},e){return window.__TAURI_INTERNALS__.invoke(t,a,e)}var n;async function r(t,n,r){const i="string"==typeof r?.target?{kind:"AnyLabel",label:r.target}:r?.target??{kind:"Any"};return e("plugin:event|listen",{event:t,target:i,handler:a(n)}).then((a=>async()=>async function(t,a){await e("plugin:event|unlisten",{event:t,eventId:a})}(t,a)))}"function"==typeof SuppressedError&&SuppressedError,function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WEBVIEW_CREATED="tauri://webview-created",t.FILE_DROP="tauri://file-drop",t.FILE_DROP_HOVER="tauri://file-drop-hover",t.FILE_DROP_CANCELLED="tauri://file-drop-cancelled"}(n||(n={}));return t.Store=class{constructor(t){this.path=t}async set(t,a){return await e("plugin:store|set",{path:this.path,key:t,value:a})}async get(t){return await e("plugin:store|get",{path:this.path,key:t})}async has(t){return await e("plugin:store|has",{path:this.path,key:t})}async delete(t){return await e("plugin:store|delete",{path:this.path,key:t})}async clear(){return await e("plugin:store|clear",{path:this.path})}async reset(){return await e("plugin:store|reset",{path:this.path})}async keys(){return await e("plugin:store|keys",{path:this.path})}async values(){return await e("plugin:store|values",{path:this.path})}async entries(){return await e("plugin:store|entries",{path:this.path})}async length(){return await e("plugin:store|length",{path:this.path})}async load(){return await e("plugin:store|load",{path:this.path})}async save(){return await e("plugin:store|save",{path:this.path})}async onKeyChange(t,a){return await r("store://change",(e=>{e.payload.path===this.path&&e.payload.key===t&&a(e.payload.value)}))}async onChange(t){return await r("store://change",(a=>{a.payload.path===this.path&&t(a.payload.key,a.payload.value)}))}},t}({});Object.defineProperty(window.__TAURI__,"store",{value:__TAURI_PLUGIN_STORE__})} diff --git a/plugins/store/src/error.rs b/plugins/store/src/error.rs index 0a04bb09..ef5ee593 100644 --- a/plugins/store/src/error.rs +++ b/plugins/store/src/error.rs @@ -3,7 +3,8 @@ // SPDX-License-Identifier: MIT use serde::{Serialize, Serializer}; -use std::path::PathBuf; + +pub type Result = std::result::Result; /// The error types. #[derive(thiserror::Error, Debug)] @@ -19,9 +20,15 @@ pub enum Error { /// IO error. #[error(transparent)] Io(#[from] std::io::Error), - /// Store not found - #[error("Store \"{0}\" not found")] - NotFound(PathBuf), + // /// Store already exists + // #[error("Store at \"{0}\" already exists")] + // AlreadyExists(PathBuf), + /// Serialize function not found + #[error("Serialize Function \"{0}\" not found")] + SerializeFunctionNotFound(String), + /// Deserialize function not found + #[error("Deserialize Function \"{0}\" not found")] + DeserializeFunctionNotFound(String), /// Some Tauri API failed #[error(transparent)] Tauri(#[from] tauri::Error), diff --git a/plugins/store/src/lib.rs b/plugins/store/src/lib.rs index f76752f8..310e80ec 100644 --- a/plugins/store/src/lib.rs +++ b/plugins/store/src/lib.rs @@ -11,315 +11,431 @@ html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png" )] -pub use error::Error; -use log::warn; -use serde::Serialize; +pub use error::{Error, Result}; +use serde::{Deserialize, Serialize}; pub use serde_json::Value as JsonValue; use std::{ collections::HashMap, path::{Path, PathBuf}, - sync::Mutex, + sync::{Arc, Mutex}, + time::Duration, }; -pub use store::{Store, StoreBuilder}; +pub use store::{resolve_store_path, DeserializeFn, SerializeFn, Store, StoreBuilder}; use tauri::{ plugin::{self, TauriPlugin}, - AppHandle, Manager, RunEvent, Runtime, State, + AppHandle, Manager, ResourceId, RunEvent, Runtime, State, }; mod error; mod store; #[derive(Serialize, Clone)] +#[serde(rename_all = "camelCase")] struct ChangePayload<'a> { path: &'a Path, + resource_id: Option, key: &'a str, - value: &'a JsonValue, + value: Option<&'a JsonValue>, + exists: bool, } -#[derive(Default)] -pub struct StoreCollection { - stores: Mutex>>, - frozen: bool, +#[derive(Debug)] +struct StoreState { + stores: Arc>>, + serialize_fns: HashMap, + deserialize_fns: HashMap, + default_serialize: SerializeFn, + default_deserialize: DeserializeFn, } -pub fn with_store) -> Result>( +#[derive(Serialize, Deserialize)] +#[serde(untagged)] +enum AutoSave { + DebounceDuration(u64), + Bool(bool), +} + +fn builder( app: AppHandle, - collection: State<'_, StoreCollection>, - path: impl AsRef, - f: F, -) -> Result { - let mut stores = collection.stores.lock().expect("mutex poisoned"); - - let path = path.as_ref(); - if !stores.contains_key(path) { - if collection.frozen { - return Err(Error::NotFound(path.to_path_buf())); - } - let mut store = StoreBuilder::new(path).build(app); - // ignore loading errors, just use the default - if let Err(err) = store.load() { - warn!( - "Failed to load store {:?} from disk: {}. Falling back to default values.", - path, err - ); + store_state: State<'_, StoreState>, + path: PathBuf, + auto_save: Option, + serialize_fn_name: Option, + deserialize_fn_name: Option, + create_new: bool, +) -> Result> { + let mut builder = app.store_builder(path); + if let Some(auto_save) = auto_save { + match auto_save { + AutoSave::DebounceDuration(duration) => { + builder = builder.auto_save(Duration::from_millis(duration)); + } + AutoSave::Bool(false) => { + builder = builder.disable_auto_save(); + } + _ => {} } - stores.insert(path.to_path_buf(), store); } - f(stores - .get_mut(path) - .expect("failed to retrieve store. This is a bug!")) + if let Some(serialize_fn_name) = serialize_fn_name { + let serialize_fn = store_state + .serialize_fns + .get(&serialize_fn_name) + .ok_or_else(|| crate::Error::SerializeFunctionNotFound(serialize_fn_name))?; + builder = builder.serialize(*serialize_fn); + } + + if let Some(deserialize_fn_name) = deserialize_fn_name { + let deserialize_fn = store_state + .deserialize_fns + .get(&deserialize_fn_name) + .ok_or_else(|| crate::Error::DeserializeFunctionNotFound(deserialize_fn_name))?; + builder = builder.deserialize(*deserialize_fn); + } + + if create_new { + builder = builder.create_new(); + } + + Ok(builder) } #[tauri::command] -async fn set( +async fn load( app: AppHandle, - stores: State<'_, StoreCollection>, + store_state: State<'_, StoreState>, path: PathBuf, - key: String, - value: JsonValue, -) -> Result<(), Error> { - with_store(app, stores, path, |store| store.insert(key, value)) + auto_save: Option, + serialize_fn_name: Option, + deserialize_fn_name: Option, + create_new: Option, +) -> Result { + let builder = builder( + app, + store_state, + path, + auto_save, + serialize_fn_name, + deserialize_fn_name, + create_new.unwrap_or_default(), + )?; + let (_, rid) = builder.build_inner()?; + Ok(rid) } #[tauri::command] -async fn get( +async fn get_store( app: AppHandle, - stores: State<'_, StoreCollection>, + store_state: State<'_, StoreState>, path: PathBuf, - key: String, -) -> Result, Error> { - with_store(app, stores, path, |store| Ok(store.get(key).cloned())) +) -> Result> { + let stores = store_state.stores.lock().unwrap(); + Ok(stores.get(&resolve_store_path(&app, path)?).copied()) } #[tauri::command] -async fn has( +async fn set( app: AppHandle, - stores: State<'_, StoreCollection>, - path: PathBuf, + rid: ResourceId, key: String, -) -> Result { - with_store(app, stores, path, |store| Ok(store.has(key))) + value: JsonValue, +) -> Result<()> { + let store = app.resources_table().get::>(rid)?; + store.set(key, value); + Ok(()) } #[tauri::command] -async fn delete( +async fn get( app: AppHandle, - stores: State<'_, StoreCollection>, - path: PathBuf, + rid: ResourceId, key: String, -) -> Result { - with_store(app, stores, path, |store| store.delete(key)) +) -> Result<(Option, bool)> { + let store = app.resources_table().get::>(rid)?; + let value = store.get(key); + let exists = value.is_some(); + Ok((value, exists)) } #[tauri::command] -async fn clear( - app: AppHandle, - stores: State<'_, StoreCollection>, - path: PathBuf, -) -> Result<(), Error> { - with_store(app, stores, path, |store| store.clear()) +async fn has(app: AppHandle, rid: ResourceId, key: String) -> Result { + let store = app.resources_table().get::>(rid)?; + Ok(store.has(key)) } #[tauri::command] -async fn reset( - app: AppHandle, - collection: State<'_, StoreCollection>, - path: PathBuf, -) -> Result<(), Error> { - with_store(app, collection, path, |store| store.reset()) +async fn delete(app: AppHandle, rid: ResourceId, key: String) -> Result { + let store = app.resources_table().get::>(rid)?; + Ok(store.delete(key)) } #[tauri::command] -async fn keys( - app: AppHandle, - stores: State<'_, StoreCollection>, - path: PathBuf, -) -> Result, Error> { - with_store(app, stores, path, |store| { - Ok(store.keys().cloned().collect()) - }) +async fn clear(app: AppHandle, rid: ResourceId) -> Result<()> { + let store = app.resources_table().get::>(rid)?; + store.clear(); + Ok(()) } #[tauri::command] -async fn values( - app: AppHandle, - stores: State<'_, StoreCollection>, - path: PathBuf, -) -> Result, Error> { - with_store(app, stores, path, |store| { - Ok(store.values().cloned().collect()) - }) +async fn reset(app: AppHandle, rid: ResourceId) -> Result<()> { + let store = app.resources_table().get::>(rid)?; + store.reset(); + Ok(()) } #[tauri::command] -async fn entries( - app: AppHandle, - stores: State<'_, StoreCollection>, - path: PathBuf, -) -> Result, Error> { - with_store(app, stores, path, |store| { - Ok(store - .entries() - .map(|(k, v)| (k.to_owned(), v.to_owned())) - .collect()) - }) +async fn keys(app: AppHandle, rid: ResourceId) -> Result> { + let store = app.resources_table().get::>(rid)?; + Ok(store.keys()) } #[tauri::command] -async fn length( - app: AppHandle, - stores: State<'_, StoreCollection>, - path: PathBuf, -) -> Result { - with_store(app, stores, path, |store| Ok(store.len())) +async fn values(app: AppHandle, rid: ResourceId) -> Result> { + let store = app.resources_table().get::>(rid)?; + Ok(store.values()) } #[tauri::command] -async fn load( +async fn entries( app: AppHandle, - stores: State<'_, StoreCollection>, - path: PathBuf, -) -> Result<(), Error> { - with_store(app, stores, path, |store| store.load()) + rid: ResourceId, +) -> Result> { + let store = app.resources_table().get::>(rid)?; + Ok(store.entries()) } #[tauri::command] -async fn save( - app: AppHandle, - stores: State<'_, StoreCollection>, - path: PathBuf, -) -> Result<(), Error> { - with_store(app, stores, path, |store| store.save()) +async fn length(app: AppHandle, rid: ResourceId) -> Result { + let store = app.resources_table().get::>(rid)?; + Ok(store.length()) } -// #[derive(Default)] -pub struct Builder { - stores: HashMap>, - frozen: bool, +#[tauri::command] +async fn reload(app: AppHandle, rid: ResourceId) -> Result<()> { + let store = app.resources_table().get::>(rid)?; + store.reload() } -impl Default for Builder { - fn default() -> Self { - Self { - stores: Default::default(), - frozen: false, - } - } +#[tauri::command] +async fn save(app: AppHandle, rid: ResourceId) -> Result<()> { + let store = app.resources_table().get::>(rid)?; + store.save() } -impl Builder { - pub fn new() -> Self { - Self::default() - } - - /// Registers a store with the plugin. +pub trait StoreExt { + /// Create a store or load an existing store with default settings at the given path. + /// + /// If the store is already loaded, its instance is automatically returned. /// /// # Examples /// /// ``` - /// use tauri_plugin_store::{StoreBuilder, Builder}; + /// use tauri_plugin_store::StoreExt; /// /// tauri::Builder::default() + /// .plugin(tauri_plugin_store::Builder::default().build()) /// .setup(|app| { - /// let store = StoreBuilder::new("store.bin").build(app.handle().clone()); - /// let builder = Builder::default().store(store); + /// let store = app.store("my-store")?; /// Ok(()) /// }); /// ``` - pub fn store(mut self, store: Store) -> Self { - self.stores.insert(store.path.clone(), store); - self - } - - /// Registers multiple stores with the plugin. + fn store(&self, path: impl AsRef) -> Result>>; + /// Get a store builder. + /// + /// The builder can be used to configure the store. + /// To use the default settings see [`Self::store`]. /// /// # Examples /// /// ``` - /// use tauri_plugin_store::{StoreBuilder, Builder}; + /// use tauri_plugin_store::StoreExt; + /// use std::time::Duration; /// /// tauri::Builder::default() + /// .plugin(tauri_plugin_store::Builder::default().build()) /// .setup(|app| { - /// let store = StoreBuilder::new("store.bin").build(app.handle().clone()); - /// let builder = Builder::default().stores([store]); + /// let store = app.store_builder("users.json").auto_save(Duration::from_secs(1)).build()?; /// Ok(()) /// }); /// ``` - pub fn stores>>(mut self, stores: T) -> Self { - self.stores = stores - .into_iter() - .map(|store| (store.path.clone(), store)) - .collect(); - self - } - - /// Freezes the collection. + fn store_builder(&self, path: impl AsRef) -> StoreBuilder; + /// Get a handle of an already loaded store. + /// + /// If the store is not loaded or does not exist, it returns `None`. /// - /// This causes requests for plugins that haven't been registered to fail + /// Note that using this function can cause race conditions if you fallback to creating or loading the store, + /// so you should consider using [`Self::store`] if you are not sure if the store is loaded or not. /// /// # Examples /// /// ``` - /// use tauri_plugin_store::{StoreBuilder, Builder}; + /// use tauri_plugin_store::StoreExt; /// /// tauri::Builder::default() + /// .plugin(tauri_plugin_store::Builder::default().build()) /// .setup(|app| { - /// let store = StoreBuilder::new("store.bin").build(app.handle().clone()); - /// app.handle().plugin(Builder::default().freeze().build()); + /// let store = if let Some(s) = app.get_store("store.json") { + /// s + /// } else { + /// // this is not thread safe; if another thread is doing the same load/create, + /// // there will be a race condition; in this case we could remove the get_store + /// // and only run app.store() as it will return the existing store if it has been loaded + /// app.store("store.json")? + /// }; /// Ok(()) /// }); /// ``` - pub fn freeze(mut self) -> Self { - self.frozen = true; + fn get_store(&self, path: impl AsRef) -> Option>>; +} + +impl> StoreExt for T { + fn store(&self, path: impl AsRef) -> Result>> { + StoreBuilder::new(self.app_handle(), path).build() + } + + fn store_builder(&self, path: impl AsRef) -> StoreBuilder { + StoreBuilder::new(self.app_handle(), path) + } + + fn get_store(&self, path: impl AsRef) -> Option>> { + let collection = self.state::(); + let stores = collection.stores.lock().unwrap(); + stores + .get(&resolve_store_path(self.app_handle(), path.as_ref()).ok()?) + .and_then(|rid| self.resources_table().get(*rid).ok()) + } +} + +fn default_serialize( + cache: &HashMap, +) -> std::result::Result, Box> { + Ok(serde_json::to_vec_pretty(&cache)?) +} + +fn default_deserialize( + bytes: &[u8], +) -> std::result::Result, Box> { + serde_json::from_slice(bytes).map_err(Into::into) +} + +pub struct Builder { + serialize_fns: HashMap, + deserialize_fns: HashMap, + default_serialize: SerializeFn, + default_deserialize: DeserializeFn, +} + +impl Default for Builder { + fn default() -> Self { + Self { + serialize_fns: Default::default(), + deserialize_fns: Default::default(), + default_serialize, + default_deserialize, + } + } +} + +impl Builder { + pub fn new() -> Self { + Self::default() + } + + /// Register a serialize function to access it from the JavaScript side + /// + /// # Examples + /// + /// ``` + /// fn no_pretty_json( + /// cache: &std::collections::HashMap, + /// ) -> Result, Box> { + /// Ok(serde_json::to_vec(&cache)?) + /// } + /// + /// tauri::Builder::default() + /// .plugin( + /// tauri_plugin_store::Builder::default() + /// .register_serialize_fn("no-pretty-json".to_owned(), no_pretty_json) + /// .build(), + /// ); + /// ``` + pub fn register_serialize_fn(mut self, name: String, serialize_fn: SerializeFn) -> Self { + self.serialize_fns.insert(name, serialize_fn); self } - /// Builds the plugin. + /// Register a deserialize function to access it from the JavaScript side + pub fn register_deserialize_fn(mut self, name: String, deserialize_fn: DeserializeFn) -> Self { + self.deserialize_fns.insert(name, deserialize_fn); + self + } + + /// Use this serialize function for stores by default /// /// # Examples /// /// ``` - /// use tauri_plugin_store::{StoreBuilder, Builder}; + /// fn no_pretty_json( + /// cache: &std::collections::HashMap, + /// ) -> Result, Box> { + /// Ok(serde_json::to_vec(&cache)?) + /// } + /// + /// tauri::Builder::default() + /// .plugin( + /// tauri_plugin_store::Builder::default() + /// .default_serialize_fn(no_pretty_json) + /// .build(), + /// ); + /// ``` + pub fn default_serialize_fn(mut self, serialize_fn: SerializeFn) -> Self { + self.default_serialize = serialize_fn; + self + } + + /// Use this deserialize function for stores by default + pub fn default_deserialize_fn(mut self, deserialize_fn: DeserializeFn) -> Self { + self.default_deserialize = deserialize_fn; + self + } + + /// Builds the plugin. + /// + /// # Examples /// + /// ``` /// tauri::Builder::default() + /// .plugin(tauri_plugin_store::Builder::default().build()) /// .setup(|app| { - /// let store = StoreBuilder::new("store.bin").build(app.handle().clone()); - /// app.handle().plugin(Builder::default().build()); + /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.bin").build()?; /// Ok(()) /// }); /// ``` - pub fn build(mut self) -> TauriPlugin { + pub fn build(self) -> TauriPlugin { plugin::Builder::new("store") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![ - set, get, has, delete, clear, reset, keys, values, length, entries, load, save + load, get_store, set, get, has, delete, clear, reset, keys, values, length, + entries, reload, save, ]) .setup(move |app_handle, _api| { - for (path, store) in self.stores.iter_mut() { - // ignore loading errors, just use the default - if let Err(err) = store.load() { - warn!( - "Failed to load store {:?} from disk: {}. Falling back to default values.", - path, err - ); - } - } - - app_handle.manage(StoreCollection { - stores: Mutex::new(self.stores), - frozen: self.frozen, + app_handle.manage(StoreState { + stores: Arc::new(Mutex::new(HashMap::new())), + serialize_fns: self.serialize_fns, + deserialize_fns: self.deserialize_fns, + default_serialize: self.default_serialize, + default_deserialize: self.default_deserialize, }); - Ok(()) }) .on_event(|app_handle, event| { if let RunEvent::Exit = event { - let collection = app_handle.state::>(); - - for store in collection.stores.lock().expect("mutex poisoned").values() { - if let Err(err) = store.save() { - eprintln!("failed to save store {:?} with error {:?}", store.path, err); + let collection = app_handle.state::(); + let stores = collection.stores.lock().unwrap(); + for (path, rid) in stores.iter() { + if let Ok(store) = app_handle.resources_table().get::>(*rid) { + if let Err(err) = store.save() { + log::error!("failed to save store {path:?} with error {err:?}"); + } } } } diff --git a/plugins/store/src/store.rs b/plugins/store/src/store.rs index 1a7b6e1b..1dc5e1d2 100644 --- a/plugins/store/src/store.rs +++ b/plugins/store/src/store.rs @@ -2,62 +2,70 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use crate::{ChangePayload, Error}; +use crate::{ChangePayload, StoreState}; use serde_json::Value as JsonValue; use std::{ collections::HashMap, - fs::{create_dir_all, read, File}, - io::Write, + fs, path::{Path, PathBuf}, + sync::{Arc, Mutex}, + time::Duration, +}; +use tauri::{path::BaseDirectory, AppHandle, Emitter, Manager, Resource, ResourceId, Runtime}; +use tokio::{ + select, + sync::mpsc::{unbounded_channel, UnboundedSender}, + time::sleep, }; -use tauri::{AppHandle, Manager, Runtime}; -type SerializeFn = +pub type SerializeFn = fn(&HashMap) -> Result, Box>; -type DeserializeFn = +pub type DeserializeFn = fn(&[u8]) -> Result, Box>; -fn default_serialize( - cache: &HashMap, -) -> Result, Box> { - Ok(serde_json::to_vec(&cache)?) -} - -fn default_deserialize( - bytes: &[u8], -) -> Result, Box> { - serde_json::from_slice(bytes).map_err(Into::into) +pub fn resolve_store_path( + app: &AppHandle, + path: impl AsRef, +) -> crate::Result { + Ok(dunce::simplified(&app.path().resolve(path, BaseDirectory::AppData)?).to_path_buf()) } /// Builds a [`Store`] -pub struct StoreBuilder { +pub struct StoreBuilder { + app: AppHandle, path: PathBuf, defaults: Option>, - cache: HashMap, - serialize: SerializeFn, - deserialize: DeserializeFn, + serialize_fn: SerializeFn, + deserialize_fn: DeserializeFn, + auto_save: Option, + create_new: bool, } -impl StoreBuilder { +impl StoreBuilder { /// Creates a new [`StoreBuilder`]. /// /// # Examples /// ``` - /// # fn main() -> Result<(), Box> { - /// use tauri_plugin_store::StoreBuilder; - /// - /// let builder = StoreBuilder::new("store.bin"); - /// - /// # Ok(()) - /// # } + /// tauri::Builder::default() + /// .plugin(tauri_plugin_store::Builder::default().build()) + /// .setup(|app| { + /// let builder = tauri_plugin_store::StoreBuilder::new(app, "store.bin"); + /// Ok(()) + /// }); /// ``` - pub fn new>(path: P) -> Self { + pub fn new, P: AsRef>(manager: &M, path: P) -> Self { + let app = manager.app_handle().clone(); + let state = app.state::(); + let serialize_fn = state.default_serialize; + let deserialize_fn = state.default_deserialize; Self { + app, path: path.as_ref().to_path_buf(), defaults: None, - cache: Default::default(), - serialize: default_serialize, - deserialize: default_deserialize, + serialize_fn, + deserialize_fn, + auto_save: Some(Duration::from_millis(100)), + create_new: false, } } @@ -65,39 +73,39 @@ impl StoreBuilder { /// /// # Examples /// ``` - /// # fn main() -> Result<(), Box> { - /// use tauri_plugin_store::StoreBuilder; - /// use std::collections::HashMap; - /// - /// let mut defaults = HashMap::new(); - /// - /// defaults.insert("foo".to_string(), "bar".into()); - /// - /// let builder = StoreBuilder::new("store.bin") - /// .defaults(defaults); + /// tauri::Builder::default() + /// .plugin(tauri_plugin_store::Builder::default().build()) + /// .setup(|app| { + /// let mut defaults = std::collections::HashMap::new(); + /// defaults.insert("foo".to_string(), "bar".into()); /// - /// # Ok(()) - /// # } + /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.bin") + /// .defaults(defaults) + /// .build()?; + /// Ok(()) + /// }); + /// ``` pub fn defaults(mut self, defaults: HashMap) -> Self { - self.cache = defaults.clone(); self.defaults = Some(defaults); self } - /// Inserts multiple key-value pairs. + /// Inserts multiple default key-value pairs. /// /// # Examples /// ``` - /// # fn main() -> Result<(), Box> { - /// use tauri_plugin_store::StoreBuilder; - /// - /// let builder = StoreBuilder::new("store.bin") - /// .default("foo".to_string(), "bar".into()); - /// - /// # Ok(()) - /// # } - pub fn default(mut self, key: String, value: JsonValue) -> Self { - self.cache.insert(key.clone(), value.clone()); + /// tauri::Builder::default() + /// .plugin(tauri_plugin_store::Builder::default().build()) + /// .setup(|app| { + /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.bin") + /// .default("foo".to_string(), "bar") + /// .build()?; + /// Ok(()) + /// }); + /// ``` + pub fn default(mut self, key: impl Into, value: impl Into) -> Self { + let key = key.into(); + let value = value.into(); self.defaults .get_or_insert(HashMap::new()) .insert(key, value); @@ -108,16 +116,17 @@ impl StoreBuilder { /// /// # Examples /// ``` - /// # fn main() -> Result<(), Box> { - /// use tauri_plugin_store::StoreBuilder; - /// - /// let builder = StoreBuilder::new("store.json") - /// .serialize(|cache| serde_json::to_vec(&cache).map_err(Into::into)); - /// - /// # Ok(()) - /// # } + /// tauri::Builder::default() + /// .plugin(tauri_plugin_store::Builder::default().build()) + /// .setup(|app| { + /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.json") + /// .serialize(|cache| serde_json::to_vec(&cache).map_err(Into::into)) + /// .build()?; + /// Ok(()) + /// }); + /// ``` pub fn serialize(mut self, serialize: SerializeFn) -> Self { - self.serialize = serialize; + self.serialize_fn = serialize; self } @@ -125,192 +134,443 @@ impl StoreBuilder { /// /// # Examples /// ``` - /// # fn main() -> Result<(), Box> { - /// use tauri_plugin_store::StoreBuilder; - /// - /// let builder = StoreBuilder::new("store.json") - /// .deserialize(|bytes| serde_json::from_slice(&bytes).map_err(Into::into)); - /// - /// # Ok(()) - /// # } + /// tauri::Builder::default() + /// .plugin(tauri_plugin_store::Builder::default().build()) + /// .setup(|app| { + /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.json") + /// .deserialize(|bytes| serde_json::from_slice(&bytes).map_err(Into::into)) + /// .build()?; + /// Ok(()) + /// }); + /// ``` pub fn deserialize(mut self, deserialize: DeserializeFn) -> Self { - self.deserialize = deserialize; + self.deserialize_fn = deserialize; self } - /// Builds the [`Store`]. + /// Auto save on modified with a debounce duration /// /// # Examples /// ``` /// tauri::Builder::default() + /// .plugin(tauri_plugin_store::Builder::default().build()) /// .setup(|app| { - /// let store = tauri_plugin_store::StoreBuilder::new("store.json").build(app.handle().clone()); + /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.json") + /// .auto_save(std::time::Duration::from_millis(100)) + /// .build()?; /// Ok(()) /// }); /// ``` - pub fn build(self, app: AppHandle) -> Store { - Store { - app, - path: self.path, - defaults: self.defaults, - cache: self.cache, - serialize: self.serialize, - deserialize: self.deserialize, + pub fn auto_save(mut self, debounce_duration: Duration) -> Self { + self.auto_save = Some(debounce_duration); + self + } + + /// Disable auto save on modified with a debounce duration. + pub fn disable_auto_save(mut self) -> Self { + self.auto_save = None; + self + } + + /// Force create a new store with default values even if it already exists. + pub fn create_new(mut self) -> Self { + self.create_new = true; + self + } + + pub(crate) fn build_inner(mut self) -> crate::Result<(Arc>, ResourceId)> { + let stores = self.app.state::().stores.clone(); + let mut stores = stores.lock().unwrap(); + + self.path = resolve_store_path(&self.app, self.path)?; + + if self.create_new { + if let Some(rid) = stores.remove(&self.path) { + let _ = self.app.resources_table().take::>(rid); + } + } else if let Some(rid) = stores.get(&self.path) { + return Ok((self.app.resources_table().get(*rid).unwrap(), *rid)); + } + + // if stores.contains_key(&self.path) { + // return Err(crate::Error::AlreadyExists(self.path)); + // } + + let mut store_inner = StoreInner::new( + self.app.clone(), + self.path.clone(), + self.defaults.take(), + self.serialize_fn, + self.deserialize_fn, + ); + + if !self.create_new { + let _ = store_inner.load(); } + + let store = Store { + auto_save: self.auto_save, + auto_save_debounce_sender: Arc::new(Mutex::new(None)), + store: Arc::new(Mutex::new(store_inner)), + }; + + let store = Arc::new(store); + let rid = self.app.resources_table().add_arc(store.clone()); + stores.insert(self.path, rid); + + Ok((store, rid)) + } + + /// Load the existing store with the same path or creates a new [`Store`]. + /// + /// If a store with the same path has already been loaded its instance is returned. + /// + /// # Examples + /// ``` + /// tauri::Builder::default() + /// .plugin(tauri_plugin_store::Builder::default().build()) + /// .setup(|app| { + /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.json").build(); + /// Ok(()) + /// }); + /// ``` + pub fn build(self) -> crate::Result>> { + let (store, _) = self.build_inner()?; + Ok(store) } } +enum AutoSaveMessage { + Reset, + Cancel, +} + #[derive(Clone)] -pub struct Store { +struct StoreInner { app: AppHandle, - pub(crate) path: PathBuf, - defaults: Option>, + path: PathBuf, cache: HashMap, - serialize: SerializeFn, - deserialize: DeserializeFn, + defaults: Option>, + serialize_fn: SerializeFn, + deserialize_fn: DeserializeFn, } -impl Store { - /// Update the store from the on-disk state - pub fn load(&mut self) -> Result<(), Error> { - let app_dir = self - .app - .path() - .app_data_dir() - .expect("failed to resolve app dir"); - let store_path = app_dir.join(&self.path); +impl StoreInner { + fn new( + app: AppHandle, + path: PathBuf, + defaults: Option>, + serialize_fn: SerializeFn, + deserialize_fn: DeserializeFn, + ) -> Self { + Self { + app, + path, + cache: defaults.clone().unwrap_or_default(), + defaults, + serialize_fn, + deserialize_fn, + } + } - let bytes = read(store_path)?; + /// Saves the store to disk at the store's `path`. + pub fn save(&self) -> crate::Result<()> { + fs::create_dir_all(self.path.parent().expect("invalid store path"))?; - self.cache - .extend((self.deserialize)(&bytes).map_err(Error::Deserialize)?); + let bytes = (self.serialize_fn)(&self.cache).map_err(crate::Error::Serialize)?; + fs::write(&self.path, bytes)?; Ok(()) } - /// Saves the store to disk - pub fn save(&self) -> Result<(), Error> { - let app_dir = self - .app - .path() - .app_data_dir() - .expect("failed to resolve app dir"); - let store_path = app_dir.join(&self.path); - - create_dir_all(store_path.parent().expect("invalid store path"))?; + /// Update the store from the on-disk state + pub fn load(&mut self) -> crate::Result<()> { + let bytes = fs::read(&self.path)?; - let bytes = (self.serialize)(&self.cache).map_err(Error::Serialize)?; - let mut f = File::create(&store_path)?; - f.write_all(&bytes)?; + self.cache + .extend((self.deserialize_fn)(&bytes).map_err(crate::Error::Deserialize)?); Ok(()) } - pub fn insert(&mut self, key: String, value: JsonValue) -> Result<(), Error> { + /// Inserts a key-value pair into the store. + pub fn set(&mut self, key: impl Into, value: impl Into) { + let key = key.into(); + let value = value.into(); self.cache.insert(key.clone(), value.clone()); - self.app.emit( - "store://change", - ChangePayload { - path: &self.path, - key: &key, - value: &value, - }, - )?; - - Ok(()) + let _ = self.emit_change_event(&key, Some(&value)); } + /// Returns a reference to the value corresponding to the key. pub fn get(&self, key: impl AsRef) -> Option<&JsonValue> { self.cache.get(key.as_ref()) } + /// Returns `true` if the given `key` exists in the store. pub fn has(&self, key: impl AsRef) -> bool { self.cache.contains_key(key.as_ref()) } - pub fn delete(&mut self, key: impl AsRef) -> Result { + /// Removes a key-value pair from the store. + pub fn delete(&mut self, key: impl AsRef) -> bool { let flag = self.cache.remove(key.as_ref()).is_some(); if flag { - self.app.emit( - "store://change", - ChangePayload { - path: &self.path, - key: key.as_ref(), - value: &JsonValue::Null, - }, - )?; + let _ = self.emit_change_event(key.as_ref(), None); } - Ok(flag) + flag } - pub fn clear(&mut self) -> Result<(), Error> { + /// Clears the store, removing all key-value pairs. + /// + /// Note: To clear the storage and reset it to its `default` value, use [`reset`](Self::reset) instead. + pub fn clear(&mut self) { let keys: Vec = self.cache.keys().cloned().collect(); self.cache.clear(); - for key in keys { - self.app.emit( - "store://change", - ChangePayload { - path: &self.path, - key: &key, - value: &JsonValue::Null, - }, - )?; + for key in &keys { + let _ = self.emit_change_event(key, None); } - Ok(()) } - pub fn reset(&mut self) -> Result<(), Error> { - let has_defaults = self.defaults.is_some(); - - if has_defaults { - if let Some(defaults) = &self.defaults { - for (key, value) in &self.cache { - if defaults.get(key) != Some(value) { - let _ = self.app.emit( - "store://change", - ChangePayload { - path: &self.path, - key, - value: defaults.get(key).unwrap_or(&JsonValue::Null), - }, - ); - } + /// Resets the store to its `default` value. + /// + /// If no default value has been set, this method behaves identical to [`clear`](Self::clear). + pub fn reset(&mut self) { + if let Some(defaults) = &self.defaults { + for (key, value) in &self.cache { + if defaults.get(key) != Some(value) { + let _ = self.emit_change_event(key, defaults.get(key)); } - self.cache = defaults.clone(); } - Ok(()) + for (key, value) in defaults { + if !self.cache.contains_key(key) { + let _ = self.emit_change_event(key, Some(value)); + } + } + self.cache.clone_from(defaults); } else { self.clear() } } + /// An iterator visiting all keys in arbitrary order. pub fn keys(&self) -> impl Iterator { self.cache.keys() } + /// An iterator visiting all values in arbitrary order. pub fn values(&self) -> impl Iterator { self.cache.values() } + /// An iterator visiting all key-value pairs in arbitrary order. pub fn entries(&self) -> impl Iterator { self.cache.iter() } + /// Returns the number of elements in the store. pub fn len(&self) -> usize { self.cache.len() } + /// Returns true if the store contains no elements. pub fn is_empty(&self) -> bool { self.cache.is_empty() } + + fn emit_change_event(&self, key: &str, value: Option<&JsonValue>) -> crate::Result<()> { + let state = self.app.state::(); + let stores = state.stores.lock().unwrap(); + let exists = value.is_some(); + self.app.emit( + "store://change", + ChangePayload { + path: &self.path, + resource_id: stores.get(&self.path).copied(), + key, + value, + exists, + }, + )?; + Ok(()) + } } -impl std::fmt::Debug for Store { +impl std::fmt::Debug for StoreInner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("Store") .field("path", &self.path) - .field("defaults", &self.defaults) .field("cache", &self.cache) .finish() } } + +pub struct Store { + auto_save: Option, + auto_save_debounce_sender: Arc>>>, + store: Arc>>, +} + +impl Resource for Store { + fn close(self: Arc) { + let store = self.store.lock().unwrap(); + let state = store.app.state::(); + let mut stores = state.stores.lock().unwrap(); + stores.remove(&store.path); + } +} + +impl Store { + // /// Do something with the inner store, + // /// useful for batching some work if you need higher performance + // pub fn with_store(&self, f: impl FnOnce(&mut StoreInner) -> T) -> T { + // let mut store = self.store.lock().unwrap(); + // f(&mut store) + // } + + /// Inserts a key-value pair into the store. + pub fn set(&self, key: impl Into, value: impl Into) { + self.store.lock().unwrap().set(key.into(), value.into()); + let _ = self.trigger_auto_save(); + } + + /// Returns the value for the given `key` or `None` if the key does not exist. + pub fn get(&self, key: impl AsRef) -> Option { + self.store.lock().unwrap().get(key).cloned() + } + + /// Returns `true` if the given `key` exists in the store. + pub fn has(&self, key: impl AsRef) -> bool { + self.store.lock().unwrap().has(key) + } + + /// Removes a key-value pair from the store. + pub fn delete(&self, key: impl AsRef) -> bool { + let deleted = self.store.lock().unwrap().delete(key); + if deleted { + let _ = self.trigger_auto_save(); + } + deleted + } + + /// Clears the store, removing all key-value pairs. + /// + /// Note: To clear the storage and reset it to its `default` value, use [`reset`](Self::reset) instead. + pub fn clear(&self) { + self.store.lock().unwrap().clear(); + let _ = self.trigger_auto_save(); + } + + /// Resets the store to its `default` value. + /// + /// If no default value has been set, this method behaves identical to [`clear`](Self::clear). + pub fn reset(&self) { + self.store.lock().unwrap().reset(); + let _ = self.trigger_auto_save(); + } + + /// Returns a list of all keys in the store. + pub fn keys(&self) -> Vec { + self.store.lock().unwrap().keys().cloned().collect() + } + + /// Returns a list of all values in the store. + pub fn values(&self) -> Vec { + self.store.lock().unwrap().values().cloned().collect() + } + + /// Returns a list of all key-value pairs in the store. + pub fn entries(&self) -> Vec<(String, JsonValue)> { + self.store + .lock() + .unwrap() + .entries() + .map(|(k, v)| (k.to_owned(), v.to_owned())) + .collect() + } + + /// Returns the number of elements in the store. + pub fn length(&self) -> usize { + self.store.lock().unwrap().len() + } + + /// Returns true if the store contains no elements. + pub fn is_empty(&self) -> bool { + self.store.lock().unwrap().is_empty() + } + + /// Update the store from the on-disk state + pub fn reload(&self) -> crate::Result<()> { + self.store.lock().unwrap().load() + } + + /// Saves the store to disk at the store's `path`. + pub fn save(&self) -> crate::Result<()> { + if let Some(sender) = self.auto_save_debounce_sender.lock().unwrap().take() { + let _ = sender.send(AutoSaveMessage::Cancel); + } + self.store.lock().unwrap().save() + } + + /// Removes the store from the resource table + pub fn close_resource(&self) { + let store = self.store.lock().unwrap(); + let app = store.app.clone(); + let state = app.state::(); + let stores = state.stores.lock().unwrap(); + if let Some(rid) = stores.get(&store.path).copied() { + drop(store); + drop(stores); + let _ = app.resources_table().close(rid); + } + } + + fn trigger_auto_save(&self) -> crate::Result<()> { + let Some(auto_save_delay) = self.auto_save else { + return Ok(()); + }; + if auto_save_delay.is_zero() { + return self.save(); + } + let mut auto_save_debounce_sender = self.auto_save_debounce_sender.lock().unwrap(); + if let Some(ref sender) = *auto_save_debounce_sender { + let _ = sender.send(AutoSaveMessage::Reset); + return Ok(()); + } + let (sender, mut receiver) = unbounded_channel(); + auto_save_debounce_sender.replace(sender); + drop(auto_save_debounce_sender); + let store = self.store.clone(); + let auto_save_debounce_sender = self.auto_save_debounce_sender.clone(); + tauri::async_runtime::spawn(async move { + loop { + select! { + should_cancel = receiver.recv() => { + if matches!(should_cancel, Some(AutoSaveMessage::Cancel) | None) { + return; + } + } + _ = sleep(auto_save_delay) => { + auto_save_debounce_sender.lock().unwrap().take(); + let _ = store.lock().unwrap().save(); + return; + } + }; + } + }); + Ok(()) + } + + fn apply_pending_auto_save(&self) { + // Cancel and save if auto save is pending + if let Some(sender) = self.auto_save_debounce_sender.lock().unwrap().take() { + let _ = sender.send(AutoSaveMessage::Cancel); + let _ = self.save(); + }; + } +} + +impl Drop for Store { + fn drop(&mut self) { + self.apply_pending_auto_save(); + } +} diff --git a/plugins/stronghold/.gitignore b/plugins/stronghold/.gitignore deleted file mode 100644 index b512c09d..00000000 --- a/plugins/stronghold/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/plugins/stronghold/CHANGELOG.md b/plugins/stronghold/CHANGELOG.md index 32977003..1b292461 100644 --- a/plugins/stronghold/CHANGELOG.md +++ b/plugins/stronghold/CHANGELOG.md @@ -1,5 +1,54 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.8] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.7] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.6] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[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] + +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -42,4 +91,5 @@ - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/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! \`]\(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! + om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/stronghold/Cargo.toml b/plugins/stronghold/Cargo.toml index 8fb6f4a4..fbfdf47e 100644 --- a/plugins/stronghold/Cargo.toml +++ b/plugins/stronghold/Cargo.toml @@ -1,19 +1,27 @@ [package] name = "tauri-plugin-stronghold" -version = "2.0.0-beta.1" -description = "Store secrets and keys using the IOTA Stronghold encrypted database." +version = "2.0.1" +description = "Store secrets and keys using the IOTA Stronghold secret management engine." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-stronghold" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "full", notes = "" } +ios = { level = "full", notes = "" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -21,18 +29,18 @@ serde_json = { workspace = true } tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } -iota_stronghold = "1" +iota_stronghold = "2" iota-crypto = "0.23" hex = "0.4" -zeroize = { version = "1", features = [ "zeroize_derive" ] } -rust-argon2 = { version = "1", optional = true } +zeroize = { version = "1", features = ["zeroize_derive"] } +rust-argon2 = { version = "2", optional = true } rand_chacha = { version = "0.3.1", optional = true } -rand_core = { version = "0.6.4", features = [ "getrandom" ], optional = true } +rand_core = { version = "0.6.4", features = ["getrandom"], optional = true } [dev-dependencies] rand = "0.8" rusty-fork = "0.3" [features] -default = [ "kdf" ] -kdf = [ "dep:rust-argon2", "dep:rand_chacha", "dep:rand_core" ] +default = ["kdf"] +kdf = ["dep:rust-argon2", "dep:rand_chacha", "dep:rand_core"] diff --git a/plugins/stronghold/README.md b/plugins/stronghold/README.md index 0b293a2d..d885bf64 100644 --- a/plugins/stronghold/README.md +++ b/plugins/stronghold/README.md @@ -1,10 +1,18 @@ ![plugin-stronghold](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/stronghold/banner.png) -Store secrets and keys using the [IOTA Stronghold](https://github.com/iotaledger/stronghold.rs) encrypted database and secure runtime. +Store secrets and keys using the [IOTA Stronghold](https://github.com/iotaledger/stronghold.rs) secret management engine. + +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ✓ | +| iOS | ✓ | ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,14 +26,14 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-stronghold = "2.0.0-beta" +tauri-plugin-stronghold = "2.0.0" # alternatively with Git: tauri-plugin-stronghold = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` You can install the JavaScript Guest bindings using your preferred JavaScript package manager: -> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. +> Note: If your JavaScript package manager cannot install packages from git monorepos, you can still use the code by manually copying the [Guest bindings](./guest-js/index.ts) into your source files. ```sh pnpm add @tauri-apps/plugin-stronghold @@ -52,8 +60,25 @@ First you need to register the core plugin with Tauri: fn main() { tauri::Builder::default() .plugin(tauri_plugin_stronghold::Builder::new(|password| { - // TODO: hash the password here with e.g. argon2, blake2b or any other secure algorithm - todo!() + // Hash the password here with e.g. argon2, blake2b or any other secure algorithm + // Here is an example implementation using the `rust-argon2` crate for hashing the password + + use argon2::{hash_raw, Config, Variant, Version}; + + let config = Config { + lanes: 4, + mem_cost: 10_000, + time_cost: 10, + variant: Variant::Argon2id, + version: Version::Version13, + ..Default::default() + }; + + let salt = "your-salt".as_bytes(); + + let key = hash_raw(password.as_ref(), salt, &config).expect("failed to hash password"); + + key.to_vec() }) .build()) .run(tauri::generate_context!()) @@ -64,9 +89,57 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { Stronghold, Location } from "@tauri-apps/plugin-stronghold"; +import { Stronghold, Location, Client } from "tauri-plugin-stronghold-api"; +import { appDataDir } from "@tauri-apps/api/path"; + +const initStronghold = async () => { + const vaultPath = `${await appDataDir()}/vault.hold`; + + const vaultKey = "The key to the vault"; + + const stronghold = await Stronghold.load(vaultPath, vaultKey); + + let client: Client; + + const clientName = "name your client"; + + try { + client = await hold.loadClient(clientName); + } catch { + client = await hold.createClient(clientName); + } + + return { + stronghold, + client, + }; +}; + +const { stronghold, client } = await initStronghold(); + +const store = client.getStore(); + +const key = "my_key"; + +// Insert a record to the store + +const data = Array.from(new TextEncoder().encode("Hello, World!")); + +await store.insert(key, data); + +// Read a record from store + +const data = await store.get(key); + +const value = new TextDecoder().decode(new Uint8Array(data)); + +// Save your updates + +await stronghold.save(); + +// Remove a record from store -// TODO +await store.remove(key); ``` ## Contributing diff --git a/plugins/stronghold/SECURITY.md b/plugins/stronghold/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/stronghold/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/stronghold/api-iife.js b/plugins/stronghold/api-iife.js new file mode 100644 index 00000000..aabe9ed2 --- /dev/null +++ b/plugins/stronghold/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_STRONGHOLD__=function(t){"use strict";async function e(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}"function"==typeof SuppressedError&&SuppressedError;class r{constructor(t,e){this.type=t,this.payload=e}static generic(t,e){return new r("Generic",{vault:t,record:e})}static counter(t,e){return new r("Counter",{vault:t,counter:e})}}class n{constructor(t){this.procedureArgs=t}async generateSLIP10Seed(t,r){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"SLIP10Generate",payload:{output:t,sizeBytes:r}}}).then((t=>Uint8Array.from(t)))}async deriveSLIP10(t,r,n,a){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"SLIP10Derive",payload:{chain:t,input:{type:r,payload:n},output:a}}}).then((t=>Uint8Array.from(t)))}async recoverBIP39(t,r,n){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"BIP39Recover",payload:{mnemonic:t,passphrase:n,output:r}}}).then((t=>Uint8Array.from(t)))}async generateBIP39(t,r){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"BIP39Generate",payload:{output:t,passphrase:r}}}).then((t=>Uint8Array.from(t)))}async getEd25519PublicKey(t){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"PublicKey",payload:{type:"Ed25519",privateKey:t}}}).then((t=>Uint8Array.from(t)))}async signEd25519(t,r){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"Ed25519Sign",payload:{privateKey:t,msg:r}}}).then((t=>Uint8Array.from(t)))}}class a{constructor(t,e){this.path=t,this.name=e}getVault(t){return new o(this.path,this.name,t)}getStore(){return new s(this.path,this.name)}}class s{constructor(t,e){this.path=t,this.client=e}async get(t){return await e("plugin:stronghold|get_store_record",{snapshotPath:this.path,client:this.client,key:t}).then((t=>t&&Uint8Array.from(t)))}async insert(t,r,n){await e("plugin:stronghold|save_store_record",{snapshotPath:this.path,client:this.client,key:t,value:r,lifetime:n})}async remove(t){return await e("plugin:stronghold|remove_store_record",{snapshotPath:this.path,client:this.client,key:t}).then((t=>t&&Uint8Array.from(t)))}}class o extends n{constructor(t,e,r){super({snapshotPath:t,client:e,vault:r}),this.path=t,this.client=e,this.name=r}async insert(t,r){await e("plugin:stronghold|save_secret",{snapshotPath:this.path,client:this.client,vault:this.name,recordPath:t,secret:r})}async remove(t){await e("plugin:stronghold|remove_secret",{snapshotPath:this.path,client:this.client,vault:this.name,recordPath:t.payload.record})}}class i{constructor(t){this.path=t}static async load(t,r){return await e("plugin:stronghold|initialize",{snapshotPath:t,password:r}).then((()=>new i(t)))}async unload(){await e("plugin:stronghold|destroy",{snapshotPath:this.path})}async loadClient(t){return await e("plugin:stronghold|load_client",{snapshotPath:this.path,client:t}).then((()=>new a(this.path,t)))}async createClient(t){return await e("plugin:stronghold|create_client",{snapshotPath:this.path,client:t}).then((()=>new a(this.path,t)))}async save(){await e("plugin:stronghold|save",{snapshotPath:this.path})}}return t.Client=a,t.Location=r,t.Store=s,t.Stronghold=i,t.Vault=o,t}({});Object.defineProperty(window.__TAURI__,"stronghold",{value:__TAURI_PLUGIN_STRONGHOLD__})} diff --git a/plugins/stronghold/build.rs b/plugins/stronghold/build.rs index 05404a1b..e9550e25 100644 --- a/plugins/stronghold/build.rs +++ b/plugins/stronghold/build.rs @@ -17,5 +17,7 @@ const COMMANDS: &[&str] = &[ ]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/stronghold/guest-js/index.ts b/plugins/stronghold/guest-js/index.ts index bf39420b..c1945a21 100644 --- a/plugins/stronghold/guest-js/index.ts +++ b/plugins/stronghold/guest-js/index.ts @@ -2,122 +2,112 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { invoke } from "@tauri-apps/api/core"; +import { invoke } from '@tauri-apps/api/core' -type BytesDto = string | number[]; export type ClientPath = | string | Iterable | ArrayLike - | ArrayBuffer; + | ArrayBuffer export type VaultPath = | string | Iterable | ArrayLike - | ArrayBuffer; + | ArrayBuffer export type RecordPath = | string | Iterable | ArrayLike - | ArrayBuffer; + | ArrayBuffer export type StoreKey = | string | Iterable | ArrayLike - | ArrayBuffer; - -function toBytesDto( - v: ClientPath | VaultPath | RecordPath | StoreKey, -): string | number[] { - if (typeof v === "string") { - return v; - } - return Array.from(v instanceof ArrayBuffer ? new Uint8Array(v) : v); -} + | ArrayBuffer export interface ConnectionLimits { - maxPendingIncoming?: number; - maxPendingOutgoing?: number; - maxEstablishedIncoming?: number; - maxEstablishedOutgoing?: number; - maxEstablishedPerPeer?: number; - maxEstablishedTotal?: number; + maxPendingIncoming?: number + maxPendingOutgoing?: number + maxEstablishedIncoming?: number + maxEstablishedOutgoing?: number + maxEstablishedPerPeer?: number + maxEstablishedTotal?: number } export interface PeerAddress { - known: string[]; // multiaddr - use_relay_fallback: boolean; + known: string[] // multiaddr + use_relay_fallback: boolean } export interface AddressInfo { - peers: Map; - relays: string[]; // peers + peers: Map + relays: string[] // peers } export interface ClientAccess { - useVaultDefault?: boolean; - useVaultExceptions?: Map; - writeVaultDefault?: boolean; - writeVaultExceptions?: Map; - cloneVaultDefault?: boolean; - cloneVaultExceptions?: Map; - readStore?: boolean; - writeStore?: boolean; + useVaultDefault?: boolean + useVaultExceptions?: Map + writeVaultDefault?: boolean + writeVaultExceptions?: Map + cloneVaultDefault?: boolean + cloneVaultExceptions?: Map + readStore?: boolean + writeStore?: boolean } export interface Permissions { - default?: ClientAccess; - exceptions?: Map; + default?: ClientAccess + exceptions?: Map } export interface NetworkConfig { - requestTimeout?: Duration; - connectionTimeout?: Duration; - connectionsLimit?: ConnectionLimits; - enableMdns?: boolean; - enableRelay?: boolean; - addresses?: AddressInfo; - peerPermissions?: Map; - permissionsDefault?: Permissions; + requestTimeout?: Duration + connectionTimeout?: Duration + connectionsLimit?: ConnectionLimits + enableMdns?: boolean + enableRelay?: boolean + addresses?: AddressInfo + peerPermissions?: Map + permissionsDefault?: Permissions } /** A duration definition. */ export interface Duration { /** The number of whole seconds contained by this Duration. */ - secs: number; - /** The fractional part of this Duration, in nanoseconds. Must be greater or equal to 0 and smaller than 1e+9 (the max number of nanoseoncds in a second)*/ - nanos: number; + secs: number + /** The fractional part of this Duration, in nanoseconds. Must be greater or equal to 0 and smaller than 1e+9 (the max number of nanoseoncds in a second) */ + nanos: number } export class Location { - type: string; - payload: Record; + type: string + payload: Record constructor(type: string, payload: Record) { - this.type = type; - this.payload = payload; + this.type = type + this.payload = payload } static generic(vault: VaultPath, record: RecordPath): Location { - return new Location("Generic", { - vault: toBytesDto(vault), - record: toBytesDto(record), - }); + return new Location('Generic', { + vault, + record + }) } static counter(vault: VaultPath, counter: number): Location { - return new Location("Counter", { - vault: toBytesDto(vault), - counter, - }); + return new Location('Counter', { + vault, + counter + }) } } class ProcedureExecutor { - procedureArgs: Record; + procedureArgs: Record constructor(procedureArgs: Record) { - this.procedureArgs = procedureArgs; + this.procedureArgs = procedureArgs } /** @@ -129,18 +119,18 @@ class ProcedureExecutor { */ async generateSLIP10Seed( outputLocation: Location, - sizeBytes?: number, + sizeBytes?: number ): Promise { - return await invoke("plugin:stronghold|execute_procedure", { + return await invoke('plugin:stronghold|execute_procedure', { ...this.procedureArgs, procedure: { - type: "SLIP10Generate", + type: 'SLIP10Generate', payload: { output: outputLocation, - sizeBytes, - }, - }, - }).then((n) => Uint8Array.from(n)); + sizeBytes + } + } + }).then((n) => Uint8Array.from(n)) } /** @@ -154,24 +144,24 @@ class ProcedureExecutor { */ async deriveSLIP10( chain: number[], - source: "Seed" | "Key", + source: 'Seed' | 'Key', sourceLocation: Location, - outputLocation: Location, + outputLocation: Location ): Promise { - return await invoke("plugin:stronghold|execute_procedure", { + return await invoke('plugin:stronghold|execute_procedure', { ...this.procedureArgs, procedure: { - type: "SLIP10Derive", + type: 'SLIP10Derive', payload: { chain, input: { type: source, - payload: sourceLocation, + payload: sourceLocation }, - output: outputLocation, - }, - }, - }).then((n) => Uint8Array.from(n)); + output: outputLocation + } + } + }).then((n) => Uint8Array.from(n)) } /** @@ -185,19 +175,19 @@ class ProcedureExecutor { async recoverBIP39( mnemonic: string, outputLocation: Location, - passphrase?: string, + passphrase?: string ): Promise { - return await invoke("plugin:stronghold|execute_procedure", { + return await invoke('plugin:stronghold|execute_procedure', { ...this.procedureArgs, procedure: { - type: "BIP39Recover", + type: 'BIP39Recover', payload: { mnemonic, passphrase, - output: outputLocation, - }, - }, - }).then((n) => Uint8Array.from(n)); + output: outputLocation + } + } + }).then((n) => Uint8Array.from(n)) } /** @@ -209,18 +199,18 @@ class ProcedureExecutor { */ async generateBIP39( outputLocation: Location, - passphrase?: string, + passphrase?: string ): Promise { - return await invoke("plugin:stronghold|execute_procedure", { + return await invoke('plugin:stronghold|execute_procedure', { ...this.procedureArgs, procedure: { - type: "BIP39Generate", + type: 'BIP39Generate', payload: { output: outputLocation, - passphrase, - }, - }, - }).then((n) => Uint8Array.from(n)); + passphrase + } + } + }).then((n) => Uint8Array.from(n)) } /** @@ -231,16 +221,16 @@ class ProcedureExecutor { * @since 2.0.0 */ async getEd25519PublicKey(privateKeyLocation: Location): Promise { - return await invoke("plugin:stronghold|execute_procedure", { + return await invoke('plugin:stronghold|execute_procedure', { ...this.procedureArgs, procedure: { - type: "PublicKey", + type: 'PublicKey', payload: { - type: "Ed25519", - privateKey: privateKeyLocation, - }, - }, - }).then((n) => Uint8Array.from(n)); + type: 'Ed25519', + privateKey: privateKeyLocation + } + } + }).then((n) => Uint8Array.from(n)) } /** @@ -253,28 +243,28 @@ class ProcedureExecutor { */ async signEd25519( privateKeyLocation: Location, - msg: string, + msg: string ): Promise { - return await invoke("plugin:stronghold|execute_procedure", { + return await invoke('plugin:stronghold|execute_procedure', { ...this.procedureArgs, procedure: { - type: "Ed25519Sign", + type: 'Ed25519Sign', payload: { privateKey: privateKeyLocation, - msg, - }, - }, - }).then((n) => Uint8Array.from(n)); + msg + } + } + }).then((n) => Uint8Array.from(n)) } } export class Client { - path: string; - name: BytesDto; + path: string + name: ClientPath constructor(path: string, name: ClientPath) { - this.path = path; - this.name = toBytesDto(name); + this.path = path + this.name = name } /** @@ -284,54 +274,54 @@ export class Client { * @returns */ getVault(name: VaultPath): Vault { - return new Vault(this.path, this.name, toBytesDto(name)); + return new Vault(this.path, this.name, name) } getStore(): Store { - return new Store(this.path, this.name); + return new Store(this.path, this.name) } } export class Store { - path: string; - client: BytesDto; + path: string + client: ClientPath - constructor(path: string, client: BytesDto) { - this.path = path; - this.client = client; + constructor(path: string, client: ClientPath) { + this.path = path + this.client = client } async get(key: StoreKey): Promise { - return await invoke("plugin:stronghold|get_store_record", { + return await invoke('plugin:stronghold|get_store_record', { snapshotPath: this.path, client: this.client, - key: toBytesDto(key), - }).then((v) => (v != null ? Uint8Array.from(v) : null)); + key + }).then((v) => v && Uint8Array.from(v)) } async insert( key: StoreKey, value: number[], - lifetime?: Duration, + lifetime?: Duration ): Promise { - return await invoke("plugin:stronghold|save_store_record", { + await invoke('plugin:stronghold|save_store_record', { snapshotPath: this.path, client: this.client, - key: toBytesDto(key), + key, value, - lifetime, - }); + lifetime + }) } async remove(key: StoreKey): Promise { return await invoke( - "plugin:stronghold|remove_store_record", + 'plugin:stronghold|remove_store_record', { snapshotPath: this.path, client: this.client, - key: toBytesDto(key), - }, - ).then((v) => (v != null ? Uint8Array.from(v) : null)); + key + } + ).then((v) => v && Uint8Array.from(v)) } } @@ -342,20 +332,20 @@ export class Store { */ export class Vault extends ProcedureExecutor { /** The vault path. */ - path: string; - client: BytesDto; + path: string + client: ClientPath /** The vault name. */ - name: BytesDto; + name: VaultPath constructor(path: string, client: ClientPath, name: VaultPath) { super({ snapshotPath: path, client, - vault: name, - }); - this.path = path; - this.client = toBytesDto(client); - this.name = toBytesDto(name); + vault: name + }) + this.path = path + this.client = client + this.name = name } /** @@ -366,13 +356,13 @@ export class Vault extends ProcedureExecutor { * @returns */ async insert(recordPath: RecordPath, secret: number[]): Promise { - return await invoke("plugin:stronghold|save_secret", { + await invoke('plugin:stronghold|save_secret', { snapshotPath: this.path, client: this.client, vault: this.name, - recordPath: toBytesDto(recordPath), - secret, - }); + recordPath, + secret + }) } /** @@ -382,12 +372,12 @@ export class Vault extends ProcedureExecutor { * @returns */ async remove(location: Location): Promise { - return await invoke("plugin:stronghold|remove_secret", { + await invoke('plugin:stronghold|remove_secret', { snapshotPath: this.path, client: this.client, vault: this.name, - recordPath: location.payload.record, - }); + recordPath: location.payload.record + }) } } @@ -395,7 +385,7 @@ export class Vault extends ProcedureExecutor { * A representation of an access to a stronghold. */ export class Stronghold { - path: string; + path: string /** * Initializes a stronghold. @@ -404,7 +394,7 @@ export class Stronghold { * @param password */ private constructor(path: string) { - this.path = path; + this.path = path } /** @@ -413,33 +403,33 @@ export class Stronghold { * @returns */ static async load(path: string, password: string): Promise { - return await invoke("plugin:stronghold|initialize", { + return await invoke('plugin:stronghold|initialize', { snapshotPath: path, - password, - }).then(() => new Stronghold(path)); + password + }).then(() => new Stronghold(path)) } /** * Remove this instance from the cache. */ async unload(): Promise { - return await invoke("plugin:stronghold|destroy", { - snapshotPath: this.path, - }); + await invoke('plugin:stronghold|destroy', { + snapshotPath: this.path + }) } async loadClient(client: ClientPath): Promise { - return await invoke("plugin:stronghold|load_client", { + return await invoke('plugin:stronghold|load_client', { snapshotPath: this.path, - client: toBytesDto(client), - }).then(() => new Client(this.path, client)); + client + }).then(() => new Client(this.path, client)) } async createClient(client: ClientPath): Promise { - return await invoke("plugin:stronghold|create_client", { + return await invoke('plugin:stronghold|create_client', { snapshotPath: this.path, - client: toBytesDto(client), - }).then(() => new Client(this.path, client)); + client + }).then(() => new Client(this.path, client)) } /** @@ -447,8 +437,8 @@ export class Stronghold { * @returns */ async save(): Promise { - return await invoke("plugin:stronghold|save", { - snapshotPath: this.path, - }); + await invoke('plugin:stronghold|save', { + snapshotPath: this.path + }) } } diff --git a/plugins/stronghold/package.json b/plugins/stronghold/package.json index 9f519ace..cbefad53 100644 --- a/plugins/stronghold/package.json +++ b/plugins/stronghold/package.json @@ -1,11 +1,12 @@ { "name": "@tauri-apps/plugin-stronghold", - "version": "2.0.0-beta.1", + "version": "2.0.0", "description": "Store secrets and keys using the IOTA Stronghold encrypted database.", - "license": "MIT or APACHE-2.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -24,6 +25,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/stronghold/permissions/autogenerated/reference.md b/plugins/stronghold/permissions/autogenerated/reference.md index 799ae7db..c07dc283 100644 --- a/plugins/stronghold/permissions/autogenerated/reference.md +++ b/plugins/stronghold/permissions/autogenerated/reference.md @@ -1,90 +1,315 @@ -# Permissions +## Default Permission -## allow-create-client +This permission set configures what kind of +operations are available from the stronghold plugin. + +#### Granted Permissions + +All non-destructive operations are enabled by default. + + + +- `allow-create-client` +- `allow-get-store-record` +- `allow-initialize` +- `allow-execute-procedure` +- `allow-load-client` +- `allow-save-secret` +- `allow-save-store-record` +- `allow-save` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`stronghold:allow-create-client` + + Enables the create_client command without any pre-configured scope. -## deny-create-client +
+ +`stronghold:deny-create-client` + + Denies the create_client command without any pre-configured scope. -## allow-destroy +
+ +`stronghold:allow-destroy` + + Enables the destroy command without any pre-configured scope. -## deny-destroy +
+ +`stronghold:deny-destroy` + + Denies the destroy command without any pre-configured scope. -## allow-execute-procedure +
+ +`stronghold:allow-execute-procedure` + + Enables the execute_procedure command without any pre-configured scope. -## deny-execute-procedure +
+ +`stronghold:deny-execute-procedure` + + Denies the execute_procedure command without any pre-configured scope. -## allow-get-store-record +
+ +`stronghold:allow-get-store-record` + + Enables the get_store_record command without any pre-configured scope. -## deny-get-store-record +
+ +`stronghold:deny-get-store-record` + + Denies the get_store_record command without any pre-configured scope. -## allow-initialize +
+ +`stronghold:allow-initialize` + + Enables the initialize command without any pre-configured scope. -## deny-initialize +
+ +`stronghold:deny-initialize` + + Denies the initialize command without any pre-configured scope. -## allow-load-client +
+ +`stronghold:allow-load-client` + + Enables the load_client command without any pre-configured scope. -## deny-load-client +
+ +`stronghold:deny-load-client` + + Denies the load_client command without any pre-configured scope. -## allow-remove-secret +
+ +`stronghold:allow-remove-secret` + + Enables the remove_secret command without any pre-configured scope. -## deny-remove-secret +
+ +`stronghold:deny-remove-secret` + + Denies the remove_secret command without any pre-configured scope. -## allow-remove-store-record +
+ +`stronghold:allow-remove-store-record` + + Enables the remove_store_record command without any pre-configured scope. -## deny-remove-store-record +
+ +`stronghold:deny-remove-store-record` + + Denies the remove_store_record command without any pre-configured scope. -## allow-save +
+ +`stronghold:allow-save` + + Enables the save command without any pre-configured scope. -## deny-save +
+ +`stronghold:deny-save` + + Denies the save command without any pre-configured scope. -## allow-save-secret +
+ +`stronghold:allow-save-secret` + + Enables the save_secret command without any pre-configured scope. -## deny-save-secret +
+ +`stronghold:deny-save-secret` + + Denies the save_secret command without any pre-configured scope. -## allow-save-store-record +
+ +`stronghold:allow-save-store-record` + + Enables the save_store_record command without any pre-configured scope. -## deny-save-store-record +
+ +`stronghold:deny-save-store-record` + + Denies the save_store_record command without any pre-configured scope. +
diff --git a/plugins/stronghold/permissions/default.toml b/plugins/stronghold/permissions/default.toml new file mode 100644 index 00000000..c157fe7e --- /dev/null +++ b/plugins/stronghold/permissions/default.toml @@ -0,0 +1,22 @@ +"$schema" = "schemas/schema.json" + +[default] +description = """ +This permission set configures what kind of +operations are available from the stronghold plugin. + +#### Granted Permissions + +All non-destructive operations are enabled by default. + +""" +permissions = [ + "allow-create-client", + "allow-get-store-record", + "allow-initialize", + "allow-execute-procedure", + "allow-load-client", + "allow-save-secret", + "allow-save-store-record", + "allow-save", +] diff --git a/plugins/stronghold/permissions/schemas/schema.json b/plugins/stronghold/permissions/schemas/schema.json index 0efa8ac5..5657e9bb 100644 --- a/plugins/stronghold/permissions/schemas/schema.json +++ b/plugins/stronghold/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,162 +251,163 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-create-client -> Enables the create_client command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-create-client" + "macOS" ] }, { - "description": "deny-create-client -> Denies the create_client command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-create-client" + "windows" ] }, { - "description": "allow-destroy -> Enables the destroy command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-destroy" + "linux" ] }, { - "description": "deny-destroy -> Denies the destroy command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-destroy" + "android" ] }, { - "description": "allow-execute-procedure -> Enables the execute_procedure command without any pre-configured scope.", + "description": "iOS.", "type": "string", "enum": [ - "allow-execute-procedure" + "iOS" ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the create_client command without any pre-configured scope.", + "type": "string", + "const": "allow-create-client" }, { - "description": "deny-execute-procedure -> Denies the execute_procedure command without any pre-configured scope.", + "description": "Denies the create_client command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-execute-procedure" - ] + "const": "deny-create-client" }, { - "description": "allow-get-store-record -> Enables the get_store_record command without any pre-configured scope.", + "description": "Enables the destroy command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-get-store-record" - ] + "const": "allow-destroy" }, { - "description": "deny-get-store-record -> Denies the get_store_record command without any pre-configured scope.", + "description": "Denies the destroy command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-get-store-record" - ] + "const": "deny-destroy" }, { - "description": "allow-initialize -> Enables the initialize command without any pre-configured scope.", + "description": "Enables the execute_procedure command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-initialize" - ] + "const": "allow-execute-procedure" }, { - "description": "deny-initialize -> Denies the initialize command without any pre-configured scope.", + "description": "Denies the execute_procedure command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-initialize" - ] + "const": "deny-execute-procedure" }, { - "description": "allow-load-client -> Enables the load_client command without any pre-configured scope.", + "description": "Enables the get_store_record command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-load-client" - ] + "const": "allow-get-store-record" }, { - "description": "deny-load-client -> Denies the load_client command without any pre-configured scope.", + "description": "Denies the get_store_record command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-load-client" - ] + "const": "deny-get-store-record" }, { - "description": "allow-remove-secret -> Enables the remove_secret command without any pre-configured scope.", + "description": "Enables the initialize command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-remove-secret" - ] + "const": "allow-initialize" }, { - "description": "deny-remove-secret -> Denies the remove_secret command without any pre-configured scope.", + "description": "Denies the initialize command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-remove-secret" - ] + "const": "deny-initialize" }, { - "description": "allow-remove-store-record -> Enables the remove_store_record command without any pre-configured scope.", + "description": "Enables the load_client command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-remove-store-record" - ] + "const": "allow-load-client" }, { - "description": "deny-remove-store-record -> Denies the remove_store_record command without any pre-configured scope.", + "description": "Denies the load_client command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-remove-store-record" - ] + "const": "deny-load-client" }, { - "description": "allow-save -> Enables the save command without any pre-configured scope.", + "description": "Enables the remove_secret command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-save" - ] + "const": "allow-remove-secret" }, { - "description": "deny-save -> Denies the save command without any pre-configured scope.", + "description": "Denies the remove_secret command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-save" - ] + "const": "deny-remove-secret" }, { - "description": "allow-save-secret -> Enables the save_secret command without any pre-configured scope.", + "description": "Enables the remove_store_record command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-save-secret" - ] + "const": "allow-remove-store-record" }, { - "description": "deny-save-secret -> Denies the save_secret command without any pre-configured scope.", + "description": "Denies the remove_store_record command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-save-secret" - ] + "const": "deny-remove-store-record" }, { - "description": "allow-save-store-record -> Enables the save_store_record command without any pre-configured scope.", + "description": "Enables the save command without any pre-configured scope.", "type": "string", - "enum": [ - "allow-save-store-record" - ] + "const": "allow-save" }, { - "description": "deny-save-store-record -> Denies the save_store_record command without any pre-configured scope.", + "description": "Denies the save command without any pre-configured scope.", "type": "string", - "enum": [ - "deny-save-store-record" - ] + "const": "deny-save" + }, + { + "description": "Enables the save_secret command without any pre-configured scope.", + "type": "string", + "const": "allow-save-secret" + }, + { + "description": "Denies the save_secret command without any pre-configured scope.", + "type": "string", + "const": "deny-save-secret" + }, + { + "description": "Enables the save_store_record command without any pre-configured scope.", + "type": "string", + "const": "allow-save-store-record" + }, + { + "description": "Denies the save_store_record command without any pre-configured scope.", + "type": "string", + "const": "deny-save-store-record" + }, + { + "description": "This permission set configures what kind of\noperations are available from the stronghold plugin.\n\n#### Granted Permissions\n\nAll non-destructive operations are enabled by default.\n\n", + "type": "string", + "const": "default" } ] } diff --git a/plugins/stronghold/rollup.config.js b/plugins/stronghold/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/stronghold/rollup.config.js +++ b/plugins/stronghold/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/stronghold/src/api-iife.js b/plugins/stronghold/src/api-iife.js deleted file mode 100644 index b8f95ec4..00000000 --- a/plugins/stronghold/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_STRONGHOLD__=function(t){"use strict";async function e(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}function r(t){return"string"==typeof t?t:Array.from(t instanceof ArrayBuffer?new Uint8Array(t):t)}"function"==typeof SuppressedError&&SuppressedError;class n{constructor(t,e){this.type=t,this.payload=e}static generic(t,e){return new n("Generic",{vault:r(t),record:r(e)})}static counter(t,e){return new n("Counter",{vault:r(t),counter:e})}}class a{constructor(t){this.procedureArgs=t}async generateSLIP10Seed(t,r){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"SLIP10Generate",payload:{output:t,sizeBytes:r}}}).then((t=>Uint8Array.from(t)))}async deriveSLIP10(t,r,n,a){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"SLIP10Derive",payload:{chain:t,input:{type:r,payload:n},output:a}}}).then((t=>Uint8Array.from(t)))}async recoverBIP39(t,r,n){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"BIP39Recover",payload:{mnemonic:t,passphrase:n,output:r}}}).then((t=>Uint8Array.from(t)))}async generateBIP39(t,r){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"BIP39Generate",payload:{output:t,passphrase:r}}}).then((t=>Uint8Array.from(t)))}async getEd25519PublicKey(t){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"PublicKey",payload:{type:"Ed25519",privateKey:t}}}).then((t=>Uint8Array.from(t)))}async signEd25519(t,r){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"Ed25519Sign",payload:{privateKey:t,msg:r}}}).then((t=>Uint8Array.from(t)))}}class s{constructor(t,e){this.path=t,this.name=r(e)}getVault(t){return new i(this.path,this.name,r(t))}getStore(){return new o(this.path,this.name)}}class o{constructor(t,e){this.path=t,this.client=e}async get(t){return await e("plugin:stronghold|get_store_record",{snapshotPath:this.path,client:this.client,key:r(t)}).then((t=>null!=t?Uint8Array.from(t):null))}async insert(t,n,a){return await e("plugin:stronghold|save_store_record",{snapshotPath:this.path,client:this.client,key:r(t),value:n,lifetime:a})}async remove(t){return await e("plugin:stronghold|remove_store_record",{snapshotPath:this.path,client:this.client,key:r(t)}).then((t=>null!=t?Uint8Array.from(t):null))}}class i extends a{constructor(t,e,n){super({snapshotPath:t,client:e,vault:n}),this.path=t,this.client=r(e),this.name=r(n)}async insert(t,n){return await e("plugin:stronghold|save_secret",{snapshotPath:this.path,client:this.client,vault:this.name,recordPath:r(t),secret:n})}async remove(t){return await e("plugin:stronghold|remove_secret",{snapshotPath:this.path,client:this.client,vault:this.name,recordPath:t.payload.record})}}class h{constructor(t){this.path=t}static async load(t,r){return await e("plugin:stronghold|initialize",{snapshotPath:t,password:r}).then((()=>new h(t)))}async unload(){return await e("plugin:stronghold|destroy",{snapshotPath:this.path})}async loadClient(t){return await e("plugin:stronghold|load_client",{snapshotPath:this.path,client:r(t)}).then((()=>new s(this.path,t)))}async createClient(t){return await e("plugin:stronghold|create_client",{snapshotPath:this.path,client:r(t)}).then((()=>new s(this.path,t)))}async save(){return await e("plugin:stronghold|save",{snapshotPath:this.path})}}return t.Client=s,t.Location=n,t.Store=o,t.Stronghold=h,t.Vault=i,t}({});Object.defineProperty(window.__TAURI__,"stronghold",{value:__TAURI_PLUGIN_STRONGHOLD__})} diff --git a/plugins/stronghold/src/lib.rs b/plugins/stronghold/src/lib.rs index 9c09decd..29ad870f 100644 --- a/plugins/stronghold/src/lib.rs +++ b/plugins/stronghold/src/lib.rs @@ -19,9 +19,10 @@ use std::{ time::Duration, }; +use crypto::keys::bip39; use iota_stronghold::{ procedures::{ - BIP39Generate, BIP39Recover, Chain, Ed25519Sign, KeyType as StrongholdKeyType, + BIP39Generate, BIP39Recover, Curve, Ed25519Sign, KeyType as StrongholdKeyType, MnemonicLanguage, PublicKey, Slip10Derive, Slip10DeriveInput, Slip10Generate, StrongholdProcedure, }, @@ -33,7 +34,7 @@ use tauri::{ plugin::{Builder as PluginBuilder, TauriPlugin}, Manager, Runtime, State, }; -use zeroize::Zeroize; +use zeroize::{Zeroize, Zeroizing}; #[cfg(feature = "kdf")] pub mod kdf; @@ -199,7 +200,8 @@ impl From for StrongholdProcedure { input, output, } => StrongholdProcedure::Slip10Derive(Slip10Derive { - chain: Chain::from_u32_hardened(chain), + curve: Curve::Ed25519, + chain, input: input.into(), output: output.into(), }), @@ -208,13 +210,13 @@ impl From for StrongholdProcedure { passphrase, output, } => StrongholdProcedure::BIP39Recover(BIP39Recover { - mnemonic, - passphrase, + mnemonic: bip39::Mnemonic::from(mnemonic), + passphrase: bip39::Passphrase::from(passphrase.unwrap_or_default()), output: output.into(), }), ProcedureDto::BIP39Generate { passphrase, output } => { StrongholdProcedure::BIP39Generate(BIP39Generate { - passphrase, + passphrase: bip39::Passphrase::from(passphrase.unwrap_or_default()), output: output.into(), language: MnemonicLanguage::English, }) @@ -351,7 +353,10 @@ async fn save_secret( let client = get_client(collection, snapshot_path, client)?; client .vault(&vault) - .write_secret(Location::generic(vault, record_path), secret) + .write_secret( + Location::generic(vault, record_path), + Zeroizing::new(secret), + ) .map_err(Into::into) } @@ -456,19 +461,17 @@ impl Builder { pub fn build(self) -> TauriPlugin { let password_hash_function = self.password_hash_function; - let plugin_builder = PluginBuilder::new("stronghold") - .js_init_script(include_str!("api-iife.js").to_string()) - .setup(move |app, _api| { - app.manage(StrongholdCollection::default()); - app.manage(PasswordHashFunction(match password_hash_function { - #[cfg(feature = "kdf")] - PasswordHashFunctionKind::Argon2(path) => { - Box::new(move |p| kdf::KeyDerivation::argon2(p, &path)) - } - PasswordHashFunctionKind::Custom(f) => f, - })); - Ok(()) - }); + let plugin_builder = PluginBuilder::new("stronghold").setup(move |app, _api| { + app.manage(StrongholdCollection::default()); + app.manage(PasswordHashFunction(match password_hash_function { + #[cfg(feature = "kdf")] + PasswordHashFunctionKind::Argon2(path) => { + Box::new(move |p| kdf::KeyDerivation::argon2(p, &path)) + } + PasswordHashFunctionKind::Custom(f) => f, + })); + Ok(()) + }); Builder::invoke_stronghold_handlers_and_build(plugin_builder) } diff --git a/plugins/stronghold/src/stronghold.rs b/plugins/stronghold/src/stronghold.rs index 7da521bd..a5cadc26 100644 --- a/plugins/stronghold/src/stronghold.rs +++ b/plugins/stronghold/src/stronghold.rs @@ -6,6 +6,7 @@ use std::{convert::TryFrom, ops::Deref, path::Path}; use iota_stronghold::{KeyProvider, SnapshotPath}; use serde::{Serialize, Serializer}; +use zeroize::Zeroizing; pub type Result = std::result::Result; @@ -40,7 +41,7 @@ impl Stronghold { pub fn new>(path: P, password: Vec) -> Result { let path = SnapshotPath::from_path(path); let stronghold = iota_stronghold::Stronghold::default(); - let keyprovider = KeyProvider::try_from(password)?; + let keyprovider = KeyProvider::try_from(Zeroizing::new(password))?; if path.exists() { stronghold.load_snapshot(&keyprovider, &path)?; } diff --git a/plugins/updater/CHANGELOG.md b/plugins/updater/CHANGELOG.md index 16ffe235..802b31c1 100644 --- a/plugins/updater/CHANGELOG.md +++ b/plugins/updater/CHANGELOG.md @@ -1,5 +1,99 @@ # Changelog +## \[2.0.2] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.1] + +- [`9501cfa5`](https://github.com/tauri-apps/plugins-workspace/commit/9501cfa5f5385b2d7eb43a8378b322ee97cba06f) ([#1868](https://github.com/tauri-apps/plugins-workspace/pull/1868) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Fix configuration parser incorrectly warning about the endpoint scheme. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.4] + +- [`221f50f5`](https://github.com/tauri-apps/plugins-workspace/commit/221f50f53bd7a87dbd404e4cb1aaf502a5047785) ([#1816](https://github.com/tauri-apps/plugins-workspace/pull/1816) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Encode `+` when making updater requests which can be cause incorrectly interpolating the endpoint when using `{{current_version}}` in the endpoint where the current version contains a build number, for example `1.8.0+1`. +- [`04a0aea0`](https://github.com/tauri-apps/plugins-workspace/commit/04a0aea0ab9f8750200bc2fe5aff99c1c488082d) ([#1814](https://github.com/tauri-apps/plugins-workspace/pull/1814) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) **Breaking change**, Changed `UpdaterBuilder::endpoints` method to return a `Result`. +- [`04a0aea0`](https://github.com/tauri-apps/plugins-workspace/commit/04a0aea0ab9f8750200bc2fe5aff99c1c488082d) ([#1814](https://github.com/tauri-apps/plugins-workspace/pull/1814) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Add `dangerousInsecureTransportProtocol` config option to allow using insecure transport protocols, like `http` + +## \[2.0.0-rc.3] + +- [`d00519e3`](https://github.com/tauri-apps/plugins-workspace/commit/d00519e3e3a3234f9eb6c2ba82c92d4199f03e53) ([#1735](https://github.com/tauri-apps/plugins-workspace/pull/1735) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) This releases the changes from 2.0.0-rc.2 to crates.io. Please see the links below for the actual changes. + +## \[2.0.0-rc.2] + +- [`f8255e1d`](https://github.com/tauri-apps/plugins-workspace/commit/f8255e1db5df6cf562b9334fbefe5e62f4a28e0a) ([#1661](https://github.com/tauri-apps/plugins-workspace/pull/1661) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Add a second argument in `Update.download` and `Update.donloadAndInstall` JS APIs to modify headers and timeout when downloading the update. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.1] + +- [`77013925`](https://github.com/tauri-apps/plugins-workspace/commit/7701392500f375340045880fce5fb8f867bfe670) ([#1636](https://github.com/tauri-apps/plugins-workspace/pull/1636) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Fixes the updater not preserving AppImage file permissions. +- [`5d170a54`](https://github.com/tauri-apps/plugins-workspace/commit/5d170a5444982dcc14135f6f1fc3e5da359f0eb0) ([#1671](https://github.com/tauri-apps/plugins-workspace/pull/1671) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.3. + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.8] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.11] + +- [`f83b9e98`](https://github.com/tauri-apps/plugins-workspace/commit/f83b9e9813843df19b03b6af1018d848111b2a62) ([#1544](https://github.com/tauri-apps/plugins-workspace/pull/1544) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) On Windows, use a named tempfile with `--installer.exe` (or `.msi`) for v2 updater + + **Breaking Change**: `UpdaterBuilder::new` now takes one more argument `app_name: String` + +## \[2.0.0-beta.7] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.6] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.8] + +- [`bf29a72b`](https://github.com/tauri-apps/plugins-workspace/commit/bf29a72baaff15214a21989df23081eee84e3b8b) ([#1454](https://github.com/tauri-apps/plugins-workspace/pull/1454) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Fix regression in updater plugin failing to update using `.msi` installer. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. +- [`43224c5d`](https://github.com/tauri-apps/plugins-workspace/commit/43224c5d5cfe2dd676e79ebafe424027c62c51c3)([#1330](https://github.com/tauri-apps/plugins-workspace/pull/1330)) Add `Update.download` and `Update.install` functions to the JavaScript API + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[2.0.0-beta.4] + +- [`293f363`](https://github.com/tauri-apps/plugins-workspace/commit/293f363c0dccc43e8403729fdc8cc2b4311c2d5b)([#1175](https://github.com/tauri-apps/plugins-workspace/pull/1175)) Add a `on_before_exit` hook for cleanup before spawning the updater on Windows, defaults to `app.cleanup_before_exit` when used through `UpdaterExt` +- [`293f363`](https://github.com/tauri-apps/plugins-workspace/commit/293f363c0dccc43e8403729fdc8cc2b4311c2d5b)([#1175](https://github.com/tauri-apps/plugins-workspace/pull/1175)) **Breaking change:** The `rustls-tls` feature flag is now enabled by default. +- [`e3d41f4`](https://github.com/tauri-apps/plugins-workspace/commit/e3d41f4011bd3ea3ce281bb38bbe31d3709f8e0f)([#1191](https://github.com/tauri-apps/plugins-workspace/pull/1191)) Internally use the webview scoped resources table instead of the app one, so other webviews can't access other webviews resources. +- [`7e2fcc5`](https://github.com/tauri-apps/plugins-workspace/commit/7e2fcc5e74df7c3c718e40f75bfb0eafc7d69d8d)([#1146](https://github.com/tauri-apps/plugins-workspace/pull/1146)) Update dependencies to align with tauri 2.0.0-beta.14. +- [`e3d41f4`](https://github.com/tauri-apps/plugins-workspace/commit/e3d41f4011bd3ea3ce281bb38bbe31d3709f8e0f)([#1191](https://github.com/tauri-apps/plugins-workspace/pull/1191)) Update for tauri 2.0.0-beta.15. + +## \[2.0.0-beta.3] + +- [`4e37316`](https://github.com/tauri-apps/plugins-workspace/commit/4e37316af0d6532bf9a9bd0e712b5b14b0598285)([#1051](https://github.com/tauri-apps/plugins-workspace/pull/1051)) Fix deserialization of `windows > installerArgs` config field. +- [`4e37316`](https://github.com/tauri-apps/plugins-workspace/commit/4e37316af0d6532bf9a9bd0e712b5b14b0598285)([#1051](https://github.com/tauri-apps/plugins-workspace/pull/1051)) On Windows, fallback to `passive` install mode when not defined in config. +- [`a3b5396`](https://github.com/tauri-apps/plugins-workspace/commit/a3b5396113ca93912274f6890d9ef5b1a409587a)([#1054](https://github.com/tauri-apps/plugins-workspace/pull/1054)) Fix Windows powershell window flashing on update +- [`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] + +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -81,4 +175,23 @@ ## \[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! + 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + 92fac1f295998b93f2b9347f)([#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! + i-apps/plugins-workspace/pull/371)) First v2 alpha release! + 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + 92fac1f295998b93f2b9347f)([#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! + to improve consistency and ergonomics of the Rust and JS APIs + +## \[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! + 92fac1f295998b93f2b9347f)([#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! + i-apps/plugins-workspace/pull/371)) First v2 alpha release! + 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + 92fac1f295998b93f2b9347f)([#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! + com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/updater/Cargo.toml b/plugins/updater/Cargo.toml index e30345c9..9a1944e8 100644 --- a/plugins/updater/Cargo.toml +++ b/plugins/updater/Cargo.toml @@ -1,19 +1,29 @@ [package] name = "tauri-plugin-updater" -version = "2.0.0-beta.1" +version = "2.0.2" description = "In-app updates for Tauri applications." edition = { workspace = true } authors = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-updater" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] +no-default-features = true +features = ["zip"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "none", notes = "" } +ios = { level = "none", notes = "" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] tauri = { workspace = true } @@ -21,30 +31,41 @@ serde = { workspace = true } serde_json = { workspace = true } thiserror = { workspace = true } tokio = "1" -reqwest = { version = "0.11", default-features = false, features = [ "json", "stream" ] } +reqwest = { version = "0.12", default-features = false, features = [ + "json", + "stream", +] } url = { workspace = true } -http = "0.2" -dirs-next = "2" +http = "1" minisign-verify = "0.2" -time = { version = "0.3", features = [ "parsing", "formatting" ] } -base64 = "0.21" -percent-encoding = "2" -semver = { version = "1", features = [ "serde" ] } +time = { version = "0.3", features = ["parsing", "formatting"] } +base64 = "0.22" +semver = { version = "1", features = ["serde"] } futures-util = "0.3" tempfile = "3" -zip = "0.6" -tar = "0.4" +infer = "0.16" +percent-encoding = "2.3" [target."cfg(target_os = \"windows\")".dependencies] -zip = { version = "0.6", default-features = false } +zip = { version = "2", default-features = false, optional = true } +windows-sys = { version = "0.59.0", features = [ + "Win32_Foundation", + "Win32_UI_WindowsAndMessaging", + "Win32_UI_Shell", +] } -[target."cfg(any(target_os = \"macos\", target_os = \"linux\"))".dependencies] -flate2 = "1.0.27" +[target."cfg(target_os = \"linux\")".dependencies] +dirs = "5" +tar = { version = "0.4", optional = true } +flate2 = { version = "1", optional = true } -[dev-dependencies] -mockito = "0.31" +[target."cfg(target_os = \"macos\")".dependencies] +tar = "0.4" +flate2 = "1" [features] -native-tls = [ "reqwest/native-tls" ] -native-tls-vendored = [ "reqwest/native-tls-vendored" ] -rustls-tls = [ "reqwest/rustls-tls" ] +default = ["rustls-tls", "zip"] +zip = ["dep:zip", "dep:tar", "dep:flate2"] +native-tls = ["reqwest/native-tls"] +native-tls-vendored = ["reqwest/native-tls-vendored"] +rustls-tls = ["reqwest/rustls-tls"] diff --git a/plugins/updater/README.md b/plugins/updater/README.md index 71e3b282..f8dd5347 100644 --- a/plugins/updater/README.md +++ b/plugins/updater/README.md @@ -2,11 +2,17 @@ In-app updates for Tauri applications. -- Supported platforms: Windows, Linux and macOS. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | x | +| iOS | x | ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -21,7 +27,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml # you can add the dependencies on the `[dependencies]` section if you do not target mobile [target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies] -tauri-plugin-updater = "2.0.0-beta" +tauri-plugin-updater = "2.0.0" # alternatively with Git: tauri-plugin-updater = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -67,12 +73,12 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { check } from "@tauri-apps/plugin-updater"; -import { relaunch } from "@tauri-apps/plugin-process"; -const update = await check(); +import { check } from '@tauri-apps/plugin-updater' +import { relaunch } from '@tauri-apps/plugin-process' +const update = await check() if (update?.available) { - await update.downloadAndInstall(); - await relaunch(); + await update.downloadAndInstall() + await relaunch() } ``` diff --git a/plugins/updater/SECURITY.md b/plugins/updater/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/updater/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/updater/api-iife.js b/plugins/updater/api-iife.js new file mode 100644 index 00000000..2b10e2e7 --- /dev/null +++ b/plugins/updater/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_UPDATER__=function(e){"use strict";function t(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)}function s(e,t,s,n,i){if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,s),s}var n,i,r,a;"function"==typeof SuppressedError&&SuppressedError;class o{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,n.set(this,(()=>{})),i.set(this,0),r.set(this,{}),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:e,id:a})=>{if(a===t(this,i,"f")){s(this,i,a+1),t(this,n,"f").call(this,e);const o=Object.keys(t(this,r,"f"));if(o.length>0){let e=a+1;for(const s of o.sort()){if(parseInt(s)!==e)break;{const i=t(this,r,"f")[s];delete t(this,r,"f")[s],t(this,n,"f").call(this,i),e+=1}}s(this,i,e)}}else t(this,r,"f")[a.toString()]=e}))}set onmessage(e){s(this,n,e)}get onmessage(){return t(this,n,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function d(e,t={},s){return window.__TAURI_INTERNALS__.invoke(e,t,s)}n=new WeakMap,i=new WeakMap,r=new WeakMap;class l{get rid(){return t(this,a,"f")}constructor(e){a.set(this,void 0),s(this,a,e)}async close(){return d("plugin:resources|close",{rid:this.rid})}}a=new WeakMap;class c extends l{constructor(e){super(e.rid),this.available=e.available,this.currentVersion=e.currentVersion,this.version=e.version,this.date=e.date,this.body=e.body}async download(e,t){const s=new o;e&&(s.onmessage=e);const n=await d("plugin:updater|download",{onEvent:s,rid:this.rid,...t});this.downloadedBytes=new l(n)}async install(){if(!this.downloadedBytes)throw new Error("Update.install called before Update.download");await d("plugin:updater|install",{updateRid:this.rid,bytesRid:this.downloadedBytes.rid}),this.downloadedBytes=void 0}async downloadAndInstall(e,t){const s=new o;e&&(s.onmessage=e),await d("plugin:updater|download_and_install",{onEvent:s,rid:this.rid,...t})}async close(){await(this.downloadedBytes?.close()),await super.close()}}return e.Update=c,e.check=async function(e){return e?.headers&&(e.headers=Array.from(new Headers(e.headers).entries())),await d("plugin:updater|check",{...e}).then((e=>e.available?new c(e):null))},e}({});Object.defineProperty(window.__TAURI__,"updater",{value:__TAURI_PLUGIN_UPDATER__})} diff --git a/plugins/updater/build.rs b/plugins/updater/build.rs index 6ba1a7d9..7c7774b9 100644 --- a/plugins/updater/build.rs +++ b/plugins/updater/build.rs @@ -2,10 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -const COMMANDS: &[&str] = &["check", "download_and_install"]; +const COMMANDS: &[&str] = &["check", "download", "install", "download_and_install"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); let mobile = target_os == "ios" || target_os == "android"; diff --git a/plugins/updater/guest-js/index.ts b/plugins/updater/guest-js/index.ts index e3f8ec29..54d1d174 100644 --- a/plugins/updater/guest-js/index.ts +++ b/plugins/updater/guest-js/index.ts @@ -2,84 +2,136 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { invoke, Channel, Resource } from "@tauri-apps/api/core"; +import { invoke, Channel, Resource } from '@tauri-apps/api/core' -/** Options used to check for updates */ +/** Options used when checking for updates */ interface CheckOptions { /** * Request headers */ - headers?: HeadersInit; + headers?: HeadersInit /** - * Timeout in seconds + * Timeout in milliseconds */ - timeout?: number; + timeout?: number /** * A proxy url to be used when checking and downloading updates. */ - proxy?: string; + proxy?: string /** * Target identifier for the running application. This is sent to the backend. */ - target?: string; + target?: string +} + +/** Options used when downloading an update */ +interface DownloadOptions { + /** + * Request headers + */ + headers?: HeadersInit + /** + * Timeout in milliseconds + */ + timeout?: number } interface UpdateMetadata { - rid: number; - available: boolean; - currentVersion: string; - version: string; - date?: string; - body?: string; + rid: number + available: boolean + currentVersion: string + version: string + date?: string + body?: string } /** Updater download event */ type DownloadEvent = - | { event: "Started"; data: { contentLength?: number } } - | { event: "Progress"; data: { chunkLength: number } } - | { event: "Finished" }; + | { event: 'Started'; data: { contentLength?: number } } + | { event: 'Progress'; data: { chunkLength: number } } + | { event: 'Finished' } class Update extends Resource { - available: boolean; - currentVersion: string; - version: string; - date?: string; - body?: string; + available: boolean + currentVersion: string + version: string + date?: string + body?: string + private downloadedBytes?: Resource constructor(metadata: UpdateMetadata) { - super(metadata.rid); - this.available = metadata.available; - this.currentVersion = metadata.currentVersion; - this.version = metadata.version; - this.date = metadata.date; - this.body = metadata.body; + super(metadata.rid) + this.available = metadata.available + this.currentVersion = metadata.currentVersion + this.version = metadata.version + this.date = metadata.date + this.body = metadata.body + } + + /** Download the updater package */ + async download( + onEvent?: (progress: DownloadEvent) => void, + options?: DownloadOptions + ): Promise { + const channel = new Channel() + if (onEvent) { + channel.onmessage = onEvent + } + const downloadedBytesRid = await invoke('plugin:updater|download', { + onEvent: channel, + rid: this.rid, + ...options + }) + this.downloadedBytes = new Resource(downloadedBytesRid) + } + + /** Install downloaded updater package */ + async install(): Promise { + if (!this.downloadedBytes) { + throw new Error('Update.install called before Update.download') + } + + await invoke('plugin:updater|install', { + updateRid: this.rid, + bytesRid: this.downloadedBytes.rid + }) + + // Don't need to call close, we did it in rust side already + this.downloadedBytes = undefined } /** Downloads the updater package and installs it */ async downloadAndInstall( onEvent?: (progress: DownloadEvent) => void, + options?: DownloadOptions ): Promise { - const channel = new Channel(); + const channel = new Channel() if (onEvent) { - channel.onmessage = onEvent; + channel.onmessage = onEvent } - return invoke("plugin:updater|download_and_install", { + await invoke('plugin:updater|download_and_install', { onEvent: channel, rid: this.rid, - }); + ...options + }) + } + + async close(): Promise { + await this.downloadedBytes?.close() + await super.close() } } /** Check for updates, resolves to `null` if no updates are available */ async function check(options?: CheckOptions): Promise { if (options?.headers) { - options.headers = Array.from(new Headers(options.headers).entries()); + options.headers = Array.from(new Headers(options.headers).entries()) } - return invoke("plugin:updater|check", { - ...options, - }).then((meta) => (meta.available ? new Update(meta) : null)); + return await invoke('plugin:updater|check', { + ...options + }).then((meta) => (meta.available ? new Update(meta) : null)) } -export type { CheckOptions, DownloadEvent }; -export { check, Update }; +export type { CheckOptions, DownloadOptions, DownloadEvent } +export { check, Update } diff --git a/plugins/updater/package.json b/plugins/updater/package.json index 15a8cf63..3afb2f4e 100644 --- a/plugins/updater/package.json +++ b/plugins/updater/package.json @@ -1,10 +1,11 @@ { "name": "@tauri-apps/plugin-updater", - "version": "2.0.0-beta.1", - "license": "MIT or APACHE-2.0", + "version": "2.0.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -23,6 +24,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/updater/permissions/autogenerated/commands/download.toml b/plugins/updater/permissions/autogenerated/commands/download.toml new file mode 100644 index 00000000..896b30ce --- /dev/null +++ b/plugins/updater/permissions/autogenerated/commands/download.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-download" +description = "Enables the download command without any pre-configured scope." +commands.allow = ["download"] + +[[permission]] +identifier = "deny-download" +description = "Denies the download command without any pre-configured scope." +commands.deny = ["download"] diff --git a/plugins/updater/permissions/autogenerated/commands/install.toml b/plugins/updater/permissions/autogenerated/commands/install.toml new file mode 100644 index 00000000..4c6a29d4 --- /dev/null +++ b/plugins/updater/permissions/autogenerated/commands/install.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-install" +description = "Enables the install command without any pre-configured scope." +commands.allow = ["install"] + +[[permission]] +identifier = "deny-install" +description = "Denies the install command without any pre-configured scope." +commands.deny = ["install"] diff --git a/plugins/updater/permissions/autogenerated/reference.md b/plugins/updater/permissions/autogenerated/reference.md index 033690d4..06241af8 100644 --- a/plugins/updater/permissions/autogenerated/reference.md +++ b/plugins/updater/permissions/autogenerated/reference.md @@ -1,22 +1,130 @@ -# Permissions +## Default Permission -## allow-check +This permission set configures which kind of +updater functions are exposed to the frontend. + +#### Granted Permissions + +The full workflow from checking for updates to installing them +is enabled. + + + +- `allow-check` +- `allow-download` +- `allow-install` +- `allow-download-and-install` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`updater:allow-check` + + Enables the check command without any pre-configured scope. -## deny-check +
+ +`updater:deny-check` + + Denies the check command without any pre-configured scope. -## allow-download-and-install +
+ +`updater:allow-download` + + + +Enables the download command without any pre-configured scope. + +
+ +`updater:deny-download` + + + +Denies the download command without any pre-configured scope. + +
+ +`updater:allow-download-and-install` + + Enables the download_and_install command without any pre-configured scope. -## deny-download-and-install +
+ +`updater:deny-download-and-install` + + Denies the download_and_install command without any pre-configured scope. -## default +
+ +`updater:allow-install` + + + +Enables the install command without any pre-configured scope. + +
+ +`updater:deny-install` + + -Allows checking for new updates and installing them +Denies the install command without any pre-configured scope. +
diff --git a/plugins/updater/permissions/default.toml b/plugins/updater/permissions/default.toml index 857f9b5e..fcf08fa8 100644 --- a/plugins/updater/permissions/default.toml +++ b/plugins/updater/permissions/default.toml @@ -1,4 +1,18 @@ "$schema" = "schemas/schema.json" [default] -description = "Allows checking for new updates and installing them" -permissions = ["allow-check", "allow-download-and-install"] +description = """ +This permission set configures which kind of +updater functions are exposed to the frontend. + +#### Granted Permissions + +The full workflow from checking for updates to installing them +is enabled. + +""" +permissions = [ + "allow-check", + "allow-download", + "allow-install", + "allow-download-and-install", +] diff --git a/plugins/updater/permissions/schemas/schema.json b/plugins/updater/permissions/schemas/schema.json index 624f767b..2df800da 100644 --- a/plugins/updater/permissions/schemas/schema.json +++ b/plugins/updater/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,45 +251,95 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-check -> Enables the check command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-check" + "macOS" ] }, { - "description": "deny-check -> Denies the check command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-check" + "windows" ] }, { - "description": "allow-download-and-install -> Enables the download_and_install command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-download-and-install" + "linux" ] }, { - "description": "deny-download-and-install -> Denies the download_and_install command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-download-and-install" + "android" ] }, { - "description": "default -> Allows checking for new updates and installing them", + "description": "iOS.", "type": "string", "enum": [ - "default" + "iOS" ] } ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the check command without any pre-configured scope.", + "type": "string", + "const": "allow-check" + }, + { + "description": "Denies the check command without any pre-configured scope.", + "type": "string", + "const": "deny-check" + }, + { + "description": "Enables the download command without any pre-configured scope.", + "type": "string", + "const": "allow-download" + }, + { + "description": "Denies the download command without any pre-configured scope.", + "type": "string", + "const": "deny-download" + }, + { + "description": "Enables the download_and_install command without any pre-configured scope.", + "type": "string", + "const": "allow-download-and-install" + }, + { + "description": "Denies the download_and_install command without any pre-configured scope.", + "type": "string", + "const": "deny-download-and-install" + }, + { + "description": "Enables the install command without any pre-configured scope.", + "type": "string", + "const": "allow-install" + }, + { + "description": "Denies the install command without any pre-configured scope.", + "type": "string", + "const": "deny-install" + }, + { + "description": "This permission set configures which kind of\nupdater functions are exposed to the frontend.\n\n#### Granted Permissions\n\nThe full workflow from checking for updates to installing them\nis enabled.\n\n", + "type": "string", + "const": "default" + } + ] } } } \ No newline at end of file diff --git a/plugins/updater/rollup.config.js b/plugins/updater/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/updater/rollup.config.js +++ b/plugins/updater/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/updater/src/api-iife.js b/plugins/updater/src/api-iife.js deleted file mode 100644 index 2e443929..00000000 --- a/plugins/updater/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_UPDATER__=function(e){"use strict";function r(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)}function t(e,r,t,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof r?e!==r||!s:!r.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,t):s?s.value=t:r.set(e,t),t}var n,s;"function"==typeof SuppressedError&&SuppressedError;class i{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,n.set(this,(()=>{})),this.id=function(e,r=!1){return window.__TAURI_INTERNALS__.transformCallback(e,r)}((e=>{r(this,n,"f").call(this,e)}))}set onmessage(e){t(this,n,e,"f")}get onmessage(){return r(this,n,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(e,r={},t){return window.__TAURI_INTERNALS__.invoke(e,r,t)}n=new WeakMap;class o{get rid(){return r(this,s,"f")}constructor(e){s.set(this,void 0),t(this,s,e,"f")}async close(){return a("plugin:resources|close",{rid:this.rid})}}s=new WeakMap;class c extends o{constructor(e){super(e.rid),this.available=e.available,this.currentVersion=e.currentVersion,this.version=e.version,this.date=e.date,this.body=e.body}async downloadAndInstall(e){const r=new i;return e&&(r.onmessage=e),a("plugin:updater|download_and_install",{onEvent:r,rid:this.rid})}}return e.Update=c,e.check=async function(e){return e?.headers&&(e.headers=Array.from(new Headers(e.headers).entries())),a("plugin:updater|check",{...e}).then((e=>e.available?new c(e):null))},e}({});Object.defineProperty(window.__TAURI__,"updater",{value:__TAURI_PLUGIN_UPDATER__})} diff --git a/plugins/updater/src/commands.rs b/plugins/updater/src/commands.rs index 6d2668f2..f36a591c 100644 --- a/plugins/updater/src/commands.rs +++ b/plugins/updater/src/commands.rs @@ -4,13 +4,14 @@ use crate::{Result, Update, UpdaterExt}; +use http::{HeaderMap, HeaderName, HeaderValue}; use serde::Serialize; -use tauri::{ipc::Channel, AppHandle, Manager, ResourceId, Runtime}; +use tauri::{ipc::Channel, Manager, Resource, ResourceId, Runtime, Webview}; -use std::time::Duration; +use std::{str::FromStr, time::Duration}; use url::Url; -#[derive(Debug, Serialize)] +#[derive(Debug, Clone, Serialize)] #[serde(tag = "event", content = "data")] pub enum DownloadEvent { #[serde(rename_all = "camelCase")] @@ -35,22 +36,25 @@ pub(crate) struct Metadata { body: Option, } +struct DownloadedBytes(pub Vec); +impl Resource for DownloadedBytes {} + #[tauri::command] pub(crate) async fn check( - app: AppHandle, + webview: Webview, headers: Option>, timeout: Option, proxy: Option, target: Option, ) -> Result { - let mut builder = app.updater_builder(); + let mut builder = webview.updater_builder(); if let Some(headers) = headers { for (k, v) in headers { builder = builder.header(k, v)?; } } if let Some(timeout) = timeout { - builder = builder.timeout(Duration::from_secs(timeout)); + builder = builder.timeout(Duration::from_millis(timeout)); } if let Some(ref proxy) = proxy { let url = Url::parse(proxy.as_str())?; @@ -65,23 +69,97 @@ pub(crate) async fn check( let mut metadata = Metadata::default(); if let Some(update) = update { metadata.available = true; - metadata.current_version = update.current_version.clone(); - metadata.version = update.version.clone(); + metadata.current_version.clone_from(&update.current_version); + metadata.version.clone_from(&update.version); metadata.date = update.date.map(|d| d.to_string()); - metadata.body = update.body.clone(); - metadata.rid = Some(app.resources_table().add(update)); + metadata.body.clone_from(&update.body); + metadata.rid = Some(webview.resources_table().add(update)); } Ok(metadata) } +#[tauri::command] +pub(crate) async fn download( + webview: Webview, + rid: ResourceId, + on_event: Channel, + headers: Option>, + timeout: Option, +) -> Result { + let update = webview.resources_table().get::(rid)?; + + let mut update = (*update).clone(); + + if let Some(headers) = headers { + let mut map = HeaderMap::new(); + for (k, v) in headers { + map.append(HeaderName::from_str(&k)?, HeaderValue::from_str(&v)?); + } + update.headers = map; + } + + if let Some(timeout) = timeout { + update.timeout = Some(Duration::from_millis(timeout)); + } + + let mut first_chunk = true; + let bytes = update + .download( + |chunk_length, content_length| { + if first_chunk { + first_chunk = !first_chunk; + let _ = on_event.send(DownloadEvent::Started { content_length }); + } + let _ = on_event.send(DownloadEvent::Progress { chunk_length }); + }, + || { + let _ = on_event.send(DownloadEvent::Finished); + }, + ) + .await?; + + Ok(webview.resources_table().add(DownloadedBytes(bytes))) +} + +#[tauri::command] +pub(crate) async fn install( + webview: Webview, + update_rid: ResourceId, + bytes_rid: ResourceId, +) -> Result<()> { + let update = webview.resources_table().get::(update_rid)?; + let bytes = webview + .resources_table() + .get::(bytes_rid)?; + update.install(&bytes.0)?; + let _ = webview.resources_table().close(bytes_rid); + Ok(()) +} + #[tauri::command] pub(crate) async fn download_and_install( - app: AppHandle, + webview: Webview, rid: ResourceId, - on_event: Channel, + on_event: Channel, + headers: Option>, + timeout: Option, ) -> Result<()> { - let update = app.resources_table().get::(rid)?; + let update = webview.resources_table().get::(rid)?; + + let mut update = (*update).clone(); + + if let Some(headers) = headers { + let mut map = HeaderMap::new(); + for (k, v) in headers { + map.append(HeaderName::from_str(&k)?, HeaderValue::from_str(&v)?); + } + update.headers = map; + } + + if let Some(timeout) = timeout { + update.timeout = Some(Duration::from_millis(timeout)); + } let mut first_chunk = true; @@ -95,7 +173,7 @@ pub(crate) async fn download_and_install( let _ = on_event.send(DownloadEvent::Progress { chunk_length }); }, || { - let _ = on_event.send(&DownloadEvent::Finished); + let _ = on_event.send(DownloadEvent::Finished); }, ) .await?; diff --git a/plugins/updater/src/config.rs b/plugins/updater/src/config.rs index aea6a547..6b16bc01 100644 --- a/plugins/updater/src/config.rs +++ b/plugins/updater/src/config.rs @@ -32,6 +32,9 @@ impl WindowsUpdateInstallMode { /// Returns the associated nsis arguments. pub fn nsis_args(&self) -> &'static [&'static str] { + // `/P`: Passive + // `/S`: Silent + // `/R`: Restart match self { Self::Passive => &["/P", "/R"], Self::Quiet => &["/S", "/R"], @@ -46,7 +49,7 @@ impl Display for WindowsUpdateInstallMode { f, "{}", match self { - Self::BasicUi => "basicUI", + Self::BasicUi => "basicUi", Self::Quiet => "quiet", Self::Passive => "passive", } @@ -64,52 +67,92 @@ impl Default for WindowsUpdateInstallMode { #[serde(rename_all = "camelCase")] pub struct WindowsConfig { /// Additional arguments given to the NSIS or WiX installer. - #[serde(default, alias = "installer-args")] + #[serde( + default, + alias = "installer-args", + deserialize_with = "deserialize_os_string" + )] pub installer_args: Vec, - /// Updating mode, see [`WindowsUpdateInstallMode`] for more info. + /// Updating mode, defaults to `passive` mode. + /// + /// See [`WindowsUpdateInstallMode`] for more info. #[serde(default, alias = "install-mode")] pub install_mode: WindowsUpdateInstallMode, } +fn deserialize_os_string<'de, D>(deserializer: D) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + Ok(Vec::::deserialize(deserializer)? + .into_iter() + .map(OsString::from) + .collect::>()) +} + /// Updater configuration. -#[derive(Debug, Clone, Deserialize, Default)] -#[serde(rename_all = "camelCase")] +#[derive(Debug, Clone, Default)] pub struct Config { + /// Dangerously allow using insecure transport protocols for update endpoints. + pub dangerous_insecure_transport_protocol: bool, /// Updater endpoints. - #[serde(default)] - pub endpoints: Vec, + pub endpoints: Vec, /// Signature public key. pub pubkey: String, /// The Windows configuration for the updater. pub windows: Option, } -/// A URL to an updater server. -/// -/// The URL must use the `https` scheme on production. -#[derive(Debug, PartialEq, Eq, Clone)] -pub struct UpdaterEndpoint(pub Url); - -impl std::fmt::Display for UpdaterEndpoint { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", self.0) - } -} - -impl<'de> Deserialize<'de> for UpdaterEndpoint { +impl<'de> Deserialize<'de> for Config { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - let url = Url::deserialize(deserializer)?; - #[cfg(all(not(debug_assertions), not(feature = "schema")))] - { + #[derive(Deserialize)] + #[serde(rename_all = "camelCase")] + pub struct Config { + #[serde(default, alias = "dangerous-insecure-transport-protocol")] + pub dangerous_insecure_transport_protocol: bool, + #[serde(default)] + pub endpoints: Vec, + pub pubkey: String, + pub windows: Option, + } + + let config = Config::deserialize(deserializer)?; + + validate_endpoints( + &config.endpoints, + config.dangerous_insecure_transport_protocol, + ) + .map_err(serde::de::Error::custom)?; + + Ok(Self { + dangerous_insecure_transport_protocol: config.dangerous_insecure_transport_protocol, + endpoints: config.endpoints, + pubkey: config.pubkey, + windows: config.windows, + }) + } +} + +pub(crate) fn validate_endpoints( + endpoints: &[Url], + dangerous_insecure_transport_protocol: bool, +) -> crate::Result<()> { + if !dangerous_insecure_transport_protocol { + for url in endpoints { if url.scheme() != "https" { - return Err(serde::de::Error::custom( - "The configured updater endpoint must use the `https` protocol.", - )); + #[cfg(debug_assertions)] + { + eprintln!("[\x1b[33mWARNING\x1b[0m] The updater endpoint \"{url}\" doesn't use `https` protocol. This is allowed in development but will fail in release builds."); + eprintln!("[\x1b[33mWARNING\x1b[0m] if this is a desired behavior, you can enable `dangerousInsecureTransportProtocol` in the plugin configuration"); + } + #[cfg(not(debug_assertions))] + return Err(crate::Error::InsecureTransportProtocol); } } - Ok(Self(url)) } + + Ok(()) } diff --git a/plugins/updater/src/error.rs b/plugins/updater/src/error.rs index 43c0d2cb..1f5d6a15 100644 --- a/plugins/updater/src/error.rs +++ b/plugins/updater/src/error.rs @@ -54,6 +54,7 @@ pub enum Error { /// UTF8 Errors in signature. #[error("The signature {0} could not be decoded, please check if it is a valid base64 string. The signature must be the contents of the `.sig` file generated by the Tauri bundler, as a string.")] SignatureUtf8(String), + #[cfg(all(target_os = "windows", feature = "zip"))] /// `zip` errors. #[error(transparent)] Extract(#[from] zip::result::ZipError), @@ -62,9 +63,18 @@ pub enum Error { TempDirNotOnSameMountPoint, #[error("binary for the current target not found in the archive")] BinaryNotFoundInArchive, + #[error("invalid updater binary format")] + InvalidUpdaterFormat, #[error(transparent)] Http(#[from] http::Error), #[error(transparent)] + InvalidHeaderValue(#[from] http::header::InvalidHeaderValue), + #[error(transparent)] + InvalidHeaderName(#[from] http::header::InvalidHeaderName), + /// The configured updater endpoint must use a secure protocol like `https` + #[error("The configured updater endpoint must use a secure protocol like `https`.")] + InsecureTransportProtocol, + #[error(transparent)] Tauri(#[from] tauri::Error), } diff --git a/plugins/updater/src/lib.rs b/plugins/updater/src/lib.rs index 8c0ea2cb..b45f91a2 100644 --- a/plugins/updater/src/lib.rs +++ b/plugins/updater/src/lib.rs @@ -13,7 +13,7 @@ html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png" )] -use std::ffi::{OsStr, OsString}; +use std::ffi::OsString; use tauri::{ plugin::{Builder as PluginBuilder, TauriPlugin}, @@ -29,7 +29,7 @@ pub use config::Config; pub use error::{Error, Result}; pub use updater::*; -/// Extension trait to use the updater on [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`]. +/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the updater APIs. pub trait UpdaterExt { /// Gets the updater builder to build and updater /// that can manually check if an update is available. @@ -70,10 +70,14 @@ pub trait UpdaterExt { impl> UpdaterExt for T { fn updater_builder(&self) -> UpdaterBuilder { let app = self.app_handle(); - let version = app.package_info().version.clone(); + let package_info = app.package_info(); let UpdaterState { config, target } = self.state::().inner(); - let mut builder = UpdaterBuilder::new(version, config.clone()); + let mut builder = UpdaterBuilder::new( + package_info.name.clone(), + package_info.version.clone(), + config.clone(), + ); if let Some(target) = target { builder = builder.target(target); @@ -81,7 +85,7 @@ impl> UpdaterExt for T { let args = self.env().args_os; if !args.is_empty() { - builder = builder.installer_arg("/ARGS").installer_args(args); + builder = builder.current_exe_args(args); } #[cfg(any( @@ -98,6 +102,11 @@ impl> UpdaterExt for T { } } + let app_handle = app.app_handle().clone(); + builder = builder.on_before_exit(move || { + app_handle.cleanup_before_exit(); + }); + builder } @@ -136,21 +145,18 @@ impl Builder { pub fn installer_args(mut self, args: I) -> Self where I: IntoIterator, - S: AsRef, + S: Into, { - let args = args - .into_iter() - .map(|a| a.as_ref().to_os_string()) - .collect::>(); + let args = args.into_iter().map(|a| a.into()).collect::>(); self.installer_args.extend_from_slice(&args); self } pub fn installer_arg(mut self, arg: S) -> Self where - S: AsRef, + S: Into, { - self.installer_args.push(arg.as_ref().to_os_string()); + self.installer_args.push(arg.into()); self } @@ -164,7 +170,6 @@ impl Builder { let target = self.target; let installer_args = self.installer_args; PluginBuilder::::new("updater") - .js_init_script(include_str!("api-iife.js").to_string()) .setup(move |app, api| { let mut config = api.config().clone(); if let Some(pubkey) = pubkey { @@ -178,7 +183,9 @@ impl Builder { }) .invoke_handler(tauri::generate_handler![ commands::check, - commands::download_and_install + commands::download, + commands::install, + commands::download_and_install, ]) .build() } diff --git a/plugins/updater/src/updater.rs b/plugins/updater/src/updater.rs index a77d0af5..b1dadd6d 100644 --- a/plugins/updater/src/updater.rs +++ b/plugins/updater/src/updater.rs @@ -5,9 +5,10 @@ use std::{ collections::HashMap, ffi::{OsStr, OsString}, - io::{Cursor, Read}, + io::Cursor, path::{Path, PathBuf}, str::FromStr, + sync::Arc, time::Duration, }; @@ -15,6 +16,7 @@ use base64::Engine; use futures_util::StreamExt; use http::HeaderName; use minisign_verify::{PublicKey, Signature}; +use percent_encoding::{AsciiSet, CONTROLS}; use reqwest::{ header::{HeaderMap, HeaderValue}, ClientBuilder, StatusCode, @@ -30,6 +32,8 @@ use crate::{ Config, }; +const UPDATER_USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"),); + #[derive(Debug, Deserialize, Serialize, Clone)] pub struct ReleaseManifestPlatform { /// Download URL for the platform @@ -88,7 +92,10 @@ impl RemoteRelease { } } +pub type OnBeforeExit = Arc; + pub struct UpdaterBuilder { + app_name: String, current_version: Version, config: Config, version_comparator: Option bool + Send + Sync>>, @@ -99,16 +106,22 @@ pub struct UpdaterBuilder { timeout: Option, proxy: Option, installer_args: Vec, + current_exe_args: Vec, + on_before_exit: Option, } impl UpdaterBuilder { - pub fn new(current_version: Version, config: crate::Config) -> Self { + /// It's prefered to use [`crate::UpdaterExt::updater_builder`] instead of + /// constructing a [`UpdaterBuilder`] with this function yourself + pub fn new(app_name: String, current_version: Version, config: crate::Config) -> Self { Self { installer_args: config .windows .as_ref() .map(|w| w.installer_args.clone()) .unwrap_or_default(), + current_exe_args: Vec::new(), + app_name, current_version, config, version_comparator: None, @@ -118,6 +131,7 @@ impl UpdaterBuilder { headers: Default::default(), timeout: None, proxy: None, + on_before_exit: None, } } @@ -134,9 +148,14 @@ impl UpdaterBuilder { self } - pub fn endpoints(mut self, endpoints: Vec) -> Self { + pub fn endpoints(mut self, endpoints: Vec) -> Result { + crate::config::validate_endpoints( + &endpoints, + self.config.dangerous_insecure_transport_protocol, + )?; + self.endpoints.replace(endpoints); - self + Ok(self) } pub fn executable_path>(mut self, p: P) -> Self { @@ -176,21 +195,18 @@ impl UpdaterBuilder { pub fn installer_arg(mut self, arg: S) -> Self where - S: AsRef, + S: Into, { - self.installer_args.push(arg.as_ref().to_os_string()); + self.installer_args.push(arg.into()); self } pub fn installer_args(mut self, args: I) -> Self where I: IntoIterator, - S: AsRef, + S: Into, { - let args = args - .into_iter() - .map(|a| a.as_ref().to_os_string()) - .collect::>(); + let args = args.into_iter().map(|a| a.into()).collect::>(); self.installer_args.extend_from_slice(&args); self } @@ -200,10 +216,15 @@ impl UpdaterBuilder { self } + pub fn on_before_exit(mut self, f: F) -> Self { + self.on_before_exit.replace(Arc::new(f)); + self + } + pub fn build(self) -> Result { let endpoints = self .endpoints - .unwrap_or_else(|| self.config.endpoints.iter().map(|e| e.0.clone()).collect()); + .unwrap_or_else(|| self.config.endpoints.clone()); if endpoints.is_empty() { return Err(Error::EmptyEndpoints); @@ -228,30 +249,44 @@ impl UpdaterBuilder { Ok(Updater { config: self.config, + app_name: self.app_name, current_version: self.current_version, version_comparator: self.version_comparator, timeout: self.timeout, proxy: self.proxy, endpoints, installer_args: self.installer_args, + current_exe_args: self.current_exe_args, arch, target, json_target, headers: self.headers, extract_path, + on_before_exit: self.on_before_exit, }) } } +impl UpdaterBuilder { + pub(crate) fn current_exe_args(mut self, args: I) -> Self + where + I: IntoIterator, + S: Into, + { + let args = args.into_iter().map(|a| a.into()).collect::>(); + self.current_exe_args.extend_from_slice(&args); + self + } +} + pub struct Updater { config: Config, + app_name: String, current_version: Version, version_comparator: Option bool + Send + Sync>>, timeout: Option, proxy: Option, endpoints: Vec, - #[allow(dead_code)] - installer_args: Vec, arch: &'static str, // The `{{target}}` variable we replace in the endpoint target: String, @@ -259,6 +294,11 @@ pub struct Updater { json_target: String, headers: HeaderMap, extract_path: PathBuf, + on_before_exit: Option, + #[allow(unused)] + installer_args: Vec, + #[allow(unused)] + current_exe_args: Vec, } impl Updater { @@ -288,22 +328,25 @@ impl Updater { // https://releases.myapp.com/update/darwin/aarch64/1.0.0 // The main objective is if the update URL is defined via the Cargo.toml // the URL will be generated dynamically + let version = self.current_version.to_string(); + let version = version.as_bytes(); + const CONTROLS_ADD: &AsciiSet = &CONTROLS.add(b'+'); + let encoded_version = percent_encoding::percent_encode(version, CONTROLS_ADD); + let encoded_version = encoded_version.to_string(); + let url: Url = url .to_string() // url::Url automatically url-encodes the path components - .replace( - "%7B%7Bcurrent_version%7D%7D", - &self.current_version.to_string(), - ) + .replace("%7B%7Bcurrent_version%7D%7D", &encoded_version) .replace("%7B%7Btarget%7D%7D", &self.target) .replace("%7B%7Barch%7D%7D", self.arch) // but not query parameters - .replace("{{current_version}}", &self.current_version.to_string()) + .replace("{{current_version}}", &encoded_version) .replace("{{target}}", &self.target) .replace("{{arch}}", self.arch) .parse()?; - let mut request = ClientBuilder::new(); + let mut request = ClientBuilder::new().user_agent(UPDATER_USER_AGENT); if let Some(timeout) = self.timeout { request = request.timeout(timeout); } @@ -357,10 +400,11 @@ impl Updater { let update = if should_update { Some(Update { config: self.config.clone(), + on_before_exit: self.on_before_exit.clone(), + app_name: self.app_name.clone(), current_version: self.current_version.to_string(), target: self.target.clone(), extract_path: self.extract_path.clone(), - installer_args: self.installer_args.clone(), version: release.version.to_string(), date: release.pub_date, download_url: release.download_url(&self.json_target)?.to_owned(), @@ -369,6 +413,8 @@ impl Updater { timeout: self.timeout, proxy: self.proxy.clone(), headers: self.headers.clone(), + installer_args: self.installer_args.clone(), + current_exe_args: self.current_exe_args.clone(), }) } else { None @@ -378,9 +424,11 @@ impl Updater { } } -#[derive(Debug, Clone)] +#[derive(Clone)] pub struct Update { config: Config, + #[allow(unused)] + on_before_exit: Option, /// Update description pub body: Option, /// Version used to check for update @@ -391,11 +439,6 @@ pub struct Update { pub date: Option, /// Target pub target: String, - /// Extract path - #[allow(unused)] - extract_path: PathBuf, - #[allow(unused)] - installer_args: Vec, /// Download URL announced pub download_url: Url, /// Signature announced @@ -406,6 +449,16 @@ pub struct Update { pub proxy: Option, /// Request headers pub headers: HeaderMap, + /// Extract path + #[allow(unused)] + extract_path: PathBuf, + /// App name, used for creating named tempfiles on Windows + #[allow(unused)] + app_name: String, + #[allow(unused)] + installer_args: Vec, + #[allow(unused)] + current_exe_args: Vec, } impl Resource for Update {} @@ -425,12 +478,8 @@ impl Update { "Accept", HeaderValue::from_str("application/octet-stream").unwrap(), ); - headers.insert( - "User-Agent", - HeaderValue::from_str("tauri-updater").unwrap(), - ); - let mut request = ClientBuilder::new(); + let mut request = ClientBuilder::new().user_agent(UPDATER_USER_AGENT); if let Some(timeout) = self.timeout { request = request.timeout(timeout); } @@ -463,23 +512,19 @@ impl Update { let mut stream = response.bytes_stream(); while let Some(chunk) = stream.next().await { let chunk = chunk?; - let bytes = chunk.as_ref().to_vec(); - on_chunk(bytes.len(), content_length); - buffer.extend(bytes); + on_chunk(chunk.len(), content_length); + buffer.extend(chunk); } - on_download_finish(); - let mut update_buffer = Cursor::new(&buffer); - - verify_signature(&mut update_buffer, &self.signature, &self.config.pubkey)?; + verify_signature(&buffer, &self.signature, &self.config.pubkey)?; Ok(buffer) } /// Installs the updater package downloaded by [`Update::download`] - pub fn install(&self, bytes: Vec) -> Result<()> { - self.install_inner(bytes) + pub fn install(&self, bytes: impl AsRef<[u8]>) -> Result<()> { + self.install_inner(bytes.as_ref()) } /// Downloads and installs the updater package @@ -493,198 +538,240 @@ impl Update { } #[cfg(mobile)] - fn install_inner(&self, bytes: Vec) -> Result<()> { + fn install_inner(&self, _bytes: &[u8]) -> Result<()> { Ok(()) } +} - // Windows - // - // ### Expected structure: - // ├── [AppName]_[version]_x64.msi.zip # ZIP generated by tauri-bundler - // │ └──[AppName]_[version]_x64.msi # Application MSI - // ├── [AppName]_[version]_x64-setup.exe.zip # ZIP generated by tauri-bundler - // │ └──[AppName]_[version]_x64-setup.exe # NSIS installer - // └── ... - // - // ## MSI - // Update server can provide a MSI for Windows. (Generated with tauri-bundler from *Wix*) - // To replace current version of the application. In later version we'll offer - // incremental update to push specific binaries. - // - // ## EXE - // Update server can provide a custom EXE (installer) who can run any task. - #[cfg(windows)] - fn install_inner(&self, bytes: Vec) -> Result<()> { - use std::{fs, process::Command}; +#[cfg(windows)] +enum WindowsUpdaterType { + Nsis { + path: PathBuf, + #[allow(unused)] + temp: Option, + }, + Msi { + path: PathBuf, + #[allow(unused)] + temp: Option, + }, +} - // FIXME: We need to create a memory buffer with the MSI and then run it. - // (instead of extracting the MSI to a temp path) - // - // The tricky part is the MSI need to be exposed and spawned so the memory allocation - // shouldn't drop but we should be able to pass the reference so we can drop it once the installation - // is done, otherwise we have a huge memory leak. +#[cfg(windows)] +impl WindowsUpdaterType { + fn nsis(path: PathBuf, temp: Option) -> Self { + Self::Nsis { path, temp } + } - let archive = Cursor::new(bytes); + fn msi(path: PathBuf, temp: Option) -> Self { + Self::Msi { + path: path.wrap_in_quotes(), + temp, + } + } +} + +#[cfg(windows)] +impl Config { + fn install_mode(&self) -> crate::config::WindowsUpdateInstallMode { + self.windows + .as_ref() + .map(|w| w.install_mode.clone()) + .unwrap_or_default() + } +} - let tmp_dir = tempfile::Builder::new().tempdir()?.into_path(); +/// Windows +#[cfg(windows)] +impl Update { + /// ### Expected structure: + /// ├── [AppName]_[version]_x64.msi # Application MSI + /// ├── [AppName]_[version]_x64-setup.exe # NSIS installer + /// ├── [AppName]_[version]_x64.msi.zip # ZIP generated by tauri-bundler + /// │ └──[AppName]_[version]_x64.msi # Application MSI + /// ├── [AppName]_[version]_x64-setup.exe.zip # ZIP generated by tauri-bundler + /// │ └──[AppName]_[version]_x64-setup.exe # NSIS installer + /// └── ... + fn install_inner(&self, bytes: &[u8]) -> Result<()> { + use std::iter::once; + use windows_sys::{ + w, + Win32::UI::{Shell::ShellExecuteW, WindowsAndMessaging::SW_SHOW}, + }; - // extract the buffer to the tmp_dir - // we extract our signed archive into our final directory without any temp file - let mut extractor = zip::ZipArchive::new(archive)?; + let updater_type = self.extract(bytes)?; + + let install_mode = self.config.install_mode(); + let current_args = &self.current_exe_args()[1..]; + let msi_args; + + let installer_args: Vec<&OsStr> = match &updater_type { + WindowsUpdaterType::Nsis { .. } => install_mode + .nsis_args() + .iter() + .map(OsStr::new) + .chain(once(OsStr::new("/UPDATE"))) + .chain(once(OsStr::new("/ARGS"))) + .chain(current_args.to_vec()) + .chain(self.installer_args()) + .collect(), + WindowsUpdaterType::Msi { path, .. } => { + let escaped_args = current_args + .iter() + .map(escape_msi_property_arg) + .collect::>() + .join(" "); + msi_args = OsString::from(format!("LAUNCHAPPARGS=\"{escaped_args}\"")); + + [OsStr::new("/i"), path.as_os_str()] + .into_iter() + .chain(install_mode.msiexec_args().iter().map(OsStr::new)) + .chain(once(OsStr::new("/promptrestart"))) + .chain(self.installer_args()) + .chain(once(OsStr::new("AUTOLAUNCHAPP=True"))) + .chain(once(msi_args.as_os_str())) + .collect() + } + }; - // extract the msi - extractor.extract(&tmp_dir)?; + if let Some(on_before_exit) = self.on_before_exit.as_ref() { + on_before_exit(); + } - let paths = fs::read_dir(&tmp_dir)?; + let file = match &updater_type { + WindowsUpdaterType::Nsis { path, .. } => path.as_os_str().to_os_string(), + WindowsUpdaterType::Msi { .. } => std::env::var("SYSTEMROOT").as_ref().map_or_else( + |_| OsString::from("msiexec.exe"), + |p| OsString::from(format!("{p}\\System32\\msiexec.exe")), + ), + }; + let file = encode_wide(file); + + let parameters = installer_args.join(OsStr::new(" ")); + let parameters = encode_wide(parameters); + + unsafe { + ShellExecuteW( + std::ptr::null_mut(), + w!("open"), + file.as_ptr(), + parameters.as_ptr(), + std::ptr::null(), + SW_SHOW, + ) + }; - let system_root = std::env::var("SYSTEMROOT"); - let powershell_path = system_root.as_ref().map_or_else( - |_| "powershell.exe".to_string(), - |p| format!("{p}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"), - ); + std::process::exit(0); + } - for path in paths { - let found_path = path?.path(); - // we support 2 type of files exe & msi for now - // If it's an `exe` we expect an installer not a runtime. - if found_path.extension() == Some(OsStr::new("exe")) { - // we need to wrap the installer path in quotes for Start-Process - let mut installer_path = std::ffi::OsString::new(); - installer_path.push("\""); - installer_path.push(&found_path); - installer_path.push("\""); - - let installer_args = [ - self.config - .windows - .as_ref() - .map(|w| { - w.install_mode - .nsis_args() - .iter() - .map(|a| OsStr::new(a)) - .collect::>() - }) - .unwrap_or_default(), - self.installer_args - .iter() - .map(|a| a.as_os_str()) - .collect::>(), - ] - .concat(); - - // Run the installer - let mut cmd = Command::new(powershell_path); - - cmd.args(["-NoProfile", "-WindowStyle", "Hidden"]) - .args(["Start-Process"]) - .arg(installer_path); - - if !installer_args.is_empty() { - cmd.arg("-ArgumentList") - .arg(installer_args.join(OsStr::new(", "))); - } - cmd.spawn().expect("installer failed to start"); - - std::process::exit(0); - } else if found_path.extension() == Some(OsStr::new("msi")) { - // we need to wrap the current exe path in quotes for Start-Process - let mut current_exe_arg = std::ffi::OsString::new(); - current_exe_arg.push("\""); - current_exe_arg.push(current_exe()?); - current_exe_arg.push("\""); - - let mut msi_path = std::ffi::OsString::new(); - msi_path.push("\"\"\""); - msi_path.push(&found_path); - msi_path.push("\"\"\""); - - let installer_args = [ - self.config - .windows - .as_ref() - .map(|w| { - w.install_mode - .msiexec_args() - .iter() - .map(|a| OsStr::new(a)) - .collect::>() - }) - .unwrap_or_default(), - self.installer_args - .iter() - .map(|a| a.as_os_str()) - .collect::>(), - ] - .concat(); - - // run the installer and relaunch the application - let powershell_install_res = Command::new(powershell_path) - .args(["-NoProfile", "-WindowStyle", "Hidden"]) - .args([ - "Start-Process", - "-Wait", - "-FilePath", - "$Env:SYSTEMROOT\\System32\\msiexec.exe", - "-ArgumentList", - ]) - .arg("/i,") - .arg(&msi_path) - .arg(format!( - ", {}, /promptrestart;", - installer_args.join(OsStr::new(", ")).to_string_lossy() - )) - .arg("Start-Process") - .arg(current_exe_arg) - .spawn(); - if powershell_install_res.is_err() { - // fallback to running msiexec directly - relaunch won't be available - // we use this here in case powershell fails in an older machine somehow - let msiexec_path = system_root.as_ref().map_or_else( - |_| "msiexec.exe".to_string(), - |p| format!("{p}\\System32\\msiexec.exe"), - ); - let _ = Command::new(msiexec_path) - .arg("/i") - .arg(msi_path) - .args(installer_args) - .arg("/promptrestart") - .spawn(); - } + fn installer_args(&self) -> Vec<&OsStr> { + self.installer_args + .iter() + .map(OsStr::new) + .collect::>() + } - std::process::exit(0); + fn current_exe_args(&self) -> Vec<&OsStr> { + self.current_exe_args + .iter() + .map(OsStr::new) + .collect::>() + } + + fn extract(&self, bytes: &[u8]) -> Result { + #[cfg(feature = "zip")] + if infer::archive::is_zip(bytes) { + return self.extract_zip(bytes); + } + + self.extract_exe(bytes) + } + + fn make_temp_dir(&self) -> Result { + Ok(tempfile::Builder::new() + .prefix(&format!("{}-{}-updater-", self.app_name, self.version)) + .tempdir()? + .into_path()) + } + + #[cfg(feature = "zip")] + fn extract_zip(&self, bytes: &[u8]) -> Result { + let temp_dir = self.make_temp_dir()?; + + let archive = Cursor::new(bytes); + let mut extractor = zip::ZipArchive::new(archive)?; + extractor.extract(&temp_dir)?; + + let paths = std::fs::read_dir(&temp_dir)?; + for path in paths { + let path = path?.path(); + let ext = path.extension(); + if ext == Some(OsStr::new("exe")) { + return Ok(WindowsUpdaterType::nsis(path, None)); + } else if ext == Some(OsStr::new("msi")) { + return Ok(WindowsUpdaterType::msi(path, None)); } } - Ok(()) + Err(crate::Error::BinaryNotFoundInArchive) } - // Linux (AppImage) - // - // ### Expected structure: - // ├── [AppName]_[version]_amd64.AppImage.tar.gz # GZ generated by tauri-bundler - // │ └──[AppName]_[version]_amd64.AppImage # Application AppImage - // └── ... - // - // We should have an AppImage already installed to be able to copy and install - // the extract_path is the current AppImage path - // tmp_dir is where our new AppImage is found - #[cfg(any( - target_os = "linux", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "netbsd", - target_os = "openbsd" - ))] - fn install_inner(&self, bytes: Vec) -> Result<()> { - use flate2::read::GzDecoder; + fn extract_exe(&self, bytes: &[u8]) -> Result { + if infer::app::is_exe(bytes) { + let (path, temp) = self.write_to_temp(bytes, ".exe")?; + Ok(WindowsUpdaterType::nsis(path, temp)) + } else if infer::archive::is_msi(bytes) { + let (path, temp) = self.write_to_temp(bytes, ".msi")?; + Ok(WindowsUpdaterType::msi(path, temp)) + } else { + Err(crate::Error::InvalidUpdaterFormat) + } + } + + fn write_to_temp( + &self, + bytes: &[u8], + ext: &str, + ) -> Result<(PathBuf, Option)> { + use std::io::Write; + + let temp_dir = self.make_temp_dir()?; + let mut temp_file = tempfile::Builder::new() + .prefix(&format!("{}-{}-installer", self.app_name, self.version)) + .suffix(ext) + .rand_bytes(0) + .tempfile_in(temp_dir)?; + temp_file.write_all(bytes)?; + + let temp = temp_file.into_temp_path(); + Ok((temp.to_path_buf(), Some(temp))) + } +} + +/// Linux (AppImage) +#[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" +))] +impl Update { + /// ### Expected structure: + /// ├── [AppName]_[version]_amd64.AppImage.tar.gz # GZ generated by tauri-bundler + /// │ └──[AppName]_[version]_amd64.AppImage # Application AppImage + /// └── ... + /// + /// We should have an AppImage already installed to be able to copy and install + /// the extract_path is the current AppImage path + /// tmp_dir is where our new AppImage is found + fn install_inner(&self, bytes: &[u8]) -> Result<()> { use std::os::unix::fs::{MetadataExt, PermissionsExt}; - let archive = Cursor::new(bytes); let extract_path_metadata = self.extract_path.metadata()?; let tmp_dir_locations = vec![ Box::new(|| Some(std::env::temp_dir())) as Box Option>, - Box::new(dirs_next::cache_dir), + Box::new(dirs::cache_dir), Box::new(|| Some(self.extract_path.parent().unwrap().to_path_buf())), ]; @@ -702,47 +789,64 @@ impl Update { let tmp_app_image = &tmp_dir.path().join("current_app.AppImage"); + let permissions = std::fs::metadata(&self.extract_path)?.permissions(); + // create a backup of our current app image std::fs::rename(&self.extract_path, tmp_app_image)?; - // extract the buffer to the tmp_dir - // we extract our signed archive into our final directory without any temp file - let decoder = GzDecoder::new(archive); - let mut archive = tar::Archive::new(decoder); - for mut entry in archive.entries()?.flatten() { - if let Ok(path) = entry.path() { - if path.extension() == Some(OsStr::new("AppImage")) { - // if something went wrong during the extraction, we should restore previous app - if let Err(err) = entry.unpack(&self.extract_path) { - std::fs::rename(tmp_app_image, &self.extract_path)?; - return Err(err.into()); + #[cfg(feature = "zip")] + if infer::archive::is_gz(bytes) { + // extract the buffer to the tmp_dir + // we extract our signed archive into our final directory without any temp file + let archive = Cursor::new(bytes); + let decoder = flate2::read::GzDecoder::new(archive); + let mut archive = tar::Archive::new(decoder); + for mut entry in archive.entries()?.flatten() { + if let Ok(path) = entry.path() { + if path.extension() == Some(OsStr::new("AppImage")) { + // if something went wrong during the extraction, we should restore previous app + if let Err(err) = entry.unpack(&self.extract_path) { + std::fs::rename(tmp_app_image, &self.extract_path)?; + return Err(err.into()); + } + // early finish we have everything we need here + return Ok(()); } - // early finish we have everything we need here - return Ok(()); } } + // if we have not returned early we should restore the backup + std::fs::rename(tmp_app_image, &self.extract_path)?; + return Err(Error::BinaryNotFoundInArchive); } - // if we have not returned early we should restore the backup - std::fs::rename(tmp_app_image, &self.extract_path)?; - return Err(Error::BinaryNotFoundInArchive); + return match std::fs::write(&self.extract_path, bytes) + .and_then(|_| std::fs::set_permissions(&self.extract_path, permissions)) + { + Err(err) => { + // if something went wrong during the extraction, we should restore previous app + std::fs::rename(tmp_app_image, &self.extract_path)?; + Err(err.into()) + } + Ok(_) => Ok(()), + }; } } } Err(Error::TempDirNotOnSameMountPoint) } +} - // MacOS - // - // ### Expected structure: - // ├── [AppName]_[version]_x64.app.tar.gz # GZ generated by tauri-bundler - // │ └──[AppName].app # Main application - // │ └── Contents # Application contents... - // │ └── ... - // └── ... - #[cfg(target_os = "macos")] - fn install_inner(&self, bytes: Vec) -> Result<()> { +/// MacOS +#[cfg(target_os = "macos")] +impl Update { + /// ### Expected structure: + /// ├── [AppName]_[version]_x64.app.tar.gz # GZ generated by tauri-bundler + /// │ └──[AppName].app # Main application + /// │ └── Contents # Application contents... + /// │ └── ... + /// └── ... + fn install_inner(&self, bytes: &[u8]) -> Result<()> { use flate2::read::GzDecoder; let cursor = Cursor::new(bytes); @@ -918,30 +1022,15 @@ where } // Validate signature -// need to be public because its been used -// by our tests in the bundler -// -// NOTE: The buffer position is not reset. -pub fn verify_signature( - archive_reader: &mut R, - release_signature: &str, - pub_key: &str, -) -> Result -where - R: Read, -{ +fn verify_signature(data: &[u8], release_signature: &str, pub_key: &str) -> Result { // we need to convert the pub key let pub_key_decoded = base64_to_string(pub_key)?; let public_key = PublicKey::decode(&pub_key_decoded)?; let signature_base64_decoded = base64_to_string(release_signature)?; let signature = Signature::decode(&signature_base64_decoded)?; - // read all bytes until EOF in the buffer - let mut data = Vec::new(); - archive_reader.read_to_end(&mut data)?; - // Validate signature or bail out - public_key.verify(&data, &signature, true)?; + public_key.verify(data, &signature, true)?; Ok(true) } @@ -952,3 +1041,119 @@ fn base64_to_string(base64_string: &str) -> Result { .to_string(); Ok(result) } + +#[cfg(windows)] +fn encode_wide(string: impl AsRef) -> Vec { + use std::os::windows::ffi::OsStrExt; + + string + .as_ref() + .encode_wide() + .chain(std::iter::once(0)) + .collect() +} + +#[cfg(windows)] +trait PathExt { + fn wrap_in_quotes(&self) -> Self; +} + +#[cfg(windows)] +impl PathExt for PathBuf { + fn wrap_in_quotes(&self) -> Self { + let mut msi_path = OsString::from("\""); + msi_path.push(self.as_os_str()); + msi_path.push("\""); + PathBuf::from(msi_path) + } +} + +#[cfg(windows)] +fn escape_msi_property_arg(arg: impl AsRef) -> String { + let mut arg = arg.as_ref().to_string_lossy().to_string(); + + // Otherwise this argument will get lost in ShellExecute + if arg.is_empty() { + return "\"\"\"\"".to_string(); + } else if !arg.contains(' ') && !arg.contains('"') { + return arg; + } + + if arg.contains('"') { + arg = arg.replace('"', r#""""""#) + } + + if arg.starts_with('-') { + if let Some((a1, a2)) = arg.split_once('=') { + format!("{a1}=\"\"{a2}\"\"") + } else { + format!("\"\"{arg}\"\"") + } + } else { + format!("\"\"{arg}\"\"") + } +} + +#[cfg(test)] +mod tests { + + #[test] + #[cfg(windows)] + fn it_wraps_correctly() { + use super::PathExt; + use std::path::PathBuf; + + assert_eq!( + PathBuf::from("C:\\Users\\Some User\\AppData\\tauri-example.exe").wrap_in_quotes(), + PathBuf::from("\"C:\\Users\\Some User\\AppData\\tauri-example.exe\"") + ) + } + + #[test] + #[cfg(windows)] + fn it_escapes_correctly() { + use crate::updater::escape_msi_property_arg; + + // Explanation for quotes: + // The output of escape_msi_property_args() will be used in `LAUNCHAPPARGS=\"{HERE}\"`. This is the first quote level. + // To escape a quotation mark we use a second quotation mark, so "" is interpreted as " later. + // This means that the escaped strings can't ever have a single quotation mark! + // Now there are 3 major things to look out for to not break the msiexec call: + // 1) Wrap spaces in quotation marks, otherwise it will be interpreted as the end of the msiexec argument. + // 2) Escape escaping quotation marks, otherwise they will either end the msiexec argument or be ignored. + // 3) Escape emtpy args in quotation marks, otherwise the argument will get lost. + let cases = [ + "something", + "--flag", + "--empty=", + "--arg=value", + "some space", // This simulates `./my-app "some string"`. + "--arg value", // -> This simulates `./my-app "--arg value"`. Same as above but it triggers the startsWith(`-`) logic. + "--arg=unwrapped space", // `./my-app --arg="unwrapped space"` + "--arg=\"wrapped\"", // `./my-app --args=""wrapped""` + "--arg=\"wrapped space\"", // `./my-app --args=""wrapped space""` + "--arg=midword\"wrapped space\"", // `./my-app --args=midword""wrapped""` + "", // `./my-app '""'` + ]; + let cases_escaped = [ + "something", + "--flag", + "--empty=", + "--arg=value", + "\"\"some space\"\"", + "\"\"--arg value\"\"", + "--arg=\"\"unwrapped space\"\"", + r#"--arg=""""""wrapped"""""""#, + r#"--arg=""""""wrapped space"""""""#, + r#"--arg=""midword""""wrapped space"""""""#, + "\"\"\"\"", + ]; + + // Just to be sure we didn't mess that up + assert_eq!(cases.len(), cases_escaped.len()); + + for (orig, escaped) in cases.iter().zip(cases_escaped) { + assert_eq!(escape_msi_property_arg(orig), escaped); + } + } +} diff --git a/plugins/updater/tests/app-updater/Cargo.toml b/plugins/updater/tests/app-updater/Cargo.toml index c80ac920..71b9f900 100644 --- a/plugins/updater/tests/app-updater/Cargo.toml +++ b/plugins/updater/tests/app-updater/Cargo.toml @@ -7,12 +7,12 @@ edition = { workspace = true } tauri-build = { workspace = true } [dependencies] -tauri = { workspace = true } +tauri = { workspace = true, features = ["wry", "compression"] } serde = { workspace = true } serde_json = { workspace = true } tauri-plugin-updater = { path = "../.." } -tiny_http = "0.11" +tiny_http = "0.12" time = { version = "0.3", features = ["formatting"] } [features] -custom-protocol = ["tauri/custom-protocol"] +prod = ["tauri/custom-protocol"] diff --git a/plugins/updater/tests/app-updater/src/main.rs b/plugins/updater/tests/app-updater/src/main.rs index ad145c49..bbe398b5 100644 --- a/plugins/updater/tests/app-updater/src/main.rs +++ b/plugins/updater/tests/app-updater/src/main.rs @@ -42,7 +42,7 @@ fn main() { std::process::exit(0); } Ok(None) => { - std::process::exit(0); + std::process::exit(2); } Err(e) => { println!("{e}"); diff --git a/plugins/updater/tests/app-updater/tauri.conf.json b/plugins/updater/tests/app-updater/tauri.conf.json index 5eb96954..f2c6df21 100644 --- a/plugins/updater/tests/app-updater/tauri.conf.json +++ b/plugins/updater/tests/app-updater/tauri.conf.json @@ -3,15 +3,17 @@ "plugins": { "updater": { "endpoints": ["http://localhost:3007"], - "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEMwNjY1MEExMTFBMDU5RTUKUldUbFdhQVJvVkJtd09sZ1ROT25yVGFhU2o0ZnUyd1FlT0ZTQ2ZXamN3SXk4SjZLZmNwRnV5dTMK", + "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEUwNDRGMjkwRjg2MDhCRDAKUldUUWkyRDRrUEpFNEQ4SmdwcU5PaXl6R2ZRUUNvUnhIaVkwVUltV0NMaEx6VTkrWVhpT0ZqeEEK", "windows": { - "installMode": "quiet" + "installMode": "quiet", + "installerArgs": ["/NS"] } } }, "bundle": { "active": true, "targets": "all", + "createUpdaterArtifacts": true, "icon": [ "icons/32x32.png", "icons/128x128.png", @@ -20,8 +22,11 @@ "icons/icon.ico" ], "windows": { - "wix": { - "skipWebviewInstall": true + "webviewInstallMode": { + "type": "skip" + }, + "nsis": { + "compression": "none" } } } diff --git a/plugins/updater/tests/app-updater/tests/update.rs b/plugins/updater/tests/app-updater/tests/update.rs index 797be1f8..230ab376 100644 --- a/plugins/updater/tests/app-updater/tests/update.rs +++ b/plugins/updater/tests/app-updater/tests/update.rs @@ -9,15 +9,26 @@ use std::{ fs::File, path::{Path, PathBuf}, process::Command, + sync::Arc, }; use serde::Serialize; +use tauri::utils::config::{Updater, V1Compatible}; -const UPDATER_PRIVATE_KEY: &str = "dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5Qm9uUXIyeEM2YkczeGMwZDFENmw1WHEzaFk5aDlOOXNyTWRxRnY4UUpzZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQTVWbWdFYUZRWnNDZmdyUW9ibWExVEFTY0pVTWpVS2xlOHdhR1I3Q3hpd2FTNjg1MXZENEQyZWxnVE5PbnJUYWFTajRmdTJ3UWVPRlNDZldqY3dJeThKNktmY3BGdXl1M1BPdHgwOFhIQzJLSnpqS0Z2cVdmaEs2WWRmK3d4SHVCMlpHVGduaVAzclU9Cg=="; +const UPDATER_PRIVATE_KEY: &str = "dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5TlFOMFpXYzJFOUdjeHJEVXY4WE1TMUxGNDJVUjNrMmk1WlR3UVJVUWwva0FBQkFBQUFBQUFBQUFBQUlBQUFBQUpVK3ZkM3R3eWhyN3hiUXhQb2hvWFVzUW9FbEs3NlNWYjVkK1F2VGFRU1FEaGxuRUtlell5U0gxYS9DbVRrS0YyZVJGblhjeXJibmpZeGJjS0ZKSUYwYndYc2FCNXpHalM3MHcrODMwN3kwUG9SOWpFNVhCSUd6L0E4TGRUT096TEtLR1JwT1JEVFU9Cg=="; +const UPDATED_EXIT_CODE: i32 = 0; +const UP_TO_DATE_EXIT_CODE: i32 = 2; #[derive(Serialize)] struct Config { version: &'static str, + bundle: BundleConfig, +} + +#[derive(Serialize)] +#[serde(rename_all = "camelCase")] +struct BundleConfig { + create_updater_artifacts: Updater, } #[derive(Serialize)] @@ -40,6 +51,8 @@ fn build_app(cwd: &Path, config: &Config, bundle_updater: bool, target: BundleTa .args(["tauri", "build", "--debug", "--verbose"]) .arg("--config") .arg(serde_json::to_string(config).unwrap()) + .env("TAURI_SIGNING_PRIVATE_KEY", UPDATER_PRIVATE_KEY) + .env("TAURI_SIGNING_PRIVATE_KEY_PASSWORD", "") .current_dir(cwd); #[cfg(target_os = "linux")] @@ -51,10 +64,7 @@ fn build_app(cwd: &Path, config: &Config, bundle_updater: bool, target: BundleTa #[cfg(windows)] command.args(["--bundles", "msi", "nsis"]); - command - .env("TAURI_SIGNING_PRIVATE_KEY", UPDATER_PRIVATE_KEY) - .env("TAURI_SIGNING_PRIVATE_KEY_PASSWORD", "") - .args(["--bundles", "updater"]); + command.args(["--bundles", "updater"]); } else { #[cfg(windows)] command.args(["--bundles", target.name()]); @@ -64,7 +74,7 @@ fn build_app(cwd: &Path, config: &Config, bundle_updater: bool, target: BundleTa .status() .expect("failed to run Tauri CLI to bundle app"); - if !status.code().map(|c| c == 0).unwrap_or(true) { + if !status.success() { panic!("failed to bundle app {:?}", status.code()); } } @@ -158,41 +168,83 @@ fn update_app() { let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); let root_dir = manifest_dir.join("../../../.."); - let mut config = Config { version: "1.0.0" }; - - // bundle app update - build_app(&manifest_dir, &config, true, Default::default()); - - let updater_zip_ext = if cfg!(windows) { "zip" } else { "tar.gz" }; - - for (bundle_target, out_bundle_path) in bundle_paths(&root_dir, "1.0.0") { - let bundle_updater_ext = out_bundle_path - .extension() - .unwrap() - .to_str() - .unwrap() - .replace("exe", "nsis"); - let signature_path = - out_bundle_path.with_extension(format!("{bundle_updater_ext}.{updater_zip_ext}.sig")); - let signature = std::fs::read_to_string(&signature_path).unwrap_or_else(|_| { - panic!("failed to read signature file {}", signature_path.display()) - }); - let out_updater_path = - out_bundle_path.with_extension(format!("{}.{}", bundle_updater_ext, updater_zip_ext)); - let updater_path = root_dir.join(format!( - "target/debug/{}", - out_updater_path.file_name().unwrap().to_str().unwrap() - )); - std::fs::rename(&out_updater_path, &updater_path).expect("failed to rename bundle"); - - let target = target.clone(); - std::thread::spawn(move || { + for mut config in [ + Config { + version: "1.0.0", + bundle: BundleConfig { + create_updater_artifacts: Updater::Bool(true), + }, + }, + Config { + version: "1.0.0", + bundle: BundleConfig { + create_updater_artifacts: Updater::String(V1Compatible::V1Compatible), + }, + }, + ] { + let v1_compatible = matches!( + config.bundle.create_updater_artifacts, + Updater::String(V1Compatible::V1Compatible) + ); + + // bundle app update + build_app(&manifest_dir, &config, true, Default::default()); + + let updater_zip_ext = if v1_compatible { + if cfg!(windows) { + Some("zip") + } else { + Some("tar.gz") + } + } else if cfg!(target_os = "macos") { + Some("tar.gz") + } else { + None + }; + + for (bundle_target, out_bundle_path) in bundle_paths(&root_dir, "1.0.0") { + let bundle_updater_ext = if v1_compatible { + out_bundle_path + .extension() + .unwrap() + .to_str() + .unwrap() + .replace("exe", "nsis") + } else { + out_bundle_path + .extension() + .unwrap() + .to_str() + .unwrap() + .to_string() + }; + let updater_extension = if let Some(updater_zip_ext) = updater_zip_ext { + format!("{bundle_updater_ext}.{updater_zip_ext}") + } else { + bundle_updater_ext + }; + let signature_extension = format!("{updater_extension}.sig"); + let signature_path = out_bundle_path.with_extension(signature_extension); + let signature = std::fs::read_to_string(&signature_path).unwrap_or_else(|_| { + panic!("failed to read signature file {}", signature_path.display()) + }); + let out_updater_path = out_bundle_path.with_extension(updater_extension); + let updater_path = root_dir.join(format!( + "target/debug/{}", + out_updater_path.file_name().unwrap().to_str().unwrap() + )); + std::fs::rename(&out_updater_path, &updater_path).expect("failed to rename bundle"); + + let target = target.clone(); + // start the updater server - let server = - tiny_http::Server::http("localhost:3007").expect("failed to start updater server"); + let server = Arc::new( + tiny_http::Server::http("localhost:3007").expect("failed to start updater server"), + ); - loop { - if let Ok(request) = server.recv() { + let server_ = server.clone(); + std::thread::spawn(move || { + for request in server_.incoming_requests() { match request.url() { "/" => { let mut platforms = HashMap::new(); @@ -232,45 +284,63 @@ fn update_app() { ) }), )); - // close server - return; } _ => (), } } + }); + + config.version = "0.1.0"; + + // bundle initial app version + build_app(&manifest_dir, &config, false, bundle_target); + + let status_checks = if matches!(bundle_target, BundleTarget::Msi) { + // for msi we can't really check if the app was updated, because we can't change the install path + vec![UPDATED_EXIT_CODE] + } else { + vec![UPDATED_EXIT_CODE, UP_TO_DATE_EXIT_CODE] + }; + + for expected_exit_code in status_checks { + let mut binary_cmd = if cfg!(windows) { + Command::new(root_dir.join("target/debug/app-updater.exe")) + } else if cfg!(target_os = "macos") { + Command::new( + bundle_paths(&root_dir, "0.1.0") + .first() + .unwrap() + .1 + .join("Contents/MacOS/app-updater"), + ) + } else if std::env::var("CI").map(|v| v == "true").unwrap_or_default() { + let mut c = Command::new("xvfb-run"); + c.arg("--auto-servernum") + .arg(&bundle_paths(&root_dir, "0.1.0").first().unwrap().1); + c + } else { + Command::new(&bundle_paths(&root_dir, "0.1.0").first().unwrap().1) + }; + + binary_cmd.env("TARGET", bundle_target.name()); + + let status = binary_cmd.status().expect("failed to run app"); + let code = status.code().unwrap_or(-1); + + if code != expected_exit_code { + panic!( + "failed to run app, expected exit code {expected_exit_code}, got {code}" + ); + } + #[cfg(windows)] + if code == UPDATED_EXIT_CODE { + // wait for the update to finish + std::thread::sleep(std::time::Duration::from_secs(5)); + } } - }); - - config.version = "0.1.0"; - - // bundle initial app version - build_app(&manifest_dir, &config, false, bundle_target); - - let mut binary_cmd = if cfg!(windows) { - Command::new(root_dir.join("target/debug/app-updater.exe")) - } else if cfg!(target_os = "macos") { - Command::new( - bundle_paths(&root_dir, "0.1.0") - .first() - .unwrap() - .1 - .join("Contents/MacOS/app-updater"), - ) - } else if std::env::var("CI").map(|v| v == "true").unwrap_or_default() { - let mut c = Command::new("xvfb-run"); - c.arg("--auto-servernum") - .arg(&bundle_paths(&root_dir, "0.1.0").first().unwrap().1); - c - } else { - Command::new(&bundle_paths(&root_dir, "0.1.0").first().unwrap().1) - }; - - binary_cmd.env("TARGET", bundle_target.name()); - - let status = binary_cmd.status().expect("failed to run app"); - if !status.success() { - panic!("failed to run app"); + // graceful shutdown + server.unblock(); } } } diff --git a/plugins/updater/tests/updater-migration/Cargo.toml b/plugins/updater/tests/updater-migration/Cargo.toml new file mode 100644 index 00000000..4edb07da --- /dev/null +++ b/plugins/updater/tests/updater-migration/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "updater-migration-test" +version = "0.1.0" +edition = { workspace = true } + +[build-dependencies] +tauri-build = { workspace = true } + +[dependencies] +tauri = { workspace = true, features = ["wry", "compression"] } +serde = { workspace = true } +serde_json = { workspace = true } +tauri-plugin-updater = { path = "../.." } +tiny_http = "0.12" +time = { version = "0.3", features = ["formatting"] } diff --git a/plugins/updater/tests/updater-migration/icons/128x128.png b/plugins/updater/tests/updater-migration/icons/128x128.png new file mode 100644 index 00000000..77e7d233 Binary files /dev/null and b/plugins/updater/tests/updater-migration/icons/128x128.png differ diff --git a/plugins/updater/tests/updater-migration/icons/128x128@2x.png b/plugins/updater/tests/updater-migration/icons/128x128@2x.png new file mode 100644 index 00000000..0f7976f1 Binary files /dev/null and b/plugins/updater/tests/updater-migration/icons/128x128@2x.png differ diff --git a/plugins/updater/tests/updater-migration/icons/32x32.png b/plugins/updater/tests/updater-migration/icons/32x32.png new file mode 100644 index 00000000..98fda06f Binary files /dev/null and b/plugins/updater/tests/updater-migration/icons/32x32.png differ diff --git a/plugins/updater/tests/updater-migration/icons/icon.icns b/plugins/updater/tests/updater-migration/icons/icon.icns new file mode 100644 index 00000000..5594104c Binary files /dev/null and b/plugins/updater/tests/updater-migration/icons/icon.icns differ diff --git a/plugins/updater/tests/updater-migration/icons/icon.ico b/plugins/updater/tests/updater-migration/icons/icon.ico new file mode 100644 index 00000000..06c23c82 Binary files /dev/null and b/plugins/updater/tests/updater-migration/icons/icon.ico differ diff --git a/plugins/updater/tests/updater-migration/icons/icon.png b/plugins/updater/tests/updater-migration/icons/icon.png new file mode 100644 index 00000000..d1756ce4 Binary files /dev/null and b/plugins/updater/tests/updater-migration/icons/icon.png differ diff --git a/plugins/updater/tests/updater-migration/tests/update.rs b/plugins/updater/tests/updater-migration/tests/update.rs new file mode 100644 index 00000000..56cb2d30 --- /dev/null +++ b/plugins/updater/tests/updater-migration/tests/update.rs @@ -0,0 +1,473 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +#![allow(dead_code, unused_imports)] + +use std::{ + collections::HashMap, + fs::File, + path::{Path, PathBuf}, + process::Command, + sync::Arc, +}; + +use serde::Serialize; +use tauri::utils::config::{Updater, V1Compatible}; + +const UPDATER_PRIVATE_KEY: &str = "dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5TlFOMFpXYzJFOUdjeHJEVXY4WE1TMUxGNDJVUjNrMmk1WlR3UVJVUWwva0FBQkFBQUFBQUFBQUFBQUlBQUFBQUpVK3ZkM3R3eWhyN3hiUXhQb2hvWFVzUW9FbEs3NlNWYjVkK1F2VGFRU1FEaGxuRUtlell5U0gxYS9DbVRrS0YyZVJGblhjeXJibmpZeGJjS0ZKSUYwYndYc2FCNXpHalM3MHcrODMwN3kwUG9SOWpFNVhCSUd6L0E4TGRUT096TEtLR1JwT1JEVFU9Cg=="; +const UPDATED_EXIT_CODE: i32 = 0; +const UP_TO_DATE_EXIT_CODE: i32 = 2; + +fn npm_command() -> Command { + #[cfg(target_os = "windows")] + let cmd = { + let mut cmd = Command::new("cmd"); + cmd.arg("/c").arg("npm"); + cmd + }; + #[cfg(not(target_os = "windows"))] + let cmd = Command::new("npm"); + cmd +} + +mod v1 { + use super::{npm_command, BundleTarget, UPDATER_PRIVATE_KEY}; + use serde::Serialize; + use std::{ + path::{Path, PathBuf}, + process::Command, + }; + + #[derive(Serialize)] + pub struct PackageConfig { + pub version: &'static str, + } + + #[derive(Serialize)] + pub struct Config { + pub package: PackageConfig, + } + + pub fn build_app(cwd: &Path, config: &Config, bundle_updater: bool, target: BundleTarget) { + let mut command = npm_command(); + command + .args(["run", "tauri", "--", "build", "--debug", "--verbose"]) + .arg("--config") + .arg(serde_json::to_string(config).unwrap()) + .env("TAURI_PRIVATE_KEY", UPDATER_PRIVATE_KEY) + .env("TAURI_KEY_PASSWORD", "") + .current_dir(cwd); + + #[cfg(target_os = "linux")] + command.args(["--bundles", target.name()]); + #[cfg(target_os = "macos")] + command.args(["--bundles", target.name()]); + + if bundle_updater { + #[cfg(windows)] + command.args(["--bundles", "msi", "nsis"]); + + command.args(["--bundles", "updater"]); + } else { + #[cfg(windows)] + command.args(["--bundles", target.name()]); + } + + let status = command + .status() + .expect("failed to run Tauri CLI to bundle v1 app"); + + if !status.success() { + panic!("failed to bundle v1 app {:?}", status.code()); + } + } + + #[cfg(target_os = "linux")] + pub fn bundle_paths(root_dir: &Path, version: &str) -> Vec<(BundleTarget, PathBuf)> { + vec![( + BundleTarget::AppImage, + root_dir.join(format!( + "target/debug/bundle/appimage/app-updater-v1_{version}_amd64.AppImage", + )), + )] + } + + #[cfg(target_os = "macos")] + pub fn bundle_paths(root_dir: &Path, _version: &str) -> Vec<(BundleTarget, PathBuf)> { + vec![( + BundleTarget::App, + root_dir.join("target/debug/bundle/macos/app-updater-v1.app"), + )] + } + + #[cfg(target_os = "ios")] + pub fn bundle_paths(root_dir: &Path, _version: &str) -> Vec<(BundleTarget, PathBuf)> { + vec![( + BundleTarget::App, + root_dir.join("target/debug/bundle/ios/app-updater-v1.ipa"), + )] + } + + #[cfg(target_os = "android")] + pub fn bundle_path(root_dir: &Path, _version: &str) -> PathBuf { + root_dir.join("target/debug/bundle/android/app-updater-v1.apk") + } + + #[cfg(windows)] + pub fn bundle_paths(root_dir: &Path, version: &str) -> Vec<(BundleTarget, PathBuf)> { + vec![ + ( + BundleTarget::Nsis, + root_dir.join(format!( + "target/debug/bundle/nsis/app-updater-v1_{version}_x64-setup.exe" + )), + ), + ( + BundleTarget::Msi, + root_dir.join(format!( + "target/debug/bundle/msi/app-updater-v1_{version}_x64_en-US.msi" + )), + ), + ] + } +} + +mod v2 { + + use super::{BundleTarget, UPDATER_PRIVATE_KEY}; + use serde::Serialize; + use std::{ + path::{Path, PathBuf}, + process::Command, + }; + use tauri::utils::config::Updater; + + #[derive(Serialize)] + pub struct Config { + pub version: &'static str, + pub bundle: BundleConfig, + } + + #[derive(Serialize)] + #[serde(rename_all = "camelCase")] + pub struct BundleConfig { + pub create_updater_artifacts: Updater, + } + + pub fn build_app(cwd: &Path, config: &Config, bundle_updater: bool, target: BundleTarget) { + let mut command = Command::new("cargo"); + command + .args(["tauri", "build", "--debug", "--verbose"]) + .arg("--config") + .arg(serde_json::to_string(config).unwrap()) + .env("TAURI_SIGNING_PRIVATE_KEY", UPDATER_PRIVATE_KEY) + .env("TAURI_SIGNING_PRIVATE_KEY_PASSWORD", "") + .current_dir(cwd); + + #[cfg(target_os = "linux")] + command.args(["--bundles", target.name()]); + #[cfg(target_os = "macos")] + command.args(["--bundles", target.name()]); + + if bundle_updater { + #[cfg(windows)] + command.args(["--bundles", "msi", "nsis"]); + + command.args(["--bundles", "updater"]); + } else { + #[cfg(windows)] + command.args(["--bundles", target.name()]); + } + + let status = command + .status() + .expect("failed to run Tauri CLI to bundle v2 app"); + + if !status.success() { + panic!("failed to bundle v2 app {:?}", status.code()); + } + } + + #[cfg(target_os = "linux")] + pub fn bundle_paths(root_dir: &Path, version: &str) -> Vec<(BundleTarget, PathBuf)> { + vec![( + BundleTarget::AppImage, + root_dir.join(format!( + "target/debug/bundle/appimage/app-updater-v2_{version}_amd64.AppImage", + )), + )] + } + + #[cfg(target_os = "macos")] + pub fn bundle_paths(root_dir: &Path, _version: &str) -> Vec<(BundleTarget, PathBuf)> { + vec![( + BundleTarget::App, + root_dir.join("target/debug/bundle/macos/app-updater-v2.app"), + )] + } + + #[cfg(target_os = "ios")] + pub fn bundle_paths(root_dir: &Path, _version: &str) -> Vec<(BundleTarget, PathBuf)> { + vec![( + BundleTarget::App, + root_dir.join("target/debug/bundle/ios/app-updater-v2.ipa"), + )] + } + + #[cfg(target_os = "android")] + pub fn bundle_path(root_dir: &Path, _version: &str) -> PathBuf { + root_dir.join("target/debug/bundle/android/app-updater-v2.apk") + } + + #[cfg(windows)] + pub fn bundle_paths(root_dir: &Path, version: &str) -> Vec<(BundleTarget, PathBuf)> { + vec![ + ( + BundleTarget::Nsis, + root_dir.join(format!( + "target/debug/bundle/nsis/app-updater-v2_{version}_x64-setup.exe" + )), + ), + ( + BundleTarget::Msi, + root_dir.join(format!( + "target/debug/bundle/msi/app-updater-v2_{version}_x64_en-US.msi" + )), + ), + ] + } +} + +#[derive(Serialize)] +struct PlatformUpdate { + signature: String, + url: &'static str, + with_elevated_task: bool, +} + +#[derive(Serialize)] +struct Update { + version: &'static str, + date: String, + platforms: HashMap, +} + +#[derive(Copy, Clone)] +enum BundleTarget { + AppImage, + + App, + + Msi, + Nsis, +} + +impl BundleTarget { + fn name(self) -> &'static str { + match self { + Self::AppImage => "appimage", + Self::App => "app", + Self::Msi => "msi", + Self::Nsis => "nsis", + } + } +} + +impl Default for BundleTarget { + fn default() -> Self { + #[cfg(any(target_os = "macos", target_os = "ios"))] + return Self::App; + #[cfg(target_os = "linux")] + return Self::AppImage; + #[cfg(windows)] + return Self::Nsis; + } +} + +#[test] +#[ignore] +fn update_app() { + let target = + tauri_plugin_updater::target().expect("running updater test in an unsupported platform"); + let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + let root_dir = manifest_dir.join("../../../.."); + let v1_root_dir = manifest_dir.join("v1-app"); + let v2_root_dir = manifest_dir.join("v2-app"); + + let status = npm_command() + .arg("install") + .current_dir(&v1_root_dir) + .status() + .expect("failed to run npm install"); + if !status.success() { + panic!("failed to run npm install"); + } + + let v2_config = v2::Config { + version: "1.0.0", + bundle: v2::BundleConfig { + create_updater_artifacts: Updater::String(V1Compatible::V1Compatible), + }, + }; + + // bundle app update (v2) + v2::build_app(&v2_root_dir, &v2_config, true, Default::default()); + + let updater_zip_ext = if cfg!(windows) { "zip" } else { "tar.gz" }; + + for (bundle_target, out_bundle_path) in v2::bundle_paths(&root_dir, "1.0.0") { + let bundle_updater_ext = out_bundle_path + .extension() + .unwrap() + .to_str() + .unwrap() + .replace("exe", "nsis"); + let updater_extension = format!("{bundle_updater_ext}.{updater_zip_ext}"); + let signature_extension = format!("{updater_extension}.sig"); + let signature_path = out_bundle_path.with_extension(signature_extension); + let signature = std::fs::read_to_string(&signature_path).unwrap_or_else(|_| { + panic!("failed to read signature file {}", signature_path.display()) + }); + let out_updater_path = out_bundle_path.with_extension(updater_extension); + let updater_path = root_dir.join(format!( + "target/debug/{}", + out_updater_path.file_name().unwrap().to_str().unwrap() + )); + std::fs::rename(&out_updater_path, &updater_path).expect("failed to rename bundle"); + + let target = target.clone(); + + // start the updater server + let server = Arc::new( + tiny_http::Server::http("localhost:3007").expect("failed to start updater server"), + ); + + let server_ = server.clone(); + std::thread::spawn(move || { + for request in server_.incoming_requests() { + match request.url() { + "/" => { + let mut platforms = HashMap::new(); + + platforms.insert( + target.clone(), + PlatformUpdate { + signature: signature.clone(), + url: "http://localhost:3007/download", + with_elevated_task: false, + }, + ); + let body = serde_json::to_vec(&Update { + version: "1.0.0", + date: time::OffsetDateTime::now_utc() + .format(&time::format_description::well_known::Rfc3339) + .unwrap(), + platforms, + }) + .unwrap(); + let len = body.len(); + let response = tiny_http::Response::new( + tiny_http::StatusCode(200), + Vec::new(), + std::io::Cursor::new(body), + Some(len), + None, + ); + let _ = request.respond(response); + } + "/download" => { + let _ = request.respond(tiny_http::Response::from_file( + File::open(&updater_path).unwrap_or_else(|_| { + panic!("failed to open updater bundle {}", updater_path.display()) + }), + )); + } + _ => (), + } + } + }); + + let v1_config = v1::Config { + package: v1::PackageConfig { version: "0.1.0" }, + }; + + // bundle initial app version (tauri v1) + v1::build_app(&v1_root_dir, &v1_config, false, bundle_target); + + let status_checks = if matches!(bundle_target, BundleTarget::Msi) { + // for msi we can't really check if the app was updated, because we can't change the install path + vec![(UPDATED_EXIT_CODE, 1)] + } else { + vec![(UPDATED_EXIT_CODE, 1), (UP_TO_DATE_EXIT_CODE, 2)] + }; + + for (expected_exit_code, expected_tauri_version) in status_checks { + let (expected_app_version, bundle_paths_fn, app_name_suffix) = + match expected_tauri_version { + 1 => ( + v1_config.package.version, + Box::new(|| v1::bundle_paths(&v1_root_dir, v1_config.package.version)) + as Box Vec<(BundleTarget, PathBuf)>>, + "-v1", + ), + 2 => ( + v2_config.version, + Box::new(|| v2::bundle_paths(&root_dir, v2_config.version)) + as Box Vec<(BundleTarget, PathBuf)>>, + "-v2", + ), + _ => panic!("unknown tauri version"), + }; + let mut binary_cmd = if cfg!(windows) { + let app_root_dir = match expected_tauri_version { + 1 => &v1_root_dir, + 2 => &root_dir, + _ => panic!("unknown tauri version"), + }; + Command::new( + app_root_dir.join(format!("target/debug/app-updater{app_name_suffix}.exe")), + ) + } else if cfg!(target_os = "macos") { + Command::new( + bundle_paths_fn() + .first() + .unwrap() + .1 + .join(format!("Contents/MacOS/app-updater{app_name_suffix}")), + ) + } else if std::env::var("CI").map(|v| v == "true").unwrap_or_default() { + let mut c = Command::new("xvfb-run"); + c.arg("--auto-servernum") + .arg(&bundle_paths_fn().first().unwrap().1); + c + } else { + Command::new(&bundle_paths_fn().first().unwrap().1) + }; + + binary_cmd.env("TARGET", bundle_target.name()); + + let output = binary_cmd.output().expect("failed to run app"); + let stdout = String::from_utf8_lossy(&output.stdout); + + println!("{stdout}"); + eprintln!("{}", String::from_utf8_lossy(&output.stderr)); + + let code = output.status.code().unwrap_or(-1); + + if code != expected_exit_code { + panic!("failed to run app, expected exit code {expected_exit_code}, got {code}"); + } + if !stdout.contains(&format!("version={expected_app_version}")) { + panic!("app version does not match {expected_app_version}"); + } + #[cfg(windows)] + if code == UPDATED_EXIT_CODE { + // wait for the update to finish + std::thread::sleep(std::time::Duration::from_secs(5)); + } + } + + server.unblock(); + } +} diff --git a/plugins/updater/tests/updater-migration/v1-app/.gitignore b/plugins/updater/tests/updater-migration/v1-app/.gitignore new file mode 100644 index 00000000..c6bfc74f --- /dev/null +++ b/plugins/updater/tests/updater-migration/v1-app/.gitignore @@ -0,0 +1,3 @@ +target/ +package-lock.json +node_modules/ \ No newline at end of file diff --git a/plugins/updater/tests/updater-migration/v1-app/Cargo.lock b/plugins/updater/tests/updater-migration/v1-app/Cargo.lock new file mode 100644 index 00000000..673454cd --- /dev/null +++ b/plugins/updater/tests/updater-migration/v1-app/Cargo.lock @@ -0,0 +1,4229 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + +[[package]] +name = "app-updater-v1" +version = "0.1.0" +dependencies = [ + "serde", + "serde_json", + "tauri", + "tauri-build", + "tiny_http", +] + +[[package]] +name = "ascii" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" + +[[package]] +name = "atk" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c3d816ce6f0e2909a96830d6911c2aff044370b1ef92d7f267b43bae5addedd" +dependencies = [ + "atk-sys", + "bitflags 1.3.2", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58aeb089fb698e06db8089971c7ee317ab9644bade33383f63631437b03aafb6" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.2.2", +] + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "backtrace" +version = "0.3.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "brotli" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bstr" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytemuck" +version = "1.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "102087e286b4677862ea56cf8fc58bb2cdfa8725c40ffb80fe3a008eb7f2fc83" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +dependencies = [ + "serde", +] + +[[package]] +name = "cairo-rs" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c76ee391b03d35510d9fa917357c7f1855bd9a6659c95a1b392e33f49b3369bc" +dependencies = [ + "bitflags 1.3.2", + "cairo-sys-rs", + "glib", + "libc", + "thiserror", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8" +dependencies = [ + "glib-sys", + "libc", + "system-deps 6.2.2", +] + +[[package]] +name = "cargo_toml" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "599aa35200ffff8f04c1925aa1acc92fa2e08874379ef42e210a80e527e60838" +dependencies = [ + "serde", + "toml 0.7.8", +] + +[[package]] +name = "cc" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549" + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfb" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" +dependencies = [ + "byteorder", + "fnv", + "uuid", +] + +[[package]] +name = "cfg-expr" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3431df59f28accaf4cb4eed4a9acc66bea3f3c3753aa6cdc2f024174ef232af7" +dependencies = [ + "smallvec", +] + +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "serde", + "windows-targets 0.52.6", +] + +[[package]] +name = "chunked_transfer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4de3bc4ea267985becf712dc6d9eed8b04c953b3fcfb339ebc87acd9804901" + +[[package]] +name = "cocoa" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" +dependencies = [ + "bitflags 1.3.2", + "block", + "cocoa-foundation", + "core-foundation", + "core-graphics", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" +dependencies = [ + "bitflags 1.3.2", + "block", + "core-foundation", + "core-graphics-types", + "libc", + "objc", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "core-graphics" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cssparser" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa 0.4.8", + "matches", + "phf 0.8.0", + "proc-macro2", + "quote", + "smallvec", + "syn 1.0.109", +] + +[[package]] +name = "cssparser-macros" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" +dependencies = [ + "quote", + "syn 2.0.72", +] + +[[package]] +name = "ctor" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" +dependencies = [ + "quote", + "syn 2.0.72", +] + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.72", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "derive_more" +version = "0.99.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.72", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "dtoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" + +[[package]] +name = "dtoa-short" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" +dependencies = [ + "dtoa", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "embed-resource" +version = "2.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4edcacde9351c33139a41e3c97eb2334351a81a2791bebb0b243df837128f602" +dependencies = [ + "cc", + "memchr", + "rustc_version", + "toml 0.8.19", + "vswhom", + "winreg 0.52.0", +] + +[[package]] +name = "embed_plist" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" + +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "fastrand" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" + +[[package]] +name = "fdeflate" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset", + "rustc_version", +] + +[[package]] +name = "filetime" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.4.1", + "windows-sys 0.52.0", +] + +[[package]] +name = "flate2" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" +dependencies = [ + "mac", + "new_debug_unreachable", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "gdk" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6e05c1f572ab0e1f15be94217f0dc29088c248b14f792a5ff0af0d84bcda9e8" +dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad38dd9cc8b099cceecdf41375bb6d481b1b5a7cd5cd603e10a69a9383f8619a" +dependencies = [ + "bitflags 1.3.2", + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "140b2f5378256527150350a8346dbdb08fadc13453a7a2d73aecd5fab3c402a7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.2.2", +] + +[[package]] +name = "gdk-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e7a08c1e8f06f4177fb7e51a777b8c1689f743a7bc11ea91d44d2226073a88" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps 6.2.2", +] + +[[package]] +name = "gdkwayland-sys" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cca49a59ad8cfdf36ef7330fe7bdfbe1d34323220cc16a0de2679ee773aee2c2" +dependencies = [ + "gdk-sys", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", + "system-deps 6.2.2", +] + +[[package]] +name = "gdkx11-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4b7f8c7a84b407aa9b143877e267e848ff34106578b64d1e0a24bf550716178" +dependencies = [ + "gdk-sys", + "glib-sys", + "libc", + "system-deps 6.2.2", + "x11", +] + +[[package]] +name = "generator" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "windows 0.48.0", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + +[[package]] +name = "gio" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68fdbc90312d462781a395f7a16d96a2b379bb6ef8cd6310a2df272771c4283b" +dependencies = [ + "bitflags 1.3.2", + "futures-channel", + "futures-core", + "futures-io", + "gio-sys", + "glib", + "libc", + "once_cell", + "thiserror", +] + +[[package]] +name = "gio-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32157a475271e2c4a023382e9cab31c4584ee30a97da41d3c4e9fdd605abcf8d" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.2.2", + "winapi", +] + +[[package]] +name = "glib" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edb0306fbad0ab5428b0ca674a23893db909a98582969c9b537be4ced78c505d" +dependencies = [ + "bitflags 1.3.2", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "once_cell", + "smallvec", + "thiserror", +] + +[[package]] +name = "glib-macros" +version = "0.15.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10c6ae9f6fa26f4fb2ac16b528d138d971ead56141de489f8111e259b9df3c4a" +dependencies = [ + "anyhow", + "heck 0.4.1", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "glib-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef4b192f8e65e9cf76cbf4ea71fa8e3be4a0e18ffe3d68b8da6836974cc5bad4" +dependencies = [ + "libc", + "system-deps 6.2.2", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "globset" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" +dependencies = [ + "aho-corasick", + "bstr", + "log", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "gobject-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a" +dependencies = [ + "glib-sys", + "libc", + "system-deps 6.2.2", +] + +[[package]] +name = "gtk" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e3004a2d5d6d8b5057d2b57b3712c9529b62e82c77f25c1fecde1fd5c23bd0" +dependencies = [ + "atk", + "bitflags 1.3.2", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "once_cell", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5bc2f0587cba247f60246a0ca11fe25fb733eabc3de12d1965fc07efab87c84" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps 6.2.2", +] + +[[package]] +name = "gtk3-macros" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "684c0456c086e8e7e9af73ec5b84e35938df394712054550e81558d21c44ab0d" +dependencies = [ + "anyhow", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.3.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "html5ever" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7" +dependencies = [ + "log", + "mac", + "markup5ever", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa 1.0.11", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "http-range" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" + +[[package]] +name = "httparse" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa 1.0.11", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ico" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3804960be0bb5e4edb1e1ad67afd321a9ecfd875c3e65c099468fd2717d7cae" +dependencies = [ + "byteorder", + "png", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "ignore" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr", + "regex-automata 0.4.7", + "same-file", + "walkdir", + "winapi-util", +] + +[[package]] +name = "image" +version = "0.24.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "num-traits", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" +dependencies = [ + "equivalent", + "hashbrown 0.14.5", + "serde", +] + +[[package]] +name = "infer" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f551f8c3a39f68f986517db0d1759de85881894fdc7db798bd2a9df9cb04b7fc" +dependencies = [ + "cfb", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "javascriptcore-rs" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf053e7843f2812ff03ef5afe34bb9c06ffee120385caad4f6b9967fcd37d41c" +dependencies = [ + "bitflags 1.3.2", + "glib", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "905fbb87419c5cde6e3269537e4ea7d46431f3008c5d057e915ef3f115e7793c" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 5.0.0", +] + +[[package]] +name = "jni" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "039022cdf4d7b1cf548d31f60ae783138e5fd42013f6271049d7df7afadef96c" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "json-patch" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec9ad60d674508f3ca8f380a928cfe7b096bc729c4e2dbfe3852bc45da3ab30b" +dependencies = [ + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "kuchikiki" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e4755b7b995046f510a7520c42b2fed58b77bd94d5a87a8eb43d2fd126da8" +dependencies = [ + "cssparser", + "html5ever", + "indexmap 1.9.3", + "matches", + "selectors", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "loom" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "serde", + "serde_json", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "markup5ever" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2629bb1404f3d34c2e921f21fd34ba00b206124c81f65c50b43b6aaefeb016" +dependencies = [ + "log", + "phf 0.10.1", + "phf_codegen 0.10.0", + "string_cache", + "string_cache_codegen", + "tendril", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minisign-verify" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881" + +[[package]] +name = "miniz_oxide" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +dependencies = [ + "adler", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +dependencies = [ + "hermit-abi", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "ndk" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" +dependencies = [ + "bitflags 1.3.2", + "jni-sys", + "ndk-sys", + "num_enum", + "thiserror", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", + "objc_exception", +] + +[[package]] +name = "objc-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +dependencies = [ + "block", + "objc", + "objc_id", +] + +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", +] + +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + +[[package]] +name = "object" +version = "0.36.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "openssl" +version = "0.10.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "pango" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e4045548659aee5313bde6c582b0d83a627b7904dd20dc2d9ef0895d414e4f" +dependencies = [ + "bitflags 1.3.2", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2a00081cde4661982ed91d80ef437c20eacaf6aa1a5962c0279ae194662c3aa" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.2.2", +] + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.5.3", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "phf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +dependencies = [ + "phf_macros 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", +] + +[[package]] +name = "phf" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +dependencies = [ + "phf_shared 0.10.0", +] + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros 0.11.2", + "phf_shared 0.11.2", +] + +[[package]] +name = "phf_codegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", +] + +[[package]] +name = "phf_codegen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", +] + +[[package]] +name = "phf_generator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +dependencies = [ + "phf_shared 0.8.0", + "rand 0.7.3", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared 0.10.0", + "rand 0.8.5", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared 0.11.2", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator 0.11.2", + "phf_shared 0.11.2", + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "phf_shared" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" +dependencies = [ + "siphasher", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "plist" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" +dependencies = [ + "base64 0.22.1", + "indexmap 2.3.0", + "quick-xml", + "serde", + "time", +] + +[[package]] +name = "png" +version = "0.17.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick-xml" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", + "rand_pcg", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.15", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "raw-window-handle" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +dependencies = [ + "bitflags 2.6.0", +] + +[[package]] +name = "redox_users" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +dependencies = [ + "getrandom 0.2.15", + "libredox", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" + +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tokio-util", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "winreg 0.50.0", +] + +[[package]] +name = "rfd" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0149778bd99b6959285b0933288206090c50e2327f47a9c463bfdbf45c8823ea" +dependencies = [ + "block", + "dispatch", + "glib-sys", + "gobject-sys", + "gtk-sys", + "js-sys", + "lazy_static", + "log", + "objc", + "objc-foundation", + "objc_id", + "raw-window-handle", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows 0.37.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.6.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "selectors" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe" +dependencies = [ + "bitflags 1.3.2", + "cssparser", + "derive_more", + "fxhash", + "log", + "matches", + "phf 0.8.0", + "phf_codegen 0.8.0", + "precomputed-hash", + "servo_arc", + "smallvec", + "thin-slice", +] + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.205" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33aedb1a7135da52b7c21791455563facbbcc43d0f0f66165b42c21b3dfb150" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.205" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "692d6f5ac90220161d6774db30c662202721e64aed9058d2c394f451261420c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "serde_json" +version = "1.0.122" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" +dependencies = [ + "indexmap 2.3.0", + "itoa 1.0.11", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "serde_spanned" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa 1.0.11", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.3.0", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "serialize-to-javascript" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9823f2d3b6a81d98228151fdeaf848206a7855a7a042bbf9bf870449a66cafb" +dependencies = [ + "serde", + "serde_json", + "serialize-to-javascript-impl", +] + +[[package]] +name = "serialize-to-javascript-impl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "servo_arc" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98238b800e0d1576d8b6e3de32827c2d74bee68bb97748dcf5071fb53965432" +dependencies = [ + "nodrop", + "stable_deref_trait", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "soup2" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b4d76501d8ba387cf0fefbe055c3e0a59891d09f0f995ae4e4b16f6b60f3c0" +dependencies = [ + "bitflags 1.3.2", + "gio", + "glib", + "libc", + "once_cell", + "soup2-sys", +] + +[[package]] +name = "soup2-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "009ef427103fcb17f802871647a7fa6c60cbb654b4c4e4c0ac60a31c5f6dc9cf" +dependencies = [ + "bitflags 1.3.2", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps 5.0.0", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "state" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b" +dependencies = [ + "loom", +] + +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared 0.10.0", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro2", + "quote", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "system-deps" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18db855554db7bd0e73e06cf7ba3df39f97812cb11d3f75e71c39bf45171797e" +dependencies = [ + "cfg-expr 0.9.1", + "heck 0.3.3", + "pkg-config", + "toml 0.5.11", + "version-compare 0.0.11", +] + +[[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr 0.15.8", + "heck 0.5.0", + "pkg-config", + "toml 0.8.19", + "version-compare 0.2.0", +] + +[[package]] +name = "tao" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "575c856fc21e551074869dcfaad8f706412bd5b803dfa0fbf6881c4ff4bfafab" +dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "cc", + "cocoa", + "core-foundation", + "core-graphics", + "crossbeam-channel", + "dispatch", + "gdk", + "gdk-pixbuf", + "gdk-sys", + "gdkwayland-sys", + "gdkx11-sys", + "gio", + "glib", + "glib-sys", + "gtk", + "image", + "instant", + "jni", + "lazy_static", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "objc", + "once_cell", + "parking_lot", + "png", + "raw-window-handle", + "scopeguard", + "serde", + "tao-macros", + "unicode-segmentation", + "uuid", + "windows 0.39.0", + "windows-implement", + "x11-dl", +] + +[[package]] +name = "tao-macros" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec114582505d158b669b136e6851f85840c109819d77c42bb7c0709f727d18c2" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "tar" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "tauri" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "336bc661a3f3250853fa83c6e5245449ed1c26dce5dcb28bdee7efedf6278806" +dependencies = [ + "anyhow", + "base64 0.21.7", + "bytes", + "cocoa", + "dirs-next", + "dunce", + "embed_plist", + "encoding_rs", + "flate2", + "futures-util", + "getrandom 0.2.15", + "glib", + "glob", + "gtk", + "heck 0.5.0", + "http", + "ignore", + "indexmap 1.9.3", + "minisign-verify", + "objc", + "once_cell", + "percent-encoding", + "rand 0.8.5", + "raw-window-handle", + "reqwest", + "rfd", + "semver", + "serde", + "serde_json", + "serde_repr", + "serialize-to-javascript", + "state", + "tar", + "tauri-macros", + "tauri-runtime", + "tauri-runtime-wry", + "tauri-utils", + "tempfile", + "thiserror", + "time", + "tokio", + "url", + "uuid", + "webkit2gtk", + "webview2-com", + "windows 0.39.0", + "zip", +] + +[[package]] +name = "tauri-build" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c6ec7a5c3296330c7818478948b422967ce4649094696c985f61d50076d29c" +dependencies = [ + "anyhow", + "cargo_toml", + "dirs-next", + "heck 0.5.0", + "json-patch", + "semver", + "serde", + "serde_json", + "tauri-utils", + "tauri-winres", + "walkdir", +] + +[[package]] +name = "tauri-codegen" +version = "1.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1aed706708ff1200ec12de9cfbf2582b5d8ec05f6a7293911091effbd22036b" +dependencies = [ + "base64 0.21.7", + "brotli", + "ico", + "json-patch", + "plist", + "png", + "proc-macro2", + "quote", + "semver", + "serde", + "serde_json", + "sha2", + "tauri-utils", + "thiserror", + "time", + "uuid", + "walkdir", +] + +[[package]] +name = "tauri-macros" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b88f831d2973ae4f81a706a0004e67dac87f2e4439973bbe98efbd73825d8ede" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 1.0.109", + "tauri-codegen", + "tauri-utils", +] + +[[package]] +name = "tauri-runtime" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3068ed62b63dedc705558f4248c7ecbd5561f0f8050949859ea0db2326f26012" +dependencies = [ + "gtk", + "http", + "http-range", + "rand 0.8.5", + "raw-window-handle", + "serde", + "serde_json", + "tauri-utils", + "thiserror", + "url", + "uuid", + "webview2-com", + "windows 0.39.0", +] + +[[package]] +name = "tauri-runtime-wry" +version = "0.14.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c3db170233096aa30330feadcd895bf9317be97e624458560a20e814db7955" +dependencies = [ + "cocoa", + "gtk", + "percent-encoding", + "rand 0.8.5", + "raw-window-handle", + "tauri-runtime", + "tauri-utils", + "uuid", + "webkit2gtk", + "webview2-com", + "windows 0.39.0", + "wry", +] + +[[package]] +name = "tauri-utils" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2826db448309d382dac14d520f0c0a40839b87b57b977e59cf5f296b3ace6a93" +dependencies = [ + "brotli", + "ctor", + "dunce", + "glob", + "heck 0.5.0", + "html5ever", + "infer", + "json-patch", + "kuchikiki", + "log", + "memchr", + "phf 0.11.2", + "proc-macro2", + "quote", + "semver", + "serde", + "serde_json", + "serde_with", + "thiserror", + "url", + "walkdir", + "windows-version", +] + +[[package]] +name = "tauri-winres" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5993dc129e544393574288923d1ec447c857f3f644187f4fbf7d9a875fbfc4fb" +dependencies = [ + "embed-resource", + "toml 0.7.8", +] + +[[package]] +name = "tempfile" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +dependencies = [ + "cfg-if", + "fastrand", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "tendril" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +dependencies = [ + "futf", + "mac", + "utf-8", +] + +[[package]] +name = "thin-slice" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" + +[[package]] +name = "thiserror" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa 1.0.11", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny_http" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0d6ef4e10d23c1efb862eecad25c5054429a71958b4eeef85eb5e7170b477ca" +dependencies = [ + "ascii", + "chunked_transfer", + "log", + "time", + "url", +] + +[[package]] +name = "tinyvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.39.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.19.15", +] + +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.22.20", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.3.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +dependencies = [ + "indexmap 2.3.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.6.18", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + +[[package]] +name = "url" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "uuid" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +dependencies = [ + "getrandom 0.2.15", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version-compare" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c18c859eead79d8b95d09e4678566e8d70105c4e7b251f707a03df32442661b" + +[[package]] +name = "version-compare" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b17ae1f6c8a2b28506cd96d412eebf83b4a0ff2cbefeeb952f2f9dfa44ba18" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.72", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "wasm-streams" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webkit2gtk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8f859735e4a452aeb28c6c56a852967a8a76c8eb1cc32dbf931ad28a13d6370" +dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup2", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d76ca6ecc47aeba01ec61e480139dda143796abcae6f83bcddf50d6b5b1dcf3" +dependencies = [ + "atk-sys", + "bitflags 1.3.2", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pango-sys", + "pkg-config", + "soup2-sys", + "system-deps 6.2.2", +] + +[[package]] +name = "webview2-com" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4a769c9f1a64a8734bde70caafac2b96cada12cd4aefa49196b3a386b8b4178" +dependencies = [ + "webview2-com-macros", + "webview2-com-sys", + "windows 0.39.0", + "windows-implement", +] + +[[package]] +name = "webview2-com-macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaebe196c01691db62e9e4ca52c5ef1e4fd837dcae27dae3ada599b5a8fd05ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "webview2-com-sys" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac48ef20ddf657755fdcda8dfed2a7b4fc7e4581acce6fe9b88c3d64f29dee7" +dependencies = [ + "regex", + "serde", + "serde_json", + "thiserror", + "windows 0.39.0", + "windows-bindgen", + "windows-metadata", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57b543186b344cc61c85b5aab0d2e3adf4e0f99bc076eff9aa5927bcc0b8a647" +dependencies = [ + "windows_aarch64_msvc 0.37.0", + "windows_i686_gnu 0.37.0", + "windows_i686_msvc 0.37.0", + "windows_x86_64_gnu 0.37.0", + "windows_x86_64_msvc 0.37.0", +] + +[[package]] +name = "windows" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1c4bd0a50ac6020f65184721f758dba47bb9fbc2133df715ec74a237b26794a" +dependencies = [ + "windows-implement", + "windows_aarch64_msvc 0.39.0", + "windows_i686_gnu 0.39.0", + "windows_i686_msvc 0.39.0", + "windows_x86_64_gnu 0.39.0", + "windows_x86_64_msvc 0.39.0", +] + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-bindgen" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68003dbd0e38abc0fb85b939240f4bce37c43a5981d3df37ccbaaa981b47cb41" +dependencies = [ + "windows-metadata", + "windows-tokens", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba01f98f509cb5dc05f4e5fc95e535f78260f15fea8fe1a8abdd08f774f1cee7" +dependencies = [ + "syn 1.0.109", + "windows-tokens", +] + +[[package]] +name = "windows-metadata" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ee5e275231f07c6e240d14f34e1b635bf1faa1c76c57cfd59a5cdb9848e4278" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-tokens" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f838de2fe15fe6bac988e74b798f26499a8b21a9d97edec321e79b28d1d7f597" + +[[package]] +name = "windows-version" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6998aa457c9ba8ff2fb9f13e9d2a930dabcea28f1d0ab94d687d8b3654844515" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2623277cb2d1c216ba3b578c0f3cf9cdebeddb6e66b1b218bb33596ea7769c3a" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3925fd0b0b804730d44d4b6278c50f9699703ec49bcd628020f46f4ba07d9e1" + +[[package]] +name = "windows_i686_gnu" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce907ac74fe331b524c1298683efbf598bb031bc84d5e274db2083696d07c57c" + +[[package]] +name = "windows_i686_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2babfba0828f2e6b32457d5341427dcbb577ceef556273229959ac23a10af33d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4dd6dc7df2d84cf7b33822ed5b86318fb1781948e9663bacd047fc9dd52259d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "winreg" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "wry" +version = "0.24.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00711278ed357350d44c749c286786ecac644e044e4da410d466212152383b45" +dependencies = [ + "base64 0.13.1", + "block", + "cocoa", + "core-graphics", + "crossbeam-channel", + "dunce", + "gdk", + "gio", + "glib", + "gtk", + "html5ever", + "http", + "kuchikiki", + "libc", + "log", + "objc", + "objc_id", + "once_cell", + "serde", + "serde_json", + "sha2", + "soup2", + "tao", + "thiserror", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2-com", + "windows 0.39.0", + "windows-implement", +] + +[[package]] +name = "x11" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + +[[package]] +name = "xattr" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +dependencies = [ + "libc", + "linux-raw-sys", + "rustix", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "byteorder", + "crc32fast", + "crossbeam-utils", +] diff --git a/plugins/updater/tests/updater-migration/v1-app/Cargo.toml b/plugins/updater/tests/updater-migration/v1-app/Cargo.toml new file mode 100644 index 00000000..e99e4108 --- /dev/null +++ b/plugins/updater/tests/updater-migration/v1-app/Cargo.toml @@ -0,0 +1,18 @@ +workspace = {} + +[package] +name = "app-updater-v1" +version = "0.1.0" +edition = "2021" + +[build-dependencies] +tauri-build = { version = "1", features = [] } + +[dependencies] +serde = { version = "1", features = ["derive"] } +serde_json = "1" +tiny_http = "0.11" +tauri = { version = "1", features = ["updater"] } + +[features] +custom-protocol = ["tauri/custom-protocol"] diff --git a/plugins/updater/tests/updater-migration/v1-app/build.rs b/plugins/updater/tests/updater-migration/v1-app/build.rs new file mode 100644 index 00000000..5ebf8d2f --- /dev/null +++ b/plugins/updater/tests/updater-migration/v1-app/build.rs @@ -0,0 +1,7 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +fn main() { + tauri_build::build() +} diff --git a/plugins/updater/tests/updater-migration/v1-app/package.json b/plugins/updater/tests/updater-migration/v1-app/package.json new file mode 100644 index 00000000..2379b094 --- /dev/null +++ b/plugins/updater/tests/updater-migration/v1-app/package.json @@ -0,0 +1,10 @@ +{ + "name": "v1-app", + "version": "0.0.0", + "dependencies": { + "@tauri-apps/cli": "^1.0.0" + }, + "scripts": { + "tauri": "tauri" + } +} diff --git a/plugins/updater/tests/updater-migration/v1-app/src/main.rs b/plugins/updater/tests/updater-migration/v1-app/src/main.rs new file mode 100644 index 00000000..3c3138dd --- /dev/null +++ b/plugins/updater/tests/updater-migration/v1-app/src/main.rs @@ -0,0 +1,50 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] + +fn main() { + let mut context = tauri::generate_context!(); + if std::env::var("TARGET").unwrap_or_default() == "nsis" { + // /D sets the default installation directory ($INSTDIR), + // overriding InstallDir and InstallDirRegKey. + // It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces. + // Only absolute paths are supported. + // NOTE: we only need this because this is an integration test and we don't want to install the app in the programs folder + context.config_mut().tauri.updater.windows.installer_args = vec![format!( + "/D={}", + tauri::utils::platform::current_exe() + .unwrap() + .parent() + .unwrap() + .display() + )]; + } + tauri::Builder::default() + .setup(|app| { + println!("version={}", app.package_info().version); + let handle = app.handle(); + tauri::async_runtime::spawn(async move { + match handle.updater().check().await { + Ok(update) => { + if update.is_update_available() { + if let Err(e) = update.download_and_install().await { + println!("{e}"); + std::process::exit(1); + } + std::process::exit(0); + } + std::process::exit(2); + } + Err(e) => { + println!("{e}"); + std::process::exit(1); + } + } + }); + Ok(()) + }) + .run(context) + .expect("error while running tauri application"); +} diff --git a/plugins/updater/tests/updater-migration/v1-app/tauri.conf.json b/plugins/updater/tests/updater-migration/v1-app/tauri.conf.json new file mode 100644 index 00000000..13e79887 --- /dev/null +++ b/plugins/updater/tests/updater-migration/v1-app/tauri.conf.json @@ -0,0 +1,39 @@ +{ + "$schema": "../../../core/tauri-config-schema/schema.json", + "build": { + "distDir": [], + "devPath": [] + }, + "tauri": { + "bundle": { + "active": true, + "targets": "all", + "identifier": "com.tauri.updater", + "icon": [ + "../icons/32x32.png", + "../icons/128x128.png", + "../icons/128x128@2x.png", + "../icons/icon.icns", + "../icons/icon.ico" + ], + "category": "DeveloperTool", + "windows": { + "wix": { + "skipWebviewInstall": true + } + } + }, + "allowlist": { + "all": false + }, + "updater": { + "active": true, + "dialog": false, + "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEUwNDRGMjkwRjg2MDhCRDAKUldUUWkyRDRrUEpFNEQ4SmdwcU5PaXl6R2ZRUUNvUnhIaVkwVUltV0NMaEx6VTkrWVhpT0ZqeEEK", + "endpoints": ["http://localhost:3007"], + "windows": { + "installMode": "quiet" + } + } + } +} diff --git a/plugins/updater/tests/updater-migration/v2-app/.gitignore b/plugins/updater/tests/updater-migration/v2-app/.gitignore new file mode 100644 index 00000000..6a4bb536 --- /dev/null +++ b/plugins/updater/tests/updater-migration/v2-app/.gitignore @@ -0,0 +1 @@ +/gen/schemas diff --git a/plugins/updater/tests/updater-migration/v2-app/Cargo.toml b/plugins/updater/tests/updater-migration/v2-app/Cargo.toml new file mode 100644 index 00000000..d74275b1 --- /dev/null +++ b/plugins/updater/tests/updater-migration/v2-app/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "app-updater-v2" +version = "0.1.0" +edition = { workspace = true } + +[build-dependencies] +tauri-build = { workspace = true } + +[dependencies] +tauri = { workspace = true, features = ["wry", "compression"] } +serde = { workspace = true } +serde_json = { workspace = true } +tauri-plugin-updater = { path = "../../.." } +tiny_http = "0.12" diff --git a/plugins/updater/tests/updater-migration/v2-app/build.rs b/plugins/updater/tests/updater-migration/v2-app/build.rs new file mode 100644 index 00000000..5ebf8d2f --- /dev/null +++ b/plugins/updater/tests/updater-migration/v2-app/build.rs @@ -0,0 +1,7 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +fn main() { + tauri_build::build() +} diff --git a/plugins/updater/tests/updater-migration/v2-app/src/main.rs b/plugins/updater/tests/updater-migration/v2-app/src/main.rs new file mode 100644 index 00000000..b2bbe04b --- /dev/null +++ b/plugins/updater/tests/updater-migration/v2-app/src/main.rs @@ -0,0 +1,58 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] + +use tauri_plugin_updater::UpdaterExt; + +fn main() { + #[allow(unused_mut)] + let mut context = tauri::generate_context!(); + + tauri::Builder::default() + .plugin(tauri_plugin_updater::Builder::new().build()) + .setup(|app| { + println!("version={}", app.package_info().version); + let handle = app.handle().clone(); + tauri::async_runtime::spawn(async move { + let mut builder = handle.updater_builder(); + if std::env::var("TARGET").unwrap_or_default() == "nsis" { + // /D sets the default installation directory ($INSTDIR), + // overriding InstallDir and InstallDirRegKey. + // It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces. + // Only absolute paths are supported. + // NOTE: we only need this because this is an integration test and we don't want to install the app in the programs folder + builder = builder.installer_args(vec![format!( + "/D={}", + tauri::utils::platform::current_exe() + .unwrap() + .parent() + .unwrap() + .display() + )]); + } + let updater = builder.build().unwrap(); + + match updater.check().await { + Ok(Some(update)) => { + if let Err(e) = update.download_and_install(|_, _| {}, || {}).await { + println!("{e}"); + std::process::exit(1); + } + std::process::exit(0); + } + Ok(None) => { + std::process::exit(2); + } + Err(e) => { + println!("{e}"); + std::process::exit(1); + } + } + }); + Ok(()) + }) + .run(context) + .expect("error while running tauri application"); +} diff --git a/plugins/updater/tests/updater-migration/v2-app/tauri.conf.json b/plugins/updater/tests/updater-migration/v2-app/tauri.conf.json new file mode 100644 index 00000000..d6cff85f --- /dev/null +++ b/plugins/updater/tests/updater-migration/v2-app/tauri.conf.json @@ -0,0 +1,33 @@ +{ + "identifier": "com.tauri.updater", + "plugins": { + "updater": { + "endpoints": ["http://localhost:3007"], + "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEUwNDRGMjkwRjg2MDhCRDAKUldUUWkyRDRrUEpFNEQ4SmdwcU5PaXl6R2ZRUUNvUnhIaVkwVUltV0NMaEx6VTkrWVhpT0ZqeEEK", + "windows": { + "installMode": "quiet", + "installerArgs": ["/NS"] + } + } + }, + "bundle": { + "active": true, + "targets": "all", + "createUpdaterArtifacts": true, + "icon": [ + "../icons/32x32.png", + "../icons/128x128.png", + "../icons/128x128@2x.png", + "../icons/icon.icns", + "../icons/icon.ico" + ], + "windows": { + "webviewInstallMode": { + "type": "skip" + }, + "nsis": { + "compression": "none" + } + } + } +} diff --git a/plugins/upload/.gitignore b/plugins/upload/.gitignore deleted file mode 100644 index b512c09d..00000000 --- a/plugins/upload/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/plugins/upload/CHANGELOG.md b/plugins/upload/CHANGELOG.md index fab00b13..3c52be17 100644 --- a/plugins/upload/CHANGELOG.md +++ b/plugins/upload/CHANGELOG.md @@ -1,5 +1,64 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.2] + +### bug + +- [`1d9741b5`](https://github.com/tauri-apps/plugins-workspace/commit/1d9741b52bb242d32b2ffd46fb4343a501cbd54b) ([#1783](https://github.com/tauri-apps/plugins-workspace/pull/1783) by [@fxsalazar](https://github.com/tauri-apps/plugins-workspace/../../fxsalazar)) fix download content to file when unsuccessful response + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.9] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.8] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.7] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.6] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.5] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.4] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[2.0.0-beta.3] + +- [`4a5ab18`](https://github.com/tauri-apps/plugins-workspace/commit/4a5ab18a229b902314f242d656b3a2290a8b9065)([#976](https://github.com/tauri-apps/plugins-workspace/pull/976)) Return the upload response as a string and error out if the status code is not within 200-299. + +## \[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] + +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -42,4 +101,8 @@ - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! 17ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! 67\`]\(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! + s-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! + 67\`]\(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! + com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/upload/Cargo.toml b/plugins/upload/Cargo.toml index 2db3ac15..692c13e1 100644 --- a/plugins/upload/Cargo.toml +++ b/plugins/upload/Cargo.toml @@ -1,19 +1,27 @@ [package] name = "tauri-plugin-upload" -version = "2.0.0-beta.1" +version = "2.0.1" description = "Upload files from disk to a remote server over HTTP." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-upload" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "full", notes = "" } +ios = { level = "full", notes = "" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -21,13 +29,20 @@ serde_json = { workspace = true } tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } -tokio = { version = "1", features = [ "fs" ] } -tokio-util = { version = "0.7", features = [ "codec" ] } -reqwest = { version = "0.11", default-features = false, features = [ "json", "stream" ] } +tokio = { version = "1", features = ["fs"] } +tokio-util = { version = "0.7", features = ["codec"] } +reqwest = { version = "0.12", default-features = false, features = [ + "json", + "stream", +] } futures-util = "0.3" read-progress-stream = "1.0.0" [features] -native-tls = [ "reqwest/native-tls" ] -native-tls-vendored = [ "reqwest/native-tls-vendored" ] -rustls-tls = [ "reqwest/rustls-tls" ] +native-tls = ["reqwest/native-tls"] +native-tls-vendored = ["reqwest/native-tls-vendored"] +rustls-tls = ["reqwest/rustls-tls"] + +[dev-dependencies] +mockito = "1.5.0" +tokio = { version = "1", features = ["macros"] } diff --git a/plugins/upload/README.md b/plugins/upload/README.md index d0c43078..15dd3ad6 100644 --- a/plugins/upload/README.md +++ b/plugins/upload/README.md @@ -3,9 +3,17 @@ Upload files from disk to a remote server over HTTP. Download files from a remote HTTP server to disk. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ✓ | +| iOS | ✓ | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -19,7 +27,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-upload = "2.0.0-beta" +tauri-plugin-upload = "2.0.0" # alternatively with Git: tauri-plugin-upload = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -61,25 +69,25 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { upload } from "@tauri-apps/plugin-upload"; +import { upload } from '@tauri-apps/plugin-upload' upload( - "https://example.com/file-upload", - "./path/to/my/file.txt", + 'https://example.com/file-upload', + './path/to/my/file.txt', (progress, total) => console.log(`Uploaded ${progress} of ${total} bytes`), // a callback that will be called with the upload progress - { "Content-Type": "text/plain" }, // optional headers to send with the request -); + { 'Content-Type': 'text/plain' } // optional headers to send with the request +) ``` ```javascript -import { download } from "tauri-plugin-upload-api"; +import { download } from '@tauri-apps/plugin-upload' download( - "https://example.com/file-download-link", - "./path/to/save/my/file.txt", + 'https://example.com/file-download-link', + './path/to/save/my/file.txt', (progress, total) => console.log(`Downloaded ${progress} of ${total} bytes`), // a callback that will be called with the download progress - { "Content-Type": "text/plain" }, // optional headers to send with the request -); + { 'Content-Type': 'text/plain' } // optional headers to send with the request +) ``` ## Contributing diff --git a/plugins/upload/SECURITY.md b/plugins/upload/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/upload/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/upload/api-iife.js b/plugins/upload/api-iife.js new file mode 100644 index 00000000..188b262a --- /dev/null +++ b/plugins/upload/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_UPLOAD__=function(e){"use strict";function t(e,t,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(e):o?o.value:t.get(e)}function n(e,t,n,o,s){if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var o,s,r;"function"==typeof SuppressedError&&SuppressedError;class i{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,o.set(this,(()=>{})),s.set(this,0),r.set(this,{}),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:e,id:i})=>{if(i===t(this,s,"f")){n(this,s,i+1),t(this,o,"f").call(this,e);const a=Object.keys(t(this,r,"f"));if(a.length>0){let e=i+1;for(const n of a.sort()){if(parseInt(n)!==e)break;{const s=t(this,r,"f")[n];delete t(this,r,"f")[n],t(this,o,"f").call(this,s),e+=1}}n(this,s,e)}}else t(this,r,"f")[i.toString()]=e}))}set onmessage(e){n(this,o,e)}get onmessage(){return t(this,o,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}return o=new WeakMap,s=new WeakMap,r=new WeakMap,e.download=async function(e,t,n,o){const s=new Uint32Array(1);window.crypto.getRandomValues(s);const r=s[0],c=new i;n&&(c.onmessage=n),await a("plugin:upload|download",{id:r,url:e,filePath:t,headers:o??{},onProgress:c})},e.upload=async function(e,t,n,o){const s=new Uint32Array(1);window.crypto.getRandomValues(s);const r=s[0],c=new i;return n&&(c.onmessage=n),await a("plugin:upload|upload",{id:r,url:e,filePath:t,headers:o??{},onProgress:c})},e}({});Object.defineProperty(window.__TAURI__,"upload",{value:__TAURI_PLUGIN_UPLOAD__})} diff --git a/plugins/upload/build.rs b/plugins/upload/build.rs index bfdf48b9..96b5a90a 100644 --- a/plugins/upload/build.rs +++ b/plugins/upload/build.rs @@ -5,5 +5,7 @@ const COMMANDS: &[&str] = &["download", "upload"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/upload/guest-js/index.ts b/plugins/upload/guest-js/index.ts index 02ec75fa..9586a241 100644 --- a/plugins/upload/guest-js/index.ts +++ b/plugins/upload/guest-js/index.ts @@ -2,37 +2,37 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { invoke, Channel } from "@tauri-apps/api/core"; +import { invoke, Channel } from '@tauri-apps/api/core' interface ProgressPayload { - progress: number; - total: number; + progress: number + total: number } -type ProgressHandler = (progress: ProgressPayload) => void; +type ProgressHandler = (progress: ProgressPayload) => void async function upload( url: string, filePath: string, progressHandler?: ProgressHandler, - headers?: Map, -): Promise { - const ids = new Uint32Array(1); - window.crypto.getRandomValues(ids); - const id = ids[0]; + headers?: Map +): Promise { + const ids = new Uint32Array(1) + window.crypto.getRandomValues(ids) + const id = ids[0] - const onProgress = new Channel(); - if (progressHandler != null) { - onProgress.onmessage = progressHandler; + const onProgress = new Channel() + if (progressHandler) { + onProgress.onmessage = progressHandler } - await invoke("plugin:upload|upload", { + return await invoke('plugin:upload|upload', { id, url, filePath, headers: headers ?? {}, - onProgress, - }); + onProgress + }) } /// Download file from given url. @@ -43,24 +43,24 @@ async function download( url: string, filePath: string, progressHandler?: ProgressHandler, - headers?: Map, + headers?: Map ): Promise { - const ids = new Uint32Array(1); - window.crypto.getRandomValues(ids); - const id = ids[0]; + const ids = new Uint32Array(1) + window.crypto.getRandomValues(ids) + const id = ids[0] - const onProgress = new Channel(); - if (progressHandler != null) { - onProgress.onmessage = progressHandler; + const onProgress = new Channel() + if (progressHandler) { + onProgress.onmessage = progressHandler } - await invoke("plugin:upload|download", { + await invoke('plugin:upload|download', { id, url, filePath, headers: headers ?? {}, - onProgress, - }); + onProgress + }) } -export { download, upload }; +export { download, upload } diff --git a/plugins/upload/package.json b/plugins/upload/package.json index 21756994..03b1c9ea 100644 --- a/plugins/upload/package.json +++ b/plugins/upload/package.json @@ -1,11 +1,12 @@ { "name": "@tauri-apps/plugin-upload", - "version": "2.0.0-beta.1", + "version": "2.0.0", "description": "Upload files from disk to a remote server over HTTP.", - "license": "MIT or APACHE-2.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -24,6 +25,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/upload/permissions/autogenerated/reference.md b/plugins/upload/permissions/autogenerated/reference.md index 2e8a4853..19dbe32f 100644 --- a/plugins/upload/permissions/autogenerated/reference.md +++ b/plugins/upload/permissions/autogenerated/reference.md @@ -1,18 +1,75 @@ -# Permissions +## Default Permission -## allow-download +This permission set configures what kind of +operations are available from the upload plugin. + +#### Granted Permissions + +All operations are enabled by default. + + + +- `allow-upload` +- `allow-download` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`upload:allow-download` + + Enables the download command without any pre-configured scope. -## deny-download +
+ +`upload:deny-download` + + Denies the download command without any pre-configured scope. -## allow-upload +
+ +`upload:allow-upload` + + Enables the upload command without any pre-configured scope. -## deny-upload +
+ +`upload:deny-upload` + + Denies the upload command without any pre-configured scope. +
diff --git a/plugins/upload/permissions/default.toml b/plugins/upload/permissions/default.toml new file mode 100644 index 00000000..74a2eb9f --- /dev/null +++ b/plugins/upload/permissions/default.toml @@ -0,0 +1,13 @@ +"$schema" = "schemas/schema.json" + +[default] +description = """ +This permission set configures what kind of +operations are available from the upload plugin. + +#### Granted Permissions + +All operations are enabled by default. + +""" +permissions = ["allow-upload", "allow-download"] diff --git a/plugins/upload/permissions/schemas/schema.json b/plugins/upload/permissions/schemas/schema.json index 24f9a486..abe3a09f 100644 --- a/plugins/upload/permissions/schemas/schema.json +++ b/plugins/upload/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,36 +251,73 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-download -> Enables the download command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-download" + "macOS" ] }, { - "description": "deny-download -> Denies the download command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-download" + "windows" ] }, { - "description": "allow-upload -> Enables the upload command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-upload" + "linux" ] }, { - "description": "deny-upload -> Denies the upload command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-upload" + "android" ] + }, + { + "description": "iOS.", + "type": "string", + "enum": [ + "iOS" + ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the download command without any pre-configured scope.", + "type": "string", + "const": "allow-download" + }, + { + "description": "Denies the download command without any pre-configured scope.", + "type": "string", + "const": "deny-download" + }, + { + "description": "Enables the upload command without any pre-configured scope.", + "type": "string", + "const": "allow-upload" + }, + { + "description": "Denies the upload command without any pre-configured scope.", + "type": "string", + "const": "deny-upload" + }, + { + "description": "This permission set configures what kind of\noperations are available from the upload plugin.\n\n#### Granted Permissions\n\nAll operations are enabled by default.\n\n", + "type": "string", + "const": "default" } ] } diff --git a/plugins/upload/rollup.config.js b/plugins/upload/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/upload/rollup.config.js +++ b/plugins/upload/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/upload/src/api-iife.js b/plugins/upload/src/api-iife.js deleted file mode 100644 index d81c4d17..00000000 --- a/plugins/upload/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_UPLOAD__=function(e){"use strict";function t(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}var n;"function"==typeof SuppressedError&&SuppressedError;class r{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,n.set(this,(()=>{})),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((e=>{t(this,n,"f").call(this,e)}))}set onmessage(e){!function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?o.call(e,n):o?o.value=n:t.set(e,n)}(this,n,e,"f")}get onmessage(){return t(this,n,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function o(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}return n=new WeakMap,e.download=async function(e,t,n,a){const i=new Uint32Array(1);window.crypto.getRandomValues(i);const s=i[0],_=new r;null!=n&&(_.onmessage=n),await o("plugin:upload|download",{id:s,url:e,filePath:t,headers:a??{},onProgress:_})},e.upload=async function(e,t,n,a){const i=new Uint32Array(1);window.crypto.getRandomValues(i);const s=i[0],_=new r;null!=n&&(_.onmessage=n),await o("plugin:upload|upload",{id:s,url:e,filePath:t,headers:a??{},onProgress:_})},e}({});Object.defineProperty(window.__TAURI__,"upload",{value:__TAURI_PLUGIN_UPLOAD__})} diff --git a/plugins/upload/src/lib.rs b/plugins/upload/src/lib.rs index 12106d80..9351b246 100644 --- a/plugins/upload/src/lib.rs +++ b/plugins/upload/src/lib.rs @@ -41,6 +41,8 @@ pub enum Error { Request(#[from] reqwest::Error), #[error("{0}")] ContentLength(String), + #[error("request failed with status code {0}: {1}")] + HttpErrorCode(u16, String), } impl Serialize for Error { @@ -63,18 +65,24 @@ async fn download( url: &str, file_path: &str, headers: HashMap, - on_progress: Channel, + on_progress: Channel, ) -> Result<()> { let client = reqwest::Client::new(); let mut request = client.get(url); - // Loop trought the headers keys and values + // Loop through the headers keys and values // and add them to the request object. for (key, value) in headers { request = request.header(&key, value); } let response = request.send().await?; + if !response.status().is_success() { + return Err(Error::HttpErrorCode( + response.status().as_u16(), + response.text().await.unwrap_or_default(), + )); + } let total = response.content_length().unwrap_or(0); let mut file = BufWriter::new(File::create(file_path).await?); @@ -82,7 +90,7 @@ async fn download( while let Some(chunk) = stream.try_next().await? { file.write_all(&chunk).await?; - let _ = on_progress.send(&ProgressPayload { + let _ = on_progress.send(ProgressPayload { progress: chunk.len() as u64, total, }); @@ -97,27 +105,37 @@ async fn upload( url: &str, file_path: &str, headers: HashMap, - on_progress: Channel, -) -> Result { + on_progress: Channel, +) -> Result { // Read the file let file = File::open(file_path).await?; + let file_len = file.metadata().await.unwrap().len(); // Create the request and attach the file to the body let client = reqwest::Client::new(); - let mut request = client.post(url).body(file_to_body(on_progress, file)); + let mut request = client + .post(url) + .header(reqwest::header::CONTENT_LENGTH, file_len) + .body(file_to_body(on_progress, file)); - // Loop trought the headers keys and values + // Loop through the headers keys and values // and add them to the request object. for (key, value) in headers { request = request.header(&key, value); } let response = request.send().await?; - - response.json().await.map_err(Into::into) + if response.status().is_success() { + response.text().await.map_err(Into::into) + } else { + Err(Error::HttpErrorCode( + response.status().as_u16(), + response.text().await.unwrap_or_default(), + )) + } } -fn file_to_body(channel: Channel, file: File) -> reqwest::Body { +fn file_to_body(channel: Channel, file: File) -> reqwest::Body { let stream = FramedRead::new(file, BytesCodec::new()).map_ok(|r| r.freeze()); reqwest::Body::wrap_stream(ReadProgressStream::new( @@ -130,7 +148,67 @@ fn file_to_body(channel: Channel, file: File) -> reqwest::Body { pub fn init() -> TauriPlugin { PluginBuilder::new("upload") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![download, upload]) .build() } + +#[cfg(test)] +mod tests { + use super::*; + use mockito::{self, Mock, Server, ServerGuard}; + use tauri::ipc::InvokeResponseBody; + struct MockedServer { + _server: ServerGuard, + url: String, + mocked_endpoint: Mock, + } + + #[tokio::test] + async fn should_error_if_status_not_success() { + let mocked_server = spawn_server_mocked(400).await; + let result = download_file(&mocked_server.url).await; + mocked_server.mocked_endpoint.assert(); + assert!(result.is_err()); + } + + #[tokio::test] + async fn should_download_file_successfully() { + let mocked_server = spawn_server_mocked(200).await; + let result = download_file(&mocked_server.url).await; + mocked_server.mocked_endpoint.assert(); + assert!( + result.is_ok(), + "failed to download file: {}", + result.unwrap_err() + ); + } + + async fn download_file(url: &str) -> Result<()> { + let file_path = concat!(env!("CARGO_MANIFEST_DIR"), "/test/test.txt"); + let headers = HashMap::new(); + let sender: Channel = + Channel::new(|msg: InvokeResponseBody| -> tauri::Result<()> { + let _ = msg; + Ok(()) + }); + download(url, file_path, headers, sender).await + } + + async fn spawn_server_mocked(return_status: usize) -> MockedServer { + let mut _server = Server::new_async().await; + let path = "/mock_test"; + let mock = _server + .mock("GET", path) + .with_status(return_status) + .with_body("mocked response body") + .create_async() + .await; + + let url = _server.url() + path; + MockedServer { + _server, + url, + mocked_endpoint: mock, + } + } +} diff --git a/plugins/upload/test/test.txt b/plugins/upload/test/test.txt new file mode 100644 index 00000000..629b997b --- /dev/null +++ b/plugins/upload/test/test.txt @@ -0,0 +1 @@ +mocked response body \ No newline at end of file diff --git a/plugins/websocket/.gitignore b/plugins/websocket/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/plugins/websocket/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/plugins/websocket/CHANGELOG.md b/plugins/websocket/CHANGELOG.md index f8865a01..4268e32e 100644 --- a/plugins/websocket/CHANGELOG.md +++ b/plugins/websocket/CHANGELOG.md @@ -1,5 +1,58 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.8] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.7] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.6] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.5] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.4] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.3] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[2.0.0-beta.4] + +- [`ed46dca`](https://github.com/tauri-apps/plugins-workspace/commit/ed46dca74ff3947dbbcb26a7b571c129bf925698) **Breaking change:** Enable rustls by default and added a method to configure the TLS Connector for tungstenite. + +## \[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] + +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -47,4 +100,5 @@ - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ae67\`]\(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! + com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/websocket/Cargo.toml b/plugins/websocket/Cargo.toml index ab3beff2..e3d92026 100644 --- a/plugins/websocket/Cargo.toml +++ b/plugins/websocket/Cargo.toml @@ -1,20 +1,28 @@ [package] name = "tauri-plugin-websocket" -version = "2.0.0-beta.1" +version = "2.0.1" description = "Expose a WebSocket server to your Tauri frontend." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-websocket" -exclude = [ "/examples" ] +exclude = ["/examples"] [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "full", notes = "" } +ios = { level = "full", notes = "" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -25,10 +33,12 @@ thiserror = { workspace = true } http = "1" rand = "0.8" futures-util = "0.3" -tokio = { version = "1", features = [ "net", "sync" ] } -tokio-tungstenite = { version = "0.21" } +tokio = { version = "1", features = ["net", "sync"] } +tokio-tungstenite = { version = "0.24" } [features] -native-tls = [ "tokio-tungstenite/native-tls" ] -native-tls-vendored = [ "tokio-tungstenite/native-tls-vendored" ] -rustls-tls-webpki-roots = [ "tokio-tungstenite/rustls-tls-webpki-roots" ] +default = ["rustls-tls"] +native-tls = ["tokio-tungstenite/native-tls"] +native-tls-vendored = ["native-tls", "tokio-tungstenite/native-tls-vendored"] +rustls-tls = ["tokio-tungstenite/rustls-tls-webpki-roots"] +rustls-tls-native-roots = ["tokio-tungstenite/rustls-tls-native-roots"] diff --git a/plugins/websocket/README.md b/plugins/websocket/README.md index 650ffcf1..a9c3a267 100644 --- a/plugins/websocket/README.md +++ b/plugins/websocket/README.md @@ -2,9 +2,17 @@ Expose a WebSocket server to your Tauri frontend. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ✓ | +| iOS | ✓ | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-websocket = "2.0.0-beta" +tauri-plugin-websocket = "2.0.0" # alternatively with Git: tauri-plugin-websocket = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -60,13 +68,13 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import WebSocket from "@tauri-apps/plugin-websocket"; +import WebSocket from '@tauri-apps/plugin-websocket' -const ws = await WebSocket.connect("wss://example.com"); +const ws = await WebSocket.connect('wss://example.com') -await ws.send("Hello World"); +await ws.send('Hello World') -await ws.disconnect(); +await ws.disconnect() ``` ## Contributing diff --git a/plugins/websocket/SECURITY.md b/plugins/websocket/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/websocket/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/websocket/api-iife.js b/plugins/websocket/api-iife.js new file mode 100644 index 00000000..ec81c68f --- /dev/null +++ b/plugins/websocket/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_WEBSOCKET__=function(){"use strict";function e(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)}function t(e,t,s,n,r){if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,s),s}var s,n,r;"function"==typeof SuppressedError&&SuppressedError;class i{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,s.set(this,(()=>{})),n.set(this,0),r.set(this,{}),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:i,id:a})=>{if(a===e(this,n,"f")){t(this,n,a+1),e(this,s,"f").call(this,i);const o=Object.keys(e(this,r,"f"));if(o.length>0){let i=a+1;for(const t of o.sort()){if(parseInt(t)!==i)break;{const n=e(this,r,"f")[t];delete e(this,r,"f")[t],e(this,s,"f").call(this,n),i+=1}}t(this,n,i)}}else e(this,r,"f")[a.toString()]=i}))}set onmessage(e){t(this,s,e)}get onmessage(){return e(this,s,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(e,t={},s){return window.__TAURI_INTERNALS__.invoke(e,t,s)}s=new WeakMap,n=new WeakMap,r=new WeakMap;class o{constructor(e,t){this.id=e,this.listeners=t}static async connect(e,t){const s=[],n=new i;return n.onmessage=e=>{s.forEach((t=>{t(e)}))},t?.headers&&(t.headers=Array.from(new Headers(t.headers).entries())),await a("plugin:websocket|connect",{url:e,onMessage:n,config:t}).then((e=>new o(e,s)))}addListener(e){this.listeners.push(e)}async send(e){let t;if("string"==typeof e)t={type:"Text",data:e};else if("object"==typeof e&&"type"in e)t=e;else{if(!Array.isArray(e))throw new Error("invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array");t={type:"Binary",data:e}}await a("plugin:websocket|send",{id:this.id,message:t})}async disconnect(){await this.send({type:"Close",data:{code:1e3,reason:"Disconnected by client"}})}}return o}();Object.defineProperty(window.__TAURI__,"websocket",{value:__TAURI_PLUGIN_WEBSOCKET__})} diff --git a/plugins/websocket/build.rs b/plugins/websocket/build.rs index b7bf848c..deadb78f 100644 --- a/plugins/websocket/build.rs +++ b/plugins/websocket/build.rs @@ -5,5 +5,7 @@ const COMMANDS: &[&str] = &["connect", "send"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/websocket/examples/tauri-app/package.json b/plugins/websocket/examples/tauri-app/package.json index dc916a38..e0d196e9 100644 --- a/plugins/websocket/examples/tauri-app/package.json +++ b/plugins/websocket/examples/tauri-app/package.json @@ -9,9 +9,9 @@ "preview": "vite preview" }, "devDependencies": { - "@tauri-apps/cli": "2.0.0-beta.3", + "@tauri-apps/cli": "2.0.3", "typescript": "^5.3.3", - "vite": "^5.0.12" + "vite": "^5.4.7" }, "dependencies": { "tauri-plugin-websocket-api": "link:..\\.." diff --git a/plugins/websocket/examples/tauri-app/src-tauri/Cargo.toml b/plugins/websocket/examples/tauri-app/src-tauri/Cargo.toml index fb3b862c..3c789aba 100644 --- a/plugins/websocket/examples/tauri-app/src-tauri/Cargo.toml +++ b/plugins/websocket/examples/tauri-app/src-tauri/Cargo.toml @@ -7,14 +7,14 @@ edition = "2021" [dependencies] serde = { workspace = true } serde_json = { workspace = true } -tauri = { workspace = true } +tauri = { workspace = true, features = ["wry", "compression"] } tokio = { version = "1", features = ["net"] } futures-util = "0.3" tauri-plugin-websocket = { path = "../../../" } -tokio-tungstenite = "0.21" +tokio-tungstenite = "0.24" [build-dependencies] tauri-build = { workspace = true } [features] -custom-protocol = [ "tauri/custom-protocol" ] +prod = ["tauri/custom-protocol"] diff --git a/plugins/websocket/examples/tauri-app/src-tauri/tauri.conf.json b/plugins/websocket/examples/tauri-app/src-tauri/tauri.conf.json index c4fe3f7f..6647b5e6 100644 --- a/plugins/websocket/examples/tauri-app/src-tauri/tauri.conf.json +++ b/plugins/websocket/examples/tauri-app/src-tauri/tauri.conf.json @@ -2,7 +2,7 @@ "identifier": "com.tauri.dev", "build": { "devUrl": "http://localhost:5173/", - "frontendDist": "../build", + "frontendDist": "../dist", "beforeDevCommand": "pnpm dev", "beforeBuildCommand": "pnpm build" }, diff --git a/plugins/websocket/examples/tauri-app/src/main.ts b/plugins/websocket/examples/tauri-app/src/main.ts index 731fd60d..05fecfe8 100644 --- a/plugins/websocket/examples/tauri-app/src/main.ts +++ b/plugins/websocket/examples/tauri-app/src/main.ts @@ -2,53 +2,57 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import WebSocket from "tauri-plugin-websocket-api"; -import "./style.css"; +import WebSocket from 'tauri-plugin-websocket-api' +import './style.css' -let ws: WebSocket; +let ws: WebSocket -document.addEventListener("DOMContentLoaded", async () => { - document.querySelector("#send")?.addEventListener("click", send); - document.querySelector("#disconnect")?.addEventListener("click", disconnect); - await connect(); -}); +document.addEventListener('DOMContentLoaded', async () => { + document.querySelector('#send')?.addEventListener('click', send) + document.querySelector('#disconnect')?.addEventListener('click', disconnect) + await connect() +}) function _updateResponse(returnValue: unknown) { - const msg = document.createElement("p"); + const msg = document.createElement('p') msg.textContent = - typeof returnValue === "string" ? returnValue : JSON.stringify(returnValue); - document.querySelector("#response-container")?.appendChild(msg); + typeof returnValue === 'string' ? returnValue : JSON.stringify(returnValue) + document.querySelector('#response-container')?.appendChild(msg) } async function connect() { try { - ws = await WebSocket.connect("ws://127.0.0.1:8080").then((r) => { - _updateResponse("Connected"); - return r; - }); + ws = await WebSocket.connect('ws://127.0.0.1:8080').then((r) => { + _updateResponse('Connected') + return r + }) } catch (e) { - _updateResponse(e); + _updateResponse(e) } - ws.addListener(_updateResponse); + ws.addListener(_updateResponse) } function send() { - ws.send(document.querySelector("#msg-input")?.textContent || "") - .then(() => _updateResponse("Message sent")) - .catch(_updateResponse); + ws.send(document.querySelector('#msg-input')?.textContent || '') + .then(() => { + _updateResponse('Message sent') + }) + .catch(_updateResponse) } function disconnect() { ws.disconnect() - .then(() => _updateResponse("Disconnected")) - .catch(_updateResponse); + .then(() => { + _updateResponse('Disconnected') + }) + .catch(_updateResponse) } -document.querySelector("#app")!.innerHTML = ` +document.querySelector('#app')!.innerHTML = `
-`; +` diff --git a/plugins/websocket/examples/tauri-app/src/style.css b/plugins/websocket/examples/tauri-app/src/style.css index 21d7637f..915efaee 100644 --- a/plugins/websocket/examples/tauri-app/src/style.css +++ b/plugins/websocket/examples/tauri-app/src/style.css @@ -10,8 +10,8 @@ body { margin: 0; padding: 8px; box-sizing: border-box; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, - Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, + Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; } a { diff --git a/plugins/websocket/guest-js/index.ts b/plugins/websocket/guest-js/index.ts index 5f5e2461..8d787742 100644 --- a/plugins/websocket/guest-js/index.ts +++ b/plugins/websocket/guest-js/index.ts @@ -2,95 +2,97 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { invoke, Channel } from "@tauri-apps/api/core"; +import { invoke, Channel } from '@tauri-apps/api/core' export interface ConnectionConfig { - writeBufferSize?: number; - maxWriteBufferSize?: number; - maxMessageSize?: number; - maxFrameSize?: number; - acceptUnmaskedFrames?: boolean; - headers?: HeadersInit; + writeBufferSize?: number + maxWriteBufferSize?: number + maxMessageSize?: number + maxFrameSize?: number + acceptUnmaskedFrames?: boolean + headers?: HeadersInit } export interface MessageKind { - type: T; - data: D; + type: T + data: D } export interface CloseFrame { - code: number; - reason: string; + code: number + reason: string } export type Message = - | MessageKind<"Text", string> - | MessageKind<"Binary", number[]> - | MessageKind<"Ping", number[]> - | MessageKind<"Pong", number[]> - | MessageKind<"Close", CloseFrame | null>; + | MessageKind<'Text', string> + | MessageKind<'Binary', number[]> + | MessageKind<'Ping', number[]> + | MessageKind<'Pong', number[]> + | MessageKind<'Close', CloseFrame | null> export default class WebSocket { - id: number; - private readonly listeners: Array<(arg: Message) => void>; + id: number + private readonly listeners: Array<(arg: Message) => void> constructor(id: number, listeners: Array<(arg: Message) => void>) { - this.id = id; - this.listeners = listeners; + this.id = id + this.listeners = listeners } static async connect( url: string, - config?: ConnectionConfig, + config?: ConnectionConfig ): Promise { - const listeners: Array<(arg: Message) => void> = []; + const listeners: Array<(arg: Message) => void> = [] - const onMessage = new Channel(); + const onMessage = new Channel() onMessage.onmessage = (message: Message): void => { - listeners.forEach((l) => l(message)); - }; + listeners.forEach((l) => { + l(message) + }) + } if (config?.headers) { - config.headers = Array.from(new Headers(config.headers).entries()); + config.headers = Array.from(new Headers(config.headers).entries()) } - return await invoke("plugin:websocket|connect", { + return await invoke('plugin:websocket|connect', { url, onMessage, - config, - }).then((id) => new WebSocket(id, listeners)); + config + }).then((id) => new WebSocket(id, listeners)) } addListener(cb: (arg: Message) => void): void { - this.listeners.push(cb); + this.listeners.push(cb) } async send(message: Message | string | number[]): Promise { - let m: Message; - if (typeof message === "string") { - m = { type: "Text", data: message }; - } else if (typeof message === "object" && "type" in message) { - m = message; + let m: Message + if (typeof message === 'string') { + m = { type: 'Text', data: message } + } else if (typeof message === 'object' && 'type' in message) { + m = message } else if (Array.isArray(message)) { - m = { type: "Binary", data: message }; + m = { type: 'Binary', data: message } } else { throw new Error( - "invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array", - ); + 'invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array' + ) } - return await invoke("plugin:websocket|send", { + await invoke('plugin:websocket|send', { id: this.id, - message: m, - }); + message: m + }) } async disconnect(): Promise { - return await this.send({ - type: "Close", + await this.send({ + type: 'Close', data: { code: 1000, - reason: "Disconnected by client", - }, - }); + reason: 'Disconnected by client' + } + }) } } diff --git a/plugins/websocket/package.json b/plugins/websocket/package.json index a2fddbdd..2579eb42 100644 --- a/plugins/websocket/package.json +++ b/plugins/websocket/package.json @@ -1,10 +1,11 @@ { "name": "@tauri-apps/plugin-websocket", - "version": "2.0.0-beta.1", - "license": "MIT or APACHE-2.0", + "version": "2.0.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -23,6 +24,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/websocket/permissions/autogenerated/reference.md b/plugins/websocket/permissions/autogenerated/reference.md index 9f66b798..640c05a8 100644 --- a/plugins/websocket/permissions/autogenerated/reference.md +++ b/plugins/websocket/permissions/autogenerated/reference.md @@ -1,22 +1,68 @@ -# Permissions +## Default Permission + +Allows connecting and sending data to a WebSocket server + +- `allow-connect` +- `allow-send` + +## Permission Table + + + + + + -## allow-connect + + + + + + + + + + + + + + + -Denies the send command without any pre-configured scope. + + + + +
IdentifierDescription
+ +`websocket:allow-connect` + + Enables the connect command without any pre-configured scope. -## deny-connect +
+ +`websocket:deny-connect` + + Denies the connect command without any pre-configured scope. -## allow-send +
+ +`websocket:allow-send` + + Enables the send command without any pre-configured scope. -## deny-send +
-## default +`websocket:deny-send` -Allows connecting and sending data to a WebSocket server + + +Denies the send command without any pre-configured scope. +
diff --git a/plugins/websocket/permissions/schemas/schema.json b/plugins/websocket/permissions/schemas/schema.json index f3d2067d..9f574650 100644 --- a/plugins/websocket/permissions/schemas/schema.json +++ b/plugins/websocket/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,45 +251,75 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-connect -> Enables the connect command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-connect" + "macOS" ] }, { - "description": "deny-connect -> Denies the connect command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-connect" + "windows" ] }, { - "description": "allow-send -> Enables the send command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-send" + "linux" ] }, { - "description": "deny-send -> Denies the send command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-send" + "android" ] }, { - "description": "default -> Allows connecting and sending data to a WebSocket server", + "description": "iOS.", "type": "string", "enum": [ - "default" + "iOS" ] } ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the connect command without any pre-configured scope.", + "type": "string", + "const": "allow-connect" + }, + { + "description": "Denies the connect command without any pre-configured scope.", + "type": "string", + "const": "deny-connect" + }, + { + "description": "Enables the send command without any pre-configured scope.", + "type": "string", + "const": "allow-send" + }, + { + "description": "Denies the send command without any pre-configured scope.", + "type": "string", + "const": "deny-send" + }, + { + "description": "Allows connecting and sending data to a WebSocket server", + "type": "string", + "const": "default" + } + ] } } } \ No newline at end of file diff --git a/plugins/websocket/rollup.config.js b/plugins/websocket/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/websocket/rollup.config.js +++ b/plugins/websocket/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/websocket/src/api-iife.js b/plugins/websocket/src/api-iife.js deleted file mode 100644 index 12fc8534..00000000 --- a/plugins/websocket/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_WEBSOCKET__=function(){"use strict";function e(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}var t;"function"==typeof SuppressedError&&SuppressedError;class r{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,t.set(this,(()=>{})),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((r=>{e(this,t,"f").call(this,r)}))}set onmessage(e){!function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?s.call(e,r):s?s.value=r:t.set(e,r)}(this,t,e,"f")}get onmessage(){return e(this,t,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function n(e,t={},r){return window.__TAURI_INTERNALS__.invoke(e,t,r)}t=new WeakMap;class s{constructor(e,t){this.id=e,this.listeners=t}static async connect(e,t){const a=[],i=new r;return i.onmessage=e=>{a.forEach((t=>t(e)))},t?.headers&&(t.headers=Array.from(new Headers(t.headers).entries())),await n("plugin:websocket|connect",{url:e,onMessage:i,config:t}).then((e=>new s(e,a)))}addListener(e){this.listeners.push(e)}async send(e){let t;if("string"==typeof e)t={type:"Text",data:e};else if("object"==typeof e&&"type"in e)t=e;else{if(!Array.isArray(e))throw new Error("invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array");t={type:"Binary",data:e}}return await n("plugin:websocket|send",{id:this.id,message:t})}async disconnect(){return await this.send({type:"Close",data:{code:1e3,reason:"Disconnected by client"}})}}return s}();Object.defineProperty(window.__TAURI__,"websocket",{value:__TAURI_PLUGIN_WEBSOCKET__})} diff --git a/plugins/websocket/src/lib.rs b/plugins/websocket/src/lib.rs index f4a95b8e..2ce02e81 100644 --- a/plugins/websocket/src/lib.rs +++ b/plugins/websocket/src/lib.rs @@ -20,14 +20,17 @@ use tauri::{ Manager, Runtime, State, Window, }; use tokio::{net::TcpStream, sync::Mutex}; +#[cfg(any(feature = "rustls-tls", feature = "native-tls"))] +use tokio_tungstenite::connect_async_tls_with_config; +#[cfg(not(any(feature = "rustls-tls", feature = "native-tls")))] +use tokio_tungstenite::connect_async_with_config; use tokio_tungstenite::{ - connect_async_with_config, tungstenite::{ client::IntoClientRequest, protocol::{CloseFrame as ProtocolCloseFrame, WebSocketConfig}, Message, }, - MaybeTlsStream, WebSocketStream, + Connector, MaybeTlsStream, WebSocketStream, }; use std::collections::HashMap; @@ -62,6 +65,9 @@ impl Serialize for Error { #[derive(Default)] struct ConnectionManager(Mutex>); +#[cfg(any(feature = "rustls-tls", feature = "native-tls"))] +struct TlsConnector(Mutex>); + #[derive(Deserialize)] #[serde(rename_all = "camelCase")] pub struct ConnectionConfig { @@ -111,7 +117,7 @@ enum WebSocketMessage { async fn connect( window: Window, url: String, - on_message: Channel, + on_message: Channel, config: Option, ) -> Result { let id = rand::random(); @@ -125,6 +131,17 @@ async fn connect( } } + #[cfg(any(feature = "rustls-tls", feature = "native-tls"))] + let tls_connector = match window.try_state::() { + Some(tls_connector) => tls_connector.0.lock().await.clone(), + None => None, + }; + + #[cfg(any(feature = "rustls-tls", feature = "native-tls"))] + let (ws_stream, _) = + connect_async_tls_with_config(request, config.map(Into::into), false, tls_connector) + .await?; + #[cfg(not(any(feature = "rustls-tls", feature = "native-tls")))] let (ws_stream, _) = connect_async_with_config(request, config.map(Into::into), false).await?; tauri::async_runtime::spawn(async move { @@ -199,12 +216,35 @@ async fn send( } pub fn init() -> TauriPlugin { - PluginBuilder::new("websocket") - .js_init_script(include_str!("api-iife.js").to_string()) - .invoke_handler(tauri::generate_handler![connect, send]) - .setup(|app, _api| { - app.manage(ConnectionManager::default()); - Ok(()) - }) - .build() + Builder::default().build() +} + +#[derive(Default)] +pub struct Builder { + tls_connector: Option, +} + +impl Builder { + pub fn new() -> Self { + Self { + tls_connector: None, + } + } + + pub fn tls_connector(mut self, connector: Connector) -> Self { + self.tls_connector.replace(connector); + self + } + + pub fn build(self) -> TauriPlugin { + PluginBuilder::new("websocket") + .invoke_handler(tauri::generate_handler![connect, send]) + .setup(|app, _api| { + app.manage(ConnectionManager::default()); + #[cfg(any(feature = "rustls-tls", feature = "native-tls"))] + app.manage(TlsConnector(Mutex::new(self.tls_connector))); + Ok(()) + }) + .build() + } } diff --git a/plugins/window-state/.gitignore b/plugins/window-state/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/plugins/window-state/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/plugins/window-state/CHANGELOG.md b/plugins/window-state/CHANGELOG.md index 7a380c03..4f6eb45d 100644 --- a/plugins/window-state/CHANGELOG.md +++ b/plugins/window-state/CHANGELOG.md @@ -1,5 +1,86 @@ # Changelog +## \[2.0.1] + +- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. + +## \[2.0.0] + +- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. + +## \[2.0.0-rc.5] + +- [`7a37355e`](https://github.com/tauri-apps/plugins-workspace/commit/7a37355e177772cbddf24397d5a23280e00558af) ([#1787](https://github.com/tauri-apps/plugins-workspace/pull/1787) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Fix deadlock when trying to restore window states on initial load + +## \[2.0.0-rc.4] + +- [`204e5aac`](https://github.com/tauri-apps/plugins-workspace/commit/204e5aacad7e8f99a9a08f4a45cfed83643c1cc0) ([#1743](https://github.com/tauri-apps/plugins-workspace/pull/1743)) Fix can't restore a minimized window's size and position properly + +### breaking + +- [`204e5aac`](https://github.com/tauri-apps/plugins-workspace/commit/204e5aacad7e8f99a9a08f4a45cfed83643c1cc0) ([#1743](https://github.com/tauri-apps/plugins-workspace/pull/1743)) Window's size is now stored in physical size instead of logical size + +## \[2.0.0-rc.3] + +- [`17e8014b`](https://github.com/tauri-apps/plugins-workspace/commit/17e8014b6993602ddad21e8f5dcb625de1eea2c0) ([#1702](https://github.com/tauri-apps/plugins-workspace/pull/1702) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Fix saving a minimized window's state changes its position to -32000 + +## \[2.0.0-rc.1] + +- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8 + +## \[2.0.0-rc.1] + +- [`2c00c029`](https://github.com/tauri-apps/plugins-workspace/commit/2c00c0292c9127b81567de46691e8c0f73557261) ([#1630](https://github.com/tauri-apps/plugins-workspace/pull/1630) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fixed an issue that caused multi-word IIFE names to not be formatted correctly. For example the `barcode-scanner` was defined as `window.__TAURI_PLUGIN_CLIPBOARDMANAGER__` instead of `window.__TAURI_PLUGIN_CLIPBOARD_MANAGER__`. + +## \[2.0.0-rc.0] + +- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC. + +## \[2.0.0-beta.9] + +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. + +## \[2.0.0-beta.8] + +- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24. + +## \[2.0.0-beta.7] + +- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23. + +## \[2.0.0-beta.6] + +- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22. + +## \[2.0.0-beta.5] + +- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20. + +## \[2.0.0-beta.7] + +- [`d9de5b19`](https://github.com/tauri-apps/plugins-workspace/commit/d9de5b19d1e950c06f0915ae92a862acb266d108)([#1283](https://github.com/tauri-apps/plugins-workspace/pull/1283)) Implement `WindowExt` for `WebviewWindow`. + +## \[2.0.0-beta.4] + +- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17. + +## \[2.0.0-beta.3] + +- [`0e9541f`](https://github.com/tauri-apps/plugins-workspace/commit/0e9541fe8990395de7cc8887bc46b3f3665b44e1)([#1138](https://github.com/tauri-apps/plugins-workspace/pull/1138)) Add `Builder::with_filename` to support using a custom filename. Also add `AppHandleExt::file_name` and a similar function in JS, to retrieve it later. + +## \[2.0.0-beta.4] + +- [`c013fa5`](https://github.com/tauri-apps/plugins-workspace/commit/c013fa52cd66885cf457a64e75373cb2066bc849)([#1078](https://github.com/tauri-apps/plugins-workspace/pull/1078)) **Breaking change**: Changed the format of the state file from bincode to json. Also changed the filename to from `.window-state` to `.window-state.json`. + +## \[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] + +- [`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. + ## \[2.0.0-beta.1] - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. @@ -45,4 +126,25 @@ lugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! /pull/371)) First v2 alpha release! lugins-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! + +## \[0.1.1] + +- Address a couple of issues with restoring positions: + +- Fix restoring window positions correctly when the top-left corner of the window was outside of the monitor. + +- Fix restore maximization state only maximized on main monitor. + +- [70d9908](https://github.com/tauri-apps/plugins-workspace/commit/70d99086de3a58189d65c49954a3495972880725) fix(window-state): restore window position if the one of the window corners intersects with monitor ([#898](https://github.com/tauri-apps/plugins-workspace/pull/898)) on 2024-01-25 + sues with restoring positions: + +- Fix restoring window positions correctly when the top-left corner of the window was outside of the monitor. + +- Fix restore maximization state only maximized on main monitor. + +- [70d9908](https://github.com/tauri-apps/plugins-workspace/commit/70d99086de3a58189d65c49954a3495972880725) fix(window-state): restore window position if the one of the window corners intersects with monitor ([#898](https://github.com/tauri-apps/plugins-workspace/pull/898)) on 2024-01-25 + ://github.com/tauri-apps/plugins-workspace/commit/70d99086de3a58189d65c49954a3495972880725) fix(window-state): restore window position if the one of the window corners intersects with monitor ([#898](https://github.com/tauri-apps/plugins-workspace/pull/898)) on 2024-01-25 + indow position if the one of the window corners intersects with monitor ([#898](https://github.com/tauri-apps/plugins-workspace/pull/898)) on 2024-01-25 + ://github.com/tauri-apps/plugins-workspace/commit/70d99086de3a58189d65c49954a3495972880725) fix(window-state): restore window position if the one of the window corners intersects with monitor ([#898](https://github.com/tauri-apps/plugins-workspace/pull/898)) on 2024-01-25 + ://github.com/tauri-apps/plugins-workspace/pull/898)) on 2024-01-25 diff --git a/plugins/window-state/Cargo.toml b/plugins/window-state/Cargo.toml index 60c03781..d7a7a5f7 100644 --- a/plugins/window-state/Cargo.toml +++ b/plugins/window-state/Cargo.toml @@ -1,19 +1,27 @@ [package] name = "tauri-plugin-window-state" -version = "2.0.0-beta.1" +version = "2.0.1" description = "Save window positions and sizes and restore them when the app is reopened." authors = { workspace = true } license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +repository = { workspace = true } links = "tauri-plugin-window-state" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "none", notes = "" } +ios = { level = "none", notes = "" } [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -21,5 +29,4 @@ serde_json = { workspace = true } tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } -bincode = "1.3" bitflags = "2" diff --git a/plugins/window-state/README.md b/plugins/window-state/README.md index c71b4df3..a4355fb5 100644 --- a/plugins/window-state/README.md +++ b/plugins/window-state/README.md @@ -2,9 +2,17 @@ Save window positions and sizes and restore them when the app is reopened. +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | x | +| iOS | x | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-window-state = "2.0.0-beta" +tauri-plugin-window-state = "2.0.0" # alternatively with Git: tauri-plugin-window-state = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` @@ -71,9 +79,9 @@ app.save_window_state(StateFlags::all()); // will save the state of all open win or through Javascript ```javascript -import { saveWindowState, StateFlags } from "@tauri-apps/plugin-window-state"; +import { saveWindowState, StateFlags } from '@tauri-apps/plugin-window-state' -saveWindowState(StateFlags.ALL); +saveWindowState(StateFlags.ALL) ``` To manually restore a windows state from disk you can call the `restore_state()` method exposed by the `WindowExt` trait: @@ -90,10 +98,10 @@ or through Javascript ```javascript import { restoreStateCurrent, - StateFlags, -} from "@tauri-apps/plugin-window-state"; + StateFlags +} from '@tauri-apps/plugin-window-state' -restoreStateCurrent(StateFlags.ALL); +restoreStateCurrent(StateFlags.ALL) ``` ## Contributing diff --git a/plugins/window-state/SECURITY.md b/plugins/window-state/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/window-state/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/window-state/api-iife.js b/plugins/window-state/api-iife.js new file mode 100644 index 00000000..de6e9613 --- /dev/null +++ b/plugins/window-state/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_WINDOW_STATE__=function(e){"use strict";var t,i,n,a;function l(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}async function s(e,t={},i){return window.__TAURI_INTERNALS__.invoke(e,t,i)}"function"==typeof SuppressedError&&SuppressedError;class r{get rid(){return function(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}(this,t,"f")}constructor(e){t.set(this,void 0),function(e,t,i,n,a){if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");t.set(e,i)}(this,t,e)}async close(){return s("plugin:resources|close",{rid:this.rid})}}t=new WeakMap;class o{constructor(e,t){this.type="Logical",this.width=e,this.height=t}toPhysical(e){return new u(this.width*e,this.height*e)}}class u{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new o(this.width/e,this.height/e)}}class c{constructor(e,t){this.type="Logical",this.x=e,this.y=t}toPhysical(e){return new d(this.x*e,this.x*e)}}class d{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new c(this.x/e,this.y/e)}}async function h(e,t){await s("plugin:event|unlisten",{event:e,eventId:t})}async function w(e,t,i){var n;const a="string"==typeof(null==i?void 0:i.target)?{kind:"AnyLabel",label:i.target}:null!==(n=null==i?void 0:i.target)&&void 0!==n?n:{kind:"Any"};return s("plugin:event|listen",{event:e,target:a,handler:l(t)}).then((t=>async()=>h(e,t)))}!function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_CREATED="tauri://window-created",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG_ENTER="tauri://drag-enter",e.DRAG_OVER="tauri://drag-over",e.DRAG_DROP="tauri://drag-drop",e.DRAG_LEAVE="tauri://drag-leave"}(i||(i={}));class b extends r{constructor(e){super(e)}static async new(e,t,i){return s("plugin:image|new",{rgba:y(e),width:t,height:i}).then((e=>new b(e)))}static async fromBytes(e){return s("plugin:image|from_bytes",{bytes:y(e)}).then((e=>new b(e)))}static async fromPath(e){return s("plugin:image|from_path",{path:e}).then((e=>new b(e)))}async rgba(){return s("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return s("plugin:image|size",{rid:this.rid})}}function y(e){return null==e?null:"string"==typeof e?e:e instanceof b?e.rid:e}!function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"}(n||(n={}));class p{constructor(e){this._preventDefault=!1,this.event=e.event,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}function g(){return new v(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}async function _(){return s("plugin:window|get_all_windows").then((e=>e.map((e=>new v(e,{skip:!0})))))}!function(e){e.None="none",e.Normal="normal",e.Indeterminate="indeterminate",e.Paused="paused",e.Error="error"}(a||(a={}));const m=["tauri://created","tauri://error"];class v{constructor(e,t={}){var i;this.label=e,this.listeners=Object.create(null),(null==t?void 0:t.skip)||s("plugin:window|create",{options:{...t,parent:"string"==typeof t.parent?t.parent:null===(i=t.parent)||void 0===i?void 0:i.label,label:e}}).then((async()=>this.emit("tauri://created"))).catch((async e=>this.emit("tauri://error",e)))}static async getByLabel(e){var t;return null!==(t=(await _()).find((t=>t.label===e)))&&void 0!==t?t:null}static getCurrent(){return g()}static async getAll(){return _()}static async getFocusedWindow(){for(const e of await _())if(await e.isFocused())return e;return null}async listen(e,t){return this._handleTauriEvent(e,t)?()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)}:w(e,t,{target:{kind:"Window",label:this.label}})}async once(e,t){return this._handleTauriEvent(e,t)?()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)}:async function(e,t,i){return w(e,(i=>{h(e,i.id),t(i)}),i)}(e,t,{target:{kind:"Window",label:this.label}})}async emit(e,t){if(!m.includes(e))return async function(e,t){await s("plugin:event|emit",{event:e,payload:t})}(e,t);for(const i of this.listeners[e]||[])i({event:e,id:-1,payload:t})}async emitTo(e,t,i){if(!m.includes(t))return async function(e,t,i){const n="string"==typeof e?{kind:"AnyLabel",label:e}:e;await s("plugin:event|emit_to",{target:n,event:t,payload:i})}(e,t,i);for(const e of this.listeners[t]||[])e({event:t,id:-1,payload:i})}_handleTauriEvent(e,t){return!!m.includes(e)&&(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0)}async scaleFactor(){return s("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return s("plugin:window|inner_position",{label:this.label}).then((({x:e,y:t})=>new d(e,t)))}async outerPosition(){return s("plugin:window|outer_position",{label:this.label}).then((({x:e,y:t})=>new d(e,t)))}async innerSize(){return s("plugin:window|inner_size",{label:this.label}).then((({width:e,height:t})=>new u(e,t)))}async outerSize(){return s("plugin:window|outer_size",{label:this.label}).then((({width:e,height:t})=>new u(e,t)))}async isFullscreen(){return s("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return s("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return s("plugin:window|is_maximized",{label:this.label})}async isFocused(){return s("plugin:window|is_focused",{label:this.label})}async isDecorated(){return s("plugin:window|is_decorated",{label:this.label})}async isResizable(){return s("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return s("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return s("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return s("plugin:window|is_closable",{label:this.label})}async isVisible(){return s("plugin:window|is_visible",{label:this.label})}async title(){return s("plugin:window|title",{label:this.label})}async theme(){return s("plugin:window|theme",{label:this.label})}async center(){return s("plugin:window|center",{label:this.label})}async requestUserAttention(e){let t=null;return e&&(t=e===n.Critical?{type:"Critical"}:{type:"Informational"}),s("plugin:window|request_user_attention",{label:this.label,value:t})}async setResizable(e){return s("plugin:window|set_resizable",{label:this.label,value:e})}async setEnabled(e){return s("plugin:window|set_enabled",{label:this.label,value:e})}async isEnabled(){return s("plugin:window|is_enabled",{label:this.label})}async setMaximizable(e){return s("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return s("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return s("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return s("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return s("plugin:window|maximize",{label:this.label})}async unmaximize(){return s("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return s("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return s("plugin:window|minimize",{label:this.label})}async unminimize(){return s("plugin:window|unminimize",{label:this.label})}async show(){return s("plugin:window|show",{label:this.label})}async hide(){return s("plugin:window|hide",{label:this.label})}async close(){return s("plugin:window|close",{label:this.label})}async destroy(){return s("plugin:window|destroy",{label:this.label})}async setDecorations(e){return s("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return s("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return s("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return s("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return s("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return s("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return s("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");const t={};return t[`${e.type}`]={width:e.width,height:e.height},s("plugin:window|set_size",{label:this.label,value:t})}async setMinSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");let t=null;return e&&(t={},t[`${e.type}`]={width:e.width,height:e.height}),s("plugin:window|set_min_size",{label:this.label,value:t})}async setMaxSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");let t=null;return e&&(t={},t[`${e.type}`]={width:e.width,height:e.height}),s("plugin:window|set_max_size",{label:this.label,value:t})}async setSizeConstraints(e){function t(e){return e?{Logical:e}:null}return s("plugin:window|set_size_constraints",{label:this.label,value:{minWidth:t(null==e?void 0:e.minWidth),minHeight:t(null==e?void 0:e.minHeight),maxWidth:t(null==e?void 0:e.maxWidth),maxHeight:t(null==e?void 0:e.maxHeight)}})}async setPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");const t={};return t[`${e.type}`]={x:e.x,y:e.y},s("plugin:window|set_position",{label:this.label,value:t})}async setFullscreen(e){return s("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return s("plugin:window|set_focus",{label:this.label})}async setIcon(e){return s("plugin:window|set_icon",{label:this.label,value:y(e)})}async setSkipTaskbar(e){return s("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return s("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return s("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return s("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setCursorPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");const t={};return t[`${e.type}`]={x:e.x,y:e.y},s("plugin:window|set_cursor_position",{label:this.label,value:t})}async setIgnoreCursorEvents(e){return s("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return s("plugin:window|start_dragging",{label:this.label})}async startResizeDragging(e){return s("plugin:window|start_resize_dragging",{label:this.label,value:e})}async setProgressBar(e){return s("plugin:window|set_progress_bar",{label:this.label,value:e})}async setVisibleOnAllWorkspaces(e){return s("plugin:window|set_visible_on_all_workspaces",{label:this.label,value:e})}async setTitleBarStyle(e){return s("plugin:window|set_title_bar_style",{label:this.label,value:e})}async setTheme(e){return s("plugin:window|set_theme",{label:this.label,value:e})}async onResized(e){return this.listen(i.WINDOW_RESIZED,(t=>{var i;t.payload=(i=t.payload,new u(i.width,i.height)),e(t)}))}async onMoved(e){return this.listen(i.WINDOW_MOVED,(t=>{t.payload=I(t.payload),e(t)}))}async onCloseRequested(e){return this.listen(i.WINDOW_CLOSE_REQUESTED,(async t=>{const i=new p(t);await e(i),i.isPreventDefault()||await this.destroy()}))}async onDragDropEvent(e){const t=await this.listen(i.DRAG_ENTER,(t=>{e({...t,payload:{type:"enter",paths:t.payload.paths,position:I(t.payload.position)}})})),n=await this.listen(i.DRAG_OVER,(t=>{e({...t,payload:{type:"over",position:I(t.payload.position)}})})),a=await this.listen(i.DRAG_DROP,(t=>{e({...t,payload:{type:"drop",paths:t.payload.paths,position:I(t.payload.position)}})})),l=await this.listen(i.DRAG_LEAVE,(t=>{e({...t,payload:{type:"leave"}})}));return()=>{t(),a(),n(),l()}}async onFocusChanged(e){const t=await this.listen(i.WINDOW_FOCUS,(t=>{e({...t,payload:!0})})),n=await this.listen(i.WINDOW_BLUR,(t=>{e({...t,payload:!1})}));return()=>{t(),n()}}async onScaleChanged(e){return this.listen(i.WINDOW_SCALE_FACTOR_CHANGED,e)}async onThemeChanged(e){return this.listen(i.WINDOW_THEME_CHANGED,e)}}var f,E,D;function I(e){return new d(e.x,e.y)}async function S(e,t){await s("plugin:window-state|restore_state",{label:e,flags:t})}return function(e){e.AppearanceBased="appearanceBased",e.Light="light",e.Dark="dark",e.MediumLight="mediumLight",e.UltraDark="ultraDark",e.Titlebar="titlebar",e.Selection="selection",e.Menu="menu",e.Popover="popover",e.Sidebar="sidebar",e.HeaderView="headerView",e.Sheet="sheet",e.WindowBackground="windowBackground",e.HudWindow="hudWindow",e.FullScreenUI="fullScreenUI",e.Tooltip="tooltip",e.ContentBackground="contentBackground",e.UnderWindowBackground="underWindowBackground",e.UnderPageBackground="underPageBackground",e.Mica="mica",e.Blur="blur",e.Acrylic="acrylic",e.Tabbed="tabbed",e.TabbedDark="tabbedDark",e.TabbedLight="tabbedLight"}(f||(f={})),function(e){e.FollowsWindowActiveState="followsWindowActiveState",e.Active="active",e.Inactive="inactive"}(E||(E={})),e.StateFlags=void 0,(D=e.StateFlags||(e.StateFlags={}))[D.SIZE=1]="SIZE",D[D.POSITION=2]="POSITION",D[D.MAXIMIZED=4]="MAXIMIZED",D[D.VISIBLE=8]="VISIBLE",D[D.DECORATIONS=16]="DECORATIONS",D[D.FULLSCREEN=32]="FULLSCREEN",D[D.ALL=63]="ALL",e.filename=async function(){return await s("plugin:window-state|filename")},e.restoreState=S,e.restoreStateCurrent=async function(e){await S(g().label,e)},e.saveWindowState=async function(e){await s("plugin:window-state|save_window_state",{flags:e})},e}({});Object.defineProperty(window.__TAURI__,"windowState",{value:__TAURI_PLUGIN_WINDOW_STATE__})} diff --git a/plugins/window-state/build.rs b/plugins/window-state/build.rs index 9d9a160a..2a9354c9 100644 --- a/plugins/window-state/build.rs +++ b/plugins/window-state/build.rs @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -const COMMANDS: &[&str] = &["save_window_state", "restore_window_state"]; +const COMMANDS: &[&str] = &["save_window_state", "restore_state", "filename"]; fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .build(); } diff --git a/plugins/window-state/guest-js/index.ts b/plugins/window-state/guest-js/index.ts index 4800ecb9..f922f3f0 100644 --- a/plugins/window-state/guest-js/index.ts +++ b/plugins/window-state/guest-js/index.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { invoke } from "@tauri-apps/api/core"; -import { WindowLabel, getCurrent } from "@tauri-apps/api/window"; +import { invoke } from '@tauri-apps/api/core' +import { type WindowLabel, getCurrentWindow } from '@tauri-apps/api/window' export enum StateFlags { SIZE = 1 << 0, @@ -12,14 +12,14 @@ export enum StateFlags { VISIBLE = 1 << 3, DECORATIONS = 1 << 4, FULLSCREEN = 1 << 5, - ALL = SIZE | POSITION | MAXIMIZED | VISIBLE | DECORATIONS | FULLSCREEN, + ALL = SIZE | POSITION | MAXIMIZED | VISIBLE | DECORATIONS | FULLSCREEN } /** * Save the state of all open windows to disk. */ async function saveWindowState(flags: StateFlags): Promise { - return invoke("plugin:window-state|save_window_state", { flags }); + await invoke('plugin:window-state|save_window_state', { flags }) } /** @@ -27,16 +27,22 @@ async function saveWindowState(flags: StateFlags): Promise { */ async function restoreState( label: WindowLabel, - flags: StateFlags, + flags: StateFlags ): Promise { - return invoke("plugin:window-state|restore_state", { label, flags }); + await invoke('plugin:window-state|restore_state', { label, flags }) } /** * Restore the state for the current window from disk. */ async function restoreStateCurrent(flags: StateFlags): Promise { - return restoreState(getCurrent().label, flags); + await restoreState(getCurrentWindow().label, flags) +} +/** + * Get the name of the file used to store window state. + */ +async function filename(): Promise { + return await invoke('plugin:window-state|filename') } -export { restoreState, restoreStateCurrent, saveWindowState }; +export { restoreState, restoreStateCurrent, saveWindowState, filename } diff --git a/plugins/window-state/package.json b/plugins/window-state/package.json index 2fe3d414..eea695bf 100644 --- a/plugins/window-state/package.json +++ b/plugins/window-state/package.json @@ -1,11 +1,12 @@ { "name": "@tauri-apps/plugin-window-state", - "version": "2.0.0-beta.1", + "version": "2.0.0", "description": "Save window positions and sizes and restore them when the app is reopened.", - "license": "MIT or APACHE-2.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -24,6 +25,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/plugins/window-state/permissions/autogenerated/commands/filename.toml b/plugins/window-state/permissions/autogenerated/commands/filename.toml new file mode 100644 index 00000000..1cfcee45 --- /dev/null +++ b/plugins/window-state/permissions/autogenerated/commands/filename.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-filename" +description = "Enables the filename command without any pre-configured scope." +commands.allow = ["filename"] + +[[permission]] +identifier = "deny-filename" +description = "Denies the filename command without any pre-configured scope." +commands.deny = ["filename"] diff --git a/plugins/window-state/permissions/autogenerated/commands/restore_state.toml b/plugins/window-state/permissions/autogenerated/commands/restore_state.toml new file mode 100644 index 00000000..61df5cd4 --- /dev/null +++ b/plugins/window-state/permissions/autogenerated/commands/restore_state.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-restore-state" +description = "Enables the restore_state command without any pre-configured scope." +commands.allow = ["restore_state"] + +[[permission]] +identifier = "deny-restore-state" +description = "Denies the restore_state command without any pre-configured scope." +commands.deny = ["restore_state"] diff --git a/plugins/window-state/permissions/autogenerated/commands/restore_window_state.toml b/plugins/window-state/permissions/autogenerated/commands/restore_window_state.toml deleted file mode 100644 index 07fa8bb2..00000000 --- a/plugins/window-state/permissions/autogenerated/commands/restore_window_state.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-restore-window-state" -description = "Enables the restore_window_state command without any pre-configured scope." -commands.allow = ["restore_window_state"] - -[[permission]] -identifier = "deny-restore-window-state" -description = "Denies the restore_window_state command without any pre-configured scope." -commands.deny = ["restore_window_state"] diff --git a/plugins/window-state/permissions/autogenerated/reference.md b/plugins/window-state/permissions/autogenerated/reference.md index 767eea84..53d51ca6 100644 --- a/plugins/window-state/permissions/autogenerated/reference.md +++ b/plugins/window-state/permissions/autogenerated/reference.md @@ -1,18 +1,102 @@ -# Permissions +## Default Permission -## allow-restore-window-state +This permission set configures what kind of +operations are available from the window state plugin. -Enables the restore_window_state command without any pre-configured scope. +#### Granted Permissions -## deny-restore-window-state +All operations are enabled by default. -Denies the restore_window_state command without any pre-configured scope. -## allow-save-window-state + +- `allow-filename` +- `allow-restore-state` +- `allow-save-window-state` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`window-state:allow-filename` + + + +Enables the filename command without any pre-configured scope. + +
+ +`window-state:deny-filename` + + + +Denies the filename command without any pre-configured scope. + +
+ +`window-state:allow-restore-state` + + + +Enables the restore_state command without any pre-configured scope. + +
+ +`window-state:deny-restore-state` + + + +Denies the restore_state command without any pre-configured scope. + +
+ +`window-state:allow-save-window-state` + + Enables the save_window_state command without any pre-configured scope. -## deny-save-window-state +
+ +`window-state:deny-save-window-state` + + Denies the save_window_state command without any pre-configured scope. +
diff --git a/plugins/window-state/permissions/default.toml b/plugins/window-state/permissions/default.toml new file mode 100644 index 00000000..1823e198 --- /dev/null +++ b/plugins/window-state/permissions/default.toml @@ -0,0 +1,17 @@ +"$schema" = "schemas/schema.json" + +[default] +description = """ +This permission set configures what kind of +operations are available from the window state plugin. + +#### Granted Permissions + +All operations are enabled by default. + +""" +permissions = [ + "allow-filename", + "allow-restore-state", + "allow-save-window-state", +] diff --git a/plugins/window-state/permissions/schemas/schema.json b/plugins/window-state/permissions/schemas/schema.json index c9bafc76..67888bc6 100644 --- a/plugins/window-state/permissions/schemas/schema.json +++ b/plugins/window-state/permissions/schemas/schema.json @@ -49,7 +49,7 @@ "minimum": 1.0 }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -111,7 +111,7 @@ "type": "string" }, "description": { - "description": "Human-readable description of what the permission does.", + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", "type": [ "string", "null" @@ -136,6 +136,16 @@ "$ref": "#/definitions/Scopes" } ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } } } }, @@ -162,7 +172,7 @@ } }, "Scopes": { - "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "type": "object", "properties": { "allow": { @@ -176,7 +186,7 @@ } }, "deny": { - "description": "Data that defines what is denied by the scope.", + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "type": [ "array", "null" @@ -241,36 +251,83 @@ } ] }, - "PermissionKind": { - "type": "string", + "Target": { + "description": "Platform target.", "oneOf": [ { - "description": "allow-restore-window-state -> Enables the restore_window_state command without any pre-configured scope.", + "description": "MacOS.", "type": "string", "enum": [ - "allow-restore-window-state" + "macOS" ] }, { - "description": "deny-restore-window-state -> Denies the restore_window_state command without any pre-configured scope.", + "description": "Windows.", "type": "string", "enum": [ - "deny-restore-window-state" + "windows" ] }, { - "description": "allow-save-window-state -> Enables the save_window_state command without any pre-configured scope.", + "description": "Linux.", "type": "string", "enum": [ - "allow-save-window-state" + "linux" ] }, { - "description": "deny-save-window-state -> Denies the save_window_state command without any pre-configured scope.", + "description": "Android.", "type": "string", "enum": [ - "deny-save-window-state" + "android" ] + }, + { + "description": "iOS.", + "type": "string", + "enum": [ + "iOS" + ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the filename command without any pre-configured scope.", + "type": "string", + "const": "allow-filename" + }, + { + "description": "Denies the filename command without any pre-configured scope.", + "type": "string", + "const": "deny-filename" + }, + { + "description": "Enables the restore_state command without any pre-configured scope.", + "type": "string", + "const": "allow-restore-state" + }, + { + "description": "Denies the restore_state command without any pre-configured scope.", + "type": "string", + "const": "deny-restore-state" + }, + { + "description": "Enables the save_window_state command without any pre-configured scope.", + "type": "string", + "const": "allow-save-window-state" + }, + { + "description": "Denies the save_window_state command without any pre-configured scope.", + "type": "string", + "const": "deny-save-window-state" + }, + { + "description": "This permission set configures what kind of\noperations are available from the window state plugin.\n\n#### Granted Permissions\n\nAll operations are enabled by default.\n\n", + "type": "string", + "const": "default" } ] } diff --git a/plugins/window-state/rollup.config.js b/plugins/window-state/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/plugins/window-state/rollup.config.js +++ b/plugins/window-state/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/plugins/window-state/src/api-iife.js b/plugins/window-state/src/api-iife.js deleted file mode 100644 index 47212356..00000000 --- a/plugins/window-state/src/api-iife.js +++ /dev/null @@ -1 +0,0 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_WINDOWSTATE__=function(e){"use strict";function t(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}async function i(e,t={},i){return window.__TAURI_INTERNALS__.invoke(e,t,i)}"function"==typeof SuppressedError&&SuppressedError;class n{constructor(e,t){this.type="Logical",this.width=e,this.height=t}}class a{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new n(this.width/e,this.height/e)}}class l{constructor(e,t){this.type="Logical",this.x=e,this.y=t}}class s{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new l(this.x/e,this.y/e)}}var r,o,u;async function c(e,t){await i("plugin:event|unlisten",{event:e,eventId:t})}async function d(e,n,a){const l="string"==typeof a?.target?{kind:"AnyLabel",label:a.target}:a?.target??{kind:"Any"};return i("plugin:event|listen",{event:e,target:l,handler:t(n)}).then((t=>async()=>c(e,t)))}!function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WEBVIEW_CREATED="tauri://webview-created",e.FILE_DROP="tauri://file-drop",e.FILE_DROP_HOVER="tauri://file-drop-hover",e.FILE_DROP_CANCELLED="tauri://file-drop-cancelled"}(r||(r={})),function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"}(o||(o={}));class h{constructor(e){this._preventDefault=!1,this.event=e.event,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}function w(){return new y(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function b(){return window.__TAURI_INTERNALS__.metadata.windows.map((e=>new y(e.label,{skip:!0})))}!function(e){e.None="none",e.Normal="normal",e.Indeterminate="indeterminate",e.Paused="paused",e.Error="error"}(u||(u={}));const p=["tauri://created","tauri://error"];class y{constructor(e,t={}){this.label=e,this.listeners=Object.create(null),t?.skip||i("plugin:window|create",{options:{...t,parent:"string"==typeof t.parent?t.parent:t.parent?.label,label:e}}).then((async()=>this.emit("tauri://created"))).catch((async e=>this.emit("tauri://error",e)))}static getByLabel(e){return b().find((t=>t.label===e))??null}static getCurrent(){return w()}static getAll(){return b()}static async getFocusedWindow(){for(const e of b())if(await e.isFocused())return e;return null}async listen(e,t){return this._handleTauriEvent(e,t)?Promise.resolve((()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)})):d(e,t,{target:{kind:"Window",label:this.label}})}async once(e,t){return this._handleTauriEvent(e,t)?Promise.resolve((()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)})):async function(e,t,i){return d(e,(i=>{t(i),c(e,i.id).catch((()=>{}))}),i)}(e,t,{target:{kind:"Window",label:this.label}})}async emit(e,t){if(p.includes(e)){for(const i of this.listeners[e]||[])i({event:e,id:-1,payload:t});return Promise.resolve()}return async function(e,t){await i("plugin:event|emit",{event:e,payload:t})}(e,t)}async emitTo(e,t,n){if(p.includes(t)){for(const e of this.listeners[t]||[])e({event:t,id:-1,payload:n});return Promise.resolve()}return async function(e,t,n){const a="string"==typeof e?{kind:"AnyLabel",label:e}:e;await i("plugin:event|emit_to",{target:a,event:t,payload:n})}(e,t,n)}_handleTauriEvent(e,t){return!!p.includes(e)&&(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0)}async scaleFactor(){return i("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return i("plugin:window|inner_position",{label:this.label}).then((({x:e,y:t})=>new s(e,t)))}async outerPosition(){return i("plugin:window|outer_position",{label:this.label}).then((({x:e,y:t})=>new s(e,t)))}async innerSize(){return i("plugin:window|inner_size",{label:this.label}).then((({width:e,height:t})=>new a(e,t)))}async outerSize(){return i("plugin:window|outer_size",{label:this.label}).then((({width:e,height:t})=>new a(e,t)))}async isFullscreen(){return i("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return i("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return i("plugin:window|is_maximized",{label:this.label})}async isFocused(){return i("plugin:window|is_focused",{label:this.label})}async isDecorated(){return i("plugin:window|is_decorated",{label:this.label})}async isResizable(){return i("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return i("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return i("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return i("plugin:window|is_closable",{label:this.label})}async isVisible(){return i("plugin:window|is_visible",{label:this.label})}async title(){return i("plugin:window|title",{label:this.label})}async theme(){return i("plugin:window|theme",{label:this.label})}async center(){return i("plugin:window|center",{label:this.label})}async requestUserAttention(e){let t=null;return e&&(t=e===o.Critical?{type:"Critical"}:{type:"Informational"}),i("plugin:window|request_user_attention",{label:this.label,value:t})}async setResizable(e){return i("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return i("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return i("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return i("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return i("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return i("plugin:window|maximize",{label:this.label})}async unmaximize(){return i("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return i("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return i("plugin:window|minimize",{label:this.label})}async unminimize(){return i("plugin:window|unminimize",{label:this.label})}async show(){return i("plugin:window|show",{label:this.label})}async hide(){return i("plugin:window|hide",{label:this.label})}async close(){return i("plugin:window|close",{label:this.label})}async destroy(){return i("plugin:window|destroy",{label:this.label})}async setDecorations(e){return i("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return i("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return i("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return i("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return i("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return i("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return i("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i("plugin:window|set_size",{label:this.label,value:{type:e.type,data:{width:e.width,height:e.height}}})}async setMinSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i("plugin:window|set_min_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setMaxSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i("plugin:window|set_max_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return i("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return i("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return i("plugin:window|set_focus",{label:this.label})}async setIcon(e){return i("plugin:window|set_icon",{label:this.label,value:"string"==typeof e?e:Array.from(e)})}async setSkipTaskbar(e){return i("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return i("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return i("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return i("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setCursorPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return i("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return i("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return i("plugin:window|start_dragging",{label:this.label})}async startResizeDragging(e){return i("plugin:window|start_resize_dragging",{label:this.label,value:e})}async setProgressBar(e){return i("plugin:window|set_progress_bar",{label:this.label,value:e})}async setVisibleOnAllWorkspaces(e){return i("plugin:window|set_visible_on_all_workspaces",{label:this.label,value:e})}async onResized(e){return this.listen(r.WINDOW_RESIZED,(t=>{var i;t.payload=(i=t.payload,new a(i.width,i.height)),e(t)}))}async onMoved(e){return this.listen(r.WINDOW_MOVED,(t=>{t.payload=v(t.payload),e(t)}))}async onCloseRequested(e){return this.listen(r.WINDOW_CLOSE_REQUESTED,(t=>{const i=new h(t);Promise.resolve(e(i)).then((()=>{if(!i.isPreventDefault())return this.destroy()}))}))}async onFileDropEvent(e){const t=await this.listen(r.FILE_DROP,(t=>{e({...t,payload:{type:"drop",paths:t.payload.paths,position:v(t.payload.position)}})})),i=await this.listen(r.FILE_DROP_HOVER,(t=>{e({...t,payload:{type:"hover",paths:t.payload.paths,position:v(t.payload.position)}})})),n=await this.listen(r.FILE_DROP_CANCELLED,(t=>{e({...t,payload:{type:"cancel"}})}));return()=>{t(),i(),n()}}async onFocusChanged(e){const t=await this.listen(r.WINDOW_FOCUS,(t=>{e({...t,payload:!0})})),i=await this.listen(r.WINDOW_BLUR,(t=>{e({...t,payload:!1})}));return()=>{t(),i()}}async onScaleChanged(e){return this.listen(r.WINDOW_SCALE_FACTOR_CHANGED,e)}async onThemeChanged(e){return this.listen(r.WINDOW_THEME_CHANGED,e)}}var g,_,m;function v(e){return new s(e.x,e.y)}async function f(e,t){return i("plugin:window-state|restore_state",{label:e,flags:t})}return function(e){e.AppearanceBased="appearanceBased",e.Light="light",e.Dark="dark",e.MediumLight="mediumLight",e.UltraDark="ultraDark",e.Titlebar="titlebar",e.Selection="selection",e.Menu="menu",e.Popover="popover",e.Sidebar="sidebar",e.HeaderView="headerView",e.Sheet="sheet",e.WindowBackground="windowBackground",e.HudWindow="hudWindow",e.FullScreenUI="fullScreenUI",e.Tooltip="tooltip",e.ContentBackground="contentBackground",e.UnderWindowBackground="underWindowBackground",e.UnderPageBackground="underPageBackground",e.Mica="mica",e.Blur="blur",e.Acrylic="acrylic",e.Tabbed="tabbed",e.TabbedDark="tabbedDark",e.TabbedLight="tabbedLight"}(g||(g={})),function(e){e.FollowsWindowActiveState="followsWindowActiveState",e.Active="active",e.Inactive="inactive"}(_||(_={})),e.StateFlags=void 0,(m=e.StateFlags||(e.StateFlags={}))[m.SIZE=1]="SIZE",m[m.POSITION=2]="POSITION",m[m.MAXIMIZED=4]="MAXIMIZED",m[m.VISIBLE=8]="VISIBLE",m[m.DECORATIONS=16]="DECORATIONS",m[m.FULLSCREEN=32]="FULLSCREEN",m[m.ALL=63]="ALL",e.restoreState=f,e.restoreStateCurrent=async function(e){return f(w().label,e)},e.saveWindowState=async function(e){return i("plugin:window-state|save_window_state",{flags:e})},e}({});Object.defineProperty(window.__TAURI__,"windowState",{value:__TAURI_PLUGIN_WINDOWSTATE__})} diff --git a/plugins/window-state/src/cmd.rs b/plugins/window-state/src/cmd.rs index 75a390b7..99d41a82 100644 --- a/plugins/window-state/src/cmd.rs +++ b/plugins/window-state/src/cmd.rs @@ -26,9 +26,12 @@ pub async fn restore_state( .ok_or_else(|| format!("Invalid state flags bits: {}", flags))?; app.get_webview_window(&label) .ok_or_else(|| format!("Couldn't find window with label: {}", label))? - .as_ref() - .window() .restore_state(flags) .map_err(|e| e.to_string())?; Ok(()) } + +#[command] +pub fn filename(app: AppHandle) -> String { + app.filename() +} diff --git a/plugins/window-state/src/lib.rs b/plugins/window-state/src/lib.rs index 16ad75e5..15599da8 100644 --- a/plugins/window-state/src/lib.rs +++ b/plugins/window-state/src/lib.rs @@ -16,20 +16,24 @@ use bitflags::bitflags; use serde::{Deserialize, Serialize}; use tauri::{ plugin::{Builder as PluginBuilder, TauriPlugin}, - LogicalSize, Manager, Monitor, PhysicalPosition, PhysicalSize, RunEvent, Runtime, Window, + Manager, Monitor, PhysicalPosition, PhysicalSize, RunEvent, Runtime, WebviewWindow, Window, WindowEvent, }; use std::{ collections::{HashMap, HashSet}, fs::{create_dir_all, File}, - io::Write, sync::{Arc, Mutex}, }; mod cmd; -pub const STATE_FILENAME: &str = ".window-state"; +type LabelMapperFn = dyn Fn(&str) -> &str + Send + Sync; + +/// Default filename used to store window state. +/// +/// If using a custom filename, you should probably use [`AppHandleExt::filename`] instead. +pub const DEFAULT_FILENAME: &str = ".window-state.json"; #[derive(Debug, thiserror::Error)] pub enum Error { @@ -38,7 +42,7 @@ pub enum Error { #[error(transparent)] Tauri(#[from] tauri::Error), #[error(transparent)] - Bincode(#[from] Box), + SerdeJson(#[from] serde_json::Error), } pub type Result = std::result::Result; @@ -61,10 +65,15 @@ impl Default for StateFlags { } } +struct PluginState { + filename: String, + map_label: Option>, +} + #[derive(Debug, Deserialize, Serialize, PartialEq)] struct WindowState { - width: f64, - height: f64, + width: u32, + height: u32, x: i32, y: i32, // prev_x and prev_y are used to store position @@ -96,34 +105,49 @@ impl Default for WindowState { } struct WindowStateCache(Arc>>); +/// Used to prevent deadlocks from resize and position event listeners setting the cached state on restoring states +struct RestoringWindowState(Mutex<()>); pub trait AppHandleExt { /// Saves all open windows state to disk fn save_window_state(&self, flags: StateFlags) -> Result<()>; + /// Get the name of the file used to store window state. + fn filename(&self) -> String; } impl AppHandleExt for tauri::AppHandle { fn save_window_state(&self, flags: StateFlags) -> Result<()> { if let Ok(app_dir) = self.path().app_config_dir() { - let state_path = app_dir.join(STATE_FILENAME); + let plugin_state = self.state::(); + let state_path = app_dir.join(&plugin_state.filename); + let windows = self.webview_windows(); let cache = self.state::(); let mut state = cache.0.lock().unwrap(); + for (label, s) in state.iter_mut() { - if let Some(window) = self.get_webview_window(label) { - window.as_ref().window().update_state(s, flags)?; + let window = match &plugin_state.map_label { + Some(map) => windows + .iter() + .find_map(|(l, window)| (map(l) == label).then_some(window)), + None => windows.get(label), + }; + + if let Some(window) = window { + window.update_state(s, flags)?; } } create_dir_all(&app_dir) .map_err(Error::Io) .and_then(|_| File::create(state_path).map_err(Into::into)) - .and_then(|mut f| { - f.write_all(&bincode::serialize(&*state).map_err(Error::Bincode)?) - .map_err(Into::into) - }) + .and_then(|mut f| serde_json::to_writer_pretty(&mut f, &*state).map_err(Into::into)) } else { Ok(()) } } + + fn filename(&self) -> String { + self.state::().filename.clone() + } } pub trait WindowExt { @@ -131,25 +155,37 @@ pub trait WindowExt { fn restore_state(&self, flags: StateFlags) -> tauri::Result<()>; } +impl WindowExt for WebviewWindow { + fn restore_state(&self, flags: StateFlags) -> tauri::Result<()> { + self.as_ref().window().restore_state(flags) + } +} impl WindowExt for Window { fn restore_state(&self, flags: StateFlags) -> tauri::Result<()> { + let plugin_state = self.app_handle().state::(); + let label = plugin_state + .map_label + .as_ref() + .map(|map| map(self.label())) + .unwrap_or_else(|| self.label()); + + let restoring_window_state = self.state::(); + let _restoring_window_lock = restoring_window_state.0.lock().unwrap(); let cache = self.state::(); let mut c = cache.0.lock().unwrap(); let mut should_show = true; - if let Some(state) = c.get(self.label()) { - // avoid restoring the default zeroed state - if *state == WindowState::default() { - return Ok(()); - } - + if let Some(state) = c + .get(label) + .filter(|state| state != &&WindowState::default()) + { if flags.contains(StateFlags::DECORATIONS) { self.set_decorations(state.decorated)?; } if flags.contains(StateFlags::SIZE) { - self.set_size(LogicalSize { + self.set_size(PhysicalSize { width: state.width, height: state.height, })?; @@ -191,11 +227,7 @@ impl WindowExt for Window { let mut metadata = WindowState::default(); if flags.contains(StateFlags::SIZE) { - let scale_factor = self - .current_monitor()? - .map(|m| m.scale_factor()) - .unwrap_or(1.); - let size = self.inner_size()?.to_logical(scale_factor); + let size = self.inner_size()?; metadata.width = size.width; metadata.height = size.height; } @@ -222,7 +254,7 @@ impl WindowExt for Window { metadata.fullscreen = self.is_fullscreen()?; } - c.insert(self.label().into(), metadata); + c.insert(label.into(), metadata); } if flags.contains(StateFlags::VISIBLE) && should_show { @@ -238,12 +270,19 @@ trait WindowExtInternal { fn update_state(&self, state: &mut WindowState, flags: StateFlags) -> tauri::Result<()>; } +impl WindowExtInternal for WebviewWindow { + fn update_state(&self, state: &mut WindowState, flags: StateFlags) -> tauri::Result<()> { + self.as_ref().window().update_state(state, flags) + } +} + impl WindowExtInternal for Window { fn update_state(&self, state: &mut WindowState, flags: StateFlags) -> tauri::Result<()> { - let is_maximized = match flags.intersects(StateFlags::MAXIMIZED | StateFlags::SIZE) { - true => self.is_maximized()?, - false => false, - }; + let is_maximized = flags + .intersects(StateFlags::MAXIMIZED | StateFlags::POSITION | StateFlags::SIZE) + && self.is_maximized()?; + let is_minimized = + flags.intersects(StateFlags::POSITION | StateFlags::SIZE) && self.is_minimized()?; if flags.contains(StateFlags::MAXIMIZED) { state.maximized = is_maximized; @@ -261,21 +300,16 @@ impl WindowExtInternal for Window { state.visible = self.is_visible()?; } - if flags.contains(StateFlags::SIZE) { - let scale_factor = self - .current_monitor()? - .map(|m| m.scale_factor()) - .unwrap_or(1.); - let size = self.inner_size()?.to_logical(scale_factor); - + if flags.contains(StateFlags::SIZE) && !is_maximized && !is_minimized { + let size = self.inner_size()?; // It doesn't make sense to save a window with 0 height or width - if size.width > 0. && size.height > 0. && !is_maximized { + if size.width > 0 && size.height > 0 { state.width = size.width; state.height = size.height; } } - if flags.contains(StateFlags::POSITION) && !is_maximized { + if flags.contains(StateFlags::POSITION) && !is_maximized && !is_minimized { let position = self.outer_position()?; state.x = position.x; state.y = position.y; @@ -290,6 +324,8 @@ pub struct Builder { denylist: HashSet, skip_initial_state: HashSet, state_flags: StateFlags, + map_label: Option>, + filename: Option, } impl Builder { @@ -303,6 +339,12 @@ impl Builder { self } + /// Sets a custom filename to use when saving and restoring window states from disk. + pub fn with_filename(mut self, filename: impl Into) -> Self { + self.filename.replace(filename.into()); + self + } + /// Sets a list of windows that shouldn't be tracked and managed by this plugin /// for example splash screen windows. pub fn with_denylist(mut self, denylist: &[&str]) -> Self { @@ -316,47 +358,74 @@ impl Builder { self } + /// Transforms the window label when saving the window state. + /// + /// This can be used to group different windows to use the same state. + pub fn map_label(mut self, map_fn: F) -> Self + where + F: Fn(&str) -> &str + Sync + Send + 'static, + { + self.map_label = Some(Box::new(map_fn)); + self + } + pub fn build(self) -> TauriPlugin { let flags = self.state_flags; + let filename = self.filename.unwrap_or_else(|| DEFAULT_FILENAME.into()); + let map_label = self.map_label; + PluginBuilder::new("window-state") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![ cmd::save_window_state, - cmd::restore_state + cmd::restore_state, + cmd::filename ]) .setup(|app, _api| { - let cache: Arc>> = if let Ok(app_dir) = - app.path().app_config_dir() - { - let state_path = app_dir.join(STATE_FILENAME); - if state_path.exists() { - Arc::new(Mutex::new( - std::fs::read(state_path) - .map_err(Error::from) - .and_then(|state| bincode::deserialize(&state).map_err(Into::into)) - .unwrap_or_default(), - )) + let cache: Arc>> = + if let Ok(app_dir) = app.path().app_config_dir() { + let state_path = app_dir.join(&filename); + if state_path.exists() { + Arc::new(Mutex::new( + std::fs::read(state_path) + .map_err(Error::from) + .and_then(|state| { + serde_json::from_slice(&state).map_err(Into::into) + }) + .unwrap_or_default(), + )) + } else { + Default::default() + } } else { Default::default() - } - } else { - Default::default() - }; + }; app.manage(WindowStateCache(cache)); + app.manage(RestoringWindowState(Mutex::new(()))); + app.manage(PluginState { + filename, + map_label, + }); Ok(()) }) .on_window_ready(move |window| { - if self.denylist.contains(window.label()) { + let plugin_state = window.app_handle().state::(); + let label = plugin_state + .map_label + .as_ref() + .map(|map| map(window.label())) + .unwrap_or_else(|| window.label()); + + if self.denylist.contains(label) { return; } - if !self.skip_initial_state.contains(window.label()) { + if !self.skip_initial_state.contains(label) { let _ = window.restore_state(self.state_flags); } let cache = window.state::(); let cache = cache.0.clone(); - let label = window.label().to_string(); + let label = label.to_string(); let window_clone = window.clone(); let flags = self.state_flags; @@ -379,13 +448,37 @@ impl Builder { } WindowEvent::Moved(position) if flags.contains(StateFlags::POSITION) => { - let mut c = cache.lock().unwrap(); - if let Some(state) = c.get_mut(&label) { - state.prev_x = state.x; - state.prev_y = state.y; - - state.x = position.x; - state.y = position.y; + if window_clone + .state::() + .0 + .try_lock() + .is_ok() + && !window_clone.is_minimized().unwrap_or_default() + { + let mut c = cache.lock().unwrap(); + if let Some(state) = c.get_mut(&label) { + state.prev_x = state.x; + state.prev_y = state.y; + + state.x = position.x; + state.y = position.y; + } + } + } + WindowEvent::Resized(size) if flags.contains(StateFlags::SIZE) => { + if window_clone + .state::() + .0 + .try_lock() + .is_ok() + && !window_clone.is_minimized().unwrap_or_default() + && !window_clone.is_maximized().unwrap_or_default() + { + let mut c = cache.lock().unwrap(); + if let Some(state) = c.get_mut(&label) { + state.width = size.width; + state.height = size.height; + } } } _ => {} @@ -401,13 +494,11 @@ impl Builder { } trait MonitorExt { - fn intersects(&self, position: PhysicalPosition, size: LogicalSize) -> bool; + fn intersects(&self, position: PhysicalPosition, size: PhysicalSize) -> bool; } impl MonitorExt for Monitor { - fn intersects(&self, position: PhysicalPosition, size: LogicalSize) -> bool { - let size = size.to_physical::(self.scale_factor()); - + fn intersects(&self, position: PhysicalPosition, size: PhysicalSize) -> bool { let PhysicalPosition { x, y } = *self.position(); let PhysicalSize { width, height } = *self.size(); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6aae7334..4abfcf4e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.0' +lockfileVersion: '9.0' settings: autoInstallPeers: true @@ -12,313 +12,320 @@ importers: .: devDependencies: + '@eslint/js': + specifier: 9.13.0 + version: 9.13.0 '@rollup/plugin-node-resolve': - specifier: 15.2.3 - version: 15.2.3(rollup@4.9.6) + specifier: 15.3.0 + version: 15.3.0(rollup@4.22.4) '@rollup/plugin-terser': specifier: 0.4.4 - version: 0.4.4(rollup@4.9.6) + version: 0.4.4(rollup@4.22.4) '@rollup/plugin-typescript': specifier: 11.1.6 - version: 11.1.6(rollup@4.9.6)(typescript@5.3.3) - '@typescript-eslint/eslint-plugin': - specifier: 6.20.0 - version: 6.20.0(@typescript-eslint/parser@6.20.0)(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/parser': - specifier: 6.20.0 - version: 6.20.0(eslint@8.56.0)(typescript@5.3.3) + version: 11.1.6(rollup@4.22.4)(tslib@2.7.0)(typescript@5.6.3) + '@types/eslint__js': + specifier: 8.42.3 + version: 8.42.3 covector: - specifier: ^0.10.2 - version: 0.10.2(mocha@10.2.0) + specifier: ^0.12.3 + version: 0.12.3(mocha@10.7.3) eslint: - specifier: 8.56.0 - version: 8.56.0 + specifier: 9.13.0 + version: 9.13.0(jiti@2.0.0) eslint-config-prettier: specifier: 9.1.0 - version: 9.1.0(eslint@8.56.0) - eslint-config-standard-with-typescript: - specifier: 43.0.1 - version: 43.0.1(@typescript-eslint/eslint-plugin@6.20.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.2)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) - eslint-plugin-import: - specifier: 2.29.1 - version: 2.29.1(@typescript-eslint/parser@6.20.0)(eslint@8.56.0) - eslint-plugin-n: - specifier: 16.6.2 - version: 16.6.2(eslint@8.56.0) - eslint-plugin-promise: - specifier: 6.1.1 - version: 6.1.1(eslint@8.56.0) + version: 9.1.0(eslint@9.13.0(jiti@2.0.0)) eslint-plugin-security: - specifier: 2.1.0 - version: 2.1.0 + specifier: 3.0.1 + version: 3.0.1 prettier: - specifier: 3.2.2 - version: 3.2.2 + specifier: 3.3.3 + version: 3.3.3 rollup: - specifier: 4.9.6 - version: 4.9.6 + specifier: 4.22.4 + version: 4.22.4 + tslib: + specifier: 2.7.0 + version: 2.7.0 typescript: - specifier: 5.3.3 - version: 5.3.3 + specifier: 5.6.3 + version: 5.6.3 + typescript-eslint: + specifier: 8.10.0 + version: 8.10.0(eslint@9.13.0(jiti@2.0.0))(typescript@5.6.3) examples/api: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: 2.0.2 + version: 2.0.2 '@tauri-apps/plugin-barcode-scanner': - specifier: 2.0.0-beta.1 + specifier: 2.0.0 version: link:../../plugins/barcode-scanner '@tauri-apps/plugin-biometric': - specifier: 2.0.0-beta.1 + specifier: 2.0.0 version: link:../../plugins/biometric '@tauri-apps/plugin-cli': - specifier: 2.0.0-beta.1 + specifier: 2.0.0 version: link:../../plugins/cli '@tauri-apps/plugin-clipboard-manager': - specifier: 2.0.0-beta.1 + specifier: 2.0.0 version: link:../../plugins/clipboard-manager '@tauri-apps/plugin-dialog': - specifier: 2.0.0-beta.1 + specifier: 2.0.1 version: link:../../plugins/dialog '@tauri-apps/plugin-fs': - specifier: 2.0.0-beta.1 + specifier: 2.0.1 version: link:../../plugins/fs + '@tauri-apps/plugin-geolocation': + specifier: 2.0.0 + version: link:../../plugins/geolocation '@tauri-apps/plugin-global-shortcut': - specifier: 2.0.0-beta.1 + specifier: 2.0.0 version: link:../../plugins/global-shortcut + '@tauri-apps/plugin-haptics': + specifier: 2.0.0 + version: link:../../plugins/haptics '@tauri-apps/plugin-http': - specifier: 2.0.0-beta.1 + specifier: 2.0.1 version: link:../../plugins/http '@tauri-apps/plugin-nfc': - specifier: 2.0.0-beta.1 + specifier: 2.0.0 version: link:../../plugins/nfc '@tauri-apps/plugin-notification': - specifier: 2.0.0-beta.1 + specifier: 2.0.0 version: link:../../plugins/notification '@tauri-apps/plugin-os': - specifier: 2.0.0-beta.1 + specifier: 2.0.0 version: link:../../plugins/os '@tauri-apps/plugin-process': - specifier: 2.0.0-beta.1 + specifier: 2.0.0 version: link:../../plugins/process '@tauri-apps/plugin-shell': - specifier: 2.0.0-beta.1 + specifier: 2.0.1 version: link:../../plugins/shell + '@tauri-apps/plugin-store': + specifier: 2.1.0 + version: link:../../plugins/store '@tauri-apps/plugin-updater': - specifier: 2.0.0-beta.1 + specifier: 2.0.0 version: link:../../plugins/updater '@zerodevx/svelte-json-view': - specifier: 1.0.7 - version: 1.0.7(svelte@4.2.8) + specifier: 1.0.11 + version: 1.0.11(svelte@4.2.19) devDependencies: '@iconify-json/codicon': specifier: ^1.1.37 - version: 1.1.37 + version: 1.2.2 '@iconify-json/ph': specifier: ^1.1.8 - version: 1.1.8 + version: 1.2.0 '@sveltejs/vite-plugin-svelte': specifier: ^3.0.1 - version: 3.0.1(svelte@4.2.8)(vite@5.0.12) + version: 3.1.2(svelte@4.2.19)(vite@5.4.8(terser@5.34.1)) '@tauri-apps/cli': - specifier: 2.0.0-beta.3 - version: 2.0.0-beta.3 + specifier: 2.0.3 + version: 2.0.3 '@unocss/extractor-svelte': - specifier: ^0.58.0 - version: 0.58.0 - internal-ip: - specifier: ^8.0.0 - version: 8.0.0 + specifier: ^0.63.0 + version: 0.63.1 svelte: - specifier: ^4.2.8 - version: 4.2.8 + specifier: ^4.2.19 + version: 4.2.19 unocss: - specifier: ^0.58.0 - version: 0.58.0(postcss@8.4.32)(vite@5.0.12) + specifier: ^0.63.0 + version: 0.63.1(postcss@8.4.47)(rollup@4.22.4)(vite@5.4.8(terser@5.34.1)) vite: - specifier: ^5.0.12 - version: 5.0.12 - - plugins/authenticator: - dependencies: - '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^5.4.7 + version: 5.4.8(terser@5.34.1) plugins/autostart: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/barcode-scanner: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/biometric: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 - devDependencies: - tslib: - specifier: 2.6.0 - version: 2.6.0 + specifier: ^2.0.0 + version: 2.0.2 plugins/cli: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/clipboard-manager: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/deep-link: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/deep-link/examples/app: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: 2.0.2 + version: 2.0.2 '@tauri-apps/plugin-deep-link': - specifier: 2.0.0-beta.1 + specifier: 2.0.0 version: link:../.. devDependencies: '@tauri-apps/cli': - specifier: 2.0.0-beta.3 - version: 2.0.0-beta.3 - internal-ip: - specifier: ^8.0.0 - version: 8.0.0 + specifier: 2.0.3 + version: 2.0.3 typescript: specifier: ^5.2.2 - version: 5.3.2 + version: 5.6.3 vite: - specifier: ^5.0.12 - version: 5.0.12 + specifier: ^5.4.7 + version: 5.4.8(terser@5.34.1) plugins/dialog: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/fs: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 + + plugins/geolocation: + dependencies: + '@tauri-apps/api': + specifier: ^2.0.0 + version: 2.0.2 plugins/global-shortcut: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 + + plugins/haptics: + dependencies: + '@tauri-apps/api': + specifier: ^2.0.0 + version: 2.0.2 plugins/http: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/log: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/nfc: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 - devDependencies: - tslib: - specifier: 2.6.0 - version: 2.6.0 + specifier: ^2.0.0 + version: 2.0.2 plugins/notification: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/os: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/positioner: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/process: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/shell: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/single-instance/examples/vanilla: devDependencies: '@tauri-apps/cli': - specifier: 2.0.0-beta.3 - version: 2.0.0-beta.3 + specifier: 2.0.3 + version: 2.0.3 plugins/sql: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/store: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 + + plugins/store/examples/AppSettingsManager: + devDependencies: + '@tauri-apps/cli': + specifier: 2.0.3 + version: 2.0.3 + typescript: + specifier: ^5.4.7 + version: 5.6.3 + vite: + specifier: ^5.0.12 + version: 5.4.8(terser@5.34.1) plugins/stronghold: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/updater: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/upload: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/websocket: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 plugins/websocket/examples/tauri-app: dependencies: @@ -327,871 +334,483 @@ importers: version: link:../.. devDependencies: '@tauri-apps/cli': - specifier: 2.0.0-beta.3 - version: 2.0.0-beta.3 + specifier: 2.0.3 + version: 2.0.3 typescript: specifier: ^5.3.3 - version: 5.3.3 + version: 5.6.3 vite: - specifier: ^5.0.12 - version: 5.0.12 + specifier: ^5.4.7 + version: 5.4.8(terser@5.34.1) plugins/window-state: dependencies: '@tauri-apps/api': - specifier: 2.0.0-beta.2 - version: 2.0.0-beta.2 + specifier: ^2.0.0 + version: 2.0.2 packages: - /@aashutoshrathi/word-wrap@1.2.6: - resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} - engines: {node: '>=0.10.0'} - dev: true - - /@ampproject/remapping@2.2.1: - resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} - engines: {node: '>=6.0.0'} - dependencies: - '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.20 - - /@antfu/install-pkg@0.1.1: - resolution: {integrity: sha512-LyB/8+bSfa0DFGC06zpCEfs89/XoWZwws5ygEa5D+Xsm3OfI+aXQ86VgVG7Acyef+rSZ5HE7J8rrxzrQeM3PjQ==} - dependencies: - execa: 5.1.1 - find-up: 5.0.0 - dev: true - - /@antfu/utils@0.7.6: - resolution: {integrity: sha512-pvFiLP2BeOKA/ZOS6jxx4XhKzdVLHDhGlFEaZ2flWWYf2xOqVniqpk38I04DFRyz+L0ASggl7SkItTc+ZLju4w==} - dev: true - - /@babel/code-frame@7.23.5: - resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/highlight': 7.23.4 - chalk: 2.4.2 - dev: true - - /@babel/compat-data@7.23.5: - resolution: {integrity: sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/core@7.23.5: - resolution: {integrity: sha512-Cwc2XjUrG4ilcfOw4wBAK+enbdgwAcAJCfGUItPBKR7Mjw4aEfAFYrLxeRp4jWgtNIKn3n2AlBOfwwafl+42/g==} - engines: {node: '>=6.9.0'} - dependencies: - '@ampproject/remapping': 2.2.1 - '@babel/code-frame': 7.23.5 - '@babel/generator': 7.23.5 - '@babel/helper-compilation-targets': 7.22.15 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.5) - '@babel/helpers': 7.23.5 - '@babel/parser': 7.23.5 - '@babel/template': 7.22.15 - '@babel/traverse': 7.23.5 - '@babel/types': 7.23.5 - convert-source-map: 2.0.0 - debug: 4.3.4 - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 7.5.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@babel/generator@7.23.5: - resolution: {integrity: sha512-BPssCHrBD+0YrxviOa3QzpqwhNIXKEtOa2jQrm4FlmkC2apYgRnQcmPWiGZDlGxiNtltnUFolMe8497Esry+jA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.23.5 - '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.20 - jsesc: 2.5.2 - dev: true - - /@babel/helper-annotate-as-pure@7.22.5: - resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.23.5 - dev: true - - /@babel/helper-compilation-targets@7.22.15: - resolution: {integrity: sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/compat-data': 7.23.5 - '@babel/helper-validator-option': 7.23.5 - browserslist: 4.22.2 - lru-cache: 5.1.1 - semver: 7.5.4 - dev: true - - /@babel/helper-create-class-features-plugin@7.23.5(@babel/core@7.23.5): - resolution: {integrity: sha512-QELlRWxSpgdwdJzSJn4WAhKC+hvw/AtHbbrIoncKHkhKKR/luAlKkgBDcri1EzWAo8f8VvYVryEHN4tax/V67A==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.23.5 - '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-member-expression-to-functions': 7.23.0 - '@babel/helper-optimise-call-expression': 7.22.5 - '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.5) - '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - semver: 7.5.4 - dev: true - - /@babel/helper-environment-visitor@7.22.20: - resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/helper-function-name@7.23.0: - resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/template': 7.22.15 - '@babel/types': 7.23.5 - dev: true - - /@babel/helper-hoist-variables@7.22.5: - resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.23.5 - dev: true - - /@babel/helper-member-expression-to-functions@7.23.0: - resolution: {integrity: sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.23.5 - dev: true - - /@babel/helper-module-imports@7.22.15: - resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.23.5 - dev: true - - /@babel/helper-module-transforms@7.23.3(@babel/core@7.23.5): - resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.23.5 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-module-imports': 7.22.15 - '@babel/helper-simple-access': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/helper-validator-identifier': 7.22.20 - dev: true - - /@babel/helper-optimise-call-expression@7.22.5: - resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.23.5 - dev: true - - /@babel/helper-plugin-utils@7.22.5: - resolution: {integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/helper-replace-supers@7.22.20(@babel/core@7.23.5): - resolution: {integrity: sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.23.5 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-member-expression-to-functions': 7.23.0 - '@babel/helper-optimise-call-expression': 7.22.5 - dev: true - - /@babel/helper-simple-access@7.22.5: - resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.23.5 - dev: true - - /@babel/helper-skip-transparent-expression-wrappers@7.22.5: - resolution: {integrity: sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.23.5 - dev: true - - /@babel/helper-split-export-declaration@7.22.6: - resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.23.5 - dev: true - - /@babel/helper-string-parser@7.23.4: - resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/helper-validator-identifier@7.22.20: - resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/helper-validator-option@7.23.5: - resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/helpers@7.23.5: - resolution: {integrity: sha512-oO7us8FzTEsG3U6ag9MfdF1iA/7Z6dz+MtFhifZk8C8o453rGJFFWUP1t+ULM9TUIAzC9uxXEiXjOiVMyd7QPg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/template': 7.22.15 - '@babel/traverse': 7.23.5 - '@babel/types': 7.23.5 - transitivePeerDependencies: - - supports-color - dev: true - - /@babel/highlight@7.23.4: - resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-validator-identifier': 7.22.20 - chalk: 2.4.2 - js-tokens: 4.0.0 - dev: true - - /@babel/parser@7.23.5: - resolution: {integrity: sha512-hOOqoiNXrmGdFbhgCzu6GiURxUgM27Xwd/aPuu8RfHEZPBzL1Z54okAHAQjXfcQNwvrlkAmAp4SlRTZ45vlthQ==} + '@ampproject/remapping@2.3.0': + resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} - hasBin: true - dependencies: - '@babel/types': 7.23.5 - dev: true - /@babel/plugin-syntax-jsx@7.23.3(@babel/core@7.23.5): - resolution: {integrity: sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.23.5 - '@babel/helper-plugin-utils': 7.22.5 - dev: true + '@antfu/install-pkg@0.4.1': + resolution: {integrity: sha512-T7yB5QNG29afhWVkVq7XeIMBa5U/vs9mX69YqayXypPRmYzUmzwnYltplHmPtZ4HPCn+sQKeXW8I47wCbuBOjw==} - /@babel/plugin-syntax-typescript@7.23.3(@babel/core@7.23.5): - resolution: {integrity: sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.23.5 - '@babel/helper-plugin-utils': 7.22.5 - dev: true + '@antfu/utils@0.7.10': + resolution: {integrity: sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==} - /@babel/plugin-transform-modules-commonjs@7.23.3(@babel/core@7.23.5): - resolution: {integrity: sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.23.5 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.5) - '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-simple-access': 7.22.5 - dev: true + '@chainsafe/abort-controller@3.0.1': + resolution: {integrity: sha512-oyq0qgFJDIIgLpyPwTv4j/sHX/MITatFzY3/b42VSldyZfnUC1lYBx5RwFvzBv1Sq4APOj2VCZO23pDRwy5kew==} + engines: {node: '>=6.5'} - /@babel/plugin-transform-typescript@7.23.5(@babel/core@7.23.5): - resolution: {integrity: sha512-2fMkXEJkrmwgu2Bsv1Saxgj30IXZdJ+84lQcKKI7sm719oXs0BBw2ZENKdJdR1PjWndgLCEBNXJOri0fk7RYQA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.23.5 - '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.23.5(@babel/core@7.23.5) - '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-typescript': 7.23.3(@babel/core@7.23.5) - dev: true - - /@babel/preset-typescript@7.23.3(@babel/core@7.23.5): - resolution: {integrity: sha512-17oIGVlqz6CchO9RFYn5U6ZpWRZIngayYCtrPRSgANSwC2V1Jb+iP74nVxzzXJte8b8BYxrL1yY96xfhTBrNNQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.23.5 - '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-validator-option': 7.23.5 - '@babel/plugin-syntax-jsx': 7.23.3(@babel/core@7.23.5) - '@babel/plugin-transform-modules-commonjs': 7.23.3(@babel/core@7.23.5) - '@babel/plugin-transform-typescript': 7.23.5(@babel/core@7.23.5) - dev: true - - /@babel/template@7.22.15: - resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.23.5 - '@babel/parser': 7.23.5 - '@babel/types': 7.23.5 - dev: true - - /@babel/traverse@7.23.5: - resolution: {integrity: sha512-czx7Xy5a6sapWWRx61m1Ke1Ra4vczu1mCTtJam5zRTBOonfdJ+S/B6HYmGYu3fJtr8GGET3si6IhgWVBhJ/m8w==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.23.5 - '@babel/generator': 7.23.5 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-hoist-variables': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.23.5 - '@babel/types': 7.23.5 - debug: 4.3.4 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - dev: true + '@clack/core@0.3.4': + resolution: {integrity: sha512-H4hxZDXgHtWTwV3RAVenqcC4VbJZNegbBjlPvzOzCouXtS2y3sDvlO3IsbrPNWuLWPPlYVYPghQdSF64683Ldw==} - /@babel/types@7.23.5: - resolution: {integrity: sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-string-parser': 7.23.4 - '@babel/helper-validator-identifier': 7.22.20 - to-fast-properties: 2.0.0 - dev: true + '@clack/prompts@0.7.0': + resolution: {integrity: sha512-0MhX9/B4iL6Re04jPrttDm+BsP8y6mS7byuv0BvXgdXhbV5PdlsHt55dvNsuBCPZ7xq1oTAOOuotR9NFbQyMSA==} + bundledDependencies: + - is-unicode-supported - /@chainsafe/abort-controller@3.0.1: - resolution: {integrity: sha512-oyq0qgFJDIIgLpyPwTv4j/sHX/MITatFzY3/b42VSldyZfnUC1lYBx5RwFvzBv1Sq4APOj2VCZO23pDRwy5kew==} - engines: {node: '>=6.5'} - dependencies: - event-target-shim: 5.0.1 - dev: true + '@covector/apply@0.10.0': + resolution: {integrity: sha512-/LB0kG0RGsqcQopjg6FX94fUDaVrPSpsU5CaKbdOWXGzRBwMa4MZxiGu1S8mji3xcLE6ALUBQNZpyOKsfxXaGQ==} - /@covector/apply@0.9.2(mocha@10.2.0): - resolution: {integrity: sha512-XrNujG6ERUq8bwPCQgOEzuwBCSLKV5nC4AuO+QBpuC0xA9Qz9w025YKYNMIsXxVf0SBscMXKzhBAo9iUDTzKFw==} - dependencies: - '@covector/files': 0.7.1 - effection: 2.0.8(mocha@10.2.0) - semver: 7.5.4 - transitivePeerDependencies: - - encoding - - mocha - dev: true + '@covector/assemble@0.12.0': + resolution: {integrity: sha512-lBXUzc3aIWKW6Xf5I2WhWNi4Eabteu+3GmrKwrxIs5ofBBZDi8ZDd1Sfuh7yraPV7+ytDm2CHc+cJFLzoJYWAQ==} - /@covector/assemble@0.10.3(mocha@10.2.0): - resolution: {integrity: sha512-LcltbmTDHeCouIGvDJ268UQ2T/JGOjt/vE4lT15BOq3F+RjTdE3B+1XmhhkFzP6Ebp6hnU5mZXFDmWqqrQKWFA==} - dependencies: - '@covector/command': 0.7.0(mocha@10.2.0) - '@covector/files': 0.7.1 - effection: 2.0.8(mocha@10.2.0) - js-yaml: 4.1.0 - lodash: 4.17.21 - remark-frontmatter: 3.0.0 - remark-parse: 9.0.0 - remark-stringify: 9.0.1 - unified: 9.2.2 - transitivePeerDependencies: - - encoding - - mocha - - supports-color - dev: true + '@covector/changelog@0.12.0': + resolution: {integrity: sha512-cWjCdhpRpyeYPh1sRmc+5nAKBNiu/3aYOWt2uEmviDemM2PPa3lMQwn3snmH717MNE+68vhWjKd/9/dhBM1W4Q==} - /@covector/changelog@0.10.1(mocha@10.2.0): - resolution: {integrity: sha512-p1kDf6abq8TAKIzLMcieMD+hoP4RamykoPpk3PYHUhZnz0xi1+8sVGEPByCQGb3SI9PCg8CZPuyIA91YtuiTsQ==} - dependencies: - '@covector/files': 0.7.1 - effection: 2.0.8(mocha@10.2.0) - lodash: 4.17.21 - remark-parse: 9.0.0 - remark-stringify: 9.0.1 - unified: 9.2.2 - transitivePeerDependencies: - - encoding - - mocha - - supports-color - dev: true + '@covector/command@0.8.0': + resolution: {integrity: sha512-6KDgmQXc8/lSrTJsSfw+zjl+qcW9jy71UXFf1sJ49jUDBKs3dh6RTW3fjjIxYQ9SG1mZ0eGOZbuG5pI1mYvn1Q==} - /@covector/command@0.7.0(mocha@10.2.0): - resolution: {integrity: sha512-9DGx4tOY9Fkd4AlYbOE0rnesYAYJm7Wr6BUBJlRxErtA0vDAejZ0+jVHZbemB1MbLOaYWXkDf/wD7SLnf06gfw==} - dependencies: - '@effection/process': 2.1.4(mocha@10.2.0) - effection: 2.0.8(mocha@10.2.0) - strip-ansi: 6.0.1 - transitivePeerDependencies: - - encoding - - mocha - dev: true + '@covector/files@0.8.0': + resolution: {integrity: sha512-cx0bexTWFYdBnta55U8+c4p7ekzS5AZ8A2R9OXWZDVFajvH7LzPEXgvwi0IfVO26zzWxMyMFhHyugwUF6i+wKg==} - /@covector/files@0.7.1: - resolution: {integrity: sha512-fGMNfTkjTvgXyj5ctfGxPhxW05SNlLK3V0eiSjP2nMVLEapPtp9ZMJNGqvvoHIs1R2IxURh0iUOjA8O2zQaCfQ==} - dependencies: - '@iarna/toml': 2.2.5 - '@tauri-apps/toml': 2.2.4 - globby: 11.1.0 - js-yaml: 4.1.0 - semver: 7.5.4 - zod: 3.22.4 - zod-validation-error: 1.5.0(zod@3.22.4) - dev: true + '@covector/toml@0.2.0': + resolution: {integrity: sha512-bIKZQLaUU1hoXiN1fvae7gNB3eT/8kLo/XlPtYmj/wY+UpukrvDkoWyMz+SRwWlUOjHU2ogrhkaoWCq1BpS43Q==} + engines: {node: '>=18'} - /@effection/channel@2.0.6: + '@effection/channel@2.0.6': resolution: {integrity: sha512-ugBR6GfhUo1Ltqz472h+48k+s72hkU8x8QI9Zd7FZRuS4z1xdv8I795QgQWD5hBTgl8o36zMVCzyICQpfwwkMw==} - dependencies: - '@effection/core': 2.2.3 - '@effection/events': 2.0.6 - '@effection/stream': 2.0.6 - dev: true - /@effection/core@2.2.3: + '@effection/core@2.2.3': resolution: {integrity: sha512-arg67zzGS+24CkSSn86cDOU80XwlBv9yM4lEJEd19DZhu9J9bkf8Lktm1AP1W5UXLM5mjGjEpIeYo1k/uYF5Fw==} - dependencies: - '@chainsafe/abort-controller': 3.0.1 - dev: true - /@effection/events@2.0.6: + '@effection/events@2.0.6': resolution: {integrity: sha512-G3gHqFIvfa9b2vozkUSvRttjcnqbU+nSGbbXcU4I3lxVcvMPEaMlt4MtuM2E6KNGvABuPYLZMWFxgBmW1BzUqA==} - dependencies: - '@effection/core': 2.2.3 - '@effection/stream': 2.0.6 - dev: true - /@effection/fetch@2.0.7(mocha@10.2.0): + '@effection/fetch@2.0.7': resolution: {integrity: sha512-1lZTmhhtaGjEOMPS6UNhmKjXoJXh8n5hmSAM2d1oZUOPGMnuJaYlyqjCusdlnJF8SgJbwuek9Hux3TEyLV3c1g==} - dependencies: - '@effection/core': 2.2.3 - '@effection/mocha': 2.0.8(mocha@10.2.0) - cross-fetch: 3.1.5 - transitivePeerDependencies: - - encoding - - mocha - dev: true - /@effection/main@2.1.2: + '@effection/main@2.1.2': resolution: {integrity: sha512-202JariBwP210C3Ka+ZHLGymcAuXs8Lg8TECbawpMFhA2w58AZhQB/oc0SOGvHWDarfRjVCMmB2dvQchCAGgnQ==} - dependencies: - '@effection/core': 2.2.3 - chalk: 4.1.2 - stacktrace-parser: 0.1.10 - dev: true - /@effection/mocha@2.0.8(mocha@10.2.0): + '@effection/mocha@2.0.8': resolution: {integrity: sha512-XXL3Vhhu6w8tQNv4EJI6H0+JZBzzi8FI6caCbQdiS7M3FOON9WI3EnorpIsOtZyZoKXaH+8d9543+ufRGzyP+Q==} peerDependencies: mocha: ^10.0.0 - dependencies: - effection: 2.0.8 - mocha: 10.2.0 - dev: true - /@effection/process@2.1.4(mocha@10.2.0): + '@effection/process@2.1.4': resolution: {integrity: sha512-MBvcCwUzxma2Luk+JSc8we3qDeFEf7rt6XYg6krpytICODHs6VMp1xl8YJhfLqGFza7/WR70FPAoK34BidiIIA==} - dependencies: - cross-spawn: 7.0.3 - ctrlc-windows: 2.1.0 - effection: 2.0.8(mocha@10.2.0) - shellwords: 0.1.1 - transitivePeerDependencies: - - encoding - - mocha - dev: true - /@effection/stream@2.0.6: + '@effection/stream@2.0.6': resolution: {integrity: sha512-cAg6p5S2NKbRF418J9Df3biMY+f0vEjgW46IOyShkMyg0AK/fYXMT6GIiMB5oNGiALkTuj/xsi3DDnEcO4Of+w==} - dependencies: - '@effection/core': 2.2.3 - '@effection/subscription': 2.0.6 - dev: true - /@effection/subscription@2.0.6: + '@effection/subscription@2.0.6': resolution: {integrity: sha512-znTi75JFyC1S0YjyTtFEWNRQbhk01UxOapWELlIkZOwjGIEjcx6+G8y6n9JpZ8OGKmJQ0GBlRMZozsR5gcQvBg==} - dependencies: - '@effection/core': 2.2.3 - dev: true - /@esbuild/android-arm64@0.19.8: - resolution: {integrity: sha512-B8JbS61bEunhfx8kasogFENgQfr/dIp+ggYXwTqdbMAgGDhRa3AaPpQMuQU0rNxDLECj6FhDzk1cF9WHMVwrtA==} + '@esbuild/aix-ppc64@0.21.5': + resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + + '@esbuild/aix-ppc64@0.23.1': + resolution: {integrity: sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.21.5': + resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} engines: {node: '>=12'} cpu: [arm64] os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-arm@0.19.8: - resolution: {integrity: sha512-31E2lxlGM1KEfivQl8Yf5aYU/mflz9g06H6S15ITUFQueMFtFjESRMoDSkvMo8thYvLBax+VKTPlpnx+sPicOA==} + '@esbuild/android-arm64@0.23.1': + resolution: {integrity: sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.21.5': + resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} engines: {node: '>=12'} cpu: [arm] os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-x64@0.19.8: - resolution: {integrity: sha512-rdqqYfRIn4jWOp+lzQttYMa2Xar3OK9Yt2fhOhzFXqg0rVWEfSclJvZq5fZslnz6ypHvVf3CT7qyf0A5pM682A==} + '@esbuild/android-arm@0.23.1': + resolution: {integrity: sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.21.5': + resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} engines: {node: '>=12'} cpu: [x64] os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/darwin-arm64@0.19.8: - resolution: {integrity: sha512-RQw9DemMbIq35Bprbboyf8SmOr4UXsRVxJ97LgB55VKKeJOOdvsIPy0nFyF2l8U+h4PtBx/1kRf0BelOYCiQcw==} + '@esbuild/android-x64@0.23.1': + resolution: {integrity: sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.21.5': + resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] - requiresBuild: true - dev: true - optional: true - /@esbuild/darwin-x64@0.19.8: - resolution: {integrity: sha512-3sur80OT9YdeZwIVgERAysAbwncom7b4bCI2XKLjMfPymTud7e/oY4y+ci1XVp5TfQp/bppn7xLw1n/oSQY3/Q==} + '@esbuild/darwin-arm64@0.23.1': + resolution: {integrity: sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.21.5': + resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} engines: {node: '>=12'} cpu: [x64] os: [darwin] - requiresBuild: true - dev: true - optional: true - /@esbuild/freebsd-arm64@0.19.8: - resolution: {integrity: sha512-WAnPJSDattvS/XtPCTj1tPoTxERjcTpH6HsMr6ujTT+X6rylVe8ggxk8pVxzf5U1wh5sPODpawNicF5ta/9Tmw==} + '@esbuild/darwin-x64@0.23.1': + resolution: {integrity: sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.21.5': + resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/freebsd-x64@0.19.8: - resolution: {integrity: sha512-ICvZyOplIjmmhjd6mxi+zxSdpPTKFfyPPQMQTK/w+8eNK6WV01AjIztJALDtwNNfFhfZLux0tZLC+U9nSyA5Zg==} + '@esbuild/freebsd-arm64@0.23.1': + resolution: {integrity: sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.21.5': + resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-arm64@0.19.8: - resolution: {integrity: sha512-z1zMZivxDLHWnyGOctT9JP70h0beY54xDDDJt4VpTX+iwA77IFsE1vCXWmprajJGa+ZYSqkSbRQ4eyLCpCmiCQ==} + '@esbuild/freebsd-x64@0.23.1': + resolution: {integrity: sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.21.5': + resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} engines: {node: '>=12'} cpu: [arm64] os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-arm@0.19.8: - resolution: {integrity: sha512-H4vmI5PYqSvosPaTJuEppU9oz1dq2A7Mr2vyg5TF9Ga+3+MGgBdGzcyBP7qK9MrwFQZlvNyJrvz6GuCaj3OukQ==} + '@esbuild/linux-arm64@0.23.1': + resolution: {integrity: sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.21.5': + resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} engines: {node: '>=12'} cpu: [arm] os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-ia32@0.19.8: - resolution: {integrity: sha512-1a8suQiFJmZz1khm/rDglOc8lavtzEMRo0v6WhPgxkrjcU0LkHj+TwBrALwoz/OtMExvsqbbMI0ChyelKabSvQ==} + '@esbuild/linux-arm@0.23.1': + resolution: {integrity: sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.21.5': + resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} engines: {node: '>=12'} cpu: [ia32] os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-loong64@0.19.8: - resolution: {integrity: sha512-fHZWS2JJxnXt1uYJsDv9+b60WCc2RlvVAy1F76qOLtXRO+H4mjt3Tr6MJ5l7Q78X8KgCFudnTuiQRBhULUyBKQ==} + '@esbuild/linux-ia32@0.23.1': + resolution: {integrity: sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.21.5': + resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} engines: {node: '>=12'} cpu: [loong64] os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-mips64el@0.19.8: - resolution: {integrity: sha512-Wy/z0EL5qZYLX66dVnEg9riiwls5IYnziwuju2oUiuxVc+/edvqXa04qNtbrs0Ukatg5HEzqT94Zs7J207dN5Q==} + '@esbuild/linux-loong64@0.23.1': + resolution: {integrity: sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.21.5': + resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-ppc64@0.19.8: - resolution: {integrity: sha512-ETaW6245wK23YIEufhMQ3HSeHO7NgsLx8gygBVldRHKhOlD1oNeNy/P67mIh1zPn2Hr2HLieQrt6tWrVwuqrxg==} + '@esbuild/linux-mips64el@0.23.1': + resolution: {integrity: sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.21.5': + resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-riscv64@0.19.8: - resolution: {integrity: sha512-T2DRQk55SgoleTP+DtPlMrxi/5r9AeFgkhkZ/B0ap99zmxtxdOixOMI570VjdRCs9pE4Wdkz7JYrsPvsl7eESg==} + '@esbuild/linux-ppc64@0.23.1': + resolution: {integrity: sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.21.5': + resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-s390x@0.19.8: - resolution: {integrity: sha512-NPxbdmmo3Bk7mbNeHmcCd7R7fptJaczPYBaELk6NcXxy7HLNyWwCyDJ/Xx+/YcNH7Im5dHdx9gZ5xIwyliQCbg==} + '@esbuild/linux-riscv64@0.23.1': + resolution: {integrity: sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.21.5': + resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} engines: {node: '>=12'} cpu: [s390x] os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-x64@0.19.8: - resolution: {integrity: sha512-lytMAVOM3b1gPypL2TRmZ5rnXl7+6IIk8uB3eLsV1JwcizuolblXRrc5ShPrO9ls/b+RTp+E6gbsuLWHWi2zGg==} + '@esbuild/linux-s390x@0.23.1': + resolution: {integrity: sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.21.5': + resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} engines: {node: '>=12'} cpu: [x64] os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/netbsd-x64@0.19.8: - resolution: {integrity: sha512-hvWVo2VsXz/8NVt1UhLzxwAfo5sioj92uo0bCfLibB0xlOmimU/DeAEsQILlBQvkhrGjamP0/el5HU76HAitGw==} + '@esbuild/linux-x64@0.23.1': + resolution: {integrity: sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-x64@0.21.5': + resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/openbsd-x64@0.19.8: - resolution: {integrity: sha512-/7Y7u77rdvmGTxR83PgaSvSBJCC2L3Kb1M/+dmSIvRvQPXXCuC97QAwMugBNG0yGcbEGfFBH7ojPzAOxfGNkwQ==} + '@esbuild/netbsd-x64@0.23.1': + resolution: {integrity: sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.23.1': + resolution: {integrity: sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.21.5': + resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/sunos-x64@0.19.8: - resolution: {integrity: sha512-9Lc4s7Oi98GqFA4HzA/W2JHIYfnXbUYgekUP/Sm4BG9sfLjyv6GKKHKKVs83SMicBF2JwAX6A1PuOLMqpD001w==} + '@esbuild/openbsd-x64@0.23.1': + resolution: {integrity: sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/sunos-x64@0.21.5': + resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} engines: {node: '>=12'} cpu: [x64] os: [sunos] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-arm64@0.19.8: - resolution: {integrity: sha512-rq6WzBGjSzihI9deW3fC2Gqiak68+b7qo5/3kmB6Gvbh/NYPA0sJhrnp7wgV4bNwjqM+R2AApXGxMO7ZoGhIJg==} + '@esbuild/sunos-x64@0.23.1': + resolution: {integrity: sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.21.5': + resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} engines: {node: '>=12'} cpu: [arm64] os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-ia32@0.19.8: - resolution: {integrity: sha512-AIAbverbg5jMvJznYiGhrd3sumfwWs8572mIJL5NQjJa06P8KfCPWZQ0NwZbPQnbQi9OWSZhFVSUWjjIrn4hSw==} + '@esbuild/win32-arm64@0.23.1': + resolution: {integrity: sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.21.5': + resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} engines: {node: '>=12'} cpu: [ia32] os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-x64@0.19.8: - resolution: {integrity: sha512-bfZ0cQ1uZs2PqpulNL5j/3w+GDhP36k1K5c38QdQg+Swy51jFZWWeIkteNsufkQxp986wnqRRsb/bHbY1WQ7TA==} + '@esbuild/win32-ia32@0.23.1': + resolution: {integrity: sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.21.5': + resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} engines: {node: '>=12'} cpu: [x64] os: [win32] - requiresBuild: true - dev: true - optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.56.0): + '@esbuild/win32-x64@0.23.1': + resolution: {integrity: sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + + '@eslint-community/eslint-utils@4.4.0': resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - dependencies: - eslint: 8.56.0 - eslint-visitor-keys: 3.4.3 - dev: true - /@eslint-community/regexpp@4.10.0: - resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} + '@eslint-community/regexpp@4.11.1': + resolution: {integrity: sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - dev: true - /@eslint/eslintrc@2.1.4: - resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - ajv: 6.12.6 - debug: 4.3.4 - espree: 9.6.1 - globals: 13.23.0 - ignore: 5.3.0 - import-fresh: 3.3.0 - js-yaml: 4.1.0 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - dev: true + '@eslint/config-array@0.18.0': + resolution: {integrity: sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - /@eslint/js@8.56.0: - resolution: {integrity: sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true + '@eslint/core@0.7.0': + resolution: {integrity: sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - /@humanwhocodes/config-array@0.11.13: - resolution: {integrity: sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==} - engines: {node: '>=10.10.0'} - dependencies: - '@humanwhocodes/object-schema': 2.0.1 - debug: 4.3.4 - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - dev: true + '@eslint/eslintrc@3.1.0': + resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/js@9.13.0': + resolution: {integrity: sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/object-schema@2.1.4': + resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/plugin-kit@0.2.0': + resolution: {integrity: sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - /@humanwhocodes/module-importer@1.0.1: + '@humanfs/core@0.19.0': + resolution: {integrity: sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==} + engines: {node: '>=18.18.0'} + + '@humanfs/node@0.16.5': + resolution: {integrity: sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg==} + engines: {node: '>=18.18.0'} + + '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - dev: true - /@humanwhocodes/object-schema@2.0.1: - resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} - dev: true + '@humanwhocodes/retry@0.3.1': + resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} + engines: {node: '>=18.18'} - /@iarna/toml@2.2.5: - resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==} - dev: true + '@iconify-json/codicon@1.2.2': + resolution: {integrity: sha512-ZO63Qy0e+/VBESGHE3CZEE2EFpzlBOTPSiMtIDQc1qIGvh6HpYVRNpEGuawF91oEws7PLuUifCIZL5NpYpKloA==} - /@iconify-json/codicon@1.1.37: - resolution: {integrity: sha512-S8nJQeP9VGdPO+XtuyM+HfGKCAkGXY4qteYW5PKzz1S9s73PdBTLuLTSW342HqqYhuUaiF8S+w8SAkkPZnOnpg==} - dependencies: - '@iconify/types': 2.0.0 - dev: true + '@iconify-json/ph@1.2.0': + resolution: {integrity: sha512-013eLpgTmX1lACOuDnkuhC7gRHyYj9w/j8SyDmlyUYvsKQrwdRsv1otcXtwH3DevuDAzSkreeeRsCeez+gTyVA==} - /@iconify-json/ph@1.1.8: - resolution: {integrity: sha512-LtUWsiO/R2Gx4ZqHGJbJYG4XaAFkQ1+rHPQmmQ7NVTaqg7EZibB3ky1aXX12sJ2F+6z8QIpthsw3wRjReEnTig==} - dependencies: - '@iconify/types': 2.0.0 - dev: true - - /@iconify/types@2.0.0: + '@iconify/types@2.0.0': resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} - dev: true - /@iconify/utils@2.1.12: - resolution: {integrity: sha512-7vf3Uk6H7TKX4QMs2gbg5KR1X9J0NJzKSRNWhMZ+PWN92l0t6Q3tj2ZxLDG07rC3ppWBtTtA4FPmkQphuEmdsg==} - dependencies: - '@antfu/install-pkg': 0.1.1 - '@antfu/utils': 0.7.6 - '@iconify/types': 2.0.0 - debug: 4.3.4 - kolorist: 1.8.0 - local-pkg: 0.4.3 - transitivePeerDependencies: - - supports-color - dev: true + '@iconify/utils@2.1.33': + resolution: {integrity: sha512-jP9h6v/g0BIZx0p7XGJJVtkVnydtbgTgt9mVNcGDYwaa7UhdHdI9dvoq+gKj9sijMSJKxUPEG2JyjsgXjxL7Kw==} - /@jridgewell/gen-mapping@0.3.3: - resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} + '@jridgewell/gen-mapping@0.3.5': + resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} engines: {node: '>=6.0.0'} - dependencies: - '@jridgewell/set-array': 1.1.2 - '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.20 - /@jridgewell/resolve-uri@3.1.1: - resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} - /@jridgewell/set-array@1.1.2: - resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} + '@jridgewell/set-array@1.2.1': + resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} engines: {node: '>=6.0.0'} - /@jridgewell/source-map@0.3.5: - resolution: {integrity: sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==} - dependencies: - '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.20 - dev: true + '@jridgewell/source-map@0.3.6': + resolution: {integrity: sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==} - /@jridgewell/sourcemap-codec@1.4.15: - resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + '@jridgewell/sourcemap-codec@1.5.0': + resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} - /@jridgewell/trace-mapping@0.3.20: - resolution: {integrity: sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==} - dependencies: - '@jridgewell/resolve-uri': 3.1.1 - '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/trace-mapping@0.3.25': + resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} - /@nodelib/fs.scandir@2.1.5: + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - dev: true - /@nodelib/fs.stat@2.0.5: + '@nodelib/fs.stat@2.0.5': resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} engines: {node: '>= 8'} - dev: true - /@nodelib/fs.walk@1.2.8: + '@nodelib/fs.walk@1.2.8': resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.15.0 - dev: true - /@polka/url@1.0.0-next.21: - resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} - dev: true + '@polka/url@1.0.0-next.28': + resolution: {integrity: sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==} - /@rollup/plugin-node-resolve@15.2.3(rollup@4.9.6): - resolution: {integrity: sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==} + '@rollup/plugin-node-resolve@15.3.0': + resolution: {integrity: sha512-9eO5McEICxMzJpDW9OnMYSv4Sta3hmt7VtBFz5zR9273suNOydOyq/FrGeGy+KsTRFm8w0SLVhzig2ILFT63Ag==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^2.78.0||^3.0.0||^4.0.0 peerDependenciesMeta: rollup: optional: true - dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.9.6) - '@types/resolve': 1.20.2 - deepmerge: 4.3.1 - is-builtin-module: 3.2.1 - is-module: 1.0.0 - resolve: 1.22.8 - rollup: 4.9.6 - dev: true - /@rollup/plugin-terser@0.4.4(rollup@4.9.6): + '@rollup/plugin-terser@0.4.4': resolution: {integrity: sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1199,14 +818,8 @@ packages: peerDependenciesMeta: rollup: optional: true - dependencies: - rollup: 4.9.6 - serialize-javascript: 6.0.1 - smob: 1.4.1 - terser: 5.25.0 - dev: true - /@rollup/plugin-typescript@11.1.6(rollup@4.9.6)(typescript@5.3.3): + '@rollup/plugin-typescript@11.1.6': resolution: {integrity: sha512-R92yOmIACgYdJ7dJ97p4K69I8gg6IEHt8M7dUBxN3W6nrO8uUxX5ixl0yU/N3aZTi8WhPuICvOHXQvF6FaykAA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1218,2602 +831,2869 @@ packages: optional: true tslib: optional: true - dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.9.6) - resolve: 1.22.8 - rollup: 4.9.6 - typescript: 5.3.3 - dev: true - - /@rollup/pluginutils@5.1.0: - resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - '@types/estree': 1.0.5 - estree-walker: 2.0.2 - picomatch: 2.3.1 - dev: true - /@rollup/pluginutils@5.1.0(rollup@4.9.6): - resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==} + '@rollup/pluginutils@5.1.2': + resolution: {integrity: sha512-/FIdS3PyZ39bjZlwqFnWqCOVnW7o963LtKMwQOD0NhQqw22gSr2YY1afu3FxRip4ZCZNsD5jq6Aaz6QV3D/Njw==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 peerDependenciesMeta: rollup: optional: true - dependencies: - '@types/estree': 1.0.5 - estree-walker: 2.0.2 - picomatch: 2.3.1 - rollup: 4.9.6 - dev: true - - /@rollup/rollup-android-arm-eabi@4.6.1: - resolution: {integrity: sha512-0WQ0ouLejaUCRsL93GD4uft3rOmB8qoQMU05Kb8CmMtMBe7XUDLAltxVZI1q6byNqEtU7N1ZX1Vw5lIpgulLQA==} - cpu: [arm] - os: [android] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-android-arm-eabi@4.9.6: - resolution: {integrity: sha512-MVNXSSYN6QXOulbHpLMKYi60ppyO13W9my1qogeiAqtjb2yR4LSmfU2+POvDkLzhjYLXz9Rf9+9a3zFHW1Lecg==} + '@rollup/rollup-android-arm-eabi@4.22.4': + resolution: {integrity: sha512-Fxamp4aEZnfPOcGA8KSNEohV8hX7zVHOemC8jVBoBUHu5zpJK/Eu3uJwt6BMgy9fkvzxDaurgj96F/NiLukF2w==} cpu: [arm] os: [android] - requiresBuild: true - dev: true - optional: true - - /@rollup/rollup-android-arm64@4.6.1: - resolution: {integrity: sha512-1TKm25Rn20vr5aTGGZqo6E4mzPicCUD79k17EgTLAsXc1zysyi4xXKACfUbwyANEPAEIxkzwue6JZ+stYzWUTA==} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-android-arm64@4.9.6: - resolution: {integrity: sha512-T14aNLpqJ5wzKNf5jEDpv5zgyIqcpn1MlwCrUXLrwoADr2RkWA0vOWP4XxbO9aiO3dvMCQICZdKeDrFl7UMClw==} + '@rollup/rollup-android-arm64@4.22.4': + resolution: {integrity: sha512-VXoK5UMrgECLYaMuGuVTOx5kcuap1Jm8g/M83RnCHBKOqvPPmROFJGQaZhGccnsFtfXQ3XYa4/jMCJvZnbJBdA==} cpu: [arm64] os: [android] - requiresBuild: true - dev: true - optional: true - - /@rollup/rollup-darwin-arm64@4.6.1: - resolution: {integrity: sha512-cEXJQY/ZqMACb+nxzDeX9IPLAg7S94xouJJCNVE5BJM8JUEP4HeTF+ti3cmxWeSJo+5D+o8Tc0UAWUkfENdeyw==} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-darwin-arm64@4.9.6: - resolution: {integrity: sha512-CqNNAyhRkTbo8VVZ5R85X73H3R5NX9ONnKbXuHisGWC0qRbTTxnF1U4V9NafzJbgGM0sHZpdO83pLPzq8uOZFw==} + '@rollup/rollup-darwin-arm64@4.22.4': + resolution: {integrity: sha512-xMM9ORBqu81jyMKCDP+SZDhnX2QEVQzTcC6G18KlTQEzWK8r/oNZtKuZaCcHhnsa6fEeOBionoyl5JsAbE/36Q==} cpu: [arm64] os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@rollup/rollup-darwin-x64@4.6.1: - resolution: {integrity: sha512-LoSU9Xu56isrkV2jLldcKspJ7sSXmZWkAxg7sW/RfF7GS4F5/v4EiqKSMCFbZtDu2Nc1gxxFdQdKwkKS4rwxNg==} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-darwin-x64@4.9.6: - resolution: {integrity: sha512-zRDtdJuRvA1dc9Mp6BWYqAsU5oeLixdfUvkTHuiYOHwqYuQ4YgSmi6+/lPvSsqc/I0Omw3DdICx4Tfacdzmhog==} + '@rollup/rollup-darwin-x64@4.22.4': + resolution: {integrity: sha512-aJJyYKQwbHuhTUrjWjxEvGnNNBCnmpHDvrb8JFDbeSH3m2XdHcxDd3jthAzvmoI8w/kSjd2y0udT+4okADsZIw==} cpu: [x64] os: [darwin] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.6.1: - resolution: {integrity: sha512-EfI3hzYAy5vFNDqpXsNxXcgRDcFHUWSx5nnRSCKwXuQlI5J9dD84g2Usw81n3FLBNsGCegKGwwTVsSKK9cooSQ==} + '@rollup/rollup-linux-arm-gnueabihf@4.22.4': + resolution: {integrity: sha512-j63YtCIRAzbO+gC2L9dWXRh5BFetsv0j0va0Wi9epXDgU/XUi5dJKo4USTttVyK7fGw2nPWK0PbAvyliz50SCQ==} cpu: [arm] os: [linux] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.9.6: - resolution: {integrity: sha512-oNk8YXDDnNyG4qlNb6is1ojTOGL/tRhbbKeE/YuccItzerEZT68Z9gHrY3ROh7axDc974+zYAPxK5SH0j/G+QQ==} + '@rollup/rollup-linux-arm-musleabihf@4.22.4': + resolution: {integrity: sha512-dJnWUgwWBX1YBRsuKKMOlXCzh2Wu1mlHzv20TpqEsfdZLb3WoJW2kIEsGwLkroYf24IrPAvOT/ZQ2OYMV6vlrg==} cpu: [arm] os: [linux] - requiresBuild: true - dev: true - optional: true - - /@rollup/rollup-linux-arm64-gnu@4.6.1: - resolution: {integrity: sha512-9lhc4UZstsegbNLhH0Zu6TqvDfmhGzuCWtcTFXY10VjLLUe4Mr0Ye2L3rrtHaDd/J5+tFMEuo5LTCSCMXWfUKw==} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-linux-arm64-gnu@4.9.6: - resolution: {integrity: sha512-Z3O60yxPtuCYobrtzjo0wlmvDdx2qZfeAWTyfOjEDqd08kthDKexLpV97KfAeUXPosENKd8uyJMRDfFMxcYkDQ==} + '@rollup/rollup-linux-arm64-gnu@4.22.4': + resolution: {integrity: sha512-AdPRoNi3NKVLolCN/Sp4F4N1d98c4SBnHMKoLuiG6RXgoZ4sllseuGioszumnPGmPM2O7qaAX/IJdeDU8f26Aw==} cpu: [arm64] os: [linux] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-linux-arm64-musl@4.6.1: - resolution: {integrity: sha512-FfoOK1yP5ksX3wwZ4Zk1NgyGHZyuRhf99j64I5oEmirV8EFT7+OhUZEnP+x17lcP/QHJNWGsoJwrz4PJ9fBEXw==} + '@rollup/rollup-linux-arm64-musl@4.22.4': + resolution: {integrity: sha512-Gl0AxBtDg8uoAn5CCqQDMqAx22Wx22pjDOjBdmG0VIWX3qUBHzYmOKh8KXHL4UpogfJ14G4wk16EQogF+v8hmA==} cpu: [arm64] os: [linux] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-linux-arm64-musl@4.9.6: - resolution: {integrity: sha512-gpiG0qQJNdYEVad+1iAsGAbgAnZ8j07FapmnIAQgODKcOTjLEWM9sRb+MbQyVsYCnA0Im6M6QIq6ax7liws6eQ==} - cpu: [arm64] + '@rollup/rollup-linux-powerpc64le-gnu@4.22.4': + resolution: {integrity: sha512-3aVCK9xfWW1oGQpTsYJJPF6bfpWfhbRnhdlyhak2ZiyFLDaayz0EP5j9V1RVLAAxlmWKTDfS9wyRyY3hvhPoOg==} + cpu: [ppc64] os: [linux] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-linux-riscv64-gnu@4.9.6: - resolution: {integrity: sha512-+uCOcvVmFUYvVDr27aiyun9WgZk0tXe7ThuzoUTAukZJOwS5MrGbmSlNOhx1j80GdpqbOty05XqSl5w4dQvcOA==} + '@rollup/rollup-linux-riscv64-gnu@4.22.4': + resolution: {integrity: sha512-ePYIir6VYnhgv2C5Xe9u+ico4t8sZWXschR6fMgoPUK31yQu7hTEJb7bCqivHECwIClJfKgE7zYsh1qTP3WHUA==} cpu: [riscv64] os: [linux] - requiresBuild: true - dev: true - optional: true - - /@rollup/rollup-linux-x64-gnu@4.6.1: - resolution: {integrity: sha512-DNGZvZDO5YF7jN5fX8ZqmGLjZEXIJRdJEdTFMhiyXqyXubBa0WVLDWSNlQ5JR2PNgDbEV1VQowhVRUh+74D+RA==} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-linux-x64-gnu@4.9.6: - resolution: {integrity: sha512-HUNqM32dGzfBKuaDUBqFB7tP6VMN74eLZ33Q9Y1TBqRDn+qDonkAUyKWwF9BR9unV7QUzffLnz9GrnKvMqC/fw==} - cpu: [x64] + '@rollup/rollup-linux-s390x-gnu@4.22.4': + resolution: {integrity: sha512-GqFJ9wLlbB9daxhVlrTe61vJtEY99/xB3C8e4ULVsVfflcpmR6c8UZXjtkMA6FhNONhj2eA5Tk9uAVw5orEs4Q==} + cpu: [s390x] os: [linux] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-linux-x64-musl@4.6.1: - resolution: {integrity: sha512-RkJVNVRM+piYy87HrKmhbexCHg3A6Z6MU0W9GHnJwBQNBeyhCJG9KDce4SAMdicQnpURggSvtbGo9xAWOfSvIQ==} + '@rollup/rollup-linux-x64-gnu@4.22.4': + resolution: {integrity: sha512-87v0ol2sH9GE3cLQLNEy0K/R0pz1nvg76o8M5nhMR0+Q+BBGLnb35P0fVz4CQxHYXaAOhE8HhlkaZfsdUOlHwg==} cpu: [x64] os: [linux] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-linux-x64-musl@4.9.6: - resolution: {integrity: sha512-ch7M+9Tr5R4FK40FHQk8VnML0Szi2KRujUgHXd/HjuH9ifH72GUmw6lStZBo3c3GB82vHa0ZoUfjfcM7JiiMrQ==} + '@rollup/rollup-linux-x64-musl@4.22.4': + resolution: {integrity: sha512-UV6FZMUgePDZrFjrNGIWzDo/vABebuXBhJEqrHxrGiU6HikPy0Z3LfdtciIttEUQfuDdCn8fqh7wiFJjCNwO+g==} cpu: [x64] os: [linux] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-win32-arm64-msvc@4.6.1: - resolution: {integrity: sha512-v2FVT6xfnnmTe3W9bJXl6r5KwJglMK/iRlkKiIFfO6ysKs0rDgz7Cwwf3tjldxQUrHL9INT/1r4VA0n9L/F1vQ==} + '@rollup/rollup-win32-arm64-msvc@4.22.4': + resolution: {integrity: sha512-BjI+NVVEGAXjGWYHz/vv0pBqfGoUH0IGZ0cICTn7kB9PyjrATSkX+8WkguNjWoj2qSr1im/+tTGRaY+4/PdcQw==} cpu: [arm64] os: [win32] - requiresBuild: true - dev: true - optional: true - - /@rollup/rollup-win32-arm64-msvc@4.9.6: - resolution: {integrity: sha512-VD6qnR99dhmTQ1mJhIzXsRcTBvTjbfbGGwKAHcu+52cVl15AC/kplkhxzW/uT0Xl62Y/meBKDZvoJSJN+vTeGA==} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@rollup/rollup-win32-ia32-msvc@4.6.1: - resolution: {integrity: sha512-YEeOjxRyEjqcWphH9dyLbzgkF8wZSKAKUkldRY6dgNR5oKs2LZazqGB41cWJ4Iqqcy9/zqYgmzBkRoVz3Q9MLw==} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-win32-ia32-msvc@4.9.6: - resolution: {integrity: sha512-J9AFDq/xiRI58eR2NIDfyVmTYGyIZmRcvcAoJ48oDld/NTR8wyiPUu2X/v1navJ+N/FGg68LEbX3Ejd6l8B7MQ==} + '@rollup/rollup-win32-ia32-msvc@4.22.4': + resolution: {integrity: sha512-SiWG/1TuUdPvYmzmYnmd3IEifzR61Tragkbx9D3+R8mzQqDBz8v+BvZNDlkiTtI9T15KYZhP0ehn3Dld4n9J5g==} cpu: [ia32] os: [win32] - requiresBuild: true - dev: true - optional: true - - /@rollup/rollup-win32-x64-msvc@4.6.1: - resolution: {integrity: sha512-0zfTlFAIhgz8V2G8STq8toAjsYYA6eci1hnXuyOTUFnymrtJwnS6uGKiv3v5UrPZkBlamLvrLV2iiaeqCKzb0A==} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-win32-x64-msvc@4.9.6: - resolution: {integrity: sha512-jqzNLhNDvIZOrt69Ce4UjGRpXJBzhUBzawMwnaDAwyHriki3XollsewxWzOzz+4yOFDkuJHtTsZFwMxhYJWmLQ==} + '@rollup/rollup-win32-x64-msvc@4.22.4': + resolution: {integrity: sha512-j8pPKp53/lq9lMXN57S8cFz0MynJk8OWNuUnXct/9KCpKU7DgU3bYMJhwWmcqC0UU29p8Lr0/7KEVcaM6bf47Q==} cpu: [x64] os: [win32] - requiresBuild: true - dev: true - optional: true - /@sveltejs/vite-plugin-svelte-inspector@2.0.0(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.2.8)(vite@5.0.12): - resolution: {integrity: sha512-gjr9ZFg1BSlIpfZ4PRewigrvYmHWbDrq2uvvPB1AmTWKuM+dI1JXQSUu2pIrYLb/QncyiIGkFDFKTwJ0XqQZZg==} + '@sveltejs/vite-plugin-svelte-inspector@2.1.0': + resolution: {integrity: sha512-9QX28IymvBlSCqsCll5t0kQVxipsfhFFL+L2t3nTWfXnddYwxBuAEtTtlaVQpRz9c37BhJjltSeY4AJSC03SSg==} engines: {node: ^18.0.0 || >=20} peerDependencies: '@sveltejs/vite-plugin-svelte': ^3.0.0 svelte: ^4.0.0 || ^5.0.0-next.0 vite: ^5.0.0 - dependencies: - '@sveltejs/vite-plugin-svelte': 3.0.1(svelte@4.2.8)(vite@5.0.12) - debug: 4.3.4 - svelte: 4.2.8 - vite: 5.0.12 - transitivePeerDependencies: - - supports-color - dev: true - /@sveltejs/vite-plugin-svelte@3.0.1(svelte@4.2.8)(vite@5.0.12): - resolution: {integrity: sha512-CGURX6Ps+TkOovK6xV+Y2rn8JKa8ZPUHPZ/NKgCxAmgBrXReavzFl8aOSCj3kQ1xqT7yGJj53hjcV/gqwDAaWA==} + '@sveltejs/vite-plugin-svelte@3.1.2': + resolution: {integrity: sha512-Txsm1tJvtiYeLUVRNqxZGKR/mI+CzuIQuc2gn+YCs9rMTowpNZ2Nqt53JdL8KF9bLhAf2ruR/dr9eZCwdTriRA==} engines: {node: ^18.0.0 || >=20} peerDependencies: svelte: ^4.0.0 || ^5.0.0-next.0 vite: ^5.0.0 - dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 2.0.0(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.2.8)(vite@5.0.12) - debug: 4.3.4 - deepmerge: 4.3.1 - kleur: 4.1.5 - magic-string: 0.30.5 - svelte: 4.2.8 - svelte-hmr: 0.15.3(svelte@4.2.8) - vite: 5.0.12 - vitefu: 0.2.5(vite@5.0.12) - transitivePeerDependencies: - - supports-color - dev: true - /@tauri-apps/api@2.0.0-beta.2: - resolution: {integrity: sha512-4r1r6kgttzIWxJ3HxkZQH+b7EiUtKhdUCPbi0KSalD+2T3j6klw+v8VyxhKwEdjM/eo60NE+J33v1E/Urq8puw==} - engines: {node: '>= 18', npm: '>= 6.6.0', yarn: '>= 1.19.1'} - dev: false + '@tauri-apps/api@2.0.2': + resolution: {integrity: sha512-3wSwmG+1kr6WrgAFKK5ijkNFPp8TT3FLj3YHUb5EwMO+3FxX4uWlfSWkeeBy+Kc1RsKzugtYLuuya+98Flj+3w==} - /@tauri-apps/cli-darwin-arm64@2.0.0-beta.3: - resolution: {integrity: sha512-gHcn3jI/4MDXDIlK/4Zz0ftTosgN3OimWlKxEz777QrA1hldrQweYIhdZXkqE9KgoE+u6w80vWIcr0InHAf7Iw==} + '@tauri-apps/cli-darwin-arm64@2.0.3': + resolution: {integrity: sha512-jIsbxGWS+As1ZN7umo90nkql/ZAbrDK0GBT6UsgHSz5zSwwArICsZFFwE1pLZip5yoiV5mn3TGG2c1+v+0puzQ==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] - requiresBuild: true - dev: true - optional: true - /@tauri-apps/cli-darwin-x64@2.0.0-beta.3: - resolution: {integrity: sha512-kRCaukT2IAGMmNuAOUBhdZRlKujTy2lSsdNKmgGEMnzQLKJwWO9Gpq1NmPY7ZVqyXK/X8QnGHuasDEQsSO6B4w==} + '@tauri-apps/cli-darwin-x64@2.0.3': + resolution: {integrity: sha512-ROITHtLTA1muyrwgyuwyasmaLCGtT4as/Kd1kerXaSDtFcYrnxiM984ZD0+FDUEDl5BgXtYa/sKKkKQFjgmM0A==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] - requiresBuild: true - dev: true - optional: true - /@tauri-apps/cli-linux-arm-gnueabihf@2.0.0-beta.3: - resolution: {integrity: sha512-cpNZOQDotNSdjoZT16s1JtZvnkM0wgLwU39AhKhRCco4KEH3/8G1ngKF9JKalWUN8zDTcuCigEAr37gEv4mLAA==} + '@tauri-apps/cli-linux-arm-gnueabihf@2.0.3': + resolution: {integrity: sha512-bQ3EZwCFfrLg/ZQ2I8sLuifSxESz4TP56SleTkKsPtTIZgNnKpM88PRDz4neiRroHVOq8NK0X276qi9LjGcXPw==} engines: {node: '>= 10'} cpu: [arm] os: [linux] - requiresBuild: true - dev: true - optional: true - /@tauri-apps/cli-linux-arm64-gnu@2.0.0-beta.3: - resolution: {integrity: sha512-8q86V6P9bkeoFcnvSsnvOwmKY6ijIN4ueRVXCj5cVpsw392VF9vud1Nq7/l+QDgn9OWbZNNVDl30iyoSuaykBA==} + '@tauri-apps/cli-linux-arm64-gnu@2.0.3': + resolution: {integrity: sha512-aLfAA8P9OTErVUk3sATxtXqpAtlfDPMPp4fGjDysEELG/MyekGhmh2k/kG/i32OdPeCfO+Nr37wJksARJKubGw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - requiresBuild: true - dev: true - optional: true - /@tauri-apps/cli-linux-arm64-musl@2.0.0-beta.3: - resolution: {integrity: sha512-L7fokh4aqyV6yDPoeKwFN3Yt0pCAuZMWeP5tOeSBiom1pU7ppKH+4KHeTekNEIecZG+Ah250DkVCdmWS+aRFTA==} + '@tauri-apps/cli-linux-arm64-musl@2.0.3': + resolution: {integrity: sha512-I4MVD7nf6lLLRmNQPpe5beEIFM6q7Zkmh77ROA5BNu/+vHNL5kiTMD+bmd10ZL2r753A6pO7AvqkIxcBuIl0tg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - requiresBuild: true - dev: true - optional: true - /@tauri-apps/cli-linux-x64-gnu@2.0.0-beta.3: - resolution: {integrity: sha512-/crp3K6PathqicVWPj8Kh1120NNVV7nagJ7oZW9OFch7nBS1tmDnSB5k5LgA4yYu+lDKNUREnATMWHL6i0gNeg==} + '@tauri-apps/cli-linux-x64-gnu@2.0.3': + resolution: {integrity: sha512-C6Jkx2zZGKkoi+sg5FK9GoH/0EvAaOgrZfF5azV5EALGba46g7VpWcZgp9zFUd7K2IzTi+0OOY8TQ2OVfKZgew==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - requiresBuild: true - dev: true - optional: true - /@tauri-apps/cli-linux-x64-musl@2.0.0-beta.3: - resolution: {integrity: sha512-jX1ZT0UQwdBGbpCwlpv2bsLDO7KFMeDJQ/ZZVMfWyjuYrGBG5zhJ2NXwTMkHVnxfvE6BVmnybWcykeSqTATeOw==} + '@tauri-apps/cli-linux-x64-musl@2.0.3': + resolution: {integrity: sha512-qi4ghmTfSAl+EEUDwmwI9AJUiOLNSmU1RgiGgcPRE+7A/W+Am9UnxYySAiRbB/gJgTl9sj/pqH5Y9duP1/sqHg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - requiresBuild: true - dev: true - optional: true - /@tauri-apps/cli-win32-arm64-msvc@2.0.0-beta.3: - resolution: {integrity: sha512-UCEZNKocENLX3HYKid4FEbrCMjCX9e58klBIvJKxT8HTjvpgFYDoKccswDNfszLhmineKMlkUvm7j7U0sMh8MQ==} + '@tauri-apps/cli-win32-arm64-msvc@2.0.3': + resolution: {integrity: sha512-UXxHkYmFesC97qVmZre4vY7oDxRDtC2OeKNv0bH+iSnuUp/ROxzJYGyaelnv9Ybvgl4YVqDCnxgB28qMM938TA==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] - requiresBuild: true - dev: true - optional: true - /@tauri-apps/cli-win32-ia32-msvc@2.0.0-beta.3: - resolution: {integrity: sha512-O8syGXDHyKN/cv1ktD76dTcbkQ1nNEPhnT1Z+r0GKxNsw4/MyIVglzEcou3aPq0/1MQ0PEGVyG1x0JMaPw7oHQ==} + '@tauri-apps/cli-win32-ia32-msvc@2.0.3': + resolution: {integrity: sha512-D+xoaa35RGlkXDpnL5uDTpj29untuC5Wp6bN9snfgFDagD0wnFfC8+2ZQGu16bD0IteWqDI0OSoIXhNvy+F+wg==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] - requiresBuild: true - dev: true - optional: true - /@tauri-apps/cli-win32-x64-msvc@2.0.0-beta.3: - resolution: {integrity: sha512-YDdF3XWaptjKtKz33sZhC+uNAZwp6QtAmZSRCQQlC1W7uJwLD00/3QF4vO/c6Qm+BGFsazVh1+YmBF1p0kV0rg==} + '@tauri-apps/cli-win32-x64-msvc@2.0.3': + resolution: {integrity: sha512-eWV9XWb4dSYHXl13OtYWLjX1JHphUEkHkkGwJrhr8qFBm7RbxXxQvrsUEprSi51ug/dwJenjJgM4zR8By4htfw==} engines: {node: '>= 10'} cpu: [x64] os: [win32] - requiresBuild: true - dev: true - optional: true - /@tauri-apps/cli@2.0.0-beta.3: - resolution: {integrity: sha512-xLAL2DNNUJWqHBKvanc3V9bG9kkwtFwc40X/DrfgEKnkajEm79wqnkaT8LUnmbe0WZ8bzBRO1fLIgKlOH6GiCA==} + '@tauri-apps/cli@2.0.3': + resolution: {integrity: sha512-JwEyhc5BAVpn4E8kxzY/h7+bVOiXQdudR1r3ODMfyyumZBfgIWqpD/WuTcPq6Yjchju1BSS+80jAE/oYwI/RKg==} engines: {node: '>= 10'} hasBin: true - optionalDependencies: - '@tauri-apps/cli-darwin-arm64': 2.0.0-beta.3 - '@tauri-apps/cli-darwin-x64': 2.0.0-beta.3 - '@tauri-apps/cli-linux-arm-gnueabihf': 2.0.0-beta.3 - '@tauri-apps/cli-linux-arm64-gnu': 2.0.0-beta.3 - '@tauri-apps/cli-linux-arm64-musl': 2.0.0-beta.3 - '@tauri-apps/cli-linux-x64-gnu': 2.0.0-beta.3 - '@tauri-apps/cli-linux-x64-musl': 2.0.0-beta.3 - '@tauri-apps/cli-win32-arm64-msvc': 2.0.0-beta.3 - '@tauri-apps/cli-win32-ia32-msvc': 2.0.0-beta.3 - '@tauri-apps/cli-win32-x64-msvc': 2.0.0-beta.3 - dev: true - - /@tauri-apps/toml@2.2.4: - resolution: {integrity: sha512-NJV/pdgJObDlDWi5+MTHZ2qyNvdL0dlHqQ72nzQYXWbW1LHMPXgCJYl0pLqL1XxxLtxtInYbtVCGVAcwhGxdkw==} - dev: true - - /@types/estree@1.0.5: + + '@types/eslint@9.6.1': + resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} + + '@types/eslint__js@8.42.3': + resolution: {integrity: sha512-alfG737uhmPdnvkrLdZLcEKJ/B8s9Y4hrZ+YAdzUeoArBlSUERA2E87ROfOaS4jd/C45fzOoZzidLc1IPwLqOw==} + + '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} - /@types/json-schema@7.0.15: - resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - dev: true + '@types/estree@1.0.6': + resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} - /@types/json5@0.0.29: - resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} - dev: true + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - /@types/mdast@3.0.15: + '@types/mdast@3.0.15': resolution: {integrity: sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==} - dependencies: - '@types/unist': 2.0.10 - dev: true - /@types/resolve@1.20.2: + '@types/resolve@1.20.2': resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} - dev: true - /@types/semver@7.5.6: - resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==} - dev: true + '@types/unist@2.0.11': + resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==} - /@types/unist@2.0.10: - resolution: {integrity: sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==} - dev: true - - /@typescript-eslint/eslint-plugin@6.20.0(@typescript-eslint/parser@6.20.0)(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-fTwGQUnjhoYHeSF6m5pWNkzmDDdsKELYrOBxhjMrofPqCkoC2k3B2wvGHFxa1CTIqkEn88nlW1HVMztjo2K8Hg==} - engines: {node: ^16.0.0 || >=18.0.0} + '@typescript-eslint/eslint-plugin@8.10.0': + resolution: {integrity: sha512-phuB3hoP7FFKbRXxjl+DRlQDuJqhpOnm5MmtROXyWi3uS/Xg2ZXqiQfcG2BJHiN4QKyzdOJi3NEn/qTnjUlkmQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha - eslint: ^7.0.0 || ^8.0.0 + '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 + eslint: ^8.57.0 || ^9.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true - dependencies: - '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.20.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/scope-manager': 6.20.0 - '@typescript-eslint/type-utils': 6.20.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.20.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.20.0 - debug: 4.3.4 - eslint: 8.56.0 - graphemer: 1.4.0 - ignore: 5.3.0 - natural-compare: 1.4.0 - semver: 7.5.4 - ts-api-utils: 1.0.3(typescript@5.3.3) - typescript: 5.3.3 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/parser@6.20.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-bYerPDF/H5v6V76MdMYhjwmwgMA+jlPVqjSDq2cRqMi8bP5sR3Z+RLOiOMad3nsnmDVmn2gAFCyNgh/dIrfP/w==} - engines: {node: ^16.0.0 || >=18.0.0} + '@typescript-eslint/parser@8.10.0': + resolution: {integrity: sha512-E24l90SxuJhytWJ0pTQydFT46Nk0Z+bsLKo/L8rtQSL93rQ6byd1V/QbDpHUTdLPOMsBCcYXZweADNCfOCmOAg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^7.0.0 || ^8.0.0 + eslint: ^8.57.0 || ^9.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true - dependencies: - '@typescript-eslint/scope-manager': 6.20.0 - '@typescript-eslint/types': 6.20.0 - '@typescript-eslint/typescript-estree': 6.20.0(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.20.0 - debug: 4.3.4 - eslint: 8.56.0 - typescript: 5.3.3 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/scope-manager@6.20.0: - resolution: {integrity: sha512-p4rvHQRDTI1tGGMDFQm+GtxP1ZHyAh64WANVoyEcNMpaTFn3ox/3CcgtIlELnRfKzSs/DwYlDccJEtr3O6qBvA==} - engines: {node: ^16.0.0 || >=18.0.0} - dependencies: - '@typescript-eslint/types': 6.20.0 - '@typescript-eslint/visitor-keys': 6.20.0 - dev: true + '@typescript-eslint/scope-manager@8.10.0': + resolution: {integrity: sha512-AgCaEjhfql9MDKjMUxWvH7HjLeBqMCBfIaBbzzIcBbQPZE7CPh1m6FF+L75NUMJFMLYhCywJXIDEMa3//1A0dw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - /@typescript-eslint/type-utils@6.20.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-qnSobiJQb1F5JjN0YDRPHruQTrX7ICsmltXhkV536mp4idGAYrIyr47zF/JmkJtEcAVnIz4gUYJ7gOZa6SmN4g==} - engines: {node: ^16.0.0 || >=18.0.0} + '@typescript-eslint/type-utils@8.10.0': + resolution: {integrity: sha512-PCpUOpyQSpxBn230yIcK+LeCQaXuxrgCm2Zk1S+PTIRJsEfU6nJ0TtwyH8pIwPK/vJoA+7TZtzyAJSGBz+s/dg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true - dependencies: - '@typescript-eslint/typescript-estree': 6.20.0(typescript@5.3.3) - '@typescript-eslint/utils': 6.20.0(eslint@8.56.0)(typescript@5.3.3) - debug: 4.3.4 - eslint: 8.56.0 - ts-api-utils: 1.0.3(typescript@5.3.3) - typescript: 5.3.3 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/types@6.20.0: - resolution: {integrity: sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ==} - engines: {node: ^16.0.0 || >=18.0.0} - dev: true + '@typescript-eslint/types@8.10.0': + resolution: {integrity: sha512-k/E48uzsfJCRRbGLapdZgrX52csmWJ2rcowwPvOZ8lwPUv3xW6CcFeJAXgx4uJm+Ge4+a4tFOkdYvSpxhRhg1w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - /@typescript-eslint/typescript-estree@6.20.0(typescript@5.3.3): - resolution: {integrity: sha512-RnRya9q5m6YYSpBN7IzKu9FmLcYtErkDkc8/dKv81I9QiLLtVBHrjz+Ev/crAqgMNW2FCsoZF4g2QUylMnJz+g==} - engines: {node: ^16.0.0 || >=18.0.0} + '@typescript-eslint/typescript-estree@8.10.0': + resolution: {integrity: sha512-3OE0nlcOHaMvQ8Xu5gAfME3/tWVDpb/HxtpUZ1WeOAksZ/h/gwrBzCklaGzwZT97/lBbbxJ16dMA98JMEngW4w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true - dependencies: - '@typescript-eslint/types': 6.20.0 - '@typescript-eslint/visitor-keys': 6.20.0 - debug: 4.3.4 - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.3 - semver: 7.5.4 - ts-api-utils: 1.0.3(typescript@5.3.3) - typescript: 5.3.3 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/utils@6.20.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-/EKuw+kRu2vAqCoDwDCBtDRU6CTKbUmwwI7SH7AashZ+W+7o8eiyy6V2cdOqN49KsTcASWsC5QeghYuRDTyOOg==} - engines: {node: ^16.0.0 || >=18.0.0} + '@typescript-eslint/utils@8.10.0': + resolution: {integrity: sha512-Oq4uZ7JFr9d1ZunE/QKy5egcDRXT/FrS2z/nlxzPua2VHFtmMvFNDvpq1m/hq0ra+T52aUezfcjGRIB7vNJF9w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.6 - '@typescript-eslint/scope-manager': 6.20.0 - '@typescript-eslint/types': 6.20.0 - '@typescript-eslint/typescript-estree': 6.20.0(typescript@5.3.3) - eslint: 8.56.0 - semver: 7.5.4 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /@typescript-eslint/visitor-keys@6.20.0: - resolution: {integrity: sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw==} - engines: {node: ^16.0.0 || >=18.0.0} - dependencies: - '@typescript-eslint/types': 6.20.0 - eslint-visitor-keys: 3.4.3 - dev: true + eslint: ^8.57.0 || ^9.0.0 - /@ungap/structured-clone@1.2.0: - resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - dev: true + '@typescript-eslint/visitor-keys@8.10.0': + resolution: {integrity: sha512-k8nekgqwr7FadWk548Lfph6V3r9OVqjzAIVskE7orMZR23cGJjAOVazsZSJW+ElyjfTM4wx/1g88Mi70DDtG9A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - /@unocss/astro@0.58.0(vite@5.0.12): - resolution: {integrity: sha512-df+tEFO5eKXjQOwSWQhS9IdjD0sfLHLtn8U09sEKR2Nmh5CvpwyBxmvLQgOCilPou7ehmyKfsyGRLZg7IMp+Ew==} + '@unocss/astro@0.63.1': + resolution: {integrity: sha512-TJISaUIMNPQH0MY0R7f14DO3HF4Z5H3seZazojhbLCOA7gDFV0WpSP84sdx9PsP1fpyYuNsxW9xrwA13bDaJYw==} peerDependencies: vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 peerDependenciesMeta: vite: optional: true - dependencies: - '@unocss/core': 0.58.0 - '@unocss/reset': 0.58.0 - '@unocss/vite': 0.58.0(vite@5.0.12) - vite: 5.0.12 - transitivePeerDependencies: - - rollup - dev: true - /@unocss/cli@0.58.0: - resolution: {integrity: sha512-rhsrDBxAVueygMcAbMkbuvsHbBL2rG6N96LllYwHn16FLgOE3Sf4JW1/LlNjQje3BtwMMtbSCCAeu2SryFhzbw==} + '@unocss/cli@0.63.1': + resolution: {integrity: sha512-DH9JZBL/CecAr7HWXinUSXEnDIVcOkHn4GYuaL4Zn33ZIV9ni20/lHhxJwbnEgv1eCIa3XTAMLCOU9uhpdTKCQ==} engines: {node: '>=14'} hasBin: true - dependencies: - '@ampproject/remapping': 2.2.1 - '@rollup/pluginutils': 5.1.0 - '@unocss/config': 0.58.0 - '@unocss/core': 0.58.0 - '@unocss/preset-uno': 0.58.0 - cac: 6.7.14 - chokidar: 3.5.3 - colorette: 2.0.20 - consola: 3.2.3 - fast-glob: 3.3.2 - magic-string: 0.30.5 - pathe: 1.1.1 - perfect-debounce: 1.0.0 - transitivePeerDependencies: - - rollup - dev: true - /@unocss/config@0.58.0: - resolution: {integrity: sha512-WQD29gCZ7cajnMzezD1PRW0qQSxo/C6PX9ktygwhdinFx9nXuLZnKFOz65TiI8y48e53g1i7ivvgY3m4Sq5mIg==} + '@unocss/config@0.63.1': + resolution: {integrity: sha512-9n1VDQ3xMpRIdzqvyUhWHA2ur5CWH0Oezw6Rbg/75bk86pD3yMrD8JkP4wK9wgq1pNNEpygmE7jFbDe29r8vVw==} engines: {node: '>=14'} - dependencies: - '@unocss/core': 0.58.0 - unconfig: 0.3.11 - dev: true - /@unocss/core@0.58.0: - resolution: {integrity: sha512-KhABQXGE2AgtO9vE28d+HnciuyGDcuygsnQdUwlzUuR4K05OSw2kRE9emRN4HaMycD+gA/zDbQrJxTXb6mQUiA==} - dev: true + '@unocss/core@0.63.1': + resolution: {integrity: sha512-scg53c6vw8cRsX4DbUO+MlTXicA9GWztm6PW0lsisJxXrdbQQCd+J+PIhrxLUExxeNqxTKsL3Msy9bwJU5uUsQ==} - /@unocss/extractor-arbitrary-variants@0.58.0: - resolution: {integrity: sha512-s9wK2UugJM0WK1HpgPz2kTbpeyQc46zais+nauN/ykVX6NMq8PtGzSWszzf+0aIbtWAQGiqAfiYNTpf09tJHfg==} - dependencies: - '@unocss/core': 0.58.0 - dev: true + '@unocss/extractor-arbitrary-variants@0.63.1': + resolution: {integrity: sha512-yqHDUgFCR4R2HMuD2k4dVkkdT2uOa/gUDIY6xoseOx1r98Fxlyvdr0UnLOaWsSSzpSGm7SS7XtafGa24IgJRUQ==} - /@unocss/extractor-svelte@0.58.0: - resolution: {integrity: sha512-2eyf73dakmwMpY0r0y8xA85eRvPzQIOiegbwwif8kC8yZcMQUB5e1Xmb9CcvQsN37PV/PmA+uD/tg9oXtU7LUg==} - dev: true + '@unocss/extractor-svelte@0.63.1': + resolution: {integrity: sha512-kqf+3ghZIc/hBT3W6nrvWEBMbAleJIGI4A1GW+K+dovP68T4gFxp7D077VtuC69dZp1foV4HM17QHmphZq1Oiw==} - /@unocss/inspector@0.58.0: - resolution: {integrity: sha512-ZC4QauFGdh3/VkzW/FqkO2R03JEbzGNuX0DK03pwas8/jFIGh8pPldesj8GEKm1YWr1emx9cw7JUnhR8XSUBlA==} - dependencies: - '@unocss/core': 0.58.0 - '@unocss/rule-utils': 0.58.0 - gzip-size: 6.0.0 - sirv: 2.0.3 - dev: true + '@unocss/inspector@0.63.1': + resolution: {integrity: sha512-RO5DWZcnQ964ppaWskECSsx2b6I+dAH6A4YQIZEavG0ykHWwa//TquaY2HJH6OJoI7hKEnrFIFtlwzV5nWoYMw==} - /@unocss/postcss@0.58.0(postcss@8.4.32): - resolution: {integrity: sha512-2hAwLbfUFqysi8FN1cn3xkHy5GhLMlYy6W4NrAZ2ws7F2MKpsCT2xCj7dT5cI2tW8ulD2YoVbKH15dBhNsMNUA==} + '@unocss/postcss@0.63.1': + resolution: {integrity: sha512-ZHBy2swGg2zifQ6YEfctagIi+jZrLW/uBHqIkRIQYZyBQjw1GSqx+OSrq81LYIREBSQG7G90Nn1CXu8muttgzg==} engines: {node: '>=14'} peerDependencies: postcss: ^8.4.21 - dependencies: - '@unocss/config': 0.58.0 - '@unocss/core': 0.58.0 - '@unocss/rule-utils': 0.58.0 - css-tree: 2.3.1 - fast-glob: 3.3.2 - magic-string: 0.30.5 - postcss: 8.4.32 - dev: true - /@unocss/preset-attributify@0.58.0: - resolution: {integrity: sha512-Ew78noYes12K9gk4dF36MkjpiIqTi1XVqcniiAzxCkzuctxN4B57vW3LVTwjInGmWNNKWN3UNR4q1o0VxH4xJg==} - dependencies: - '@unocss/core': 0.58.0 - dev: true + '@unocss/preset-attributify@0.63.1': + resolution: {integrity: sha512-K6IaQ6cUQNWDp6JmAJ8dh17c/iPc9Ssgz6C9qayWwIJCZA3023EXfoXI0a0csnJyRHJALIw2sSZAvlmRudln1A==} - /@unocss/preset-icons@0.58.0: - resolution: {integrity: sha512-niT32avw+8l+L40LGhrmX6qDV9Z8/gOn4xjjRhLZZouKni3CJOpz9taILyF4xp1nak5nxGT4wa0tuC/htvOF5A==} - dependencies: - '@iconify/utils': 2.1.12 - '@unocss/core': 0.58.0 - ofetch: 1.3.3 - transitivePeerDependencies: - - supports-color - dev: true + '@unocss/preset-icons@0.63.1': + resolution: {integrity: sha512-ucCLrlQ6DsFzqSu/Cmqo3q/F/ybV+2P/TQflHS9Oo8wtOETxTT0aPEEEd/sj1SPTU9uUbLEeS6TaRD6MrwLcrw==} - /@unocss/preset-mini@0.58.0: - resolution: {integrity: sha512-oMliJZVTN3ecAvf52yN+MyJszaJOZoKwMMbUAFqVis62MaqRzZ8mSw12QFLFyX2pltulDFpMBTAKro+hP0wXEg==} - dependencies: - '@unocss/core': 0.58.0 - '@unocss/extractor-arbitrary-variants': 0.58.0 - '@unocss/rule-utils': 0.58.0 - dev: true + '@unocss/preset-mini@0.63.1': + resolution: {integrity: sha512-8NW3hK5fp+glBI2v1/3utp+Gv0yXoVTX66531BDDXxivsCJBNRTh40TP8hXSbtDne615UGrykIjyadsUHCRK5Q==} - /@unocss/preset-tagify@0.58.0: - resolution: {integrity: sha512-I+dzfs/bofiGb2AUxkhcTDhB+r2+/3SO81PFwf3Ae7afnzhA2SLsKAkEqO8YN3M3mwZL7IfXn6vpsWeEAlk/yw==} - dependencies: - '@unocss/core': 0.58.0 - dev: true + '@unocss/preset-tagify@0.63.1': + resolution: {integrity: sha512-GlhWsdD3pYvtMePVNWMOjkQGSp4XKJcfS65spUOZv03h6xrKuCCnJNsawYqbnpTzUOAL29pG/X8Quse00weRjQ==} - /@unocss/preset-typography@0.58.0: - resolution: {integrity: sha512-8qo+Z1CJtXFMDbAvtizUTRLuLxCIzytgYU0GmuRkfc2iwASSDNDsvh8nAYQfWpyAEOV7QEHtS9c9xL4b0c89FA==} - dependencies: - '@unocss/core': 0.58.0 - '@unocss/preset-mini': 0.58.0 - dev: true + '@unocss/preset-typography@0.63.1': + resolution: {integrity: sha512-NfC0qQmCeA68F0JeVMKNpCqZhh0X3+1ouEjlRrFGzmIZt5lxWuTFgGroyp5rXv++iubm3CMoW1bMnp8CsyUUYw==} - /@unocss/preset-uno@0.58.0: - resolution: {integrity: sha512-DpgfjtvSgsWeyZH+jQHc1k5IReiZNb7oGpHVnfF6SlHETTnMHSeNetxkPQWYrqJLPI6llNLPTdTa5j47NtmOiA==} - dependencies: - '@unocss/core': 0.58.0 - '@unocss/preset-mini': 0.58.0 - '@unocss/preset-wind': 0.58.0 - '@unocss/rule-utils': 0.58.0 - dev: true + '@unocss/preset-uno@0.63.1': + resolution: {integrity: sha512-L7ptI/kI48+miTv5y7vNE1igw8/ThkWPFICMuhQksQS4QuuysuzO/IjfD5QwPy8Awr9HgSYZLqf5Jaax63HJ5w==} - /@unocss/preset-web-fonts@0.58.0: - resolution: {integrity: sha512-QarDDEUlexQ2IIn23pE1eHDskG2Tz+JjCe+FAN0DoNLLhvUUWSB4cQIMFWP6dSMJ047Blj9IpgAl9dERICW1qQ==} - dependencies: - '@unocss/core': 0.58.0 - ofetch: 1.3.3 - dev: true + '@unocss/preset-web-fonts@0.63.1': + resolution: {integrity: sha512-55DkFZ2/hLYp5cDvxQWElnPgnKj9AjoC/hTgC6JlKjzaafaqKh5Bt45rDKOPiXe2cPMN7A9gURgBgFyARX4nBw==} - /@unocss/preset-wind@0.58.0: - resolution: {integrity: sha512-2zgaIy9RAGie9CsUYCkYRDSERBi8kG6Q/mQLgNfP9HMz5IThlnDHFWF/hLAVD51xQUg9gH8qWBR9kN/1ioT5Tw==} - dependencies: - '@unocss/core': 0.58.0 - '@unocss/preset-mini': 0.58.0 - '@unocss/rule-utils': 0.58.0 - dev: true + '@unocss/preset-wind@0.63.1': + resolution: {integrity: sha512-L/Pyz55NC55K2+zJX9b3cC23tMZzh/a2jUUfoiJAHudsSPjAvP/PJ31Nc+27FFMbqZXhGQ50CBq8geq51O4PKQ==} - /@unocss/reset@0.58.0: - resolution: {integrity: sha512-UVZ5kz37JGbwAA06k/gjKYcekcTwi6oIhev1EpTtCvHLL6XYcYqcwb/u4Wjzprd3L3lxDGYXvGdjREGm2u7vbQ==} - dev: true + '@unocss/reset@0.63.1': + resolution: {integrity: sha512-gjSF0LeWwkNCYZ4Z/AnQXGCIOPUGL5Ll1IIDfwnKZeFGCj9QmcV1hki4xf/7N8mNHhfP0nYdJpdAfiznhKdkwQ==} - /@unocss/rule-utils@0.58.0: - resolution: {integrity: sha512-LBJ9dJ/j5UIMzJF7pmIig55MtJAYtG+tn/zQRveZuPRVahzP+KqwlyB7u3uCUnQhdgo/MJODMcqyr0jl6+kTuA==} + '@unocss/rule-utils@0.63.1': + resolution: {integrity: sha512-z7WQ8lKq7p6sS/6Yl1pStcA2WyxxD7H1i86iXa2orWayW8KtrIJbdCXFYEsj3sOkMKLqpG5w65P+103dO2jUhQ==} engines: {node: '>=14'} - dependencies: - '@unocss/core': 0.58.0 - magic-string: 0.30.5 - dev: true - - /@unocss/scope@0.58.0: - resolution: {integrity: sha512-XgUXZJvbxWSRC/DNOWI5DYdR6Nd6IZxsE5ls3AFA5msgtk5OH4YNQELLMabQw7xbRbU/fftlRJa3vncSfOyl6w==} - dev: true - /@unocss/transformer-attributify-jsx-babel@0.58.0: - resolution: {integrity: sha512-ckDq/q476x2yikjS8usmSUGuakqMQrg2pm8sdBINTPdJxGc7kJRvI5UDnzRw4W9hE5IH+E4gg0XfCtFad0O3eg==} - dependencies: - '@babel/core': 7.23.5 - '@babel/plugin-syntax-jsx': 7.23.3(@babel/core@7.23.5) - '@babel/preset-typescript': 7.23.3(@babel/core@7.23.5) - '@unocss/core': 0.58.0 - transitivePeerDependencies: - - supports-color - dev: true - - /@unocss/transformer-attributify-jsx@0.58.0: - resolution: {integrity: sha512-QDdBEFDE7ntfCH7+8zHRW72MIQ9NH3uYGUE7lYgr5Ap8qzBHCxMT1kUrY6gwuoo3U4dMu2wruglYRHD88hvGkw==} - dependencies: - '@unocss/core': 0.58.0 - dev: true + '@unocss/transformer-attributify-jsx@0.63.1': + resolution: {integrity: sha512-c92pv9x6AZ3Zfw5ledP6rzTudWUvVY5HrVSaG3GxO2ofyCFEdHyJ1qLTK7omwnTJZ3rMJ3QplIrPJka1Ftasuw==} - /@unocss/transformer-compile-class@0.58.0: - resolution: {integrity: sha512-/BysfTg2q9sGPfiRHqWw/bT60/gjpBGBRVkIFsG4WVT2pgf3BfQUPu5FumSvZSRd0rA/pR57Lp6ZREAdj6+q+A==} - dependencies: - '@unocss/core': 0.58.0 - dev: true + '@unocss/transformer-compile-class@0.63.1': + resolution: {integrity: sha512-OV8nQJf+OEIoqHSsFQPjP/ocOxQc2nnMirB+J7D5e32SqU4Zg4GPWag3E+Pcb4InwZ/OUTPPdecKSPNHgT3CTQ==} - /@unocss/transformer-directives@0.58.0: - resolution: {integrity: sha512-sU2U/aIykRkGGbA4Qo9Z5XE/KqWf7KhBwC1m8pUoqjawsZex4aVnQgXzDPfcjtmy6pElwK0z2U5DnO+OK9vCgQ==} - dependencies: - '@unocss/core': 0.58.0 - '@unocss/rule-utils': 0.58.0 - css-tree: 2.3.1 - dev: true + '@unocss/transformer-directives@0.63.1': + resolution: {integrity: sha512-mWVcQqVXj5OtUzfwc9B2/CRPYVHqkoj+AFfhU8RZ6e1nPgDKtR9JLt0jypTvv/PMo56vPJUTbpBBvXU+vvQwQA==} - /@unocss/transformer-variant-group@0.58.0: - resolution: {integrity: sha512-O2n8uVIpNic57rrkaaQ8jnC1WJ9N6FkoqxatRDXZ368aJ1CJNya0ZcVUL6lGGND0bOLXen4WmEN62ZxEWTqdkA==} - dependencies: - '@unocss/core': 0.58.0 - dev: true + '@unocss/transformer-variant-group@0.63.1': + resolution: {integrity: sha512-Awk9FDpvZM8m9YY46MThYYZ81fY6HVs4pOX22xcbw06J2l8z3WyG5iHIzx0f8vCTNwTekDuxD6vV3UlQKoI+0w==} - /@unocss/vite@0.58.0(vite@5.0.12): - resolution: {integrity: sha512-OCUOLMSOBEtXOEyBbAvMI3/xdR175BWRzmvV9Wc34ANZclEvCdVH8+WU725ibjY4VT0gVIuX68b13fhXdHV41A==} + '@unocss/vite@0.63.1': + resolution: {integrity: sha512-MUi4gtGYPahDeabXfxq25J9YRUksJPLB+xsU2zn7Rb4ai0wBdi6SsZsjjeHhx7RZEXjse9UG3FGZP6Xhe6erUQ==} peerDependencies: vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 - dependencies: - '@ampproject/remapping': 2.2.1 - '@rollup/pluginutils': 5.1.0 - '@unocss/config': 0.58.0 - '@unocss/core': 0.58.0 - '@unocss/inspector': 0.58.0 - '@unocss/scope': 0.58.0 - '@unocss/transformer-directives': 0.58.0 - chokidar: 3.5.3 - fast-glob: 3.3.2 - magic-string: 0.30.5 - vite: 5.0.12 - transitivePeerDependencies: - - rollup - dev: true - /@zerodevx/svelte-json-view@1.0.7(svelte@4.2.8): - resolution: {integrity: sha512-yW0MV+9BCKOwzt3h86y3xDqYdI5st+Rxk+L5pa0Utq7nlPD+VvxyhL7R1gJoLxQvWwjyAvY/fyUCFTdwDyI14w==} + '@zerodevx/svelte-json-view@1.0.11': + resolution: {integrity: sha512-mIjj0H1al/P4FPlbeDoiey93lNEUqBEAe5LIdD5GttZfEYt3awexD2lHwKNfUeY4jHizOJkoWTPN/2iO0GBqpw==} peerDependencies: - svelte: ^3.57.0 || ^4.0.0 - dependencies: - svelte: 4.2.8 - dev: false + svelte: ^3.57.0 || ^4.0.0 || ^5.0.0 + + abort-controller@3.0.0: + resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} + engines: {node: '>=6.5'} - /acorn-jsx@5.3.2(acorn@8.11.2): + acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - acorn: 8.11.2 - dev: true - /acorn@8.11.2: - resolution: {integrity: sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==} + acorn@8.12.1: + resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} engines: {node: '>=0.4.0'} hasBin: true - /ajv@6.12.6: + ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} - dependencies: - fast-deep-equal: 3.1.3 - fast-json-stable-stringify: 2.1.0 - json-schema-traverse: 0.4.1 - uri-js: 4.4.1 - dev: true - /ansi-colors@4.1.1: - resolution: {integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==} + ansi-colors@4.1.3: + resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} - dev: true - - /ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - dependencies: - type-fest: 0.21.3 - dev: true - /ansi-regex@5.0.1: + ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} - dev: true - - /ansi-styles@3.2.1: - resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} - engines: {node: '>=4'} - dependencies: - color-convert: 1.9.3 - dev: true - /ansi-styles@4.3.0: + ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} - dependencies: - color-convert: 2.0.1 - dev: true - /anymatch@3.1.3: + anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} - dependencies: - normalize-path: 3.0.0 - picomatch: 2.3.1 - dev: true - /argparse@2.0.1: + argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - dev: true - - /aria-query@5.3.0: - resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==} - dependencies: - dequal: 2.0.3 - - /array-buffer-byte-length@1.0.0: - resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==} - dependencies: - call-bind: 1.0.5 - is-array-buffer: 3.0.2 - dev: true - /array-includes@3.1.7: - resolution: {integrity: sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==} + aria-query@5.3.2: + resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==} engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.3 - get-intrinsic: 1.2.2 - is-string: 1.0.7 - dev: true - /array-union@2.1.0: + array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} - dev: true - - /array.prototype.findlastindex@1.2.3: - resolution: {integrity: sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.3 - es-shim-unscopables: 1.0.2 - get-intrinsic: 1.2.2 - dev: true - - /array.prototype.flat@1.3.2: - resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.3 - es-shim-unscopables: 1.0.2 - dev: true - /array.prototype.flatmap@1.3.2: - resolution: {integrity: sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.3 - es-shim-unscopables: 1.0.2 - dev: true + atomic-sleep@1.0.0: + resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} + engines: {node: '>=8.0.0'} - /arraybuffer.prototype.slice@1.0.2: - resolution: {integrity: sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==} - engines: {node: '>= 0.4'} - dependencies: - array-buffer-byte-length: 1.0.0 - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.3 - get-intrinsic: 1.2.2 - is-array-buffer: 3.0.2 - is-shared-array-buffer: 1.0.2 - dev: true - - /available-typed-arrays@1.0.5: - resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} + axobject-query@4.1.0: + resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} engines: {node: '>= 0.4'} - dev: true - /axobject-query@3.2.1: - resolution: {integrity: sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==} - dependencies: - dequal: 2.0.3 - - /bail@1.0.5: + bail@1.0.5: resolution: {integrity: sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ==} - dev: true - /balanced-match@1.0.2: + balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - dev: true - /base64-js@1.5.1: + base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - dev: true - /binary-extensions@2.2.0: - resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} + binary-extensions@2.3.0: + resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} - dev: true - - /bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - dev: true - /brace-expansion@1.1.11: + brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - dev: true - /brace-expansion@2.0.1: + brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} - dependencies: - balanced-match: 1.0.2 - dev: true - /braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} - dependencies: - fill-range: 7.0.1 - dev: true - /browser-stdout@1.3.1: + browser-stdout@1.3.1: resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} - dev: true - - /browserslist@4.22.2: - resolution: {integrity: sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - dependencies: - caniuse-lite: 1.0.30001566 - electron-to-chromium: 1.4.605 - node-releases: 2.0.14 - update-browserslist-db: 1.0.13(browserslist@4.22.2) - dev: true - /buffer-from@1.1.2: + buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} - dev: true - - /buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - dev: true - /builtin-modules@3.3.0: - resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} - engines: {node: '>=6'} - dev: true + buffer@6.0.3: + resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} - /builtins@5.0.1: - resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} - dependencies: - semver: 7.5.4 - dev: true + bundle-require@5.0.0: + resolution: {integrity: sha512-GuziW3fSSmopcx4KRymQEJVbZUfqlCqcq7dvs6TYwKRZiegK/2buMxQTPs6MGlNv50wms1699qYO54R8XfRX4w==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + peerDependencies: + esbuild: '>=0.18' - /cac@6.7.14: + cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} - dev: true - - /call-bind@1.0.5: - resolution: {integrity: sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==} - dependencies: - function-bind: 1.1.2 - get-intrinsic: 1.2.2 - set-function-length: 1.1.1 - dev: true - /callsites@3.1.0: + callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - dev: true - /camelcase@6.3.0: + camelcase@6.3.0: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} - dev: true - - /caniuse-lite@1.0.30001566: - resolution: {integrity: sha512-ggIhCsTxmITBAMmK8yZjEhCO5/47jKXPu6Dha/wuCS4JePVL+3uiDEBuhu2aIoT+bqTOR8L76Ip1ARL9xYsEJA==} - dev: true - - /chalk@2.4.2: - resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} - engines: {node: '>=4'} - dependencies: - ansi-styles: 3.2.1 - escape-string-regexp: 1.0.5 - supports-color: 5.5.0 - dev: true - /chalk@4.1.2: + chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - dev: true - /character-entities-legacy@1.1.4: + character-entities-legacy@1.1.4: resolution: {integrity: sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==} - dev: true - /character-entities@1.2.4: + character-entities@1.2.4: resolution: {integrity: sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==} - dev: true - /character-reference-invalid@1.1.4: + character-reference-invalid@1.1.4: resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} - dev: true - /chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - dev: true - - /chokidar@3.5.3: - resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} + chokidar@3.6.0: + resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} - dependencies: - anymatch: 3.1.3 - braces: 3.0.2 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.3 - normalize-path: 3.0.0 - readdirp: 3.6.0 - optionalDependencies: - fsevents: 2.3.3 - dev: true - - /cidr-regex@4.0.3: - resolution: {integrity: sha512-HOwDIy/rhKeMf6uOzxtv7FAbrz8zPjmVKfSpM+U7/bNBXC5rtOyr758jxcptiSx6ZZn5LOhPJT5WWxPAGDV8dw==} - engines: {node: '>=14'} - dependencies: - ip-regex: 5.0.0 - dev: true - - /cidr-tools@6.4.2: - resolution: {integrity: sha512-KZC8t2ipCqU2M+ISmTxRDGu9bku5MRU3V1cWyGEFJTZEzRhGvBJvVsbpZO5UAu12fExRFihtYGXAlgFFpmK9jw==} - engines: {node: '>=16'} - dependencies: - cidr-regex: 4.0.3 - ip-bigint: 7.3.0 - ip-regex: 5.0.0 - string-natural-compare: 3.0.1 - dev: true - /cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - dependencies: - restore-cursor: 3.1.0 - dev: true - - /cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - dev: true - - /cli-width@3.0.0: - resolution: {integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==} - engines: {node: '>= 10'} - dev: true - - /cliui@7.0.4: + cliui@7.0.4: resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - dev: true - /cliui@8.0.1: + cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - dev: true - - /clone-regexp@3.0.0: - resolution: {integrity: sha512-ujdnoq2Kxb8s3ItNBtnYeXdm07FcU0u8ARAT1lQ2YdMwQC+cdiXX8KoqMVuglztILivceTtp4ivqGSmEmhBUJw==} - engines: {node: '>=12'} - dependencies: - is-regexp: 3.1.0 - dev: true - /clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - dev: true - - /code-red@1.0.4: + code-red@1.0.4: resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==} - dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 - '@types/estree': 1.0.5 - acorn: 8.11.2 - estree-walker: 3.0.3 - periscopic: 3.1.0 - - /color-convert@1.9.3: - resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} - dependencies: - color-name: 1.1.3 - dev: true - /color-convert@2.0.1: + color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} - dependencies: - color-name: 1.1.4 - dev: true - - /color-name@1.1.3: - resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} - dev: true - /color-name@1.1.4: + color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - dev: true - /colorette@2.0.20: + colorette@2.0.20: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - dev: true - /commander@2.20.3: + commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} - dev: true - /concat-map@0.0.1: + concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - dev: true - /consola@3.2.3: + confbox@0.1.7: + resolution: {integrity: sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==} + + consola@3.2.3: resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==} engines: {node: ^14.18.0 || >=16.10.0} - dev: true - - /convert-hrtime@5.0.0: - resolution: {integrity: sha512-lOETlkIeYSJWcbbcvjRKGxVMXJR+8+OQb/mTPbA4ObPMytYIsUbuOE0Jzy60hjARYszq1id0j8KgVhC+WGZVTg==} - engines: {node: '>=12'} - dev: true - - /convert-source-map@2.0.0: - resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - dev: true - /covector@0.10.2(mocha@10.2.0): - resolution: {integrity: sha512-Nbz2x5cnS7F0fTT/raNKo0UYbI6rjaDoCrAJNoOpsSHdztnlFi7Bb6lU6kOBEeEH1zHVJk5F3ChBs0VNAuf5mg==} + covector@0.12.3: + resolution: {integrity: sha512-9LNME5eb4/KMdWD2jyJ4XX6CvD45xsF9hmxTQWAoDSuDGKdyh98wzUupz4BrJ9iviR8R9pI3D6Mozv13UX0g+A==} + engines: {node: '>=18'} hasBin: true - dependencies: - '@covector/apply': 0.9.2(mocha@10.2.0) - '@covector/assemble': 0.10.3(mocha@10.2.0) - '@covector/changelog': 0.10.1(mocha@10.2.0) - '@covector/command': 0.7.0(mocha@10.2.0) - '@covector/files': 0.7.1 - effection: 2.0.8(mocha@10.2.0) - globby: 11.1.0 - inquirer: 8.2.6 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - mocha - - supports-color - dev: true - /cross-fetch@3.1.5: + cross-fetch@3.1.5: resolution: {integrity: sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==} - dependencies: - node-fetch: 2.6.7 - transitivePeerDependencies: - - encoding - dev: true - /cross-spawn@7.0.3: + cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} - dependencies: - path-key: 3.1.1 - shebang-command: 2.0.0 - which: 2.0.2 - dev: true - /css-tree@2.3.1: + css-tree@2.3.1: resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} - dependencies: - mdn-data: 2.0.30 - source-map-js: 1.0.2 - - /ctrlc-windows@2.1.0: - resolution: {integrity: sha512-OrX5KI+K+2NMN91QIhYZdW7VDO2YsSdTZW494pA7Nvw/wBdU2hz+MGP006bR978zOTrG6Q8EIeJvLJmLqc6MsQ==} - dev: true - /debug@3.2.7: - resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.3 - dev: true + css-tree@3.0.0: + resolution: {integrity: sha512-o88DVQ6GzsABn1+6+zo2ct801dBO5OASVyxbbvA2W20ue2puSh/VOuqUj90eUeMSX/xqGqBmOKiRQN7tJOuBXw==} + engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} - /debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.2 - dev: true + ctrlc-windows@2.1.0: + resolution: {integrity: sha512-OrX5KI+K+2NMN91QIhYZdW7VDO2YsSdTZW494pA7Nvw/wBdU2hz+MGP006bR978zOTrG6Q8EIeJvLJmLqc6MsQ==} - /debug@4.3.4(supports-color@8.1.1): - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + debug@4.3.7: + resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' peerDependenciesMeta: supports-color: optional: true - dependencies: - ms: 2.1.2 - supports-color: 8.1.1 - dev: true - /decamelize@4.0.0: + decamelize@4.0.0: resolution: {integrity: sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==} engines: {node: '>=10'} - dev: true - /deep-is@0.1.4: + deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - dev: true - /deepmerge@4.3.1: + deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} - dev: true - - /default-gateway@7.2.2: - resolution: {integrity: sha512-AD7TrdNNPXRZIGw63dw+lnGmT4v7ggZC5NHNJgAYWm5njrwoze1q5JSAW9YuLy2tjnoLUG/r8FEB93MCh9QJPg==} - engines: {node: '>= 16'} - dependencies: - execa: 7.2.0 - dev: true - - /defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - dependencies: - clone: 1.0.4 - dev: true - - /define-data-property@1.1.1: - resolution: {integrity: sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==} - engines: {node: '>= 0.4'} - dependencies: - get-intrinsic: 1.2.2 - gopd: 1.0.1 - has-property-descriptors: 1.0.1 - dev: true - - /define-properties@1.2.1: - resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} - engines: {node: '>= 0.4'} - dependencies: - define-data-property: 1.1.1 - has-property-descriptors: 1.0.1 - object-keys: 1.1.1 - dev: true - - /defu@6.1.2: - resolution: {integrity: sha512-+uO4+qr7msjNNWKYPHqN/3+Dx3NFkmIzayk2L1MyZQlvgZb/J1A0fo410dpKrN2SnqFjt8n4JL8fDJE0wIgjFQ==} - dev: true - /dequal@2.0.3: - resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} - engines: {node: '>=6'} + defu@6.1.4: + resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} - /destr@2.0.1: - resolution: {integrity: sha512-M1Ob1zPSIvlARiJUkKqvAZ3VAqQY6Jcuth/pBKQ2b1dX/Qx0OnJ8Vux6J2H5PTMQeRzWrrbTu70VxBfv/OPDJA==} - dev: true + destr@2.0.3: + resolution: {integrity: sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==} - /diff@5.0.0: - resolution: {integrity: sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==} + diff@5.2.0: + resolution: {integrity: sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==} engines: {node: '>=0.3.1'} - dev: true - /dir-glob@3.0.1: + dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} - dependencies: - path-type: 4.0.0 - dev: true - - /doctrine@2.1.0: - resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} - engines: {node: '>=0.10.0'} - dependencies: - esutils: 2.0.3 - dev: true - - /doctrine@3.0.0: - resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} - engines: {node: '>=6.0.0'} - dependencies: - esutils: 2.0.3 - dev: true - /duplexer@0.1.2: + duplexer@0.1.2: resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==} - dev: true - - /effection@2.0.8: - resolution: {integrity: sha512-/v7cbPIXGGylInQgHHjJutzqUn6VIfcP13hh2X0hXf04wwAlSI+lVjUBKpr5TX3+v9dXV/JLHO/pqQ9Cp1QAnQ==} - dependencies: - '@effection/channel': 2.0.6 - '@effection/core': 2.2.3 - '@effection/events': 2.0.6 - '@effection/fetch': 2.0.7(mocha@10.2.0) - '@effection/main': 2.1.2 - '@effection/stream': 2.0.6 - '@effection/subscription': 2.0.6 - dev: true - /effection@2.0.8(mocha@10.2.0): + effection@2.0.8: resolution: {integrity: sha512-/v7cbPIXGGylInQgHHjJutzqUn6VIfcP13hh2X0hXf04wwAlSI+lVjUBKpr5TX3+v9dXV/JLHO/pqQ9Cp1QAnQ==} - dependencies: - '@effection/channel': 2.0.6 - '@effection/core': 2.2.3 - '@effection/events': 2.0.6 - '@effection/fetch': 2.0.7(mocha@10.2.0) - '@effection/main': 2.1.2 - '@effection/stream': 2.0.6 - '@effection/subscription': 2.0.6 - transitivePeerDependencies: - - encoding - - mocha - dev: true - /electron-to-chromium@1.4.605: - resolution: {integrity: sha512-V52j+P5z6cdRqTjPR/bYNxx7ETCHIkm5VIGuyCy3CMrfSnbEpIlLnk5oHmZo7gYvDfh2TfHeanB6rawyQ23ktg==} - dev: true - - /emoji-regex@8.0.0: + emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - dev: true - - /es-abstract@1.22.3: - resolution: {integrity: sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA==} - engines: {node: '>= 0.4'} - dependencies: - array-buffer-byte-length: 1.0.0 - arraybuffer.prototype.slice: 1.0.2 - available-typed-arrays: 1.0.5 - call-bind: 1.0.5 - es-set-tostringtag: 2.0.2 - es-to-primitive: 1.2.1 - function.prototype.name: 1.1.6 - get-intrinsic: 1.2.2 - get-symbol-description: 1.0.0 - globalthis: 1.0.3 - gopd: 1.0.1 - has-property-descriptors: 1.0.1 - has-proto: 1.0.1 - has-symbols: 1.0.3 - hasown: 2.0.0 - internal-slot: 1.0.6 - is-array-buffer: 3.0.2 - is-callable: 1.2.7 - is-negative-zero: 2.0.2 - is-regex: 1.1.4 - is-shared-array-buffer: 1.0.2 - is-string: 1.0.7 - is-typed-array: 1.1.12 - is-weakref: 1.0.2 - object-inspect: 1.13.1 - object-keys: 1.1.1 - object.assign: 4.1.5 - regexp.prototype.flags: 1.5.1 - safe-array-concat: 1.0.1 - safe-regex-test: 1.0.0 - string.prototype.trim: 1.2.8 - string.prototype.trimend: 1.0.7 - string.prototype.trimstart: 1.0.7 - typed-array-buffer: 1.0.0 - typed-array-byte-length: 1.0.0 - typed-array-byte-offset: 1.0.0 - typed-array-length: 1.0.4 - unbox-primitive: 1.0.2 - which-typed-array: 1.1.13 - dev: true - - /es-set-tostringtag@2.0.2: - resolution: {integrity: sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q==} - engines: {node: '>= 0.4'} - dependencies: - get-intrinsic: 1.2.2 - has-tostringtag: 1.0.0 - hasown: 2.0.0 - dev: true - - /es-shim-unscopables@1.0.2: - resolution: {integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==} - dependencies: - hasown: 2.0.0 - dev: true - - /es-to-primitive@1.2.1: - resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} - engines: {node: '>= 0.4'} - dependencies: - is-callable: 1.2.7 - is-date-object: 1.0.5 - is-symbol: 1.0.4 - dev: true - /esbuild@0.19.8: - resolution: {integrity: sha512-l7iffQpT2OrZfH2rXIp7/FkmaeZM0vxbxN9KfiCwGYuZqzMg/JdvX26R31Zxn/Pxvsrg3Y9N6XTcnknqDyyv4w==} + esbuild@0.21.5: + resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} engines: {node: '>=12'} hasBin: true - requiresBuild: true - optionalDependencies: - '@esbuild/android-arm': 0.19.8 - '@esbuild/android-arm64': 0.19.8 - '@esbuild/android-x64': 0.19.8 - '@esbuild/darwin-arm64': 0.19.8 - '@esbuild/darwin-x64': 0.19.8 - '@esbuild/freebsd-arm64': 0.19.8 - '@esbuild/freebsd-x64': 0.19.8 - '@esbuild/linux-arm': 0.19.8 - '@esbuild/linux-arm64': 0.19.8 - '@esbuild/linux-ia32': 0.19.8 - '@esbuild/linux-loong64': 0.19.8 - '@esbuild/linux-mips64el': 0.19.8 - '@esbuild/linux-ppc64': 0.19.8 - '@esbuild/linux-riscv64': 0.19.8 - '@esbuild/linux-s390x': 0.19.8 - '@esbuild/linux-x64': 0.19.8 - '@esbuild/netbsd-x64': 0.19.8 - '@esbuild/openbsd-x64': 0.19.8 - '@esbuild/sunos-x64': 0.19.8 - '@esbuild/win32-arm64': 0.19.8 - '@esbuild/win32-ia32': 0.19.8 - '@esbuild/win32-x64': 0.19.8 - dev: true - - /escalade@3.1.1: - resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} - engines: {node: '>=6'} - dev: true - /escape-string-regexp@1.0.5: - resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} - engines: {node: '>=0.8.0'} - dev: true + esbuild@0.23.1: + resolution: {integrity: sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==} + engines: {node: '>=18'} + hasBin: true + + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} - /escape-string-regexp@4.0.0: + escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - dev: true - - /eslint-compat-utils@0.1.2(eslint@8.56.0): - resolution: {integrity: sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==} - engines: {node: '>=12'} - peerDependencies: - eslint: '>=6.0.0' - dependencies: - eslint: 8.56.0 - dev: true - /eslint-config-prettier@9.1.0(eslint@8.56.0): + eslint-config-prettier@9.1.0: resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} hasBin: true peerDependencies: eslint: '>=7.0.0' - dependencies: - eslint: 8.56.0 - dev: true - /eslint-config-standard-with-typescript@43.0.1(@typescript-eslint/eslint-plugin@6.20.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.2)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-WfZ986+qzIzX6dcr4yGUyVb/l9N3Z8wPXCc5z/70fljs3UbWhhV+WxrfgsqMToRzuuyX9MqZ974pq2UPhDTOcA==} - peerDependencies: - '@typescript-eslint/eslint-plugin': ^6.4.0 - eslint: ^8.0.1 - eslint-plugin-import: ^2.25.2 - eslint-plugin-n: '^15.0.0 || ^16.0.0 ' - eslint-plugin-promise: ^6.0.0 - typescript: '*' - dependencies: - '@typescript-eslint/eslint-plugin': 6.20.0(@typescript-eslint/parser@6.20.0)(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/parser': 6.20.0(eslint@8.56.0)(typescript@5.3.3) - eslint: 8.56.0 - eslint-config-standard: 17.1.0(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.2)(eslint-plugin-promise@6.1.1)(eslint@8.56.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.20.0)(eslint@8.56.0) - eslint-plugin-n: 16.6.2(eslint@8.56.0) - eslint-plugin-promise: 6.1.1(eslint@8.56.0) - typescript: 5.3.3 - transitivePeerDependencies: - - supports-color - dev: true + eslint-plugin-security@3.0.1: + resolution: {integrity: sha512-XjVGBhtDZJfyuhIxnQ/WMm385RbX3DBu7H1J7HNNhmB2tnGxMeqVSnYv79oAj992ayvIBZghsymwkYFS6cGH4Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - /eslint-config-standard@17.1.0(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.2)(eslint-plugin-promise@6.1.1)(eslint@8.56.0): - resolution: {integrity: sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q==} - engines: {node: '>=12.0.0'} - peerDependencies: - eslint: ^8.0.1 - eslint-plugin-import: ^2.25.2 - eslint-plugin-n: '^15.0.0 || ^16.0.0 ' - eslint-plugin-promise: ^6.0.0 - dependencies: - eslint: 8.56.0 - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.20.0)(eslint@8.56.0) - eslint-plugin-n: 16.6.2(eslint@8.56.0) - eslint-plugin-promise: 6.1.1(eslint@8.56.0) - dev: true - - /eslint-import-resolver-node@0.3.9: - resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} - dependencies: - debug: 3.2.7 - is-core-module: 2.13.1 - resolve: 1.22.8 - transitivePeerDependencies: - - supports-color - dev: true + eslint-scope@8.1.0: + resolution: {integrity: sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.20.0)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0): - resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} - engines: {node: '>=4'} - peerDependencies: - '@typescript-eslint/parser': '*' - eslint: '*' - eslint-import-resolver-node: '*' - eslint-import-resolver-typescript: '*' - eslint-import-resolver-webpack: '*' - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true - eslint: - optional: true - eslint-import-resolver-node: - optional: true - eslint-import-resolver-typescript: - optional: true - eslint-import-resolver-webpack: - optional: true - dependencies: - '@typescript-eslint/parser': 6.20.0(eslint@8.56.0)(typescript@5.3.3) - debug: 3.2.7 - eslint: 8.56.0 - eslint-import-resolver-node: 0.3.9 - transitivePeerDependencies: - - supports-color - dev: true + eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - /eslint-plugin-es-x@7.5.0(eslint@8.56.0): - resolution: {integrity: sha512-ODswlDSO0HJDzXU0XvgZ3lF3lS3XAZEossh15Q2UHjwrJggWeBoKqqEsLTZLXl+dh5eOAozG0zRcYtuE35oTuQ==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - eslint: '>=8' - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) - '@eslint-community/regexpp': 4.10.0 - eslint: 8.56.0 - eslint-compat-utils: 0.1.2(eslint@8.56.0) - dev: true + eslint-visitor-keys@4.1.0: + resolution: {integrity: sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.20.0)(eslint@8.56.0): - resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} - engines: {node: '>=4'} + eslint@9.13.0: + resolution: {integrity: sha512-EYZK6SX6zjFHST/HRytOdA/zE72Cq/bfw45LSyuwrdvcclb/gqV8RRQxywOBEWO2+WDpva6UZa4CcDeJKzUCFA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + hasBin: true peerDependencies: - '@typescript-eslint/parser': '*' - eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + jiti: '*' peerDependenciesMeta: - '@typescript-eslint/parser': + jiti: optional: true - dependencies: - '@typescript-eslint/parser': 6.20.0(eslint@8.56.0)(typescript@5.3.3) - array-includes: 3.1.7 - array.prototype.findlastindex: 1.2.3 - array.prototype.flat: 1.3.2 - array.prototype.flatmap: 1.3.2 - debug: 3.2.7 - doctrine: 2.1.0 - eslint: 8.56.0 - eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.20.0)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0) - hasown: 2.0.0 - is-core-module: 2.13.1 - is-glob: 4.0.3 - minimatch: 3.1.2 - object.fromentries: 2.0.7 - object.groupby: 1.0.1 - object.values: 1.1.7 - semver: 7.5.4 - tsconfig-paths: 3.15.0 - transitivePeerDependencies: - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - supports-color - dev: true - - /eslint-plugin-n@16.6.2(eslint@8.56.0): - resolution: {integrity: sha512-6TyDmZ1HXoFQXnhCTUjVFULReoBPOAjpuiKELMkeP40yffI/1ZRO+d9ug/VC6fqISo2WkuIBk3cvuRPALaWlOQ==} - engines: {node: '>=16.0.0'} - peerDependencies: - eslint: '>=7.0.0' - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) - builtins: 5.0.1 - eslint: 8.56.0 - eslint-plugin-es-x: 7.5.0(eslint@8.56.0) - get-tsconfig: 4.7.2 - globals: 13.24.0 - ignore: 5.3.0 - is-builtin-module: 3.2.1 - is-core-module: 2.13.1 - minimatch: 3.1.2 - resolve: 1.22.8 - semver: 7.5.4 - dev: true - - /eslint-plugin-promise@6.1.1(eslint@8.56.0): - resolution: {integrity: sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - dependencies: - eslint: 8.56.0 - dev: true - - /eslint-plugin-security@2.1.0: - resolution: {integrity: sha512-ywxclP954bf8d3gr6KOQ/AFc+PRvWuhOxtPOEtiHmVYiZr/mcgQtmSJq6+hTEXC5ylTjHnPPG+PEnzlDiWMXbQ==} - dependencies: - safe-regex: 2.1.1 - dev: true - - /eslint-scope@7.2.2: - resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - esrecurse: 4.3.0 - estraverse: 5.3.0 - dev: true - - /eslint-visitor-keys@3.4.3: - resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - - /eslint@8.56.0: - resolution: {integrity: sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - hasBin: true - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) - '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.56.0 - '@humanwhocodes/config-array': 0.11.13 - '@humanwhocodes/module-importer': 1.0.1 - '@nodelib/fs.walk': 1.2.8 - '@ungap/structured-clone': 1.2.0 - ajv: 6.12.6 - chalk: 4.1.2 - cross-spawn: 7.0.3 - debug: 4.3.4 - doctrine: 3.0.0 - escape-string-regexp: 4.0.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 - esquery: 1.5.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 - find-up: 5.0.0 - glob-parent: 6.0.2 - globals: 13.23.0 - graphemer: 1.4.0 - ignore: 5.3.0 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - is-path-inside: 3.0.3 - js-yaml: 4.1.0 - json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.4.1 - lodash.merge: 4.6.2 - minimatch: 3.1.2 - natural-compare: 1.4.0 - optionator: 0.9.3 - strip-ansi: 6.0.1 - text-table: 0.2.0 - transitivePeerDependencies: - - supports-color - dev: true - /espree@9.6.1: - resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - acorn: 8.11.2 - acorn-jsx: 5.3.2(acorn@8.11.2) - eslint-visitor-keys: 3.4.3 - dev: true + espree@10.2.0: + resolution: {integrity: sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - /esquery@1.5.0: - resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} + esquery@1.6.0: + resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} engines: {node: '>=0.10'} - dependencies: - estraverse: 5.3.0 - dev: true - /esrecurse@4.3.0: + esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} - dependencies: - estraverse: 5.3.0 - dev: true - /estraverse@5.3.0: + estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} - dev: true - /estree-walker@2.0.2: + estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - dev: true - /estree-walker@3.0.3: + estree-walker@3.0.3: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} - dependencies: - '@types/estree': 1.0.5 - /esutils@2.0.3: + esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} - dev: true - /event-target-shim@5.0.1: + event-target-shim@5.0.1: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} engines: {node: '>=6'} - dev: true - /execa@5.1.1: - resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} - engines: {node: '>=10'} - dependencies: - cross-spawn: 7.0.3 - get-stream: 6.0.1 - human-signals: 2.1.0 - is-stream: 2.0.1 - merge-stream: 2.0.0 - npm-run-path: 4.0.1 - onetime: 5.1.2 - signal-exit: 3.0.7 - strip-final-newline: 2.0.0 - dev: true - - /execa@7.2.0: - resolution: {integrity: sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==} - engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0} - dependencies: - cross-spawn: 7.0.3 - get-stream: 6.0.1 - human-signals: 4.3.1 - is-stream: 3.0.0 - merge-stream: 2.0.0 - npm-run-path: 5.1.0 - onetime: 6.0.0 - signal-exit: 3.0.7 - strip-final-newline: 3.0.0 - dev: true - - /extend@3.0.2: - resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} - dev: true + events@3.3.0: + resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} + engines: {node: '>=0.8.x'} - /external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - dev: true + extend@3.0.2: + resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} - /fast-deep-equal@3.1.3: + fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - dev: true - /fast-glob@3.3.2: + fast-glob@3.3.2: resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} engines: {node: '>=8.6.0'} - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.5 - dev: true - /fast-json-stable-stringify@2.1.0: + fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} - dev: true - /fast-levenshtein@2.0.6: + fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - dev: true - /fastq@1.15.0: - resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} - dependencies: - reusify: 1.0.4 - dev: true + fast-redact@3.5.0: + resolution: {integrity: sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==} + engines: {node: '>=6'} - /fault@1.0.4: + fastq@1.17.1: + resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + + fault@1.0.4: resolution: {integrity: sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA==} + + fdir@6.3.0: + resolution: {integrity: sha512-QOnuT+BOtivR77wYvCWHfGt9s4Pz1VIMbD463vegT5MLqNXy8rYFT/lPVEqf/bhYeT6qmqrNHhsX+rWwe3rOCQ==} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + file-entry-cache@8.0.0: + resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} + engines: {node: '>=16.0.0'} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + + flat-cache@4.0.1: + resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} + engines: {node: '>=16'} + + flat@5.0.2: + resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} + hasBin: true + + flatted@3.3.1: + resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + + format@0.2.2: + resolution: {integrity: sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==} + engines: {node: '>=0.4.x'} + + fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + + get-tsconfig@4.8.1: + resolution: {integrity: sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==} + + glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + + glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + + glob@8.1.0: + resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} + engines: {node: '>=12'} + deprecated: Glob versions prior to v9 are no longer supported + + globals@14.0.0: + resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} + engines: {node: '>=18'} + + globby@11.1.0: + resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} + engines: {node: '>=10'} + + graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + + gzip-size@6.0.0: + resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==} + engines: {node: '>=10'} + + has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + + he@1.2.0: + resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} + hasBin: true + + ieee754@1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + + ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} + engines: {node: '>= 4'} + + import-fresh@3.3.0: + resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + engines: {node: '>=6'} + + importx@0.5.0: + resolution: {integrity: sha512-qROz3rSOjQYclmEQAajH9RhBuqpAGHM+5CNd9fk+TsF4JKmQsAI1egafW8XZZv8vARCo4nAmmt5d0eI2B8GUsA==} + + imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + + inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + is-alphabetical@1.0.4: + resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==} + + is-alphanumerical@1.0.4: + resolution: {integrity: sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==} + + is-binary-path@2.1.0: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + + is-buffer@2.0.5: + resolution: {integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==} + engines: {node: '>=4'} + + is-core-module@2.15.1: + resolution: {integrity: sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==} + engines: {node: '>= 0.4'} + + is-decimal@1.0.4: + resolution: {integrity: sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==} + + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + + is-hexadecimal@1.0.4: + resolution: {integrity: sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==} + + is-module@1.0.0: + resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-plain-obj@2.1.0: + resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} + engines: {node: '>=8'} + + is-reference@3.0.2: + resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==} + + is-unicode-supported@0.1.0: + resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} + engines: {node: '>=10'} + + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + jiti@2.0.0: + resolution: {integrity: sha512-CJ7e7Abb779OTRv3lomfp7Mns/Sy1+U4pcAx5VbjxCZD5ZM/VJaXPpPjNKjtSvWQy/H86E49REXR34dl1JEz9w==} + hasBin: true + + js-yaml@4.1.0: + resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + hasBin: true + + json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + + json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + + json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + + keyv@4.5.4: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + + kleur@4.1.5: + resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} + engines: {node: '>=6'} + + kolorist@1.8.0: + resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==} + + levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + + load-tsconfig@0.2.5: + resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + + local-pkg@0.5.0: + resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} + engines: {node: '>=14'} + + locate-character@3.0.0: + resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} + + locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + + lodash.merge@4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + + lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + + log-symbols@4.1.0: + resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} + engines: {node: '>=10'} + + longest-streak@2.0.4: + resolution: {integrity: sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg==} + + magic-string@0.30.11: + resolution: {integrity: sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==} + + mdast-util-from-markdown@0.8.5: + resolution: {integrity: sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==} + + mdast-util-frontmatter@0.2.0: + resolution: {integrity: sha512-FHKL4w4S5fdt1KjJCwB0178WJ0evnyyQr5kXTM3wrOVpytD0hrkvd+AOOjU9Td8onOejCkmZ+HQRT3CZ3coHHQ==} + + mdast-util-to-markdown@0.6.5: + resolution: {integrity: sha512-XeV9sDE7ZlOQvs45C9UKMtfTcctcaj/pGwH8YLbMHoMOXNNCn2LsqVQOqrF1+/NU8lKDAqozme9SCXWyo9oAcQ==} + + mdast-util-to-string@2.0.0: + resolution: {integrity: sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==} + + mdn-data@2.0.30: + resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} + + mdn-data@2.10.0: + resolution: {integrity: sha512-qq7C3EtK3yJXMwz1zAab65pjl+UhohqMOctTgcqjLOWABqmwj+me02LSsCuEUxnst9X1lCBpoE0WArGKgdGDzw==} + + merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + + micromark-extension-frontmatter@0.2.2: + resolution: {integrity: sha512-q6nPLFCMTLtfsctAuS0Xh4vaolxSFUWUWR6PZSrXXiRy+SANGllpcqdXFv2z07l0Xz/6Hl40hK0ffNCJPH2n1A==} + + micromark@2.11.4: + resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + + minimatch@5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} + + minimatch@9.0.5: + resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} + engines: {node: '>=16 || 14 >=14.17'} + + mlly@1.7.1: + resolution: {integrity: sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==} + + mocha@10.7.3: + resolution: {integrity: sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==} + engines: {node: '>= 14.0.0'} + hasBin: true + + mrmime@2.0.0: + resolution: {integrity: sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==} + engines: {node: '>=10'} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + + node-fetch-native@1.6.4: + resolution: {integrity: sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==} + + node-fetch@2.6.7: + resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + + normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + + ofetch@1.4.0: + resolution: {integrity: sha512-MuHgsEhU6zGeX+EMh+8mSMrYTnsqJQQrpM00Q6QHMKNqQ0bKy0B43tk8tL1wg+CnsSTy1kg4Ir2T5Ig6rD+dfQ==} + + on-exit-leak-free@2.1.2: + resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==} + engines: {node: '>=14.0.0'} + + once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + + optionator@0.9.4: + resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} + engines: {node: '>= 0.8.0'} + + p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + + p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + + package-manager-detector@0.2.0: + resolution: {integrity: sha512-E385OSk9qDcXhcM9LNSe4sdhx8a9mAPrZ4sMLW+tmxl5ZuGtPUcdFu+MPP2jbgiWAZ6Pfe5soGFMd+0Db5Vrog==} + + parent-module@1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + + parse-entities@2.0.0: + resolution: {integrity: sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==} + + path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + + path-type@4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + + pathe@1.1.2: + resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} + + perfect-debounce@1.0.0: + resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} + + periscopic@3.1.0: + resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} + + picocolors@1.1.0: + resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} + + picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + + picomatch@4.0.2: + resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + engines: {node: '>=12'} + + pino-abstract-transport@1.2.0: + resolution: {integrity: sha512-Guhh8EZfPCfH+PMXAb6rKOjGQEoy0xlAIn+irODG5kgfYV+BQ0rGYYWTIel3P5mmyXqkYkPmdIkywsn6QKUR1Q==} + + pino-std-serializers@7.0.0: + resolution: {integrity: sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==} + + pino@9.4.0: + resolution: {integrity: sha512-nbkQb5+9YPhQRz/BeQmrWpEknAaqjpAqRK8NwJpmrX/JHu7JuZC5G1CeAwJDJfGes4h+YihC6in3Q2nGb+Y09w==} + hasBin: true + + pkg-types@1.2.0: + resolution: {integrity: sha512-+ifYuSSqOQ8CqP4MbZA5hDpb97n3E8SVWdJe+Wms9kj745lmd3b7EZJiqvmLwAlmRfjrI7Hi5z3kdBJ93lFNPA==} + + postcss@8.4.47: + resolution: {integrity: sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==} + engines: {node: ^10 || ^12 || >=14} + + prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + + prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} + engines: {node: '>=14'} + hasBin: true + + process-warning@4.0.0: + resolution: {integrity: sha512-/MyYDxttz7DfGMMHiysAsFE4qF+pQYAA8ziO/3NcRVrQ5fSk+Mns4QZA/oRPFzvcqNoVJXQNWNAsdwBXLUkQKw==} + + process@0.11.10: + resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} + engines: {node: '>= 0.6.0'} + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + + quick-format-unescaped@4.0.4: + resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==} + + randombytes@2.1.0: + resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} + + readable-stream@4.5.2: + resolution: {integrity: sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + readdirp@3.6.0: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + + real-require@0.2.0: + resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==} + engines: {node: '>= 12.13.0'} + + regexp-tree@0.1.27: + resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} + hasBin: true + + remark-frontmatter@3.0.0: + resolution: {integrity: sha512-mSuDd3svCHs+2PyO29h7iijIZx4plX0fheacJcAoYAASfgzgVIcXGYSq9GFyYocFLftQs8IOmmkgtOovs6d4oA==} + + remark-parse@9.0.0: + resolution: {integrity: sha512-geKatMwSzEXKHuzBNU1z676sGcDcFoChMK38TgdHJNAYfFtsfHDQG7MoJAjs6sgYMqyLduCYWDIWZIxiPeafEw==} + + remark-stringify@9.0.1: + resolution: {integrity: sha512-mWmNg3ZtESvZS8fv5PTvaPckdL4iNlCHTt8/e/8oN08nArHRHjNZMKzA/YW3+p7/lYqIw4nx1XsjCBo/AxNChg==} + + repeat-string@1.6.1: + resolution: {integrity: sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==} + engines: {node: '>=0.10'} + + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + + resolve-from@4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + + resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + + resolve@1.22.8: + resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + hasBin: true + + reusify@1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + + rollup@4.22.4: + resolution: {integrity: sha512-vD8HJ5raRcWOyymsR6Z3o6+RzfEPCnVLMFJ6vRslO1jt4LO6dUo5Qnpg7y4RkZFM2DMe3WUirkI5c16onjrc6A==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + + run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + + safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + + safe-regex@2.1.1: + resolution: {integrity: sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==} + + safe-stable-stringify@2.5.0: + resolution: {integrity: sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==} + engines: {node: '>=10'} + + semver@7.6.3: + resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} + engines: {node: '>=10'} + hasBin: true + + serialize-javascript@6.0.2: + resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} + + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + shellwords@0.1.1: + resolution: {integrity: sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==} + + sirv@2.0.4: + resolution: {integrity: sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==} + engines: {node: '>= 10'} + + sisteransi@1.0.5: + resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + + slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + + smob@1.5.0: + resolution: {integrity: sha512-g6T+p7QO8npa+/hNx9ohv1E5pVCmWrVCUzUXJyLdMmftX6ER0oiWY/w9knEonLpnOp6b6FenKnMfR8gqwWdwig==} + + sonic-boom@4.1.0: + resolution: {integrity: sha512-NGipjjRicyJJ03rPiZCJYjwlsuP2d1/5QUviozRXC7S3WdVWNK5e3Ojieb9CCyfhq2UC+3+SRd9nG3I2lPRvUw==} + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + source-map-support@0.5.21: + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} + + source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + + split2@4.2.0: + resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} + engines: {node: '>= 10.x'} + + stacktrace-parser@0.1.10: + resolution: {integrity: sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==} + engines: {node: '>=6'} + + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + + string_decoder@1.3.0: + resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + + strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + + supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + + supports-color@8.1.1: + resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + engines: {node: '>=10'} + + supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + + svelte-hmr@0.16.0: + resolution: {integrity: sha512-Gyc7cOS3VJzLlfj7wKS0ZnzDVdv3Pn2IuVeJPk9m2skfhcu5bq3wtIZyQGggr7/Iim5rH5cncyQft/kRLupcnA==} + engines: {node: ^12.20 || ^14.13.1 || >= 16} + peerDependencies: + svelte: ^3.19.0 || ^4.0.0 + + svelte@4.2.19: + resolution: {integrity: sha512-IY1rnGr6izd10B0A8LqsBfmlT5OILVuZ7XsI0vdGPEvuonFV7NYEUK4dAkm9Zg2q0Um92kYjTpS1CAP3Nh/KWw==} + engines: {node: '>=16'} + + terser@5.34.1: + resolution: {integrity: sha512-FsJZ7iZLd/BXkz+4xrRTGJ26o/6VTjQytUk8b8OxkwcD2I+79VPJlz7qss1+zE7h8GNIScFqXcDyJ/KqBYZFVA==} + engines: {node: '>=10'} + hasBin: true + + text-table@0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + + thread-stream@3.1.0: + resolution: {integrity: sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==} + + tinyexec@0.3.0: + resolution: {integrity: sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==} + + tinyglobby@0.2.6: + resolution: {integrity: sha512-NbBoFBpqfcgd1tCiO8Lkfdk+xrA7mlLR9zgvZcZWQQwU63XAfUePyd6wZBaU93Hqw347lHnwFzttAkemHzzz4g==} + engines: {node: '>=12.0.0'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + totalist@3.0.1: + resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} + engines: {node: '>=6'} + + tr46@0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + + trough@1.0.5: + resolution: {integrity: sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==} + + ts-api-utils@1.3.0: + resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} + engines: {node: '>=16'} + peerDependencies: + typescript: '>=4.2.0' + + tslib@2.7.0: + resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} + + tsx@4.19.1: + resolution: {integrity: sha512-0flMz1lh74BR4wOvBjuh9olbnwqCPc35OOlfyzHba0Dc+QNUeWX/Gq2YTbnwcWPO3BMd8fkzRVrHcsR+a7z7rA==} + engines: {node: '>=18.0.0'} + hasBin: true + + type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + + type-fest@0.7.1: + resolution: {integrity: sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==} + engines: {node: '>=8'} + + typescript-eslint@8.10.0: + resolution: {integrity: sha512-YIu230PeN7z9zpu/EtqCIuRVHPs4iSlqW6TEvjbyDAE3MZsSl2RXBo+5ag+lbABCG8sFM1WVKEXhlQ8Ml8A3Fw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + typescript@5.6.3: + resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==} + engines: {node: '>=14.17'} + hasBin: true + + ufo@1.5.4: + resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==} + + unconfig@0.6.0: + resolution: {integrity: sha512-4C67J0nIF2QwSXty2kW3zZx1pMZ3iXabylvJWWgHybWVUcMf9pxwsngoQt0gC+AVstRywFqrRBp3qOXJayhpOw==} + + unified@9.2.2: + resolution: {integrity: sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ==} + + unist-util-stringify-position@2.0.3: + resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} + + unocss@0.63.1: + resolution: {integrity: sha512-fVZOT+RCL43yK9enRVVClgh5RT9av8mE6P665cZH+F17hVqDO56q7J7HUqGh9/+zO+omkhYJwUQX4hTPE8J/9g==} + engines: {node: '>=14'} + peerDependencies: + '@unocss/webpack': 0.63.1 + vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 + peerDependenciesMeta: + '@unocss/webpack': + optional: true + vite: + optional: true + + uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + + vfile-message@2.0.4: + resolution: {integrity: sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==} + + vfile@4.2.1: + resolution: {integrity: sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA==} + + vite@5.4.8: + resolution: {integrity: sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || >=20.0.0 + less: '*' + lightningcss: ^1.21.0 + sass: '*' + sass-embedded: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + + vitefu@0.2.5: + resolution: {integrity: sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==} + peerDependencies: + vite: ^3.0.0 || ^4.0.0 || ^5.0.0 + peerDependenciesMeta: + vite: + optional: true + + webidl-conversions@3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + + whatwg-url@5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + + word-wrap@1.2.5: + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} + engines: {node: '>=0.10.0'} + + workerpool@6.5.1: + resolution: {integrity: sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==} + + wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + + wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + + y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + + yargs-parser@20.2.9: + resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} + engines: {node: '>=10'} + + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + + yargs-unparser@2.0.0: + resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==} + engines: {node: '>=10'} + + yargs@16.2.0: + resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} + engines: {node: '>=10'} + + yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + + yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + + zod-validation-error@1.5.0: + resolution: {integrity: sha512-/7eFkAI4qV0tcxMBB/3+d2c1P6jzzZYdYSlBuAklzMuCrJu5bzJfHS0yVAS87dRHVlhftd6RFJDIvv03JgkSbw==} + engines: {node: '>=16.0.0'} + peerDependencies: + zod: ^3.18.0 + + zod@3.23.8: + resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} + + zwitch@1.0.5: + resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} + +snapshots: + + '@ampproject/remapping@2.3.0': + dependencies: + '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/trace-mapping': 0.3.25 + + '@antfu/install-pkg@0.4.1': + dependencies: + package-manager-detector: 0.2.0 + tinyexec: 0.3.0 + + '@antfu/utils@0.7.10': {} + + '@chainsafe/abort-controller@3.0.1': + dependencies: + event-target-shim: 5.0.1 + + '@clack/core@0.3.4': + dependencies: + picocolors: 1.1.0 + sisteransi: 1.0.5 + + '@clack/prompts@0.7.0': + dependencies: + '@clack/core': 0.3.4 + picocolors: 1.1.0 + sisteransi: 1.0.5 + + '@covector/apply@0.10.0(mocha@10.7.3)': + dependencies: + '@covector/files': 0.8.0 + effection: 2.0.8(mocha@10.7.3) + semver: 7.6.3 + transitivePeerDependencies: + - encoding + - mocha + + '@covector/assemble@0.12.0(mocha@10.7.3)': + dependencies: + '@covector/command': 0.8.0(mocha@10.7.3) + '@covector/files': 0.8.0 + effection: 2.0.8(mocha@10.7.3) + js-yaml: 4.1.0 + lodash: 4.17.21 + remark-frontmatter: 3.0.0 + remark-parse: 9.0.0 + remark-stringify: 9.0.1 + unified: 9.2.2 + transitivePeerDependencies: + - encoding + - mocha + - supports-color + + '@covector/changelog@0.12.0(mocha@10.7.3)': + dependencies: + '@covector/files': 0.8.0 + effection: 2.0.8(mocha@10.7.3) + lodash: 4.17.21 + remark-parse: 9.0.0 + remark-stringify: 9.0.1 + unified: 9.2.2 + transitivePeerDependencies: + - encoding + - mocha + - supports-color + + '@covector/command@0.8.0(mocha@10.7.3)': + dependencies: + '@effection/process': 2.1.4(mocha@10.7.3) + effection: 2.0.8(mocha@10.7.3) + transitivePeerDependencies: + - encoding + - mocha + + '@covector/files@0.8.0': + dependencies: + '@covector/toml': 0.2.0 + globby: 11.1.0 + js-yaml: 4.1.0 + semver: 7.6.3 + zod: 3.23.8 + zod-validation-error: 1.5.0(zod@3.23.8) + + '@covector/toml@0.2.0': {} + + '@effection/channel@2.0.6': + dependencies: + '@effection/core': 2.2.3 + '@effection/events': 2.0.6 + '@effection/stream': 2.0.6 + + '@effection/core@2.2.3': + dependencies: + '@chainsafe/abort-controller': 3.0.1 + + '@effection/events@2.0.6': + dependencies: + '@effection/core': 2.2.3 + '@effection/stream': 2.0.6 + + '@effection/fetch@2.0.7(mocha@10.7.3)': + dependencies: + '@effection/core': 2.2.3 + '@effection/mocha': 2.0.8(mocha@10.7.3) + cross-fetch: 3.1.5 + transitivePeerDependencies: + - encoding + - mocha + + '@effection/main@2.1.2': + dependencies: + '@effection/core': 2.2.3 + chalk: 4.1.2 + stacktrace-parser: 0.1.10 + + '@effection/mocha@2.0.8(mocha@10.7.3)': + dependencies: + effection: 2.0.8(mocha@10.7.3) + mocha: 10.7.3 + + '@effection/process@2.1.4(mocha@10.7.3)': + dependencies: + cross-spawn: 7.0.3 + ctrlc-windows: 2.1.0 + effection: 2.0.8(mocha@10.7.3) + shellwords: 0.1.1 + transitivePeerDependencies: + - encoding + - mocha + + '@effection/stream@2.0.6': + dependencies: + '@effection/core': 2.2.3 + '@effection/subscription': 2.0.6 + + '@effection/subscription@2.0.6': + dependencies: + '@effection/core': 2.2.3 + + '@esbuild/aix-ppc64@0.21.5': + optional: true + + '@esbuild/aix-ppc64@0.23.1': + optional: true + + '@esbuild/android-arm64@0.21.5': + optional: true + + '@esbuild/android-arm64@0.23.1': + optional: true + + '@esbuild/android-arm@0.21.5': + optional: true + + '@esbuild/android-arm@0.23.1': + optional: true + + '@esbuild/android-x64@0.21.5': + optional: true + + '@esbuild/android-x64@0.23.1': + optional: true + + '@esbuild/darwin-arm64@0.21.5': + optional: true + + '@esbuild/darwin-arm64@0.23.1': + optional: true + + '@esbuild/darwin-x64@0.21.5': + optional: true + + '@esbuild/darwin-x64@0.23.1': + optional: true + + '@esbuild/freebsd-arm64@0.21.5': + optional: true + + '@esbuild/freebsd-arm64@0.23.1': + optional: true + + '@esbuild/freebsd-x64@0.21.5': + optional: true + + '@esbuild/freebsd-x64@0.23.1': + optional: true + + '@esbuild/linux-arm64@0.21.5': + optional: true + + '@esbuild/linux-arm64@0.23.1': + optional: true + + '@esbuild/linux-arm@0.21.5': + optional: true + + '@esbuild/linux-arm@0.23.1': + optional: true + + '@esbuild/linux-ia32@0.21.5': + optional: true + + '@esbuild/linux-ia32@0.23.1': + optional: true + + '@esbuild/linux-loong64@0.21.5': + optional: true + + '@esbuild/linux-loong64@0.23.1': + optional: true + + '@esbuild/linux-mips64el@0.21.5': + optional: true + + '@esbuild/linux-mips64el@0.23.1': + optional: true + + '@esbuild/linux-ppc64@0.21.5': + optional: true + + '@esbuild/linux-ppc64@0.23.1': + optional: true + + '@esbuild/linux-riscv64@0.21.5': + optional: true + + '@esbuild/linux-riscv64@0.23.1': + optional: true + + '@esbuild/linux-s390x@0.21.5': + optional: true + + '@esbuild/linux-s390x@0.23.1': + optional: true + + '@esbuild/linux-x64@0.21.5': + optional: true + + '@esbuild/linux-x64@0.23.1': + optional: true + + '@esbuild/netbsd-x64@0.21.5': + optional: true + + '@esbuild/netbsd-x64@0.23.1': + optional: true + + '@esbuild/openbsd-arm64@0.23.1': + optional: true + + '@esbuild/openbsd-x64@0.21.5': + optional: true + + '@esbuild/openbsd-x64@0.23.1': + optional: true + + '@esbuild/sunos-x64@0.21.5': + optional: true + + '@esbuild/sunos-x64@0.23.1': + optional: true + + '@esbuild/win32-arm64@0.21.5': + optional: true + + '@esbuild/win32-arm64@0.23.1': + optional: true + + '@esbuild/win32-ia32@0.21.5': + optional: true + + '@esbuild/win32-ia32@0.23.1': + optional: true + + '@esbuild/win32-x64@0.21.5': + optional: true + + '@esbuild/win32-x64@0.23.1': + optional: true + + '@eslint-community/eslint-utils@4.4.0(eslint@9.13.0(jiti@2.0.0))': + dependencies: + eslint: 9.13.0(jiti@2.0.0) + eslint-visitor-keys: 3.4.3 + + '@eslint-community/regexpp@4.11.1': {} + + '@eslint/config-array@0.18.0': + dependencies: + '@eslint/object-schema': 2.1.4 + debug: 4.3.7(supports-color@8.1.1) + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + + '@eslint/core@0.7.0': {} + + '@eslint/eslintrc@3.1.0': + dependencies: + ajv: 6.12.6 + debug: 4.3.7(supports-color@8.1.1) + espree: 10.2.0 + globals: 14.0.0 + ignore: 5.3.2 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + + '@eslint/js@9.13.0': {} + + '@eslint/object-schema@2.1.4': {} + + '@eslint/plugin-kit@0.2.0': + dependencies: + levn: 0.4.1 + + '@humanfs/core@0.19.0': {} + + '@humanfs/node@0.16.5': + dependencies: + '@humanfs/core': 0.19.0 + '@humanwhocodes/retry': 0.3.1 + + '@humanwhocodes/module-importer@1.0.1': {} + + '@humanwhocodes/retry@0.3.1': {} + + '@iconify-json/codicon@1.2.2': + dependencies: + '@iconify/types': 2.0.0 + + '@iconify-json/ph@1.2.0': + dependencies: + '@iconify/types': 2.0.0 + + '@iconify/types@2.0.0': {} + + '@iconify/utils@2.1.33': + dependencies: + '@antfu/install-pkg': 0.4.1 + '@antfu/utils': 0.7.10 + '@iconify/types': 2.0.0 + debug: 4.3.7(supports-color@8.1.1) + kolorist: 1.8.0 + local-pkg: 0.5.0 + mlly: 1.7.1 + transitivePeerDependencies: + - supports-color + + '@jridgewell/gen-mapping@0.3.5': + dependencies: + '@jridgewell/set-array': 1.2.1 + '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/trace-mapping': 0.3.25 + + '@jridgewell/resolve-uri@3.1.2': {} + + '@jridgewell/set-array@1.2.1': {} + + '@jridgewell/source-map@0.3.6': + dependencies: + '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/trace-mapping': 0.3.25 + + '@jridgewell/sourcemap-codec@1.5.0': {} + + '@jridgewell/trace-mapping@0.3.25': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.0 + + '@nodelib/fs.scandir@2.1.5': + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + + '@nodelib/fs.stat@2.0.5': {} + + '@nodelib/fs.walk@1.2.8': + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.17.1 + + '@polka/url@1.0.0-next.28': {} + + '@rollup/plugin-node-resolve@15.3.0(rollup@4.22.4)': + dependencies: + '@rollup/pluginutils': 5.1.2(rollup@4.22.4) + '@types/resolve': 1.20.2 + deepmerge: 4.3.1 + is-module: 1.0.0 + resolve: 1.22.8 + optionalDependencies: + rollup: 4.22.4 + + '@rollup/plugin-terser@0.4.4(rollup@4.22.4)': + dependencies: + serialize-javascript: 6.0.2 + smob: 1.5.0 + terser: 5.34.1 + optionalDependencies: + rollup: 4.22.4 + + '@rollup/plugin-typescript@11.1.6(rollup@4.22.4)(tslib@2.7.0)(typescript@5.6.3)': + dependencies: + '@rollup/pluginutils': 5.1.2(rollup@4.22.4) + resolve: 1.22.8 + typescript: 5.6.3 + optionalDependencies: + rollup: 4.22.4 + tslib: 2.7.0 + + '@rollup/pluginutils@5.1.2(rollup@4.22.4)': + dependencies: + '@types/estree': 1.0.6 + estree-walker: 2.0.2 + picomatch: 2.3.1 + optionalDependencies: + rollup: 4.22.4 + + '@rollup/rollup-android-arm-eabi@4.22.4': + optional: true + + '@rollup/rollup-android-arm64@4.22.4': + optional: true + + '@rollup/rollup-darwin-arm64@4.22.4': + optional: true + + '@rollup/rollup-darwin-x64@4.22.4': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.22.4': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.22.4': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.22.4': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.22.4': + optional: true + + '@rollup/rollup-linux-powerpc64le-gnu@4.22.4': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.22.4': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.22.4': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.22.4': + optional: true + + '@rollup/rollup-linux-x64-musl@4.22.4': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.22.4': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.22.4': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.22.4': + optional: true + + '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.8(terser@5.34.1)))(svelte@4.2.19)(vite@5.4.8(terser@5.34.1))': + dependencies: + '@sveltejs/vite-plugin-svelte': 3.1.2(svelte@4.2.19)(vite@5.4.8(terser@5.34.1)) + debug: 4.3.7(supports-color@8.1.1) + svelte: 4.2.19 + vite: 5.4.8(terser@5.34.1) + transitivePeerDependencies: + - supports-color + + '@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.8(terser@5.34.1))': + dependencies: + '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.8(terser@5.34.1)))(svelte@4.2.19)(vite@5.4.8(terser@5.34.1)) + debug: 4.3.7(supports-color@8.1.1) + deepmerge: 4.3.1 + kleur: 4.1.5 + magic-string: 0.30.11 + svelte: 4.2.19 + svelte-hmr: 0.16.0(svelte@4.2.19) + vite: 5.4.8(terser@5.34.1) + vitefu: 0.2.5(vite@5.4.8(terser@5.34.1)) + transitivePeerDependencies: + - supports-color + + '@tauri-apps/api@2.0.2': {} + + '@tauri-apps/cli-darwin-arm64@2.0.3': + optional: true + + '@tauri-apps/cli-darwin-x64@2.0.3': + optional: true + + '@tauri-apps/cli-linux-arm-gnueabihf@2.0.3': + optional: true + + '@tauri-apps/cli-linux-arm64-gnu@2.0.3': + optional: true + + '@tauri-apps/cli-linux-arm64-musl@2.0.3': + optional: true + + '@tauri-apps/cli-linux-x64-gnu@2.0.3': + optional: true + + '@tauri-apps/cli-linux-x64-musl@2.0.3': + optional: true + + '@tauri-apps/cli-win32-arm64-msvc@2.0.3': + optional: true + + '@tauri-apps/cli-win32-ia32-msvc@2.0.3': + optional: true + + '@tauri-apps/cli-win32-x64-msvc@2.0.3': + optional: true + + '@tauri-apps/cli@2.0.3': + optionalDependencies: + '@tauri-apps/cli-darwin-arm64': 2.0.3 + '@tauri-apps/cli-darwin-x64': 2.0.3 + '@tauri-apps/cli-linux-arm-gnueabihf': 2.0.3 + '@tauri-apps/cli-linux-arm64-gnu': 2.0.3 + '@tauri-apps/cli-linux-arm64-musl': 2.0.3 + '@tauri-apps/cli-linux-x64-gnu': 2.0.3 + '@tauri-apps/cli-linux-x64-musl': 2.0.3 + '@tauri-apps/cli-win32-arm64-msvc': 2.0.3 + '@tauri-apps/cli-win32-ia32-msvc': 2.0.3 + '@tauri-apps/cli-win32-x64-msvc': 2.0.3 + + '@types/eslint@9.6.1': + dependencies: + '@types/estree': 1.0.6 + '@types/json-schema': 7.0.15 + + '@types/eslint__js@8.42.3': + dependencies: + '@types/eslint': 9.6.1 + + '@types/estree@1.0.5': {} + + '@types/estree@1.0.6': {} + + '@types/json-schema@7.0.15': {} + + '@types/mdast@3.0.15': + dependencies: + '@types/unist': 2.0.11 + + '@types/resolve@1.20.2': {} + + '@types/unist@2.0.11': {} + + '@typescript-eslint/eslint-plugin@8.10.0(@typescript-eslint/parser@8.10.0(eslint@9.13.0(jiti@2.0.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.0.0))(typescript@5.6.3)': + dependencies: + '@eslint-community/regexpp': 4.11.1 + '@typescript-eslint/parser': 8.10.0(eslint@9.13.0(jiti@2.0.0))(typescript@5.6.3) + '@typescript-eslint/scope-manager': 8.10.0 + '@typescript-eslint/type-utils': 8.10.0(eslint@9.13.0(jiti@2.0.0))(typescript@5.6.3) + '@typescript-eslint/utils': 8.10.0(eslint@9.13.0(jiti@2.0.0))(typescript@5.6.3) + '@typescript-eslint/visitor-keys': 8.10.0 + eslint: 9.13.0(jiti@2.0.0) + graphemer: 1.4.0 + ignore: 5.3.2 + natural-compare: 1.4.0 + ts-api-utils: 1.3.0(typescript@5.6.3) + optionalDependencies: + typescript: 5.6.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/parser@8.10.0(eslint@9.13.0(jiti@2.0.0))(typescript@5.6.3)': + dependencies: + '@typescript-eslint/scope-manager': 8.10.0 + '@typescript-eslint/types': 8.10.0 + '@typescript-eslint/typescript-estree': 8.10.0(typescript@5.6.3) + '@typescript-eslint/visitor-keys': 8.10.0 + debug: 4.3.7(supports-color@8.1.1) + eslint: 9.13.0(jiti@2.0.0) + optionalDependencies: + typescript: 5.6.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/scope-manager@8.10.0': + dependencies: + '@typescript-eslint/types': 8.10.0 + '@typescript-eslint/visitor-keys': 8.10.0 + + '@typescript-eslint/type-utils@8.10.0(eslint@9.13.0(jiti@2.0.0))(typescript@5.6.3)': + dependencies: + '@typescript-eslint/typescript-estree': 8.10.0(typescript@5.6.3) + '@typescript-eslint/utils': 8.10.0(eslint@9.13.0(jiti@2.0.0))(typescript@5.6.3) + debug: 4.3.7(supports-color@8.1.1) + ts-api-utils: 1.3.0(typescript@5.6.3) + optionalDependencies: + typescript: 5.6.3 + transitivePeerDependencies: + - eslint + - supports-color + + '@typescript-eslint/types@8.10.0': {} + + '@typescript-eslint/typescript-estree@8.10.0(typescript@5.6.3)': + dependencies: + '@typescript-eslint/types': 8.10.0 + '@typescript-eslint/visitor-keys': 8.10.0 + debug: 4.3.7(supports-color@8.1.1) + fast-glob: 3.3.2 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.3 + ts-api-utils: 1.3.0(typescript@5.6.3) + optionalDependencies: + typescript: 5.6.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/utils@8.10.0(eslint@9.13.0(jiti@2.0.0))(typescript@5.6.3)': + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.13.0(jiti@2.0.0)) + '@typescript-eslint/scope-manager': 8.10.0 + '@typescript-eslint/types': 8.10.0 + '@typescript-eslint/typescript-estree': 8.10.0(typescript@5.6.3) + eslint: 9.13.0(jiti@2.0.0) + transitivePeerDependencies: + - supports-color + - typescript + + '@typescript-eslint/visitor-keys@8.10.0': + dependencies: + '@typescript-eslint/types': 8.10.0 + eslint-visitor-keys: 3.4.3 + + '@unocss/astro@0.63.1(rollup@4.22.4)(vite@5.4.8(terser@5.34.1))': + dependencies: + '@unocss/core': 0.63.1 + '@unocss/reset': 0.63.1 + '@unocss/vite': 0.63.1(rollup@4.22.4)(vite@5.4.8(terser@5.34.1)) + optionalDependencies: + vite: 5.4.8(terser@5.34.1) + transitivePeerDependencies: + - rollup + - supports-color + + '@unocss/cli@0.63.1(rollup@4.22.4)': dependencies: - format: 0.2.2 - dev: true + '@ampproject/remapping': 2.3.0 + '@rollup/pluginutils': 5.1.2(rollup@4.22.4) + '@unocss/config': 0.63.1 + '@unocss/core': 0.63.1 + '@unocss/preset-uno': 0.63.1 + cac: 6.7.14 + chokidar: 3.6.0 + colorette: 2.0.20 + consola: 3.2.3 + magic-string: 0.30.11 + pathe: 1.1.2 + perfect-debounce: 1.0.0 + tinyglobby: 0.2.6 + transitivePeerDependencies: + - rollup + - supports-color - /figures@3.2.0: - resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} - engines: {node: '>=8'} + '@unocss/config@0.63.1': dependencies: - escape-string-regexp: 1.0.5 - dev: true + '@unocss/core': 0.63.1 + unconfig: 0.6.0 + transitivePeerDependencies: + - supports-color + + '@unocss/core@0.63.1': {} - /file-entry-cache@6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} + '@unocss/extractor-arbitrary-variants@0.63.1': dependencies: - flat-cache: 3.2.0 - dev: true + '@unocss/core': 0.63.1 - /fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} - engines: {node: '>=8'} + '@unocss/extractor-svelte@0.63.1': {} + + '@unocss/inspector@0.63.1': dependencies: - to-regex-range: 5.0.1 - dev: true + '@unocss/core': 0.63.1 + '@unocss/rule-utils': 0.63.1 + gzip-size: 6.0.0 + sirv: 2.0.4 - /find-up@5.0.0: - resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} - engines: {node: '>=10'} + '@unocss/postcss@0.63.1(postcss@8.4.47)': dependencies: - locate-path: 6.0.0 - path-exists: 4.0.0 - dev: true + '@unocss/config': 0.63.1 + '@unocss/core': 0.63.1 + '@unocss/rule-utils': 0.63.1 + css-tree: 3.0.0 + postcss: 8.4.47 + tinyglobby: 0.2.6 + transitivePeerDependencies: + - supports-color - /flat-cache@3.2.0: - resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} - engines: {node: ^10.12.0 || >=12.0.0} + '@unocss/preset-attributify@0.63.1': dependencies: - flatted: 3.2.9 - keyv: 4.5.4 - rimraf: 3.0.2 - dev: true + '@unocss/core': 0.63.1 - /flat@5.0.2: - resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} - hasBin: true - dev: true + '@unocss/preset-icons@0.63.1': + dependencies: + '@iconify/utils': 2.1.33 + '@unocss/core': 0.63.1 + ofetch: 1.4.0 + transitivePeerDependencies: + - supports-color - /flatted@3.2.9: - resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==} - dev: true + '@unocss/preset-mini@0.63.1': + dependencies: + '@unocss/core': 0.63.1 + '@unocss/extractor-arbitrary-variants': 0.63.1 + '@unocss/rule-utils': 0.63.1 - /for-each@0.3.3: - resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} + '@unocss/preset-tagify@0.63.1': dependencies: - is-callable: 1.2.7 - dev: true + '@unocss/core': 0.63.1 - /format@0.2.2: - resolution: {integrity: sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==} - engines: {node: '>=0.4.x'} - dev: true + '@unocss/preset-typography@0.63.1': + dependencies: + '@unocss/core': 0.63.1 + '@unocss/preset-mini': 0.63.1 - /fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - dev: true + '@unocss/preset-uno@0.63.1': + dependencies: + '@unocss/core': 0.63.1 + '@unocss/preset-mini': 0.63.1 + '@unocss/preset-wind': 0.63.1 + '@unocss/rule-utils': 0.63.1 - /fsevents@2.3.3: - resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] - requiresBuild: true - dev: true - optional: true + '@unocss/preset-web-fonts@0.63.1': + dependencies: + '@unocss/core': 0.63.1 + ofetch: 1.4.0 - /function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - dev: true + '@unocss/preset-wind@0.63.1': + dependencies: + '@unocss/core': 0.63.1 + '@unocss/preset-mini': 0.63.1 + '@unocss/rule-utils': 0.63.1 - /function-timeout@0.1.1: - resolution: {integrity: sha512-0NVVC0TaP7dSTvn1yMiy6d6Q8gifzbvQafO46RtLG/kHJUBNd+pVRGOBoK44wNBvtSPUJRfdVvkFdD3p0xvyZg==} - engines: {node: '>=14.16'} - dev: true + '@unocss/reset@0.63.1': {} - /function.prototype.name@1.1.6: - resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} - engines: {node: '>= 0.4'} + '@unocss/rule-utils@0.63.1': dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.3 - functions-have-names: 1.2.3 - dev: true + '@unocss/core': 0.63.1 + magic-string: 0.30.11 - /functions-have-names@1.2.3: - resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} - dev: true + '@unocss/transformer-attributify-jsx@0.63.1': + dependencies: + '@unocss/core': 0.63.1 - /gensync@1.0.0-beta.2: - resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} - engines: {node: '>=6.9.0'} - dev: true + '@unocss/transformer-compile-class@0.63.1': + dependencies: + '@unocss/core': 0.63.1 - /get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - dev: true + '@unocss/transformer-directives@0.63.1': + dependencies: + '@unocss/core': 0.63.1 + '@unocss/rule-utils': 0.63.1 + css-tree: 3.0.0 - /get-intrinsic@1.2.2: - resolution: {integrity: sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==} + '@unocss/transformer-variant-group@0.63.1': dependencies: - function-bind: 1.1.2 - has-proto: 1.0.1 - has-symbols: 1.0.3 - hasown: 2.0.0 - dev: true + '@unocss/core': 0.63.1 - /get-stream@6.0.1: - resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} - engines: {node: '>=10'} - dev: true + '@unocss/vite@0.63.1(rollup@4.22.4)(vite@5.4.8(terser@5.34.1))': + dependencies: + '@ampproject/remapping': 2.3.0 + '@rollup/pluginutils': 5.1.2(rollup@4.22.4) + '@unocss/config': 0.63.1 + '@unocss/core': 0.63.1 + '@unocss/inspector': 0.63.1 + chokidar: 3.6.0 + magic-string: 0.30.11 + tinyglobby: 0.2.6 + vite: 5.4.8(terser@5.34.1) + transitivePeerDependencies: + - rollup + - supports-color - /get-symbol-description@1.0.0: - resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} - engines: {node: '>= 0.4'} + '@zerodevx/svelte-json-view@1.0.11(svelte@4.2.19)': dependencies: - call-bind: 1.0.5 - get-intrinsic: 1.2.2 - dev: true + svelte: 4.2.19 - /get-tsconfig@4.7.2: - resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} + abort-controller@3.0.0: dependencies: - resolve-pkg-maps: 1.0.0 - dev: true + event-target-shim: 5.0.1 - /glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} + acorn-jsx@5.3.2(acorn@8.12.1): dependencies: - is-glob: 4.0.3 - dev: true + acorn: 8.12.1 - /glob-parent@6.0.2: - resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} - engines: {node: '>=10.13.0'} + acorn@8.12.1: {} + + ajv@6.12.6: dependencies: - is-glob: 4.0.3 - dev: true + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + + ansi-colors@4.1.3: {} - /glob@7.2.0: - resolution: {integrity: sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==} + ansi-regex@5.0.1: {} + + ansi-styles@4.3.0: dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - dev: true + color-convert: 2.0.1 - /glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + anymatch@3.1.3: dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - dev: true + normalize-path: 3.0.0 + picomatch: 2.3.1 - /globals@11.12.0: - resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} - engines: {node: '>=4'} - dev: true + argparse@2.0.1: {} - /globals@13.23.0: - resolution: {integrity: sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==} - engines: {node: '>=8'} + aria-query@5.3.2: {} + + array-union@2.1.0: {} + + atomic-sleep@1.0.0: {} + + axobject-query@4.1.0: {} + + bail@1.0.5: {} + + balanced-match@1.0.2: {} + + base64-js@1.5.1: {} + + binary-extensions@2.3.0: {} + + brace-expansion@1.1.11: dependencies: - type-fest: 0.20.2 - dev: true + balanced-match: 1.0.2 + concat-map: 0.0.1 - /globals@13.24.0: - resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} - engines: {node: '>=8'} + brace-expansion@2.0.1: dependencies: - type-fest: 0.20.2 - dev: true + balanced-match: 1.0.2 - /globalthis@1.0.3: - resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} - engines: {node: '>= 0.4'} + braces@3.0.3: dependencies: - define-properties: 1.2.1 - dev: true + fill-range: 7.1.1 - /globby@11.1.0: - resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} - engines: {node: '>=10'} + browser-stdout@1.3.1: {} + + buffer-from@1.1.2: {} + + buffer@6.0.3: dependencies: - array-union: 2.1.0 - dir-glob: 3.0.1 - fast-glob: 3.3.2 - ignore: 5.3.0 - merge2: 1.4.1 - slash: 3.0.0 - dev: true + base64-js: 1.5.1 + ieee754: 1.2.1 - /gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + bundle-require@5.0.0(esbuild@0.23.1): dependencies: - get-intrinsic: 1.2.2 - dev: true + esbuild: 0.23.1 + load-tsconfig: 0.2.5 - /graphemer@1.4.0: - resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - dev: true + cac@6.7.14: {} - /gzip-size@6.0.0: - resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==} - engines: {node: '>=10'} + callsites@3.1.0: {} + + camelcase@6.3.0: {} + + chalk@4.1.2: dependencies: - duplexer: 0.1.2 - dev: true + ansi-styles: 4.3.0 + supports-color: 7.2.0 - /has-bigints@1.0.2: - resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} - dev: true + character-entities-legacy@1.1.4: {} - /has-flag@3.0.0: - resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} - engines: {node: '>=4'} - dev: true + character-entities@1.2.4: {} - /has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - dev: true + character-reference-invalid@1.1.4: {} - /has-property-descriptors@1.0.1: - resolution: {integrity: sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==} + chokidar@3.6.0: dependencies: - get-intrinsic: 1.2.2 - dev: true + anymatch: 3.1.3 + braces: 3.0.3 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 - /has-proto@1.0.1: - resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} - engines: {node: '>= 0.4'} - dev: true + cliui@7.0.4: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 - /has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - dev: true + cliui@8.0.1: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 - /has-tostringtag@1.0.0: - resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} - engines: {node: '>= 0.4'} + code-red@1.0.4: dependencies: - has-symbols: 1.0.3 - dev: true + '@jridgewell/sourcemap-codec': 1.5.0 + '@types/estree': 1.0.6 + acorn: 8.12.1 + estree-walker: 3.0.3 + periscopic: 3.1.0 - /hasown@2.0.0: - resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} - engines: {node: '>= 0.4'} + color-convert@2.0.1: dependencies: - function-bind: 1.1.2 - dev: true + color-name: 1.1.4 - /he@1.2.0: - resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} - hasBin: true - dev: true + color-name@1.1.4: {} - /human-signals@2.1.0: - resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} - engines: {node: '>=10.17.0'} - dev: true + colorette@2.0.20: {} - /human-signals@4.3.1: - resolution: {integrity: sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==} - engines: {node: '>=14.18.0'} - dev: true + commander@2.20.3: {} - /iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} + concat-map@0.0.1: {} + + confbox@0.1.7: {} + + consola@3.2.3: {} + + covector@0.12.3(mocha@10.7.3): dependencies: - safer-buffer: 2.1.2 - dev: true + '@clack/prompts': 0.7.0 + '@covector/apply': 0.10.0(mocha@10.7.3) + '@covector/assemble': 0.12.0(mocha@10.7.3) + '@covector/changelog': 0.12.0(mocha@10.7.3) + '@covector/command': 0.8.0(mocha@10.7.3) + '@covector/files': 0.8.0 + effection: 2.0.8(mocha@10.7.3) + globby: 11.1.0 + js-yaml: 4.1.0 + lodash: 4.17.21 + pino: 9.4.0 + pino-abstract-transport: 1.2.0 + strip-ansi: 6.0.1 + yargs: 17.7.2 + transitivePeerDependencies: + - encoding + - mocha + - supports-color - /ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - dev: true + cross-fetch@3.1.5: + dependencies: + node-fetch: 2.6.7 + transitivePeerDependencies: + - encoding - /ignore@5.3.0: - resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==} - engines: {node: '>= 4'} - dev: true + cross-spawn@7.0.3: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 - /import-fresh@3.3.0: - resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} - engines: {node: '>=6'} + css-tree@2.3.1: dependencies: - parent-module: 1.0.1 - resolve-from: 4.0.0 - dev: true + mdn-data: 2.0.30 + source-map-js: 1.2.1 - /imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - dev: true + css-tree@3.0.0: + dependencies: + mdn-data: 2.10.0 + source-map-js: 1.2.1 - /inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + ctrlc-windows@2.1.0: {} + + debug@4.3.7(supports-color@8.1.1): dependencies: - once: 1.4.0 - wrappy: 1.0.2 - dev: true + ms: 2.1.3 + optionalDependencies: + supports-color: 8.1.1 - /inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - dev: true + decamelize@4.0.0: {} - /inquirer@8.2.6: - resolution: {integrity: sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==} - engines: {node: '>=12.0.0'} + deep-is@0.1.4: {} + + deepmerge@4.3.1: {} + + defu@6.1.4: {} + + destr@2.0.3: {} + + diff@5.2.0: {} + + dir-glob@3.0.1: + dependencies: + path-type: 4.0.0 + + duplexer@0.1.2: {} + + effection@2.0.8(mocha@10.7.3): + dependencies: + '@effection/channel': 2.0.6 + '@effection/core': 2.2.3 + '@effection/events': 2.0.6 + '@effection/fetch': 2.0.7(mocha@10.7.3) + '@effection/main': 2.1.2 + '@effection/stream': 2.0.6 + '@effection/subscription': 2.0.6 + transitivePeerDependencies: + - encoding + - mocha + + emoji-regex@8.0.0: {} + + esbuild@0.21.5: + optionalDependencies: + '@esbuild/aix-ppc64': 0.21.5 + '@esbuild/android-arm': 0.21.5 + '@esbuild/android-arm64': 0.21.5 + '@esbuild/android-x64': 0.21.5 + '@esbuild/darwin-arm64': 0.21.5 + '@esbuild/darwin-x64': 0.21.5 + '@esbuild/freebsd-arm64': 0.21.5 + '@esbuild/freebsd-x64': 0.21.5 + '@esbuild/linux-arm': 0.21.5 + '@esbuild/linux-arm64': 0.21.5 + '@esbuild/linux-ia32': 0.21.5 + '@esbuild/linux-loong64': 0.21.5 + '@esbuild/linux-mips64el': 0.21.5 + '@esbuild/linux-ppc64': 0.21.5 + '@esbuild/linux-riscv64': 0.21.5 + '@esbuild/linux-s390x': 0.21.5 + '@esbuild/linux-x64': 0.21.5 + '@esbuild/netbsd-x64': 0.21.5 + '@esbuild/openbsd-x64': 0.21.5 + '@esbuild/sunos-x64': 0.21.5 + '@esbuild/win32-arm64': 0.21.5 + '@esbuild/win32-ia32': 0.21.5 + '@esbuild/win32-x64': 0.21.5 + + esbuild@0.23.1: + optionalDependencies: + '@esbuild/aix-ppc64': 0.23.1 + '@esbuild/android-arm': 0.23.1 + '@esbuild/android-arm64': 0.23.1 + '@esbuild/android-x64': 0.23.1 + '@esbuild/darwin-arm64': 0.23.1 + '@esbuild/darwin-x64': 0.23.1 + '@esbuild/freebsd-arm64': 0.23.1 + '@esbuild/freebsd-x64': 0.23.1 + '@esbuild/linux-arm': 0.23.1 + '@esbuild/linux-arm64': 0.23.1 + '@esbuild/linux-ia32': 0.23.1 + '@esbuild/linux-loong64': 0.23.1 + '@esbuild/linux-mips64el': 0.23.1 + '@esbuild/linux-ppc64': 0.23.1 + '@esbuild/linux-riscv64': 0.23.1 + '@esbuild/linux-s390x': 0.23.1 + '@esbuild/linux-x64': 0.23.1 + '@esbuild/netbsd-x64': 0.23.1 + '@esbuild/openbsd-arm64': 0.23.1 + '@esbuild/openbsd-x64': 0.23.1 + '@esbuild/sunos-x64': 0.23.1 + '@esbuild/win32-arm64': 0.23.1 + '@esbuild/win32-ia32': 0.23.1 + '@esbuild/win32-x64': 0.23.1 + + escalade@3.2.0: {} + + escape-string-regexp@4.0.0: {} + + eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.0.0)): + dependencies: + eslint: 9.13.0(jiti@2.0.0) + + eslint-plugin-security@3.0.1: dependencies: - ansi-escapes: 4.3.2 + safe-regex: 2.1.1 + + eslint-scope@8.1.0: + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + + eslint-visitor-keys@3.4.3: {} + + eslint-visitor-keys@4.1.0: {} + + eslint@9.13.0(jiti@2.0.0): + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.13.0(jiti@2.0.0)) + '@eslint-community/regexpp': 4.11.1 + '@eslint/config-array': 0.18.0 + '@eslint/core': 0.7.0 + '@eslint/eslintrc': 3.1.0 + '@eslint/js': 9.13.0 + '@eslint/plugin-kit': 0.2.0 + '@humanfs/node': 0.16.5 + '@humanwhocodes/module-importer': 1.0.1 + '@humanwhocodes/retry': 0.3.1 + '@types/estree': 1.0.6 + '@types/json-schema': 7.0.15 + ajv: 6.12.6 chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-width: 3.0.0 - external-editor: 3.1.0 - figures: 3.2.0 - lodash: 4.17.21 - mute-stream: 0.0.8 - ora: 5.4.1 - run-async: 2.4.1 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - through: 2.3.8 - wrap-ansi: 6.2.0 - dev: true + cross-spawn: 7.0.3 + debug: 4.3.7(supports-color@8.1.1) + escape-string-regexp: 4.0.0 + eslint-scope: 8.1.0 + eslint-visitor-keys: 4.1.0 + espree: 10.2.0 + esquery: 1.6.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 8.0.0 + find-up: 5.0.0 + glob-parent: 6.0.2 + ignore: 5.3.2 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + json-stable-stringify-without-jsonify: 1.0.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.4 + text-table: 0.2.0 + optionalDependencies: + jiti: 2.0.0 + transitivePeerDependencies: + - supports-color - /internal-ip@8.0.0: - resolution: {integrity: sha512-e6c3zxr9COnnc29PIz9LffmALOt0XhIJdR7f83DyHcQksL3B40KGmU3Sr1lrHja3i7Zyqo+AbwKZ+nZiMvg/OA==} - engines: {node: '>=16'} + espree@10.2.0: dependencies: - cidr-tools: 6.4.2 - default-gateway: 7.2.2 - is-ip: 5.0.0 - p-event: 5.0.1 - dev: true + acorn: 8.12.1 + acorn-jsx: 5.3.2(acorn@8.12.1) + eslint-visitor-keys: 4.1.0 - /internal-slot@1.0.6: - resolution: {integrity: sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg==} - engines: {node: '>= 0.4'} + esquery@1.6.0: + dependencies: + estraverse: 5.3.0 + + esrecurse@4.3.0: + dependencies: + estraverse: 5.3.0 + + estraverse@5.3.0: {} + + estree-walker@2.0.2: {} + + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.6 + + esutils@2.0.3: {} + + event-target-shim@5.0.1: {} + + events@3.3.0: {} + + extend@3.0.2: {} + + fast-deep-equal@3.1.3: {} + + fast-glob@3.3.2: dependencies: - get-intrinsic: 1.2.2 - hasown: 2.0.0 - side-channel: 1.0.4 - dev: true + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.8 - /ip-bigint@7.3.0: - resolution: {integrity: sha512-2qVAe0Q9+Y+5nGvmogwK9y4kefD5Ks5l/IG0Jo1lhU9gIF34jifhqrwXwzkIl+LC594Q6SyAlngs4p890xsXVw==} - engines: {node: '>=16'} - dev: true + fast-json-stable-stringify@2.1.0: {} - /ip-regex@5.0.0: - resolution: {integrity: sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dev: true + fast-levenshtein@2.0.6: {} - /is-alphabetical@1.0.4: - resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==} - dev: true + fast-redact@3.5.0: {} - /is-alphanumerical@1.0.4: - resolution: {integrity: sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==} + fastq@1.17.1: dependencies: - is-alphabetical: 1.0.4 - is-decimal: 1.0.4 - dev: true + reusify: 1.0.4 - /is-array-buffer@3.0.2: - resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} + fault@1.0.4: dependencies: - call-bind: 1.0.5 - get-intrinsic: 1.2.2 - is-typed-array: 1.1.12 - dev: true + format: 0.2.2 - /is-bigint@1.0.4: - resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} - dependencies: - has-bigints: 1.0.2 - dev: true + fdir@6.3.0(picomatch@4.0.2): + optionalDependencies: + picomatch: 4.0.2 - /is-binary-path@2.1.0: - resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} - engines: {node: '>=8'} + file-entry-cache@8.0.0: dependencies: - binary-extensions: 2.2.0 - dev: true + flat-cache: 4.0.1 - /is-boolean-object@1.1.2: - resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} - engines: {node: '>= 0.4'} + fill-range@7.1.1: dependencies: - call-bind: 1.0.5 - has-tostringtag: 1.0.0 - dev: true + to-regex-range: 5.0.1 - /is-buffer@2.0.5: - resolution: {integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==} - engines: {node: '>=4'} - dev: true + find-up@5.0.0: + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 - /is-builtin-module@3.2.1: - resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} - engines: {node: '>=6'} + flat-cache@4.0.1: dependencies: - builtin-modules: 3.3.0 - dev: true + flatted: 3.3.1 + keyv: 4.5.4 - /is-callable@1.2.7: - resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} - engines: {node: '>= 0.4'} - dev: true + flat@5.0.2: {} - /is-core-module@2.13.1: - resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} - dependencies: - hasown: 2.0.0 - dev: true + flatted@3.3.1: {} - /is-date-object@1.0.5: - resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.0 - dev: true + format@0.2.2: {} - /is-decimal@1.0.4: - resolution: {integrity: sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==} - dev: true + fs.realpath@1.0.0: {} - /is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - dev: true + fsevents@2.3.3: + optional: true - /is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - dev: true + function-bind@1.1.2: {} - /is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} + get-caller-file@2.0.5: {} + + get-tsconfig@4.8.1: dependencies: - is-extglob: 2.1.1 - dev: true + resolve-pkg-maps: 1.0.0 - /is-hexadecimal@1.0.4: - resolution: {integrity: sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==} - dev: true + glob-parent@5.1.2: + dependencies: + is-glob: 4.0.3 - /is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - dev: true + glob-parent@6.0.2: + dependencies: + is-glob: 4.0.3 - /is-ip@5.0.0: - resolution: {integrity: sha512-uhmKwcdWJ1nTmBdoBxdHilfJs4qdLBIvVHKRels2+UCZmfcfefuQWziadaYLpN7t/bUrJOjJHv+R1di1q7Q1HQ==} - engines: {node: '>=14.16'} + glob@8.1.0: dependencies: - ip-regex: 5.0.0 - super-regex: 0.2.0 - dev: true + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 5.1.6 + once: 1.4.0 - /is-module@1.0.0: - resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} - dev: true + globals@14.0.0: {} - /is-negative-zero@2.0.2: - resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} - engines: {node: '>= 0.4'} - dev: true + globby@11.1.0: + dependencies: + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.3.2 + ignore: 5.3.2 + merge2: 1.4.1 + slash: 3.0.0 - /is-number-object@1.0.7: - resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} - engines: {node: '>= 0.4'} + graphemer@1.4.0: {} + + gzip-size@6.0.0: dependencies: - has-tostringtag: 1.0.0 - dev: true + duplexer: 0.1.2 - /is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - dev: true + has-flag@4.0.0: {} - /is-path-inside@3.0.3: - resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} - engines: {node: '>=8'} - dev: true + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 - /is-plain-obj@2.1.0: - resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} - engines: {node: '>=8'} - dev: true + he@1.2.0: {} - /is-reference@3.0.2: - resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==} + ieee754@1.2.1: {} + + ignore@5.3.2: {} + + import-fresh@3.3.0: dependencies: - '@types/estree': 1.0.5 + parent-module: 1.0.1 + resolve-from: 4.0.0 - /is-regex@1.1.4: - resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} - engines: {node: '>= 0.4'} + importx@0.5.0: dependencies: - call-bind: 1.0.5 - has-tostringtag: 1.0.0 - dev: true + bundle-require: 5.0.0(esbuild@0.23.1) + debug: 4.3.7(supports-color@8.1.1) + esbuild: 0.23.1 + jiti: 2.0.0 + pathe: 1.1.2 + tsx: 4.19.1 + transitivePeerDependencies: + - supports-color - /is-regexp@3.1.0: - resolution: {integrity: sha512-rbku49cWloU5bSMI+zaRaXdQHXnthP6DZ/vLnfdSKyL4zUzuWnomtOEiZZOd+ioQ+avFo/qau3KPTc7Fjy1uPA==} - engines: {node: '>=12'} - dev: true + imurmurhash@0.1.4: {} - /is-shared-array-buffer@1.0.2: - resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} + inflight@1.0.6: dependencies: - call-bind: 1.0.5 - dev: true + once: 1.4.0 + wrappy: 1.0.2 - /is-stream@2.0.1: - resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} - engines: {node: '>=8'} - dev: true + inherits@2.0.4: {} - /is-stream@3.0.0: - resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dev: true + is-alphabetical@1.0.4: {} - /is-string@1.0.7: - resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} - engines: {node: '>= 0.4'} + is-alphanumerical@1.0.4: dependencies: - has-tostringtag: 1.0.0 - dev: true + is-alphabetical: 1.0.4 + is-decimal: 1.0.4 - /is-symbol@1.0.4: - resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} - engines: {node: '>= 0.4'} + is-binary-path@2.1.0: dependencies: - has-symbols: 1.0.3 - dev: true + binary-extensions: 2.3.0 - /is-typed-array@1.1.12: - resolution: {integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==} - engines: {node: '>= 0.4'} + is-buffer@2.0.5: {} + + is-core-module@2.15.1: dependencies: - which-typed-array: 1.1.13 - dev: true + hasown: 2.0.2 - /is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - dev: true + is-decimal@1.0.4: {} + + is-extglob@2.1.1: {} + + is-fullwidth-code-point@3.0.0: {} - /is-weakref@1.0.2: - resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} + is-glob@4.0.3: dependencies: - call-bind: 1.0.5 - dev: true + is-extglob: 2.1.1 - /isarray@2.0.5: - resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} - dev: true + is-hexadecimal@1.0.4: {} - /isexe@2.0.0: - resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - dev: true + is-module@1.0.0: {} - /jiti@1.20.0: - resolution: {integrity: sha512-3TV69ZbrvV6U5DfQimop50jE9Dl6J8O1ja1dvBbMba/sZ3YBEQqJ2VZRoQPVnhlzjNtU1vaXRZVrVjU4qtm8yA==} - hasBin: true - dev: true + is-number@7.0.0: {} - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true + is-plain-obj@2.1.0: {} - /js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true + is-reference@3.0.2: dependencies: - argparse: 2.0.1 - dev: true - - /jsesc@2.5.2: - resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} - engines: {node: '>=4'} - hasBin: true - dev: true + '@types/estree': 1.0.6 - /json-buffer@3.0.1: - resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - dev: true + is-unicode-supported@0.1.0: {} - /json-schema-traverse@0.4.1: - resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} - dev: true + isexe@2.0.0: {} - /json-stable-stringify-without-jsonify@1.0.1: - resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - dev: true + jiti@2.0.0: {} - /json5@1.0.2: - resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} - hasBin: true + js-yaml@4.1.0: dependencies: - minimist: 1.2.8 - dev: true + argparse: 2.0.1 - /json5@2.2.3: - resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} - engines: {node: '>=6'} - hasBin: true - dev: true + json-buffer@3.0.1: {} - /jsonc-parser@3.2.0: - resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} - dev: true + json-schema-traverse@0.4.1: {} - /keyv@4.5.4: - resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + json-stable-stringify-without-jsonify@1.0.1: {} + + keyv@4.5.4: dependencies: json-buffer: 3.0.1 - dev: true - /kleur@4.1.5: - resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} - engines: {node: '>=6'} - dev: true + kleur@4.1.5: {} - /kolorist@1.8.0: - resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==} - dev: true + kolorist@1.8.0: {} - /levn@0.4.1: - resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} - engines: {node: '>= 0.8.0'} + levn@0.4.1: dependencies: prelude-ls: 1.2.1 type-check: 0.4.0 - dev: true - /local-pkg@0.4.3: - resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} - engines: {node: '>=14'} - dev: true + load-tsconfig@0.2.5: {} - /locate-character@3.0.0: - resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} + local-pkg@0.5.0: + dependencies: + mlly: 1.7.1 + pkg-types: 1.2.0 - /locate-path@6.0.0: - resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} - engines: {node: '>=10'} + locate-character@3.0.0: {} + + locate-path@6.0.0: dependencies: p-locate: 5.0.0 - dev: true - /lodash.merge@4.6.2: - resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - dev: true + lodash.merge@4.6.2: {} - /lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - dev: true + lodash@4.17.21: {} - /log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} + log-symbols@4.1.0: dependencies: chalk: 4.1.2 is-unicode-supported: 0.1.0 - dev: true - - /longest-streak@2.0.4: - resolution: {integrity: sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg==} - dev: true - - /lru-cache@5.1.1: - resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} - dependencies: - yallist: 3.1.1 - dev: true - /lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - dependencies: - yallist: 4.0.0 - dev: true + longest-streak@2.0.4: {} - /magic-string@0.30.5: - resolution: {integrity: sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==} - engines: {node: '>=12'} + magic-string@0.30.11: dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/sourcemap-codec': 1.5.0 - /mdast-util-from-markdown@0.8.5: - resolution: {integrity: sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==} + mdast-util-from-markdown@0.8.5: dependencies: '@types/mdast': 3.0.15 mdast-util-to-string: 2.0.0 @@ -3822,348 +3702,138 @@ packages: unist-util-stringify-position: 2.0.3 transitivePeerDependencies: - supports-color - dev: true - /mdast-util-frontmatter@0.2.0: - resolution: {integrity: sha512-FHKL4w4S5fdt1KjJCwB0178WJ0evnyyQr5kXTM3wrOVpytD0hrkvd+AOOjU9Td8onOejCkmZ+HQRT3CZ3coHHQ==} + mdast-util-frontmatter@0.2.0: dependencies: micromark-extension-frontmatter: 0.2.2 - dev: true - /mdast-util-to-markdown@0.6.5: - resolution: {integrity: sha512-XeV9sDE7ZlOQvs45C9UKMtfTcctcaj/pGwH8YLbMHoMOXNNCn2LsqVQOqrF1+/NU8lKDAqozme9SCXWyo9oAcQ==} + mdast-util-to-markdown@0.6.5: dependencies: - '@types/unist': 2.0.10 + '@types/unist': 2.0.11 longest-streak: 2.0.4 mdast-util-to-string: 2.0.0 parse-entities: 2.0.0 repeat-string: 1.6.1 zwitch: 1.0.5 - dev: true - /mdast-util-to-string@2.0.0: - resolution: {integrity: sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==} - dev: true + mdast-util-to-string@2.0.0: {} - /mdn-data@2.0.30: - resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} + mdn-data@2.0.30: {} - /merge-stream@2.0.0: - resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} - dev: true + mdn-data@2.10.0: {} - /merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - dev: true + merge2@1.4.1: {} - /micromark-extension-frontmatter@0.2.2: - resolution: {integrity: sha512-q6nPLFCMTLtfsctAuS0Xh4vaolxSFUWUWR6PZSrXXiRy+SANGllpcqdXFv2z07l0Xz/6Hl40hK0ffNCJPH2n1A==} + micromark-extension-frontmatter@0.2.2: dependencies: fault: 1.0.4 - dev: true - /micromark@2.11.4: - resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==} + micromark@2.11.4: dependencies: - debug: 4.3.4 + debug: 4.3.7(supports-color@8.1.1) parse-entities: 2.0.0 transitivePeerDependencies: - supports-color - dev: true - /micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} - engines: {node: '>=8.6'} + micromatch@4.0.8: dependencies: - braces: 3.0.2 + braces: 3.0.3 picomatch: 2.3.1 - dev: true - - /mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - dev: true - /mimic-fn@4.0.0: - resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} - engines: {node: '>=12'} - dev: true - - /minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 - dev: true - /minimatch@5.0.1: - resolution: {integrity: sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==} - engines: {node: '>=10'} + minimatch@5.1.6: dependencies: brace-expansion: 2.0.1 - dev: true - /minimatch@9.0.3: - resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} - engines: {node: '>=16 || 14 >=14.17'} + minimatch@9.0.5: dependencies: brace-expansion: 2.0.1 - dev: true - - /minimist@1.2.8: - resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - dev: true - /mlly@1.4.2: - resolution: {integrity: sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==} + mlly@1.7.1: dependencies: - acorn: 8.11.2 - pathe: 1.1.1 - pkg-types: 1.0.3 - ufo: 1.3.1 - dev: true + acorn: 8.12.1 + pathe: 1.1.2 + pkg-types: 1.2.0 + ufo: 1.5.4 - /mocha@10.2.0: - resolution: {integrity: sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==} - engines: {node: '>= 14.0.0'} - hasBin: true + mocha@10.7.3: dependencies: - ansi-colors: 4.1.1 + ansi-colors: 4.1.3 browser-stdout: 1.3.1 - chokidar: 3.5.3 - debug: 4.3.4(supports-color@8.1.1) - diff: 5.0.0 + chokidar: 3.6.0 + debug: 4.3.7(supports-color@8.1.1) + diff: 5.2.0 escape-string-regexp: 4.0.0 find-up: 5.0.0 - glob: 7.2.0 + glob: 8.1.0 he: 1.2.0 js-yaml: 4.1.0 log-symbols: 4.1.0 - minimatch: 5.0.1 + minimatch: 5.1.6 ms: 2.1.3 - nanoid: 3.3.3 - serialize-javascript: 6.0.0 + serialize-javascript: 6.0.2 strip-json-comments: 3.1.1 supports-color: 8.1.1 - workerpool: 6.2.1 + workerpool: 6.5.1 yargs: 16.2.0 - yargs-parser: 20.2.4 + yargs-parser: 20.2.9 yargs-unparser: 2.0.0 - dev: true - /mrmime@1.0.1: - resolution: {integrity: sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==} - engines: {node: '>=10'} - dev: true - - /ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - dev: true - - /ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - dev: true + mrmime@2.0.0: {} - /mute-stream@0.0.8: - resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==} - dev: true + ms@2.1.3: {} - /nanoid@3.3.3: - resolution: {integrity: sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true + nanoid@3.3.7: {} - /natural-compare@1.4.0: - resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - dev: true + natural-compare@1.4.0: {} - /node-fetch-native@1.4.0: - resolution: {integrity: sha512-F5kfEj95kX8tkDhUCYdV8dg3/8Olx/94zB8+ZNthFs6Bz31UpUi8Xh40TN3thLwXgrwXry1pEg9lJ++tLWTcqA==} - dev: true + node-fetch-native@1.6.4: {} - /node-fetch@2.6.7: - resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true + node-fetch@2.6.7: dependencies: whatwg-url: 5.0.0 - dev: true - - /node-releases@2.0.14: - resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} - dev: true - - /normalize-path@3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} - dev: true - - /npm-run-path@4.0.1: - resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} - engines: {node: '>=8'} - dependencies: - path-key: 3.1.1 - dev: true - - /npm-run-path@5.1.0: - resolution: {integrity: sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - path-key: 4.0.0 - dev: true - - /object-inspect@1.13.1: - resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} - dev: true - - /object-keys@1.1.1: - resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} - engines: {node: '>= 0.4'} - dev: true - /object.assign@4.1.5: - resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - has-symbols: 1.0.3 - object-keys: 1.1.1 - dev: true - - /object.fromentries@2.0.7: - resolution: {integrity: sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.3 - dev: true - - /object.groupby@1.0.1: - resolution: {integrity: sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.3 - get-intrinsic: 1.2.2 - dev: true + normalize-path@3.0.0: {} - /object.values@1.1.7: - resolution: {integrity: sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==} - engines: {node: '>= 0.4'} + ofetch@1.4.0: dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.3 - dev: true + destr: 2.0.3 + node-fetch-native: 1.6.4 + ufo: 1.5.4 - /ofetch@1.3.3: - resolution: {integrity: sha512-s1ZCMmQWXy4b5K/TW9i/DtiN8Ku+xCiHcjQ6/J/nDdssirrQNOoB165Zu8EqLMA2lln1JUth9a0aW9Ap2ctrUg==} - dependencies: - destr: 2.0.1 - node-fetch-native: 1.4.0 - ufo: 1.3.1 - dev: true + on-exit-leak-free@2.1.2: {} - /once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + once@1.4.0: dependencies: wrappy: 1.0.2 - dev: true - - /onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - dependencies: - mimic-fn: 2.1.0 - dev: true - - /onetime@6.0.0: - resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} - engines: {node: '>=12'} - dependencies: - mimic-fn: 4.0.0 - dev: true - /optionator@0.9.3: - resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} - engines: {node: '>= 0.8.0'} + optionator@0.9.4: dependencies: - '@aashutoshrathi/word-wrap': 1.2.6 deep-is: 0.1.4 fast-levenshtein: 2.0.6 levn: 0.4.1 prelude-ls: 1.2.1 type-check: 0.4.0 - dev: true - - /ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - dev: true + word-wrap: 1.2.5 - /os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - dev: true - - /p-event@5.0.1: - resolution: {integrity: sha512-dd589iCQ7m1L0bmC5NLlVYfy3TbBEsMUfWx9PyAgPeIcFZ/E2yaTZ4Rz4MiBmmJShviiftHVXOqfnfzJ6kyMrQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - p-timeout: 5.1.0 - dev: true - - /p-limit@3.1.0: - resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} - engines: {node: '>=10'} + p-limit@3.1.0: dependencies: yocto-queue: 0.1.0 - dev: true - /p-locate@5.0.0: - resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} - engines: {node: '>=10'} + p-locate@5.0.0: dependencies: p-limit: 3.1.0 - dev: true - /p-timeout@5.1.0: - resolution: {integrity: sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==} - engines: {node: '>=12'} - dev: true + package-manager-detector@0.2.0: {} - /parent-module@1.0.1: - resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} - engines: {node: '>=6'} + parent-module@1.0.1: dependencies: callsites: 3.1.0 - dev: true - /parse-entities@2.0.0: - resolution: {integrity: sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==} + parse-entities@2.0.0: dependencies: character-entities: 1.2.4 character-entities-legacy: 1.1.4 @@ -4171,999 +3841,458 @@ packages: is-alphanumerical: 1.0.4 is-decimal: 1.0.4 is-hexadecimal: 1.0.4 - dev: true - - /path-exists@4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} - dev: true - /path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - dev: true - - /path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} - dev: true + path-exists@4.0.0: {} - /path-key@4.0.0: - resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} - engines: {node: '>=12'} - dev: true + path-key@3.1.1: {} - /path-parse@1.0.7: - resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - dev: true + path-parse@1.0.7: {} - /path-type@4.0.0: - resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} - engines: {node: '>=8'} - dev: true + path-type@4.0.0: {} - /pathe@1.1.1: - resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==} - dev: true + pathe@1.1.2: {} - /perfect-debounce@1.0.0: - resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} - dev: true + perfect-debounce@1.0.0: {} - /periscopic@3.1.0: - resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} + periscopic@3.1.0: dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 estree-walker: 3.0.3 is-reference: 3.0.2 - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true + picocolors@1.1.0: {} - /picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - dev: true + picomatch@2.3.1: {} + + picomatch@4.0.2: {} - /pkg-types@1.0.3: - resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} + pino-abstract-transport@1.2.0: dependencies: - jsonc-parser: 3.2.0 - mlly: 1.4.2 - pathe: 1.1.1 - dev: true + readable-stream: 4.5.2 + split2: 4.2.0 - /postcss@8.4.32: - resolution: {integrity: sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==} - engines: {node: ^10 || ^12 || >=14} + pino-std-serializers@7.0.0: {} + + pino@9.4.0: + dependencies: + atomic-sleep: 1.0.0 + fast-redact: 3.5.0 + on-exit-leak-free: 2.1.2 + pino-abstract-transport: 1.2.0 + pino-std-serializers: 7.0.0 + process-warning: 4.0.0 + quick-format-unescaped: 4.0.4 + real-require: 0.2.0 + safe-stable-stringify: 2.5.0 + sonic-boom: 4.1.0 + thread-stream: 3.1.0 + + pkg-types@1.2.0: + dependencies: + confbox: 0.1.7 + mlly: 1.7.1 + pathe: 1.1.2 + + postcss@8.4.47: dependencies: nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true + picocolors: 1.1.0 + source-map-js: 1.2.1 - /prelude-ls@1.2.1: - resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} - engines: {node: '>= 0.8.0'} - dev: true + prelude-ls@1.2.1: {} - /prettier@3.2.2: - resolution: {integrity: sha512-HTByuKZzw7utPiDO523Tt2pLtEyK7OibUD9suEJQrPUCYQqrHr74GGX6VidMrovbf/I50mPqr8j/II6oBAuc5A==} - engines: {node: '>=14'} - hasBin: true - dev: true + prettier@3.3.3: {} - /punycode@2.3.1: - resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} - engines: {node: '>=6'} - dev: true + process-warning@4.0.0: {} - /queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - dev: true + process@0.11.10: {} - /randombytes@2.1.0: - resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} + punycode@2.3.1: {} + + queue-microtask@1.2.3: {} + + quick-format-unescaped@4.0.4: {} + + randombytes@2.1.0: dependencies: safe-buffer: 5.2.1 - dev: true - /readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} + readable-stream@4.5.2: dependencies: - inherits: 2.0.4 + abort-controller: 3.0.0 + buffer: 6.0.3 + events: 3.3.0 + process: 0.11.10 string_decoder: 1.3.0 - util-deprecate: 1.0.2 - dev: true - /readdirp@3.6.0: - resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} - engines: {node: '>=8.10.0'} + readdirp@3.6.0: dependencies: picomatch: 2.3.1 - dev: true - /regexp-tree@0.1.27: - resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} - hasBin: true - dev: true + real-require@0.2.0: {} - /regexp.prototype.flags@1.5.1: - resolution: {integrity: sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - set-function-name: 2.0.1 - dev: true + regexp-tree@0.1.27: {} - /remark-frontmatter@3.0.0: - resolution: {integrity: sha512-mSuDd3svCHs+2PyO29h7iijIZx4plX0fheacJcAoYAASfgzgVIcXGYSq9GFyYocFLftQs8IOmmkgtOovs6d4oA==} + remark-frontmatter@3.0.0: dependencies: mdast-util-frontmatter: 0.2.0 micromark-extension-frontmatter: 0.2.2 - dev: true - /remark-parse@9.0.0: - resolution: {integrity: sha512-geKatMwSzEXKHuzBNU1z676sGcDcFoChMK38TgdHJNAYfFtsfHDQG7MoJAjs6sgYMqyLduCYWDIWZIxiPeafEw==} + remark-parse@9.0.0: dependencies: mdast-util-from-markdown: 0.8.5 transitivePeerDependencies: - supports-color - dev: true - /remark-stringify@9.0.1: - resolution: {integrity: sha512-mWmNg3ZtESvZS8fv5PTvaPckdL4iNlCHTt8/e/8oN08nArHRHjNZMKzA/YW3+p7/lYqIw4nx1XsjCBo/AxNChg==} + remark-stringify@9.0.1: dependencies: mdast-util-to-markdown: 0.6.5 - dev: true - /repeat-string@1.6.1: - resolution: {integrity: sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==} - engines: {node: '>=0.10'} - dev: true + repeat-string@1.6.1: {} - /require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - dev: true + require-directory@2.1.1: {} - /resolve-from@4.0.0: - resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} - engines: {node: '>=4'} - dev: true + resolve-from@4.0.0: {} - /resolve-pkg-maps@1.0.0: - resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - dev: true + resolve-pkg-maps@1.0.0: {} - /resolve@1.22.8: - resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} - hasBin: true + resolve@1.22.8: dependencies: - is-core-module: 2.13.1 + is-core-module: 2.15.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - dev: true - - /restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - dev: true - - /reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - dev: true - - /rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - hasBin: true - dependencies: - glob: 7.2.3 - dev: true - /rollup@4.6.1: - resolution: {integrity: sha512-jZHaZotEHQaHLgKr8JnQiDT1rmatjgKlMekyksz+yk9jt/8z9quNjnKNRoaM0wd9DC2QKXjmWWuDYtM3jfF8pQ==} - engines: {node: '>=18.0.0', npm: '>=8.0.0'} - hasBin: true - optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.6.1 - '@rollup/rollup-android-arm64': 4.6.1 - '@rollup/rollup-darwin-arm64': 4.6.1 - '@rollup/rollup-darwin-x64': 4.6.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.6.1 - '@rollup/rollup-linux-arm64-gnu': 4.6.1 - '@rollup/rollup-linux-arm64-musl': 4.6.1 - '@rollup/rollup-linux-x64-gnu': 4.6.1 - '@rollup/rollup-linux-x64-musl': 4.6.1 - '@rollup/rollup-win32-arm64-msvc': 4.6.1 - '@rollup/rollup-win32-ia32-msvc': 4.6.1 - '@rollup/rollup-win32-x64-msvc': 4.6.1 - fsevents: 2.3.3 - dev: true + reusify@1.0.4: {} - /rollup@4.9.6: - resolution: {integrity: sha512-05lzkCS2uASX0CiLFybYfVkwNbKZG5NFQ6Go0VWyogFTXXbR039UVsegViTntkk4OglHBdF54ccApXRRuXRbsg==} - engines: {node: '>=18.0.0', npm: '>=8.0.0'} - hasBin: true + rollup@4.22.4: dependencies: '@types/estree': 1.0.5 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.9.6 - '@rollup/rollup-android-arm64': 4.9.6 - '@rollup/rollup-darwin-arm64': 4.9.6 - '@rollup/rollup-darwin-x64': 4.9.6 - '@rollup/rollup-linux-arm-gnueabihf': 4.9.6 - '@rollup/rollup-linux-arm64-gnu': 4.9.6 - '@rollup/rollup-linux-arm64-musl': 4.9.6 - '@rollup/rollup-linux-riscv64-gnu': 4.9.6 - '@rollup/rollup-linux-x64-gnu': 4.9.6 - '@rollup/rollup-linux-x64-musl': 4.9.6 - '@rollup/rollup-win32-arm64-msvc': 4.9.6 - '@rollup/rollup-win32-ia32-msvc': 4.9.6 - '@rollup/rollup-win32-x64-msvc': 4.9.6 + '@rollup/rollup-android-arm-eabi': 4.22.4 + '@rollup/rollup-android-arm64': 4.22.4 + '@rollup/rollup-darwin-arm64': 4.22.4 + '@rollup/rollup-darwin-x64': 4.22.4 + '@rollup/rollup-linux-arm-gnueabihf': 4.22.4 + '@rollup/rollup-linux-arm-musleabihf': 4.22.4 + '@rollup/rollup-linux-arm64-gnu': 4.22.4 + '@rollup/rollup-linux-arm64-musl': 4.22.4 + '@rollup/rollup-linux-powerpc64le-gnu': 4.22.4 + '@rollup/rollup-linux-riscv64-gnu': 4.22.4 + '@rollup/rollup-linux-s390x-gnu': 4.22.4 + '@rollup/rollup-linux-x64-gnu': 4.22.4 + '@rollup/rollup-linux-x64-musl': 4.22.4 + '@rollup/rollup-win32-arm64-msvc': 4.22.4 + '@rollup/rollup-win32-ia32-msvc': 4.22.4 + '@rollup/rollup-win32-x64-msvc': 4.22.4 fsevents: 2.3.3 - dev: true - - /run-async@2.4.1: - resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} - engines: {node: '>=0.12.0'} - dev: true - /run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + run-parallel@1.2.0: dependencies: queue-microtask: 1.2.3 - dev: true - - /rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - dependencies: - tslib: 2.6.0 - dev: true - - /safe-array-concat@1.0.1: - resolution: {integrity: sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==} - engines: {node: '>=0.4'} - dependencies: - call-bind: 1.0.5 - get-intrinsic: 1.2.2 - has-symbols: 1.0.3 - isarray: 2.0.5 - dev: true - - /safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - dev: true - /safe-regex-test@1.0.0: - resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} - dependencies: - call-bind: 1.0.5 - get-intrinsic: 1.2.2 - is-regex: 1.1.4 - dev: true + safe-buffer@5.2.1: {} - /safe-regex@2.1.1: - resolution: {integrity: sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==} + safe-regex@2.1.1: dependencies: regexp-tree: 0.1.27 - dev: true - - /safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - dev: true - /semver@7.5.4: - resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} - engines: {node: '>=10'} - hasBin: true - dependencies: - lru-cache: 6.0.0 - dev: true + safe-stable-stringify@2.5.0: {} - /serialize-javascript@6.0.0: - resolution: {integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==} - dependencies: - randombytes: 2.1.0 - dev: true + semver@7.6.3: {} - /serialize-javascript@6.0.1: - resolution: {integrity: sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==} + serialize-javascript@6.0.2: dependencies: randombytes: 2.1.0 - dev: true - - /set-function-length@1.1.1: - resolution: {integrity: sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==} - engines: {node: '>= 0.4'} - dependencies: - define-data-property: 1.1.1 - get-intrinsic: 1.2.2 - gopd: 1.0.1 - has-property-descriptors: 1.0.1 - dev: true - - /set-function-name@2.0.1: - resolution: {integrity: sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==} - engines: {node: '>= 0.4'} - dependencies: - define-data-property: 1.1.1 - functions-have-names: 1.2.3 - has-property-descriptors: 1.0.1 - dev: true - /shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} + shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 - dev: true - /shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} - dev: true + shebang-regex@3.0.0: {} - /shellwords@0.1.1: - resolution: {integrity: sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==} - dev: true + shellwords@0.1.1: {} - /side-channel@1.0.4: - resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} + sirv@2.0.4: dependencies: - call-bind: 1.0.5 - get-intrinsic: 1.2.2 - object-inspect: 1.13.1 - dev: true + '@polka/url': 1.0.0-next.28 + mrmime: 2.0.0 + totalist: 3.0.1 - /signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - dev: true + sisteransi@1.0.5: {} - /sirv@2.0.3: - resolution: {integrity: sha512-O9jm9BsID1P+0HOi81VpXPoDxYP374pkOLzACAoyUQ/3OUVndNpsz6wMnY2z+yOxzbllCKZrM+9QrWsv4THnyA==} - engines: {node: '>= 10'} - dependencies: - '@polka/url': 1.0.0-next.21 - mrmime: 1.0.1 - totalist: 3.0.1 - dev: true + slash@3.0.0: {} - /slash@3.0.0: - resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} - engines: {node: '>=8'} - dev: true + smob@1.5.0: {} - /smob@1.4.1: - resolution: {integrity: sha512-9LK+E7Hv5R9u4g4C3p+jjLstaLe11MDsL21UpYaCNmapvMkYhqCV4A/f/3gyH8QjMyh6l68q9xC85vihY9ahMQ==} - dev: true + sonic-boom@4.1.0: + dependencies: + atomic-sleep: 1.0.0 - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} + source-map-js@1.2.1: {} - /source-map-support@0.5.21: - resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} + source-map-support@0.5.21: dependencies: buffer-from: 1.1.2 source-map: 0.6.1 - dev: true - /source-map@0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} - engines: {node: '>=0.10.0'} - dev: true + source-map@0.6.1: {} - /stacktrace-parser@0.1.10: - resolution: {integrity: sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==} - engines: {node: '>=6'} + split2@4.2.0: {} + + stacktrace-parser@0.1.10: dependencies: type-fest: 0.7.1 - dev: true - /string-natural-compare@3.0.1: - resolution: {integrity: sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==} - dev: true - - /string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 - dev: true - - /string.prototype.trim@1.2.8: - resolution: {integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.3 - dev: true - - /string.prototype.trimend@1.0.7: - resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.3 - dev: true - /string.prototype.trimstart@1.0.7: - resolution: {integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.3 - dev: true - - /string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + string_decoder@1.3.0: dependencies: safe-buffer: 5.2.1 - dev: true - /strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} + strip-ansi@6.0.1: dependencies: ansi-regex: 5.0.1 - dev: true - - /strip-bom@3.0.0: - resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} - engines: {node: '>=4'} - dev: true - - /strip-final-newline@2.0.0: - resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} - engines: {node: '>=6'} - dev: true - - /strip-final-newline@3.0.0: - resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} - engines: {node: '>=12'} - dev: true - - /strip-json-comments@3.1.1: - resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} - engines: {node: '>=8'} - dev: true - - /super-regex@0.2.0: - resolution: {integrity: sha512-WZzIx3rC1CvbMDloLsVw0lkZVKJWbrkJ0k1ghKFmcnPrW1+jWbgTkTEWVtD9lMdmI4jZEz40+naBxl1dCUhXXw==} - engines: {node: '>=14.16'} - dependencies: - clone-regexp: 3.0.0 - function-timeout: 0.1.1 - time-span: 5.1.0 - dev: true - /supports-color@5.5.0: - resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} - engines: {node: '>=4'} - dependencies: - has-flag: 3.0.0 - dev: true + strip-json-comments@3.1.1: {} - /supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} + supports-color@7.2.0: dependencies: has-flag: 4.0.0 - dev: true - /supports-color@8.1.1: - resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} - engines: {node: '>=10'} + supports-color@8.1.1: dependencies: has-flag: 4.0.0 - dev: true - /supports-preserve-symlinks-flag@1.0.0: - resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} - engines: {node: '>= 0.4'} - dev: true + supports-preserve-symlinks-flag@1.0.0: {} - /svelte-hmr@0.15.3(svelte@4.2.8): - resolution: {integrity: sha512-41snaPswvSf8TJUhlkoJBekRrABDXDMdpNpT2tfHIv4JuhgvHqLMhEPGtaQn0BmbNSTkuz2Ed20DF2eHw0SmBQ==} - engines: {node: ^12.20 || ^14.13.1 || >= 16} - peerDependencies: - svelte: ^3.19.0 || ^4.0.0 + svelte-hmr@0.16.0(svelte@4.2.19): dependencies: - svelte: 4.2.8 - dev: true + svelte: 4.2.19 - /svelte@4.2.8: - resolution: {integrity: sha512-hU6dh1MPl8gh6klQZwK/n73GiAHiR95IkFsesLPbMeEZi36ydaXL/ZAb4g9sayT0MXzpxyZjR28yderJHxcmYA==} - engines: {node: '>=16'} + svelte@4.2.19: dependencies: - '@ampproject/remapping': 2.2.1 - '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.20 - acorn: 8.11.2 - aria-query: 5.3.0 - axobject-query: 3.2.1 + '@ampproject/remapping': 2.3.0 + '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/trace-mapping': 0.3.25 + '@types/estree': 1.0.6 + acorn: 8.12.1 + aria-query: 5.3.2 + axobject-query: 4.1.0 code-red: 1.0.4 css-tree: 2.3.1 estree-walker: 3.0.3 is-reference: 3.0.2 locate-character: 3.0.0 - magic-string: 0.30.5 + magic-string: 0.30.11 periscopic: 3.1.0 - /terser@5.25.0: - resolution: {integrity: sha512-we0I9SIsfvNUMP77zC9HG+MylwYYsGFSBG8qm+13oud2Yh+O104y614FRbyjpxys16jZwot72Fpi827YvGzuqg==} - engines: {node: '>=10'} - hasBin: true + terser@5.34.1: dependencies: - '@jridgewell/source-map': 0.3.5 - acorn: 8.11.2 + '@jridgewell/source-map': 0.3.6 + acorn: 8.12.1 commander: 2.20.3 source-map-support: 0.5.21 - dev: true - - /text-table@0.2.0: - resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - dev: true - /through@2.3.8: - resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} - dev: true + text-table@0.2.0: {} - /time-span@5.1.0: - resolution: {integrity: sha512-75voc/9G4rDIJleOo4jPvN4/YC4GRZrY8yy1uU4lwrB3XEQbWve8zXoO5No4eFrGcTAMYyoY67p8jRQdtA1HbA==} - engines: {node: '>=12'} + thread-stream@3.1.0: dependencies: - convert-hrtime: 5.0.0 - dev: true + real-require: 0.2.0 - /tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - dependencies: - os-tmpdir: 1.0.2 - dev: true + tinyexec@0.3.0: {} - /to-fast-properties@2.0.0: - resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} - engines: {node: '>=4'} - dev: true + tinyglobby@0.2.6: + dependencies: + fdir: 6.3.0(picomatch@4.0.2) + picomatch: 4.0.2 - /to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} + to-regex-range@5.0.1: dependencies: is-number: 7.0.0 - dev: true - - /totalist@3.0.1: - resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} - engines: {node: '>=6'} - dev: true - - /tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - dev: true - - /trough@1.0.5: - resolution: {integrity: sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==} - dev: true - /ts-api-utils@1.0.3(typescript@5.3.3): - resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} - engines: {node: '>=16.13.0'} - peerDependencies: - typescript: '>=4.2.0' - dependencies: - typescript: 5.3.3 - dev: true + totalist@3.0.1: {} - /tsconfig-paths@3.15.0: - resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} - dependencies: - '@types/json5': 0.0.29 - json5: 1.0.2 - minimist: 1.2.8 - strip-bom: 3.0.0 - dev: true + tr46@0.0.3: {} - /tslib@2.6.0: - resolution: {integrity: sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==} - dev: true + trough@1.0.5: {} - /type-check@0.4.0: - resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} - engines: {node: '>= 0.8.0'} + ts-api-utils@1.3.0(typescript@5.6.3): dependencies: - prelude-ls: 1.2.1 - dev: true + typescript: 5.6.3 - /type-fest@0.20.2: - resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} - engines: {node: '>=10'} - dev: true - - /type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - dev: true - - /type-fest@0.7.1: - resolution: {integrity: sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==} - engines: {node: '>=8'} - dev: true + tslib@2.7.0: {} - /typed-array-buffer@1.0.0: - resolution: {integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==} - engines: {node: '>= 0.4'} + tsx@4.19.1: dependencies: - call-bind: 1.0.5 - get-intrinsic: 1.2.2 - is-typed-array: 1.1.12 - dev: true + esbuild: 0.23.1 + get-tsconfig: 4.8.1 + optionalDependencies: + fsevents: 2.3.3 - /typed-array-byte-length@1.0.0: - resolution: {integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==} - engines: {node: '>= 0.4'} + type-check@0.4.0: dependencies: - call-bind: 1.0.5 - for-each: 0.3.3 - has-proto: 1.0.1 - is-typed-array: 1.1.12 - dev: true + prelude-ls: 1.2.1 - /typed-array-byte-offset@1.0.0: - resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.5 - call-bind: 1.0.5 - for-each: 0.3.3 - has-proto: 1.0.1 - is-typed-array: 1.1.12 - dev: true + type-fest@0.7.1: {} - /typed-array-length@1.0.4: - resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} + typescript-eslint@8.10.0(eslint@9.13.0(jiti@2.0.0))(typescript@5.6.3): dependencies: - call-bind: 1.0.5 - for-each: 0.3.3 - is-typed-array: 1.1.12 - dev: true - - /typescript@5.3.2: - resolution: {integrity: sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==} - engines: {node: '>=14.17'} - hasBin: true - dev: true - - /typescript@5.3.3: - resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} - engines: {node: '>=14.17'} - hasBin: true - dev: true + '@typescript-eslint/eslint-plugin': 8.10.0(@typescript-eslint/parser@8.10.0(eslint@9.13.0(jiti@2.0.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.0.0))(typescript@5.6.3) + '@typescript-eslint/parser': 8.10.0(eslint@9.13.0(jiti@2.0.0))(typescript@5.6.3) + '@typescript-eslint/utils': 8.10.0(eslint@9.13.0(jiti@2.0.0))(typescript@5.6.3) + optionalDependencies: + typescript: 5.6.3 + transitivePeerDependencies: + - eslint + - supports-color - /ufo@1.3.1: - resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} - dev: true + typescript@5.6.3: {} - /unbox-primitive@1.0.2: - resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} - dependencies: - call-bind: 1.0.5 - has-bigints: 1.0.2 - has-symbols: 1.0.3 - which-boxed-primitive: 1.0.2 - dev: true + ufo@1.5.4: {} - /unconfig@0.3.11: - resolution: {integrity: sha512-bV/nqePAKv71v3HdVUn6UefbsDKQWRX+bJIkiSm0+twIds6WiD2bJLWWT3i214+J/B4edufZpG2w7Y63Vbwxow==} + unconfig@0.6.0: dependencies: - '@antfu/utils': 0.7.6 - defu: 6.1.2 - jiti: 1.20.0 - mlly: 1.4.2 - dev: true + '@antfu/utils': 0.7.10 + defu: 6.1.4 + importx: 0.5.0 + transitivePeerDependencies: + - supports-color - /unified@9.2.2: - resolution: {integrity: sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ==} + unified@9.2.2: dependencies: - '@types/unist': 2.0.10 + '@types/unist': 2.0.11 bail: 1.0.5 extend: 3.0.2 is-buffer: 2.0.5 is-plain-obj: 2.1.0 trough: 1.0.5 vfile: 4.2.1 - dev: true - - /unist-util-stringify-position@2.0.3: - resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} - dependencies: - '@types/unist': 2.0.10 - dev: true - /unocss@0.58.0(postcss@8.4.32)(vite@5.0.12): - resolution: {integrity: sha512-MSPRHxBqWN+1AHGV+J5uUy4//e6ZBK6O+ISzD0qrXcCD/GNtxk1+lYjOK2ltkUiKX539+/KF91vNxzhhwEf+xA==} - engines: {node: '>=14'} - peerDependencies: - '@unocss/webpack': 0.58.0 - vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 - peerDependenciesMeta: - '@unocss/webpack': - optional: true - vite: - optional: true - dependencies: - '@unocss/astro': 0.58.0(vite@5.0.12) - '@unocss/cli': 0.58.0 - '@unocss/core': 0.58.0 - '@unocss/extractor-arbitrary-variants': 0.58.0 - '@unocss/postcss': 0.58.0(postcss@8.4.32) - '@unocss/preset-attributify': 0.58.0 - '@unocss/preset-icons': 0.58.0 - '@unocss/preset-mini': 0.58.0 - '@unocss/preset-tagify': 0.58.0 - '@unocss/preset-typography': 0.58.0 - '@unocss/preset-uno': 0.58.0 - '@unocss/preset-web-fonts': 0.58.0 - '@unocss/preset-wind': 0.58.0 - '@unocss/reset': 0.58.0 - '@unocss/transformer-attributify-jsx': 0.58.0 - '@unocss/transformer-attributify-jsx-babel': 0.58.0 - '@unocss/transformer-compile-class': 0.58.0 - '@unocss/transformer-directives': 0.58.0 - '@unocss/transformer-variant-group': 0.58.0 - '@unocss/vite': 0.58.0(vite@5.0.12) - vite: 5.0.12 + unist-util-stringify-position@2.0.3: + dependencies: + '@types/unist': 2.0.11 + + unocss@0.63.1(postcss@8.4.47)(rollup@4.22.4)(vite@5.4.8(terser@5.34.1)): + dependencies: + '@unocss/astro': 0.63.1(rollup@4.22.4)(vite@5.4.8(terser@5.34.1)) + '@unocss/cli': 0.63.1(rollup@4.22.4) + '@unocss/core': 0.63.1 + '@unocss/postcss': 0.63.1(postcss@8.4.47) + '@unocss/preset-attributify': 0.63.1 + '@unocss/preset-icons': 0.63.1 + '@unocss/preset-mini': 0.63.1 + '@unocss/preset-tagify': 0.63.1 + '@unocss/preset-typography': 0.63.1 + '@unocss/preset-uno': 0.63.1 + '@unocss/preset-web-fonts': 0.63.1 + '@unocss/preset-wind': 0.63.1 + '@unocss/transformer-attributify-jsx': 0.63.1 + '@unocss/transformer-compile-class': 0.63.1 + '@unocss/transformer-directives': 0.63.1 + '@unocss/transformer-variant-group': 0.63.1 + '@unocss/vite': 0.63.1(rollup@4.22.4)(vite@5.4.8(terser@5.34.1)) + optionalDependencies: + vite: 5.4.8(terser@5.34.1) transitivePeerDependencies: - postcss - rollup - supports-color - dev: true - - /update-browserslist-db@1.0.13(browserslist@4.22.2): - resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - dependencies: - browserslist: 4.22.2 - escalade: 3.1.1 - picocolors: 1.0.0 - dev: true - /uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + uri-js@4.4.1: dependencies: punycode: 2.3.1 - dev: true - /util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - dev: true - - /vfile-message@2.0.4: - resolution: {integrity: sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==} + vfile-message@2.0.4: dependencies: - '@types/unist': 2.0.10 + '@types/unist': 2.0.11 unist-util-stringify-position: 2.0.3 - dev: true - /vfile@4.2.1: - resolution: {integrity: sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA==} + vfile@4.2.1: dependencies: - '@types/unist': 2.0.10 + '@types/unist': 2.0.11 is-buffer: 2.0.5 unist-util-stringify-position: 2.0.3 vfile-message: 2.0.4 - dev: true - /vite@5.0.12: - resolution: {integrity: sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@types/node': ^18.0.0 || >=20.0.0 - less: '*' - lightningcss: ^1.21.0 - sass: '*' - stylus: '*' - sugarss: '*' - terser: ^5.4.0 - peerDependenciesMeta: - '@types/node': - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true + vite@5.4.8(terser@5.34.1): dependencies: - esbuild: 0.19.8 - postcss: 8.4.32 - rollup: 4.6.1 + esbuild: 0.21.5 + postcss: 8.4.47 + rollup: 4.22.4 optionalDependencies: fsevents: 2.3.3 - dev: true + terser: 5.34.1 - /vitefu@0.2.5(vite@5.0.12): - resolution: {integrity: sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==} - peerDependencies: - vite: ^3.0.0 || ^4.0.0 || ^5.0.0 - peerDependenciesMeta: - vite: - optional: true - dependencies: - vite: 5.0.12 - dev: true - - /wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - dependencies: - defaults: 1.0.4 - dev: true + vitefu@0.2.5(vite@5.4.8(terser@5.34.1)): + optionalDependencies: + vite: 5.4.8(terser@5.34.1) - /webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - dev: true + webidl-conversions@3.0.1: {} - /whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + whatwg-url@5.0.0: dependencies: tr46: 0.0.3 webidl-conversions: 3.0.1 - dev: true - - /which-boxed-primitive@1.0.2: - resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} - dependencies: - is-bigint: 1.0.4 - is-boolean-object: 1.1.2 - is-number-object: 1.0.7 - is-string: 1.0.7 - is-symbol: 1.0.4 - dev: true - - /which-typed-array@1.1.13: - resolution: {integrity: sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.5 - call-bind: 1.0.5 - for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.0 - dev: true - /which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} - hasBin: true + which@2.0.2: dependencies: isexe: 2.0.0 - dev: true - /workerpool@6.2.1: - resolution: {integrity: sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==} - dev: true + word-wrap@1.2.5: {} - /wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - dev: true + workerpool@6.5.1: {} - /wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} + wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 - dev: true - - /wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - dev: true - - /y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - dev: true - /yallist@3.1.1: - resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} - dev: true + wrappy@1.0.2: {} - /yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - dev: true + y18n@5.0.8: {} - /yargs-parser@20.2.4: - resolution: {integrity: sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==} - engines: {node: '>=10'} - dev: true + yargs-parser@20.2.9: {} - /yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - dev: true + yargs-parser@21.1.1: {} - /yargs-unparser@2.0.0: - resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==} - engines: {node: '>=10'} + yargs-unparser@2.0.0: dependencies: camelcase: 6.3.0 decamelize: 4.0.0 flat: 5.0.2 is-plain-obj: 2.1.0 - dev: true - /yargs@16.2.0: - resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} - engines: {node: '>=10'} + yargs@16.2.0: dependencies: cliui: 7.0.4 - escalade: 3.1.1 + escalade: 3.2.0 get-caller-file: 2.0.5 require-directory: 2.1.1 string-width: 4.2.3 y18n: 5.0.8 - yargs-parser: 20.2.4 - dev: true + yargs-parser: 20.2.9 - /yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} + yargs@17.7.2: dependencies: cliui: 8.0.1 - escalade: 3.1.1 + escalade: 3.2.0 get-caller-file: 2.0.5 require-directory: 2.1.1 string-width: 4.2.3 y18n: 5.0.8 yargs-parser: 21.1.1 - dev: true - /yocto-queue@0.1.0: - resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} - engines: {node: '>=10'} - dev: true + yocto-queue@0.1.0: {} - /zod-validation-error@1.5.0(zod@3.22.4): - resolution: {integrity: sha512-/7eFkAI4qV0tcxMBB/3+d2c1P6jzzZYdYSlBuAklzMuCrJu5bzJfHS0yVAS87dRHVlhftd6RFJDIvv03JgkSbw==} - engines: {node: '>=16.0.0'} - peerDependencies: - zod: ^3.18.0 + zod-validation-error@1.5.0(zod@3.23.8): dependencies: - zod: 3.22.4 - dev: true + zod: 3.23.8 - /zod@3.22.4: - resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} - dev: true + zod@3.23.8: {} - /zwitch@1.0.5: - resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} - dev: true + zwitch@1.0.5: {} diff --git a/renovate.json b/renovate.json index 43f4e81a..e67495c3 100644 --- a/renovate.json +++ b/renovate.json @@ -1,7 +1,9 @@ { "extends": ["config:base"], + "baseBranches": ["v2", "v1"], "enabledManagers": ["cargo", "npm"], "semanticCommitType": "chore", + "labels": ["dependencies"], "ignorePaths": [ "**/node_modules/**", "**/bower_components/**", @@ -9,14 +11,25 @@ "**/__tests__/**", "**/test/**", "**/tests/**", - "**/__fixtures__/**" + "**/__fixtures__/**", + "shared/**" ], + "lockFileMaintenance": { + "enabled": true + }, + "rangeStrategy": "replace", "packageRules": [ { "description": "Disable node/pnpm version updates", "matchPackageNames": ["node", "pnpm"], "matchDepTypes": ["engines", "packageManager"], "enabled": false + }, + { + "description": "Disable lock file maintenance for v1", + "matchBaseBranches": ["v1"], + "matchUpdateTypes": ["lockFileMaintenance"], + "enabled": false } ], "postUpdateOptions": ["pnpmDedupe"] diff --git a/shared/rollup.config.js b/shared/rollup.config.js index c44e7fd1..09bfb889 100644 --- a/shared/rollup.config.js +++ b/shared/rollup.config.js @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { readFileSync } from "fs"; -import { join } from "path"; -import { cwd } from "process"; -import { nodeResolve } from "@rollup/plugin-node-resolve"; -import typescript from "@rollup/plugin-typescript"; -import terser from "@rollup/plugin-terser"; +import { readFileSync } from 'fs' +import { join } from 'path' +import { cwd } from 'process' +import { nodeResolve } from '@rollup/plugin-node-resolve' +import typescript from '@rollup/plugin-typescript' +import terser from '@rollup/plugin-terser' /** * Create a base rollup config @@ -21,18 +21,21 @@ import terser from "@rollup/plugin-terser"; */ export function createConfig(options = {}) { const { - input = "guest-js/index.ts", + input = 'guest-js/index.ts', external = [/^@tauri-apps\/api/], - additionalConfigs = [], - } = options; + additionalConfigs = [] + } = options // eslint-disable-next-line security/detect-non-literal-fs-filename - const pkg = JSON.parse(readFileSync(join(cwd(), "package.json"), "utf8")); + const pkg = JSON.parse(readFileSync(join(cwd(), 'package.json'), 'utf8')) const pluginJsName = pkg.name - .replace("@tauri-apps/plugin-", "") - .replace(/-./g, (x) => x[1].toUpperCase()); - const iifeVarName = `__TAURI_PLUGIN_${pluginJsName.toUpperCase()}__`; + .replace('@tauri-apps/plugin-', '') + .replace(/-./g, (x) => x[1].toUpperCase()) + const iifeVarName = `__TAURI_PLUGIN_${pkg.name + .replace('@tauri-apps/plugin-', '') + .replace('-', (x) => '_') + .toUpperCase()}__` return [ { @@ -40,50 +43,50 @@ export function createConfig(options = {}) { output: [ { file: pkg.exports.import, - format: "esm", + format: 'esm' }, { file: pkg.exports.require, - format: "cjs", - }, + format: 'cjs' + } ], plugins: [ typescript({ declaration: true, - declarationDir: `./${pkg.exports.import.split("/")[0]}`, - }), + declarationDir: `./${pkg.exports.import.split('/')[0]}` + }) ], external: [ ...external, ...Object.keys(pkg.dependencies || {}), - ...Object.keys(pkg.peerDependencies || {}), + ...Object.keys(pkg.peerDependencies || {}) ], onwarn: (warning) => { - throw Object.assign(new Error(), warning); - }, + throw Object.assign(new Error(), warning) + } }, { input, output: { - format: "iife", + format: 'iife', name: iifeVarName, // IIFE is in the format `var ${iifeVarName} = (() => {})()` // we check if __TAURI__ exists and inject the API object banner: "if ('__TAURI__' in window) {", // the last `}` closes the if in the banner footer: `Object.defineProperty(window.__TAURI__, '${pluginJsName}', { value: ${iifeVarName} }) }`, - file: "src/api-iife.js", + file: 'api-iife.js' }, // and var is not guaranteed to assign to the global `window` object so we make sure to assign it plugins: [typescript(), terser(), nodeResolve()], onwarn: (warning) => { - throw Object.assign(new Error(), warning); - }, + throw Object.assign(new Error(), warning) + } }, ...(Array.isArray(additionalConfigs) ? additionalConfigs - : [additionalConfigs]), - ]; + : [additionalConfigs]) + ] } diff --git a/shared/template/.gitignore b/shared/template/.gitignore deleted file mode 100644 index 1b0b469d..00000000 --- a/shared/template/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/.tauri diff --git a/shared/template/Cargo.toml b/shared/template/Cargo.toml index be8472bc..a672132d 100644 --- a/shared/template/Cargo.toml +++ b/shared/template/Cargo.toml @@ -1,17 +1,29 @@ [package] -name = "tauri-plugin-{{name}}" +name = "tauri-plugin-PLUGIN_NAME" version = "1.0.0" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } -links = "tauri-plugin-{{name}}" +repository = { workspace = true } +links = "tauri-plugin-PLUGIN_NAME" [package.metadata.docs.rs] -rustc-args = [ "--cfg", "docsrs" ] -rustdoc-args = [ "--cfg", "docsrs" ] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +# Platforms supported by the plugin +# Support levels are "full", "partial", "none", "unknown" +# Details of the support level are left to plugin maintainer +[package.metadata.platforms] +windows = { level = "unknown", notes = "" } +linux = { level = "unknown", notes = "" } +macos = { level = "unknown", notes = "" } +android = { level = "unknown", notes = "" } +ios = { level = "unknown", notes = "" } + [build-dependencies] -tauri-plugin = { workspace = true, features = [ "build" ] } +tauri-plugin = { workspace = true, features = ["build"] } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/shared/template/README.md b/shared/template/README.md index 920f5f8c..d22a2ba6 100644 --- a/shared/template/README.md +++ b/shared/template/README.md @@ -1,10 +1,18 @@ -![{{plugin-name}}](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/{{plugin-name}}/banner.png) +![PLUGIN_NAME](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/PLUGIN_NAME/banner.png) +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ✓ | +| iOS | ✓ | + ## Install -_This plugin requires a Rust version of at least **1.75**_ +_This plugin requires a Rust version of at least **1.77.2**_ There are three general methods of installation that we can recommend. @@ -18,9 +26,9 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-{{plugin-name}} = "2.0.0-beta" +tauri-plugin-PLUGIN_NAME = "2.0.0" # alternatively with Git: -tauri-plugin-{{plugin-name}} = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } +tauri-plugin-PLUGIN_NAME = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` You can install the JavaScript Guest bindings using your preferred JavaScript package manager: @@ -30,18 +38,18 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa ```sh -pnpm add @tauri-apps/plugin-{{plugin-name}} +pnpm add @tauri-apps/plugin-PLUGIN_NAME # or -npm add @tauri-apps/plugin-{{plugin-name}} +npm add @tauri-apps/plugin-PLUGIN_NAME # or -yarn add @tauri-apps/plugin-{{plugin-name}} +yarn add @tauri-apps/plugin-PLUGIN_NAME # alternatively with Git: -pnpm add https://github.com/tauri-apps/tauri-plugin-{{plugin-name}}#v2 +pnpm add https://github.com/tauri-apps/tauri-plugin-PLUGIN_NAME#v2 # or -npm add https://github.com/tauri-apps/tauri-plugin-{{plugin-name}}#v2 +npm add https://github.com/tauri-apps/tauri-plugin-PLUGIN_NAME#v2 # or -yarn add https://github.com/tauri-apps/tauri-plugin-{{plugin-name}}#v2 +yarn add https://github.com/tauri-apps/tauri-plugin-PLUGIN_NAME#v2 ``` ## Usage @@ -53,7 +61,7 @@ First you need to register the core plugin with Tauri: ```rust fn main() { tauri::Builder::default() - .plugin(tauri_plugin_{{plugin-name}}::init()) + .plugin(tauri_plugin_PLUGIN_NAME::init()) .run(tauri::generate_context!()) .expect("error while running tauri application"); } diff --git a/shared/template/SECURITY.md b/shared/template/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/shared/template/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/shared/template/android/build.gradle.kts b/shared/template/android/build.gradle.kts index 804384c3..1d0e9d8e 100644 --- a/shared/template/android/build.gradle.kts +++ b/shared/template/android/build.gradle.kts @@ -5,11 +5,10 @@ plugins { android { namespace = "{{android_package_id}}" - compileSdk = 32 + compileSdk = 34 defaultConfig { - minSdk = 24 - targetSdk = 32 + minSdk = 24 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") diff --git a/shared/template/build.rs b/shared/template/build.rs index 121f3b74..16a1438a 100644 --- a/shared/template/build.rs +++ b/shared/template/build.rs @@ -5,15 +5,14 @@ const COMMANDS: &[&str] = &["execute"]; fn main() { - if let Err(error) = tauri_plugin::Builder::new(COMMANDS) + let result = tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") .android_path("android") .ios_path("ios") - .run() - { - println!("{error:#}"); - // when building documentation for Android the plugin build result is irrelevant to the crate itself - if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) { - std::process::exit(1); - } + .try_build(); + + // when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build + if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) { + result.unwrap(); } } diff --git a/shared/template/ios/Package.swift b/shared/template/ios/Package.swift index e4f53f0b..e4ebd067 100644 --- a/shared/template/ios/Package.swift +++ b/shared/template/ios/Package.swift @@ -6,28 +6,29 @@ import PackageDescription let package = Package( - name: "tauri-plugin-{{ plugin_name }}", - platforms: [ - .iOS(.v13), - ], - products: [ - // Products define the executables and libraries a package produces, and make them visible to other packages. - .library( - name: "tauri-plugin-{{ plugin_name }}", - type: .static, - targets: ["tauri-plugin-{{ plugin_name }}"]), - ], - dependencies: [ - .package(name: "Tauri", path: "../.tauri/tauri-api") - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages this package depends on. - .target( - name: "tauri-plugin-{{ plugin_name }}", - dependencies: [ - .byName(name: "Tauri") - ], - path: "Sources") - ] + name: "tauri-plugin-{{ plugin_name }}", + platforms: [ + .macOS(.v10_13), + .iOS(.v13), + ], + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "tauri-plugin-{{ plugin_name }}", + type: .static, + targets: ["tauri-plugin-{{ plugin_name }}"]) + ], + dependencies: [ + .package(name: "Tauri", path: "../.tauri/tauri-api") + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "tauri-plugin-{{ plugin_name }}", + dependencies: [ + .byName(name: "Tauri") + ], + path: "Sources") + ] ) diff --git a/shared/template/ios/Sources/ExamplePlugin.swift b/shared/template/ios/Sources/ExamplePlugin.swift index 36c3a8f7..2a1055de 100644 --- a/shared/template/ios/Sources/ExamplePlugin.swift +++ b/shared/template/ios/Sources/ExamplePlugin.swift @@ -8,7 +8,7 @@ import UIKit import WebKit class PingArgs: Decodable { - let value: String? + var value: String? } class ExamplePlugin: Plugin { diff --git a/shared/template/package.json b/shared/template/package.json index 60cf5e26..75ce480a 100644 --- a/shared/template/package.json +++ b/shared/template/package.json @@ -1,10 +1,11 @@ { - "name": "@tauri-apps/plugin-{{name}}", + "name": "@tauri-apps/plugin-PLUGIN_NAME", "version": "1.0.0", - "license": "MIT or APACHE-2.0", + "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" ], + "repository": "https://github.com/tauri-apps/plugins-workspace", "type": "module", "types": "./dist-js/index.d.ts", "main": "./dist-js/index.cjs", @@ -23,6 +24,6 @@ "LICENSE" ], "dependencies": { - "@tauri-apps/api": "2.0.0-beta.2" + "@tauri-apps/api": "^2.0.0" } } diff --git a/shared/template/rollup.config.js b/shared/template/rollup.config.js index 977dfac8..1f349ec8 100644 --- a/shared/template/rollup.config.js +++ b/shared/template/rollup.config.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { createConfig } from "../../shared/rollup.config.js"; +import { createConfig } from '../../shared/rollup.config.js' -export default createConfig(); +export default createConfig() diff --git a/shared/template/src/lib.rs b/shared/template/src/lib.rs index 3e0f7618..e83735e0 100644 --- a/shared/template/src/lib.rs +++ b/shared/template/src/lib.rs @@ -25,7 +25,7 @@ use desktop::{{ plugin_name_pascal_case }}; #[cfg(mobile)] use mobile::{{ plugin_name_pascal_case }}; -/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the {{ plugin_name }} APIs. +/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the {{ plugin_name }} APIs. pub trait {{ plugin_name_pascal_case }}Ext { fn {{ plugin_name_snake_case }}(&self) -> &{{ plugin_name_pascal_case }}; } @@ -39,7 +39,6 @@ impl> crate::{{ plugin_name_pascal_case }}Ext for T /// Initializes the plugin. pub fn init() -> TauriPlugin { Builder::new("{{ plugin_name }}") - .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![commands::execute]) .setup(|app, api| { #[cfg(mobile)] diff --git a/taplo.toml b/taplo.toml new file mode 100644 index 00000000..e628d268 --- /dev/null +++ b/taplo.toml @@ -0,0 +1 @@ +exclude = ["plugins/*/permissions/autogenerated/**.toml"]

+

Welcome to Tauri!

+ +
+ +

Click on the Tauri logo to learn more about the framework

+ + + +

+