mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-02-18 00:27:46 +01:00
Compare commits
38 Commits
v2024.7.0-
...
v2024.7.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d586ec5fb4 | ||
|
|
ad8a4933da | ||
|
|
499d0b09ba | ||
|
|
ac1181c1b4 | ||
|
|
b9671781d3 | ||
|
|
42fd7cb21e | ||
|
|
fe9f765c1d | ||
|
|
087a1e5ea1 | ||
|
|
6e156497da | ||
|
|
ad3c2ed113 | ||
|
|
166bae6104 | ||
|
|
b3e6a2b34f | ||
|
|
547f1c9139 | ||
|
|
4d7ded61f8 | ||
|
|
c92472dbac | ||
|
|
d347f2db77 | ||
|
|
80c1675331 | ||
|
|
23fba45fcb | ||
|
|
80777f712c | ||
|
|
6ffb0015c6 | ||
|
|
9d9b855c04 | ||
|
|
e7cbcc7b20 | ||
|
|
20a5ab3666 | ||
|
|
311fda887f | ||
|
|
55e33df8d6 | ||
|
|
71c9c8ba8c | ||
|
|
11c2b9bb2c | ||
|
|
5cfd208c23 | ||
|
|
3a0b647ce4 | ||
|
|
8367835061 | ||
|
|
55276b968e | ||
|
|
9e04226097 | ||
|
|
51487d5412 | ||
|
|
0dccba4ab2 | ||
|
|
13183ae837 | ||
|
|
f24fd13c45 | ||
|
|
972dffe959 | ||
|
|
9f7033ab06 |
20
.github/workflows/release.yml
vendored
20
.github/workflows/release.yml
vendored
@@ -18,16 +18,16 @@ jobs:
|
||||
include:
|
||||
- platform: 'macos-latest' # for Arm-based macs (M1 and above).
|
||||
args: '--target aarch64-apple-darwin'
|
||||
node_arch: 'arm64'
|
||||
yaak_arch: 'arm64'
|
||||
- platform: 'macos-latest' # for Intel-based macs.
|
||||
args: '--target x86_64-apple-darwin'
|
||||
node_arch: 'x64'
|
||||
yaak_arch: 'x64'
|
||||
- platform: 'ubuntu-22.04' # for Tauri v1, you could replace this with ubuntu-20.04.
|
||||
args: ''
|
||||
node_arch: 'x64'
|
||||
yaak_arch: 'x64'
|
||||
- platform: 'windows-latest'
|
||||
args: ''
|
||||
node_arch: 'x64'
|
||||
yaak_arch: 'x64'
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
- name: Checkout yaakapp/app
|
||||
@@ -86,21 +86,21 @@ jobs:
|
||||
- name: Run lint
|
||||
run: npm run lint
|
||||
|
||||
- name: Set version
|
||||
run: npm run replace-version
|
||||
env:
|
||||
YAAK_VERSION: ${{ github.ref_name }}
|
||||
|
||||
- name: Checkout yaakapp/plugins
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: yaakapp/plugins
|
||||
path: ${{ env.YAAK_PLUGINS_DIR }}
|
||||
|
||||
- name: Set version
|
||||
run: npm run replace-version
|
||||
env:
|
||||
YAAK_VERSION: ${{ github.ref_name }}
|
||||
|
||||
- uses: tauri-apps/tauri-action@v0
|
||||
env:
|
||||
YAAK_PLUGINS_DIR: ${{ env.YAAK_PLUGINS_DIR }}
|
||||
NODE_ARCH: ${{ matrix.node_arch }}
|
||||
YAAK_TARGET_ARCH: ${{ matrix.yaak_arch }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
|
||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
||||
|
||||
723
package-lock.json
generated
723
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
20
package.json
20
package.json
@@ -35,12 +35,12 @@
|
||||
"@react-hook/resize-observer": "^1.2.6",
|
||||
"@tailwindcss/container-queries": "^0.1.0",
|
||||
"@tanstack/react-query": "^5.45.1",
|
||||
"@tauri-apps/api": ">=2.0.0-beta.0",
|
||||
"@tauri-apps/plugin-clipboard-manager": "^2.1.0-beta.1",
|
||||
"@tauri-apps/plugin-dialog": ">=2.0.0-beta.0",
|
||||
"@tauri-apps/plugin-fs": ">=2.0.0-beta.0",
|
||||
"@tauri-apps/plugin-os": ">=2.0.0-beta.0",
|
||||
"@tauri-apps/plugin-shell": ">=2.0.0-beta.0",
|
||||
"@tauri-apps/api": "^2.0.0-beta.15",
|
||||
"@tauri-apps/plugin-clipboard-manager": "^2.1.0-beta.5",
|
||||
"@tauri-apps/plugin-dialog": "^2.0.0-beta.7",
|
||||
"@tauri-apps/plugin-fs": "^2.0.0-beta.7",
|
||||
"@tauri-apps/plugin-os": "^2.0.0-beta.7",
|
||||
"@tauri-apps/plugin-shell": "^2.0.0-beta.8",
|
||||
"buffer": "^6.0.3",
|
||||
"classnames": "^2.3.2",
|
||||
"cm6-graphql": "^0.0.9",
|
||||
@@ -71,7 +71,7 @@
|
||||
"devDependencies": {
|
||||
"@tailwindcss/nesting": "^0.0.0-insiders.565cd3e",
|
||||
"@tanstack/react-query-devtools": "^5.45.1",
|
||||
"@tauri-apps/cli": ">=2.0.0-beta.0",
|
||||
"@tauri-apps/cli": "^2.0.0-beta.22",
|
||||
"@types/node": "^18.7.10",
|
||||
"@types/papaparse": "^5.3.7",
|
||||
"@types/parse-color": "^1.0.1",
|
||||
@@ -83,6 +83,7 @@
|
||||
"@typescript-eslint/parser": "^7.0.2",
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"decompress": "^4.2.1",
|
||||
"eslint": "^8.34.0",
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
@@ -92,18 +93,17 @@
|
||||
"husky": "^8.0.3",
|
||||
"internal-ip": "^8.0.0",
|
||||
"lint-staged": "^15.0.2",
|
||||
"nodejs-file-downloader": "^4.13.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"postcss": "^8.4.21",
|
||||
"postcss-nesting": "^11.2.1",
|
||||
"prettier": "^2.8.4",
|
||||
"react-devtools": "^4.27.2",
|
||||
"rimraf": "^5.0.7",
|
||||
"tailwindcss": "^3.2.7",
|
||||
"typescript": "^5.4.5",
|
||||
"vite": "^5.0.0",
|
||||
"vite-plugin-static-copy": "^1.0.5",
|
||||
"decompress": "^4.2.1",
|
||||
"nodejs-file-downloader": "^4.13.0",
|
||||
"rimraf": "^5.0.7",
|
||||
"vite-plugin-svgr": "^4.2.0",
|
||||
"vite-plugin-top-level-await": "^1.4.1"
|
||||
},
|
||||
|
||||
@@ -382,17 +382,17 @@ export const PluginRuntimeDefinition = {
|
||||
responseStream: false,
|
||||
options: {},
|
||||
},
|
||||
hookResponseFilter: {
|
||||
name: "hookResponseFilter",
|
||||
requestType: HookResponseFilterRequest,
|
||||
hookExport: {
|
||||
name: "hookExport",
|
||||
requestType: HookExportRequest,
|
||||
requestStream: false,
|
||||
responseType: HookResponse,
|
||||
responseStream: false,
|
||||
options: {},
|
||||
},
|
||||
hookExport: {
|
||||
name: "hookExport",
|
||||
requestType: HookExportRequest,
|
||||
hookResponseFilter: {
|
||||
name: "hookResponseFilter",
|
||||
requestType: HookResponseFilterRequest,
|
||||
requestStream: false,
|
||||
responseType: HookResponse,
|
||||
responseStream: false,
|
||||
@@ -403,20 +403,20 @@ export const PluginRuntimeDefinition = {
|
||||
|
||||
export interface PluginRuntimeServiceImplementation<CallContextExt = {}> {
|
||||
hookImport(request: HookImportRequest, context: CallContext & CallContextExt): Promise<DeepPartial<HookResponse>>;
|
||||
hookExport(request: HookExportRequest, context: CallContext & CallContextExt): Promise<DeepPartial<HookResponse>>;
|
||||
hookResponseFilter(
|
||||
request: HookResponseFilterRequest,
|
||||
context: CallContext & CallContextExt,
|
||||
): Promise<DeepPartial<HookResponse>>;
|
||||
hookExport(request: HookExportRequest, context: CallContext & CallContextExt): Promise<DeepPartial<HookResponse>>;
|
||||
}
|
||||
|
||||
export interface PluginRuntimeClient<CallOptionsExt = {}> {
|
||||
hookImport(request: DeepPartial<HookImportRequest>, options?: CallOptions & CallOptionsExt): Promise<HookResponse>;
|
||||
hookExport(request: DeepPartial<HookExportRequest>, options?: CallOptions & CallOptionsExt): Promise<HookResponse>;
|
||||
hookResponseFilter(
|
||||
request: DeepPartial<HookResponseFilterRequest>,
|
||||
options?: CallOptions & CallOptionsExt,
|
||||
): Promise<HookResponse>;
|
||||
hookExport(request: DeepPartial<HookExportRequest>, options?: CallOptions & CallOptionsExt): Promise<HookResponse>;
|
||||
}
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
|
||||
@@ -4,8 +4,8 @@ package yaak.plugins.runtime;
|
||||
|
||||
service PluginRuntime {
|
||||
rpc hookImport (HookImportRequest) returns (HookResponse);
|
||||
rpc hookResponseFilter (HookResponseFilterRequest) returns (HookResponse);
|
||||
rpc hookExport (HookExportRequest) returns (HookResponse);
|
||||
rpc hookResponseFilter (HookResponseFilterRequest) returns (HookResponse);
|
||||
}
|
||||
|
||||
message PluginInfo {
|
||||
|
||||
@@ -1,22 +1,69 @@
|
||||
const path = require('node:path');
|
||||
const {cpSync} = require('node:fs');
|
||||
const destDir = path.join(__dirname, '..', 'src-tauri', 'vendored', 'node');
|
||||
const decompress = require('decompress');
|
||||
const Downloader = require("nodejs-file-downloader");
|
||||
const {rmSync, cpSync, mkdirSync, existsSync} = require("node:fs");
|
||||
const {execSync} = require("node:child_process");
|
||||
|
||||
const DST_BIN_MAP = {
|
||||
darwin_arm64: 'node-aarch64-apple-darwin',
|
||||
darwin_x64: 'node-x86_64-apple-darwin',
|
||||
linux_x64: 'node-x86_64-unknown-linux-gnu',
|
||||
win32_x64: 'node-x86_64-pc-windows-msvc.exe',
|
||||
const NODE_VERSION = 'v22.5.1';
|
||||
|
||||
// `${process.platform}_${process.arch}`
|
||||
const MAC_ARM = 'darwin_arm64';
|
||||
const MAC_X64 = 'darwin_x64';
|
||||
const LNX_X64 = 'linux_x64';
|
||||
const WIN_X64 = 'win32_x64';
|
||||
|
||||
const URL_MAP = {
|
||||
[MAC_ARM]: `https://nodejs.org/download/release/${NODE_VERSION}/node-${NODE_VERSION}-darwin-arm64.tar.gz`,
|
||||
[MAC_X64]: `https://nodejs.org/download/release/${NODE_VERSION}/node-${NODE_VERSION}-darwin-x64.tar.gz`,
|
||||
[LNX_X64]: `https://nodejs.org/download/release/${NODE_VERSION}/node-${NODE_VERSION}-linux-x64.tar.gz`,
|
||||
[WIN_X64]: `https://nodejs.org/download/release/${NODE_VERSION}/node-${NODE_VERSION}-win-x64.zip`,
|
||||
};
|
||||
|
||||
// Build the sea
|
||||
console.log('Vendoring NodeJS binary');
|
||||
const SRC_BIN_MAP = {
|
||||
[MAC_ARM]: `node-${NODE_VERSION}-darwin-arm64/bin/node`,
|
||||
[MAC_X64]: `node-${NODE_VERSION}-darwin-x64/bin/node`,
|
||||
[LNX_X64]: `node-${NODE_VERSION}-linux-x64/bin/node`,
|
||||
[WIN_X64]: `node-${NODE_VERSION}-win-x64/node.exe`,
|
||||
};
|
||||
|
||||
// console.log('Changing Node.js binary permissions');
|
||||
// chmodSync(tmpNodePath, 0o755);
|
||||
const DST_BIN_MAP = {
|
||||
darwin_arm64: 'yaaknode-aarch64-apple-darwin',
|
||||
darwin_x64: 'yaaknode-x86_64-apple-darwin',
|
||||
linux_x64: 'yaaknode-x86_64-unknown-linux-gnu',
|
||||
win32_x64: 'yaaknode-x86_64-pc-windows-msvc.exe',
|
||||
};
|
||||
|
||||
const key = `${process.platform}_${process.env.NODE_ARCH ?? process.arch}`;
|
||||
const dstPath = path.join(destDir, DST_BIN_MAP[key]);
|
||||
cpSync(process.execPath, dstPath);
|
||||
const key = `${process.platform}_${process.env.YAAK_TARGET_ARCH ?? process.arch}`;
|
||||
|
||||
console.log(`Copied NodeJS to ${dstPath}`)
|
||||
const destDir = path.join(__dirname, `..`, 'src-tauri', 'vendored', 'node');
|
||||
const binDest = path.join(destDir, DST_BIN_MAP[key]);
|
||||
console.log(`Vendoring NodeJS ${NODE_VERSION} for ${key}`);
|
||||
|
||||
if (existsSync(binDest) && execSync(`${binDest} --version`).toString('utf-8').trim() === NODE_VERSION) {
|
||||
console.log("NodeJS already vendored");
|
||||
return;
|
||||
}
|
||||
|
||||
rmSync(destDir, {recursive: true, force: true});
|
||||
mkdirSync(destDir, {recursive: true});
|
||||
|
||||
(async function () {
|
||||
const url = URL_MAP[key];
|
||||
const tmpDir = path.join(__dirname, 'tmp', Date.now().toString());
|
||||
|
||||
// Download GitHub release artifact
|
||||
const {filePath} = await new Downloader({url, directory: tmpDir,}).download();
|
||||
|
||||
// Decompress to the same directory
|
||||
await decompress(filePath, tmpDir, {});
|
||||
|
||||
// Copy binary
|
||||
const binSrc = path.join(tmpDir, SRC_BIN_MAP[key]);
|
||||
cpSync(binSrc, binDest);
|
||||
rmSync(tmpDir, {recursive: true, force: true});
|
||||
|
||||
console.log("Downloaded NodeJS to", binDest);
|
||||
})().catch(err => {
|
||||
console.log('Script failed:', err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
const decompress = require('decompress');
|
||||
const Downloader = require("nodejs-file-downloader");
|
||||
const path = require("node:path");
|
||||
const fs = require("node:fs");
|
||||
const rimraf = require('rimraf');
|
||||
const {rmSync} = require("node:fs");
|
||||
const {rmSync, mkdirSync, cpSync} = require("node:fs");
|
||||
|
||||
// `${process.platform}_${process.arch}`
|
||||
const MAC_ARM = 'darwin_arm64';
|
||||
@@ -18,26 +16,29 @@ const URL_MAP = {
|
||||
[WIN_X64]: 'https://github.com/protocolbuffers/protobuf/releases/download/v27.2/protoc-27.2-win64.zip',
|
||||
};
|
||||
|
||||
const DST_BIN_MAP = {
|
||||
[MAC_ARM]: 'protoc-aarch64-apple-darwin',
|
||||
[MAC_X64]: 'protoc-x86_64-apple-darwin',
|
||||
[LNX_X64]: 'protoc-x86_64-unknown-linux-gnu',
|
||||
[WIN_X64]: 'protoc-x86_64-pc-windows-msvc.exe',
|
||||
const SRC_BIN_MAP = {
|
||||
[MAC_ARM]: 'bin/protoc',
|
||||
[MAC_X64]: 'bin/protoc',
|
||||
[LNX_X64]: 'bin/protoc',
|
||||
[WIN_X64]: 'bin/protoc.exe',
|
||||
};
|
||||
|
||||
const SRC_BIN_MAP = {
|
||||
[MAC_ARM]: 'protoc',
|
||||
[MAC_X64]: 'protoc',
|
||||
[LNX_X64]: 'protoc',
|
||||
[WIN_X64]: 'protoc.exe',
|
||||
const DST_BIN_MAP = {
|
||||
[MAC_ARM]: 'yaakprotoc-aarch64-apple-darwin',
|
||||
[MAC_X64]: 'yaakprotoc-x86_64-apple-darwin',
|
||||
[LNX_X64]: 'yaakprotoc-x86_64-unknown-linux-gnu',
|
||||
[WIN_X64]: 'yaakprotoc-x86_64-pc-windows-msvc.exe',
|
||||
};
|
||||
|
||||
const dstDir = path.join(__dirname, `..`, 'src-tauri', 'vendored', 'protoc');
|
||||
rmSync(dstDir, {recursive: true, force: true});
|
||||
mkdirSync(dstDir, {recursive: true});
|
||||
|
||||
(async function () {
|
||||
const key = `${process.platform}_${process.env.NODE_ARCH ?? process.arch}`;
|
||||
const key = `${process.platform}_${process.env.YAAK_TARGET_ARCH ?? process.arch}`;
|
||||
console.log("Vendoring protoc binary for", key);
|
||||
const url = URL_MAP[key];
|
||||
const tmpDir = path.join(__dirname, 'tmp', `${Math.random()}`);
|
||||
const dstDir = path.join(__dirname, `..`, 'src-tauri', 'vendored', 'protoc');
|
||||
rimraf.sync(dstDir);
|
||||
const tmpDir = path.join(__dirname, 'tmp', Date.now().toString());
|
||||
|
||||
// Download GitHub release artifact
|
||||
const {filePath} = await new Downloader({url, directory: tmpDir,}).download();
|
||||
@@ -45,18 +46,15 @@ const SRC_BIN_MAP = {
|
||||
// Decompress to the same directory
|
||||
await decompress(filePath, tmpDir, {});
|
||||
|
||||
// Remove the original archive
|
||||
fs.unlinkSync(filePath);
|
||||
|
||||
// Copy binary
|
||||
const binSrc = path.join(tmpDir, 'bin', SRC_BIN_MAP[key]);
|
||||
const binSrc = path.join(tmpDir, SRC_BIN_MAP[key]);
|
||||
const binDst = path.join(dstDir, DST_BIN_MAP[key]);
|
||||
fs.cpSync(binSrc, binDst);
|
||||
cpSync(binSrc, binDst);
|
||||
|
||||
// Copy other files
|
||||
const includeSrc = path.join(tmpDir, 'include');
|
||||
const includeDst = path.join(dstDir, 'include');
|
||||
fs.cpSync(includeSrc, includeDst, {recursive: true});
|
||||
cpSync(includeSrc, includeDst, {recursive: true});
|
||||
|
||||
rmSync(tmpDir, {recursive: true, force: true});
|
||||
|
||||
|
||||
1026
src-tauri/Cargo.lock
generated
1026
src-tauri/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -55,3 +55,4 @@ tokio = { version = "1.36.0", features = ["sync"] }
|
||||
tokio-stream = "0.1.15"
|
||||
uuid = "1.7.0"
|
||||
thiserror = "1.0.61"
|
||||
mime_guess = "2.0.5"
|
||||
|
||||
@@ -29,16 +29,6 @@
|
||||
]
|
||||
},
|
||||
"shell:allow-open",
|
||||
{
|
||||
"identifier": "shell:allow-execute",
|
||||
"allow": [
|
||||
{
|
||||
"name": "protoc",
|
||||
"sidecar": true,
|
||||
"args": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"webview:allow-set-webview-zoom",
|
||||
"window:allow-close",
|
||||
"window:allow-is-fullscreen",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
{"main":{"identifier":"main","description":"Main permissions","local":true,"windows":["*"],"permissions":["os:allow-os-type","event:allow-emit","clipboard-manager:allow-write-text","clipboard-manager:allow-read-text","dialog:allow-open","dialog:allow-save","event:allow-listen","event:allow-unlisten","fs:allow-read-file","fs:allow-read-text-file",{"identifier":"fs:scope","allow":[{"path":"$APPDATA"},{"path":"$APPDATA/**"}]},"shell:allow-open",{"identifier":"shell:allow-execute","allow":[{"args":true,"name":"protoc","sidecar":true}]},"webview:allow-set-webview-zoom","window:allow-close","window:allow-is-fullscreen","window:allow-maximize","window:allow-minimize","window:allow-toggle-maximize","window:allow-set-decorations","window:allow-set-title","window:allow-start-dragging","window:allow-unmaximize","window:allow-theme","clipboard-manager:allow-read-text","clipboard-manager:allow-write-text"]}}
|
||||
{"main":{"identifier":"main","description":"Main permissions","local":true,"windows":["*"],"permissions":["os:allow-os-type","event:allow-emit","clipboard-manager:allow-write-text","clipboard-manager:allow-read-text","dialog:allow-open","dialog:allow-save","event:allow-listen","event:allow-unlisten","fs:allow-read-file","fs:allow-read-text-file",{"identifier":"fs:scope","allow":[{"path":"$APPDATA"},{"path":"$APPDATA/**"}]},"shell:allow-open","webview:allow-set-webview-zoom","window:allow-close","window:allow-is-fullscreen","window:allow-maximize","window:allow-minimize","window:allow-toggle-maximize","window:allow-set-decorations","window:allow-set-title","window:allow-start-dragging","window:allow-unmaximize","window:allow-theme","clipboard-manager:allow-read-text","clipboard-manager:allow-write-text"]}}
|
||||
@@ -37,7 +37,7 @@
|
||||
],
|
||||
"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.",
|
||||
"description": "A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\n\nIt controls application windows fine grained access to the Tauri core, application, or plugin commands. If 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 groups of windows, based on their required system access, which can reduce impact of frontend vulnerabilities in less privileged windows. Windows can be added to a capability by exact name (e.g. `main-window`) or glob patterns like `*` or `admin-*`. A Window can have none, one, or multiple associated capabilities.\n\n## Example\n\n```json { \"identifier\": \"main-user-files-write\", \"description\": \"This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programatic access to files selected by the user.\", \"windows\": [ \"main\" ], \"permissions\": [ \"path:default\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] }, \"platforms\": [\"macOS\",\"windows\"] } ```",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"identifier",
|
||||
@@ -45,16 +45,16 @@
|
||||
],
|
||||
"properties": {
|
||||
"identifier": {
|
||||
"description": "Identifier of the capability.",
|
||||
"description": "Identifier of the capability.\n\n## Example\n\n`main-user-files-write`",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "Description of the capability.",
|
||||
"description": "Description of what the capability is intended to allow on associated windows.\n\nIt should contain a description of what the grouped permissions should allow.\n\n## Example\n\nThis capability allows the `main` window access to `filesystem` write related commands and `dialog` commands to enable programatic access to files selected by the user.",
|
||||
"default": "",
|
||||
"type": "string"
|
||||
},
|
||||
"remote": {
|
||||
"description": "Configure remote URLs that can use the capability permissions.",
|
||||
"description": "Configure remote URLs that can use the capability permissions.\n\nThis setting is optional and defaults to not being set, as our default use case is that the content is served from our local application.\n\n:::caution Make sure you understand the security implications of providing remote sources with local system access. :::\n\n## Example\n\n```json { \"urls\": [\"https://*.mydomain.dev\"] } ```",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/CapabilityRemote"
|
||||
@@ -70,28 +70,29 @@
|
||||
"type": "boolean"
|
||||
},
|
||||
"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.",
|
||||
"description": "List of windows that are affected by this capability. Can be a glob pattern.\n\nOn multiwebview windows, prefer [`Self::webviews`] for a fine grained access control.\n\n## Example\n\n`[\"main\"]`",
|
||||
"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.",
|
||||
"description": "List of webviews that are affected by 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.\n\n## Example\n\n`[\"sub-webview-one\", \"sub-webview-two\"]`",
|
||||
"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}`.",
|
||||
"description": "List of permissions attached to this capability.\n\nMust include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`. For commands directly implemented in the application itself only `${permission-name}` is required.\n\n## Example\n\n```json [ \"path:default\", \"event:default\", \"window:default\", \"app:default\", \"image:default\", \"resources:default\", \"menu:default\", \"tray:default\", \"shell:allow-open\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] } ```",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/PermissionEntry"
|
||||
}
|
||||
},
|
||||
"uniqueItems": true
|
||||
},
|
||||
"platforms": {
|
||||
"description": "Target platforms this capability applies. By default all platforms are affected by this capability.",
|
||||
"description": "Limit which target platforms this capability applies to.\n\nBy default all platforms are targeted.\n\n## Example\n\n`[\"macOS\",\"windows\"]`",
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
@@ -110,7 +111,7 @@
|
||||
],
|
||||
"properties": {
|
||||
"urls": {
|
||||
"description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n# Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api",
|
||||
"description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n## Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
@@ -142,7 +143,7 @@
|
||||
"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",
|
||||
"description": "fs:default -> 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": [
|
||||
"fs:default"
|
||||
@@ -1373,6 +1374,13 @@
|
||||
"fs:allow-write-text-file"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:create-app-specific-dirs -> This permissions allows to create the application specific directories.\n",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:create-app-specific-dirs"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:deny-copy-file -> Denies the copy_file command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -1562,6 +1570,13 @@
|
||||
"fs:read-all"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:read-app-specific-dirs-recursive -> This permission allows recursive read functionality on the application\nspecific base directories. \n",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:read-app-specific-dirs-recursive"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:read-dirs -> This enables directory read and file metadata related commands without any pre-configured accessible paths.",
|
||||
"type": "string",
|
||||
@@ -1605,7 +1620,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-app-recursive -> This scope recursive access to the complete `$APP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-app-recursive -> This scope permits recursive access to the complete `$APP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-app-recursive"
|
||||
@@ -1626,7 +1641,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appcache-recursive -> This scope recursive access to the complete `$APPCACHE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appcache-recursive -> This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appcache-recursive"
|
||||
@@ -1647,7 +1662,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appconfig-recursive -> This scope recursive access to the complete `$APPCONFIG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appconfig-recursive -> This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appconfig-recursive"
|
||||
@@ -1668,7 +1683,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appdata-recursive -> This scope recursive access to the complete `$APPDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appdata-recursive -> This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appdata-recursive"
|
||||
@@ -1689,7 +1704,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-applocaldata-recursive -> This scope recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-applocaldata-recursive -> This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-applocaldata-recursive"
|
||||
@@ -1710,7 +1725,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-applog-recursive -> This scope recursive access to the complete `$APPLOG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-applog-recursive -> This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-applog-recursive"
|
||||
@@ -1731,7 +1746,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-audio-recursive -> This scope recursive access to the complete `$AUDIO` folder, including sub directories and files.",
|
||||
"description": "fs:scope-audio-recursive -> This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-audio-recursive"
|
||||
@@ -1752,7 +1767,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-cache-recursive -> This scope recursive access to the complete `$CACHE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-cache-recursive -> This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-cache-recursive"
|
||||
@@ -1773,7 +1788,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-config-recursive -> This scope recursive access to the complete `$CONFIG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-config-recursive -> This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-config-recursive"
|
||||
@@ -1794,7 +1809,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-data-recursive -> This scope recursive access to the complete `$DATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-data-recursive -> This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-data-recursive"
|
||||
@@ -1815,7 +1830,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-desktop-recursive -> This scope recursive access to the complete `$DESKTOP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-desktop-recursive -> This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-desktop-recursive"
|
||||
@@ -1836,7 +1851,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-document-recursive -> This scope recursive access to the complete `$DOCUMENT` folder, including sub directories and files.",
|
||||
"description": "fs:scope-document-recursive -> This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-document-recursive"
|
||||
@@ -1857,7 +1872,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-download-recursive -> This scope recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.",
|
||||
"description": "fs:scope-download-recursive -> This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-download-recursive"
|
||||
@@ -1878,7 +1893,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-exe-recursive -> This scope recursive access to the complete `$EXE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-exe-recursive -> This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-exe-recursive"
|
||||
@@ -1899,7 +1914,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-font-recursive -> This scope recursive access to the complete `$FONT` folder, including sub directories and files.",
|
||||
"description": "fs:scope-font-recursive -> This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-font-recursive"
|
||||
@@ -1920,7 +1935,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-home-recursive -> This scope recursive access to the complete `$HOME` folder, including sub directories and files.",
|
||||
"description": "fs:scope-home-recursive -> This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-home-recursive"
|
||||
@@ -1941,7 +1956,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-localdata-recursive -> This scope recursive access to the complete `$LOCALDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-localdata-recursive -> This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-localdata-recursive"
|
||||
@@ -1962,7 +1977,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-log-recursive -> This scope recursive access to the complete `$LOG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-log-recursive -> This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-log-recursive"
|
||||
@@ -1983,7 +1998,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-picture-recursive -> This scope recursive access to the complete `$PICTURE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-picture-recursive -> This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-picture-recursive"
|
||||
@@ -2004,7 +2019,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-public-recursive -> This scope recursive access to the complete `$PUBLIC` folder, including sub directories and files.",
|
||||
"description": "fs:scope-public-recursive -> This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-public-recursive"
|
||||
@@ -2025,7 +2040,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-resource-recursive -> This scope recursive access to the complete `$RESOURCE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-resource-recursive -> This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-resource-recursive"
|
||||
@@ -2046,7 +2061,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-runtime-recursive -> This scope recursive access to the complete `$RUNTIME` folder, including sub directories and files.",
|
||||
"description": "fs:scope-runtime-recursive -> This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-runtime-recursive"
|
||||
@@ -2067,7 +2082,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-temp-recursive -> This scope recursive access to the complete `$TEMP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-temp-recursive -> This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-temp-recursive"
|
||||
@@ -2088,7 +2103,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-template-recursive -> This scope recursive access to the complete `$TEMPLATE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-template-recursive -> This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-template-recursive"
|
||||
@@ -2109,7 +2124,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-video-recursive -> This scope recursive access to the complete `$VIDEO` folder, including sub directories and files.",
|
||||
"description": "fs:scope-video-recursive -> This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-video-recursive"
|
||||
@@ -2190,6 +2205,7 @@
|
||||
"identifier": {
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "shell:default -> 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",
|
||||
"enum": [
|
||||
"shell:default"
|
||||
@@ -2366,6 +2382,13 @@
|
||||
"app:allow-app-show"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "app:allow-default-window-icon -> Enables the default_window_icon command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"app:allow-default-window-icon"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "app:allow-name -> Enables the name command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -2401,6 +2424,13 @@
|
||||
"app:deny-app-show"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "app:deny-default-window-icon -> Denies the default_window_icon command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"app:deny-default-window-icon"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "app:deny-name -> Denies the name command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -2423,6 +2453,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:default -> 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",
|
||||
"enum": [
|
||||
"clipboard-manager:default"
|
||||
@@ -2513,6 +2544,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "dialog:default -> 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",
|
||||
"enum": [
|
||||
"dialog:default"
|
||||
@@ -3709,7 +3741,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"description": "fs:default -> 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": [
|
||||
"fs:default"
|
||||
@@ -3883,6 +3915,13 @@
|
||||
"fs:allow-write-text-file"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:create-app-specific-dirs -> This permissions allows to create the application specific directories.\n",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:create-app-specific-dirs"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:deny-copy-file -> Denies the copy_file command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -4072,6 +4111,13 @@
|
||||
"fs:read-all"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:read-app-specific-dirs-recursive -> This permission allows recursive read functionality on the application\nspecific base directories. \n",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:read-app-specific-dirs-recursive"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:read-dirs -> This enables directory read and file metadata related commands without any pre-configured accessible paths.",
|
||||
"type": "string",
|
||||
@@ -4115,7 +4161,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-app-recursive -> This scope recursive access to the complete `$APP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-app-recursive -> This scope permits recursive access to the complete `$APP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-app-recursive"
|
||||
@@ -4136,7 +4182,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appcache-recursive -> This scope recursive access to the complete `$APPCACHE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appcache-recursive -> This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appcache-recursive"
|
||||
@@ -4157,7 +4203,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appconfig-recursive -> This scope recursive access to the complete `$APPCONFIG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appconfig-recursive -> This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appconfig-recursive"
|
||||
@@ -4178,7 +4224,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appdata-recursive -> This scope recursive access to the complete `$APPDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appdata-recursive -> This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appdata-recursive"
|
||||
@@ -4199,7 +4245,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-applocaldata-recursive -> This scope recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-applocaldata-recursive -> This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-applocaldata-recursive"
|
||||
@@ -4220,7 +4266,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-applog-recursive -> This scope recursive access to the complete `$APPLOG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-applog-recursive -> This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-applog-recursive"
|
||||
@@ -4241,7 +4287,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-audio-recursive -> This scope recursive access to the complete `$AUDIO` folder, including sub directories and files.",
|
||||
"description": "fs:scope-audio-recursive -> This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-audio-recursive"
|
||||
@@ -4262,7 +4308,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-cache-recursive -> This scope recursive access to the complete `$CACHE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-cache-recursive -> This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-cache-recursive"
|
||||
@@ -4283,7 +4329,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-config-recursive -> This scope recursive access to the complete `$CONFIG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-config-recursive -> This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-config-recursive"
|
||||
@@ -4304,7 +4350,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-data-recursive -> This scope recursive access to the complete `$DATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-data-recursive -> This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-data-recursive"
|
||||
@@ -4325,7 +4371,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-desktop-recursive -> This scope recursive access to the complete `$DESKTOP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-desktop-recursive -> This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-desktop-recursive"
|
||||
@@ -4346,7 +4392,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-document-recursive -> This scope recursive access to the complete `$DOCUMENT` folder, including sub directories and files.",
|
||||
"description": "fs:scope-document-recursive -> This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-document-recursive"
|
||||
@@ -4367,7 +4413,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-download-recursive -> This scope recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.",
|
||||
"description": "fs:scope-download-recursive -> This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-download-recursive"
|
||||
@@ -4388,7 +4434,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-exe-recursive -> This scope recursive access to the complete `$EXE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-exe-recursive -> This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-exe-recursive"
|
||||
@@ -4409,7 +4455,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-font-recursive -> This scope recursive access to the complete `$FONT` folder, including sub directories and files.",
|
||||
"description": "fs:scope-font-recursive -> This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-font-recursive"
|
||||
@@ -4430,7 +4476,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-home-recursive -> This scope recursive access to the complete `$HOME` folder, including sub directories and files.",
|
||||
"description": "fs:scope-home-recursive -> This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-home-recursive"
|
||||
@@ -4451,7 +4497,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-localdata-recursive -> This scope recursive access to the complete `$LOCALDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-localdata-recursive -> This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-localdata-recursive"
|
||||
@@ -4472,7 +4518,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-log-recursive -> This scope recursive access to the complete `$LOG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-log-recursive -> This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-log-recursive"
|
||||
@@ -4493,7 +4539,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-picture-recursive -> This scope recursive access to the complete `$PICTURE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-picture-recursive -> This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-picture-recursive"
|
||||
@@ -4514,7 +4560,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-public-recursive -> This scope recursive access to the complete `$PUBLIC` folder, including sub directories and files.",
|
||||
"description": "fs:scope-public-recursive -> This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-public-recursive"
|
||||
@@ -4535,7 +4581,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-resource-recursive -> This scope recursive access to the complete `$RESOURCE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-resource-recursive -> This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-resource-recursive"
|
||||
@@ -4556,7 +4602,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-runtime-recursive -> This scope recursive access to the complete `$RUNTIME` folder, including sub directories and files.",
|
||||
"description": "fs:scope-runtime-recursive -> This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-runtime-recursive"
|
||||
@@ -4577,7 +4623,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-temp-recursive -> This scope recursive access to the complete `$TEMP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-temp-recursive -> This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-temp-recursive"
|
||||
@@ -4598,7 +4644,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-template-recursive -> This scope recursive access to the complete `$TEMPLATE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-template-recursive -> This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-template-recursive"
|
||||
@@ -4619,7 +4665,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-video-recursive -> This scope recursive access to the complete `$VIDEO` folder, including sub directories and files.",
|
||||
"description": "fs:scope-video-recursive -> This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-video-recursive"
|
||||
@@ -5053,6 +5099,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "os:default -> 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",
|
||||
"enum": [
|
||||
"os:default"
|
||||
@@ -5311,6 +5358,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "shell:default -> 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",
|
||||
"enum": [
|
||||
"shell:default"
|
||||
@@ -5548,7 +5596,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "updater:default -> Allows checking for new updates and installing them",
|
||||
"description": "updater:default -> 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",
|
||||
"enum": [
|
||||
"updater:default"
|
||||
@@ -6170,6 +6218,13 @@
|
||||
"window:allow-set-title"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "window:allow-set-title-bar-style -> Enables the set_title_bar_style command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"window:allow-set-title-bar-style"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "window:allow-set-visible-on-all-workspaces -> Enables the set_visible_on_all_workspaces command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -6611,6 +6666,13 @@
|
||||
"window:deny-set-title"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "window:deny-set-title-bar-style -> Denies the set_title_bar_style command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"window:deny-set-title-bar-style"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "window:deny-set-visible-on-all-workspaces -> Denies the set_visible_on_all_workspaces command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -6675,6 +6737,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "window-state:default -> 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",
|
||||
"enum": [
|
||||
"window-state:default"
|
||||
|
||||
@@ -2512,69 +2512,6 @@
|
||||
"clipboard-manager:deny-write-text"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "deep-link:default -> Allows reading the opened deep link via the get_current command",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deep-link:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "deep-link:allow-get-current -> Enables the get_current command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deep-link:allow-get-current"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "deep-link:allow-is-registered -> Enables the is_registered command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deep-link:allow-is-registered"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "deep-link:allow-register -> Enables the register command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deep-link:allow-register"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "deep-link:allow-unregister -> Enables the unregister command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deep-link:allow-unregister"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "deep-link:deny-get-current -> Denies the get_current command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deep-link:deny-get-current"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "deep-link:deny-is-registered -> Denies the is_registered command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deep-link:deny-is-registered"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "deep-link:deny-register -> Denies the register command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deep-link:deny-register"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "deep-link:deny-unregister -> Denies the unregister command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deep-link:deny-unregister"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
],
|
||||
"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.",
|
||||
"description": "A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\n\nIt controls application windows fine grained access to the Tauri core, application, or plugin commands. If 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 groups of windows, based on their required system access, which can reduce impact of frontend vulnerabilities in less privileged windows. Windows can be added to a capability by exact name (e.g. `main-window`) or glob patterns like `*` or `admin-*`. A Window can have none, one, or multiple associated capabilities.\n\n## Example\n\n```json { \"identifier\": \"main-user-files-write\", \"description\": \"This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programatic access to files selected by the user.\", \"windows\": [ \"main\" ], \"permissions\": [ \"path:default\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] }, \"platforms\": [\"macOS\",\"windows\"] } ```",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"identifier",
|
||||
@@ -45,16 +45,16 @@
|
||||
],
|
||||
"properties": {
|
||||
"identifier": {
|
||||
"description": "Identifier of the capability.",
|
||||
"description": "Identifier of the capability.\n\n## Example\n\n`main-user-files-write`",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "Description of the capability.",
|
||||
"description": "Description of what the capability is intended to allow on associated windows.\n\nIt should contain a description of what the grouped permissions should allow.\n\n## Example\n\nThis capability allows the `main` window access to `filesystem` write related commands and `dialog` commands to enable programatic access to files selected by the user.",
|
||||
"default": "",
|
||||
"type": "string"
|
||||
},
|
||||
"remote": {
|
||||
"description": "Configure remote URLs that can use the capability permissions.",
|
||||
"description": "Configure remote URLs that can use the capability permissions.\n\nThis setting is optional and defaults to not being set, as our default use case is that the content is served from our local application.\n\n:::caution Make sure you understand the security implications of providing remote sources with local system access. :::\n\n## Example\n\n```json { \"urls\": [\"https://*.mydomain.dev\"] } ```",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/CapabilityRemote"
|
||||
@@ -70,28 +70,29 @@
|
||||
"type": "boolean"
|
||||
},
|
||||
"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.",
|
||||
"description": "List of windows that are affected by this capability. Can be a glob pattern.\n\nOn multiwebview windows, prefer [`Self::webviews`] for a fine grained access control.\n\n## Example\n\n`[\"main\"]`",
|
||||
"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.",
|
||||
"description": "List of webviews that are affected by 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.\n\n## Example\n\n`[\"sub-webview-one\", \"sub-webview-two\"]`",
|
||||
"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}`.",
|
||||
"description": "List of permissions attached to this capability.\n\nMust include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`. For commands directly implemented in the application itself only `${permission-name}` is required.\n\n## Example\n\n```json [ \"path:default\", \"event:default\", \"window:default\", \"app:default\", \"image:default\", \"resources:default\", \"menu:default\", \"tray:default\", \"shell:allow-open\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] } ```",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/PermissionEntry"
|
||||
}
|
||||
},
|
||||
"uniqueItems": true
|
||||
},
|
||||
"platforms": {
|
||||
"description": "Target platforms this capability applies. By default all platforms are affected by this capability.",
|
||||
"description": "Limit which target platforms this capability applies to.\n\nBy default all platforms are targeted.\n\n## Example\n\n`[\"macOS\",\"windows\"]`",
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
@@ -110,7 +111,7 @@
|
||||
],
|
||||
"properties": {
|
||||
"urls": {
|
||||
"description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n# Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api",
|
||||
"description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n## Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
@@ -142,7 +143,7 @@
|
||||
"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",
|
||||
"description": "fs:default -> 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": [
|
||||
"fs:default"
|
||||
@@ -1373,6 +1374,13 @@
|
||||
"fs:allow-write-text-file"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:create-app-specific-dirs -> This permissions allows to create the application specific directories.\n",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:create-app-specific-dirs"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:deny-copy-file -> Denies the copy_file command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -1562,6 +1570,13 @@
|
||||
"fs:read-all"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:read-app-specific-dirs-recursive -> This permission allows recursive read functionality on the application\nspecific base directories. \n",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:read-app-specific-dirs-recursive"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:read-dirs -> This enables directory read and file metadata related commands without any pre-configured accessible paths.",
|
||||
"type": "string",
|
||||
@@ -1605,7 +1620,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-app-recursive -> This scope recursive access to the complete `$APP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-app-recursive -> This scope permits recursive access to the complete `$APP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-app-recursive"
|
||||
@@ -1626,7 +1641,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appcache-recursive -> This scope recursive access to the complete `$APPCACHE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appcache-recursive -> This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appcache-recursive"
|
||||
@@ -1647,7 +1662,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appconfig-recursive -> This scope recursive access to the complete `$APPCONFIG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appconfig-recursive -> This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appconfig-recursive"
|
||||
@@ -1668,7 +1683,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appdata-recursive -> This scope recursive access to the complete `$APPDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appdata-recursive -> This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appdata-recursive"
|
||||
@@ -1689,7 +1704,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-applocaldata-recursive -> This scope recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-applocaldata-recursive -> This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-applocaldata-recursive"
|
||||
@@ -1710,7 +1725,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-applog-recursive -> This scope recursive access to the complete `$APPLOG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-applog-recursive -> This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-applog-recursive"
|
||||
@@ -1731,7 +1746,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-audio-recursive -> This scope recursive access to the complete `$AUDIO` folder, including sub directories and files.",
|
||||
"description": "fs:scope-audio-recursive -> This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-audio-recursive"
|
||||
@@ -1752,7 +1767,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-cache-recursive -> This scope recursive access to the complete `$CACHE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-cache-recursive -> This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-cache-recursive"
|
||||
@@ -1773,7 +1788,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-config-recursive -> This scope recursive access to the complete `$CONFIG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-config-recursive -> This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-config-recursive"
|
||||
@@ -1794,7 +1809,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-data-recursive -> This scope recursive access to the complete `$DATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-data-recursive -> This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-data-recursive"
|
||||
@@ -1815,7 +1830,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-desktop-recursive -> This scope recursive access to the complete `$DESKTOP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-desktop-recursive -> This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-desktop-recursive"
|
||||
@@ -1836,7 +1851,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-document-recursive -> This scope recursive access to the complete `$DOCUMENT` folder, including sub directories and files.",
|
||||
"description": "fs:scope-document-recursive -> This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-document-recursive"
|
||||
@@ -1857,7 +1872,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-download-recursive -> This scope recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.",
|
||||
"description": "fs:scope-download-recursive -> This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-download-recursive"
|
||||
@@ -1878,7 +1893,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-exe-recursive -> This scope recursive access to the complete `$EXE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-exe-recursive -> This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-exe-recursive"
|
||||
@@ -1899,7 +1914,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-font-recursive -> This scope recursive access to the complete `$FONT` folder, including sub directories and files.",
|
||||
"description": "fs:scope-font-recursive -> This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-font-recursive"
|
||||
@@ -1920,7 +1935,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-home-recursive -> This scope recursive access to the complete `$HOME` folder, including sub directories and files.",
|
||||
"description": "fs:scope-home-recursive -> This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-home-recursive"
|
||||
@@ -1941,7 +1956,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-localdata-recursive -> This scope recursive access to the complete `$LOCALDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-localdata-recursive -> This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-localdata-recursive"
|
||||
@@ -1962,7 +1977,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-log-recursive -> This scope recursive access to the complete `$LOG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-log-recursive -> This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-log-recursive"
|
||||
@@ -1983,7 +1998,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-picture-recursive -> This scope recursive access to the complete `$PICTURE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-picture-recursive -> This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-picture-recursive"
|
||||
@@ -2004,7 +2019,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-public-recursive -> This scope recursive access to the complete `$PUBLIC` folder, including sub directories and files.",
|
||||
"description": "fs:scope-public-recursive -> This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-public-recursive"
|
||||
@@ -2025,7 +2040,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-resource-recursive -> This scope recursive access to the complete `$RESOURCE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-resource-recursive -> This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-resource-recursive"
|
||||
@@ -2046,7 +2061,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-runtime-recursive -> This scope recursive access to the complete `$RUNTIME` folder, including sub directories and files.",
|
||||
"description": "fs:scope-runtime-recursive -> This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-runtime-recursive"
|
||||
@@ -2067,7 +2082,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-temp-recursive -> This scope recursive access to the complete `$TEMP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-temp-recursive -> This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-temp-recursive"
|
||||
@@ -2088,7 +2103,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-template-recursive -> This scope recursive access to the complete `$TEMPLATE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-template-recursive -> This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-template-recursive"
|
||||
@@ -2109,7 +2124,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-video-recursive -> This scope recursive access to the complete `$VIDEO` folder, including sub directories and files.",
|
||||
"description": "fs:scope-video-recursive -> This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-video-recursive"
|
||||
@@ -2190,6 +2205,7 @@
|
||||
"identifier": {
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "shell:default -> 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",
|
||||
"enum": [
|
||||
"shell:default"
|
||||
@@ -2366,6 +2382,13 @@
|
||||
"app:allow-app-show"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "app:allow-default-window-icon -> Enables the default_window_icon command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"app:allow-default-window-icon"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "app:allow-name -> Enables the name command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -2401,6 +2424,13 @@
|
||||
"app:deny-app-show"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "app:deny-default-window-icon -> Denies the default_window_icon command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"app:deny-default-window-icon"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "app:deny-name -> Denies the name command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -2423,6 +2453,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:default -> 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",
|
||||
"enum": [
|
||||
"clipboard-manager:default"
|
||||
@@ -2513,6 +2544,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "dialog:default -> 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",
|
||||
"enum": [
|
||||
"dialog:default"
|
||||
@@ -3709,7 +3741,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"description": "fs:default -> 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": [
|
||||
"fs:default"
|
||||
@@ -3883,6 +3915,13 @@
|
||||
"fs:allow-write-text-file"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:create-app-specific-dirs -> This permissions allows to create the application specific directories.\n",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:create-app-specific-dirs"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:deny-copy-file -> Denies the copy_file command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -4072,6 +4111,13 @@
|
||||
"fs:read-all"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:read-app-specific-dirs-recursive -> This permission allows recursive read functionality on the application\nspecific base directories. \n",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:read-app-specific-dirs-recursive"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:read-dirs -> This enables directory read and file metadata related commands without any pre-configured accessible paths.",
|
||||
"type": "string",
|
||||
@@ -4115,7 +4161,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-app-recursive -> This scope recursive access to the complete `$APP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-app-recursive -> This scope permits recursive access to the complete `$APP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-app-recursive"
|
||||
@@ -4136,7 +4182,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appcache-recursive -> This scope recursive access to the complete `$APPCACHE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appcache-recursive -> This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appcache-recursive"
|
||||
@@ -4157,7 +4203,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appconfig-recursive -> This scope recursive access to the complete `$APPCONFIG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appconfig-recursive -> This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appconfig-recursive"
|
||||
@@ -4178,7 +4224,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appdata-recursive -> This scope recursive access to the complete `$APPDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appdata-recursive -> This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appdata-recursive"
|
||||
@@ -4199,7 +4245,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-applocaldata-recursive -> This scope recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-applocaldata-recursive -> This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-applocaldata-recursive"
|
||||
@@ -4220,7 +4266,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-applog-recursive -> This scope recursive access to the complete `$APPLOG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-applog-recursive -> This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-applog-recursive"
|
||||
@@ -4241,7 +4287,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-audio-recursive -> This scope recursive access to the complete `$AUDIO` folder, including sub directories and files.",
|
||||
"description": "fs:scope-audio-recursive -> This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-audio-recursive"
|
||||
@@ -4262,7 +4308,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-cache-recursive -> This scope recursive access to the complete `$CACHE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-cache-recursive -> This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-cache-recursive"
|
||||
@@ -4283,7 +4329,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-config-recursive -> This scope recursive access to the complete `$CONFIG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-config-recursive -> This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-config-recursive"
|
||||
@@ -4304,7 +4350,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-data-recursive -> This scope recursive access to the complete `$DATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-data-recursive -> This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-data-recursive"
|
||||
@@ -4325,7 +4371,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-desktop-recursive -> This scope recursive access to the complete `$DESKTOP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-desktop-recursive -> This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-desktop-recursive"
|
||||
@@ -4346,7 +4392,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-document-recursive -> This scope recursive access to the complete `$DOCUMENT` folder, including sub directories and files.",
|
||||
"description": "fs:scope-document-recursive -> This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-document-recursive"
|
||||
@@ -4367,7 +4413,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-download-recursive -> This scope recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.",
|
||||
"description": "fs:scope-download-recursive -> This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-download-recursive"
|
||||
@@ -4388,7 +4434,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-exe-recursive -> This scope recursive access to the complete `$EXE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-exe-recursive -> This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-exe-recursive"
|
||||
@@ -4409,7 +4455,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-font-recursive -> This scope recursive access to the complete `$FONT` folder, including sub directories and files.",
|
||||
"description": "fs:scope-font-recursive -> This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-font-recursive"
|
||||
@@ -4430,7 +4476,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-home-recursive -> This scope recursive access to the complete `$HOME` folder, including sub directories and files.",
|
||||
"description": "fs:scope-home-recursive -> This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-home-recursive"
|
||||
@@ -4451,7 +4497,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-localdata-recursive -> This scope recursive access to the complete `$LOCALDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-localdata-recursive -> This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-localdata-recursive"
|
||||
@@ -4472,7 +4518,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-log-recursive -> This scope recursive access to the complete `$LOG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-log-recursive -> This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-log-recursive"
|
||||
@@ -4493,7 +4539,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-picture-recursive -> This scope recursive access to the complete `$PICTURE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-picture-recursive -> This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-picture-recursive"
|
||||
@@ -4514,7 +4560,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-public-recursive -> This scope recursive access to the complete `$PUBLIC` folder, including sub directories and files.",
|
||||
"description": "fs:scope-public-recursive -> This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-public-recursive"
|
||||
@@ -4535,7 +4581,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-resource-recursive -> This scope recursive access to the complete `$RESOURCE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-resource-recursive -> This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-resource-recursive"
|
||||
@@ -4556,7 +4602,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-runtime-recursive -> This scope recursive access to the complete `$RUNTIME` folder, including sub directories and files.",
|
||||
"description": "fs:scope-runtime-recursive -> This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-runtime-recursive"
|
||||
@@ -4577,7 +4623,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-temp-recursive -> This scope recursive access to the complete `$TEMP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-temp-recursive -> This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-temp-recursive"
|
||||
@@ -4598,7 +4644,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-template-recursive -> This scope recursive access to the complete `$TEMPLATE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-template-recursive -> This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-template-recursive"
|
||||
@@ -4619,7 +4665,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-video-recursive -> This scope recursive access to the complete `$VIDEO` folder, including sub directories and files.",
|
||||
"description": "fs:scope-video-recursive -> This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-video-recursive"
|
||||
@@ -5053,6 +5099,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "os:default -> 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",
|
||||
"enum": [
|
||||
"os:default"
|
||||
@@ -5311,6 +5358,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "shell:default -> 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",
|
||||
"enum": [
|
||||
"shell:default"
|
||||
@@ -5548,7 +5596,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "updater:default -> Allows checking for new updates and installing them",
|
||||
"description": "updater:default -> 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",
|
||||
"enum": [
|
||||
"updater:default"
|
||||
@@ -6170,6 +6218,13 @@
|
||||
"window:allow-set-title"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "window:allow-set-title-bar-style -> Enables the set_title_bar_style command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"window:allow-set-title-bar-style"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "window:allow-set-visible-on-all-workspaces -> Enables the set_visible_on_all_workspaces command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -6611,6 +6666,13 @@
|
||||
"window:deny-set-title"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "window:deny-set-title-bar-style -> Denies the set_title_bar_style command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"window:deny-set-title-bar-style"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "window:deny-set-visible-on-all-workspaces -> Denies the set_visible_on_all_workspaces command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -6675,6 +6737,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "window-state:default -> 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",
|
||||
"enum": [
|
||||
"window-state:default"
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
],
|
||||
"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.",
|
||||
"description": "A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\n\nIt controls application windows fine grained access to the Tauri core, application, or plugin commands. If 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 groups of windows, based on their required system access, which can reduce impact of frontend vulnerabilities in less privileged windows. Windows can be added to a capability by exact name (e.g. `main-window`) or glob patterns like `*` or `admin-*`. A Window can have none, one, or multiple associated capabilities.\n\n## Example\n\n```json { \"identifier\": \"main-user-files-write\", \"description\": \"This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programatic access to files selected by the user.\", \"windows\": [ \"main\" ], \"permissions\": [ \"path:default\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] }, \"platforms\": [\"macOS\",\"windows\"] } ```",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"identifier",
|
||||
@@ -45,16 +45,16 @@
|
||||
],
|
||||
"properties": {
|
||||
"identifier": {
|
||||
"description": "Identifier of the capability.",
|
||||
"description": "Identifier of the capability.\n\n## Example\n\n`main-user-files-write`",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "Description of the capability.",
|
||||
"description": "Description of what the capability is intended to allow on associated windows.\n\nIt should contain a description of what the grouped permissions should allow.\n\n## Example\n\nThis capability allows the `main` window access to `filesystem` write related commands and `dialog` commands to enable programatic access to files selected by the user.",
|
||||
"default": "",
|
||||
"type": "string"
|
||||
},
|
||||
"remote": {
|
||||
"description": "Configure remote URLs that can use the capability permissions.",
|
||||
"description": "Configure remote URLs that can use the capability permissions.\n\nThis setting is optional and defaults to not being set, as our default use case is that the content is served from our local application.\n\n:::caution Make sure you understand the security implications of providing remote sources with local system access. :::\n\n## Example\n\n```json { \"urls\": [\"https://*.mydomain.dev\"] } ```",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/CapabilityRemote"
|
||||
@@ -70,28 +70,29 @@
|
||||
"type": "boolean"
|
||||
},
|
||||
"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.",
|
||||
"description": "List of windows that are affected by this capability. Can be a glob pattern.\n\nOn multiwebview windows, prefer [`Self::webviews`] for a fine grained access control.\n\n## Example\n\n`[\"main\"]`",
|
||||
"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.",
|
||||
"description": "List of webviews that are affected by 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.\n\n## Example\n\n`[\"sub-webview-one\", \"sub-webview-two\"]`",
|
||||
"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}`.",
|
||||
"description": "List of permissions attached to this capability.\n\nMust include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`. For commands directly implemented in the application itself only `${permission-name}` is required.\n\n## Example\n\n```json [ \"path:default\", \"event:default\", \"window:default\", \"app:default\", \"image:default\", \"resources:default\", \"menu:default\", \"tray:default\", \"shell:allow-open\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] } ```",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/PermissionEntry"
|
||||
}
|
||||
},
|
||||
"uniqueItems": true
|
||||
},
|
||||
"platforms": {
|
||||
"description": "Target platforms this capability applies. By default all platforms are affected by this capability.",
|
||||
"description": "Limit which target platforms this capability applies to.\n\nBy default all platforms are targeted.\n\n## Example\n\n`[\"macOS\",\"windows\"]`",
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
@@ -110,7 +111,7 @@
|
||||
],
|
||||
"properties": {
|
||||
"urls": {
|
||||
"description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n# Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api",
|
||||
"description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n## Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
@@ -142,7 +143,7 @@
|
||||
"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",
|
||||
"description": "fs:default -> 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": [
|
||||
"fs:default"
|
||||
@@ -1373,6 +1374,13 @@
|
||||
"fs:allow-write-text-file"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:create-app-specific-dirs -> This permissions allows to create the application specific directories.\n",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:create-app-specific-dirs"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:deny-copy-file -> Denies the copy_file command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -1562,6 +1570,13 @@
|
||||
"fs:read-all"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:read-app-specific-dirs-recursive -> This permission allows recursive read functionality on the application\nspecific base directories. \n",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:read-app-specific-dirs-recursive"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:read-dirs -> This enables directory read and file metadata related commands without any pre-configured accessible paths.",
|
||||
"type": "string",
|
||||
@@ -1605,7 +1620,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-app-recursive -> This scope recursive access to the complete `$APP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-app-recursive -> This scope permits recursive access to the complete `$APP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-app-recursive"
|
||||
@@ -1626,7 +1641,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appcache-recursive -> This scope recursive access to the complete `$APPCACHE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appcache-recursive -> This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appcache-recursive"
|
||||
@@ -1647,7 +1662,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appconfig-recursive -> This scope recursive access to the complete `$APPCONFIG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appconfig-recursive -> This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appconfig-recursive"
|
||||
@@ -1668,7 +1683,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appdata-recursive -> This scope recursive access to the complete `$APPDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appdata-recursive -> This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appdata-recursive"
|
||||
@@ -1689,7 +1704,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-applocaldata-recursive -> This scope recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-applocaldata-recursive -> This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-applocaldata-recursive"
|
||||
@@ -1710,7 +1725,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-applog-recursive -> This scope recursive access to the complete `$APPLOG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-applog-recursive -> This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-applog-recursive"
|
||||
@@ -1731,7 +1746,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-audio-recursive -> This scope recursive access to the complete `$AUDIO` folder, including sub directories and files.",
|
||||
"description": "fs:scope-audio-recursive -> This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-audio-recursive"
|
||||
@@ -1752,7 +1767,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-cache-recursive -> This scope recursive access to the complete `$CACHE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-cache-recursive -> This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-cache-recursive"
|
||||
@@ -1773,7 +1788,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-config-recursive -> This scope recursive access to the complete `$CONFIG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-config-recursive -> This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-config-recursive"
|
||||
@@ -1794,7 +1809,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-data-recursive -> This scope recursive access to the complete `$DATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-data-recursive -> This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-data-recursive"
|
||||
@@ -1815,7 +1830,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-desktop-recursive -> This scope recursive access to the complete `$DESKTOP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-desktop-recursive -> This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-desktop-recursive"
|
||||
@@ -1836,7 +1851,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-document-recursive -> This scope recursive access to the complete `$DOCUMENT` folder, including sub directories and files.",
|
||||
"description": "fs:scope-document-recursive -> This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-document-recursive"
|
||||
@@ -1857,7 +1872,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-download-recursive -> This scope recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.",
|
||||
"description": "fs:scope-download-recursive -> This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-download-recursive"
|
||||
@@ -1878,7 +1893,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-exe-recursive -> This scope recursive access to the complete `$EXE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-exe-recursive -> This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-exe-recursive"
|
||||
@@ -1899,7 +1914,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-font-recursive -> This scope recursive access to the complete `$FONT` folder, including sub directories and files.",
|
||||
"description": "fs:scope-font-recursive -> This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-font-recursive"
|
||||
@@ -1920,7 +1935,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-home-recursive -> This scope recursive access to the complete `$HOME` folder, including sub directories and files.",
|
||||
"description": "fs:scope-home-recursive -> This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-home-recursive"
|
||||
@@ -1941,7 +1956,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-localdata-recursive -> This scope recursive access to the complete `$LOCALDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-localdata-recursive -> This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-localdata-recursive"
|
||||
@@ -1962,7 +1977,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-log-recursive -> This scope recursive access to the complete `$LOG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-log-recursive -> This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-log-recursive"
|
||||
@@ -1983,7 +1998,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-picture-recursive -> This scope recursive access to the complete `$PICTURE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-picture-recursive -> This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-picture-recursive"
|
||||
@@ -2004,7 +2019,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-public-recursive -> This scope recursive access to the complete `$PUBLIC` folder, including sub directories and files.",
|
||||
"description": "fs:scope-public-recursive -> This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-public-recursive"
|
||||
@@ -2025,7 +2040,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-resource-recursive -> This scope recursive access to the complete `$RESOURCE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-resource-recursive -> This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-resource-recursive"
|
||||
@@ -2046,7 +2061,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-runtime-recursive -> This scope recursive access to the complete `$RUNTIME` folder, including sub directories and files.",
|
||||
"description": "fs:scope-runtime-recursive -> This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-runtime-recursive"
|
||||
@@ -2067,7 +2082,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-temp-recursive -> This scope recursive access to the complete `$TEMP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-temp-recursive -> This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-temp-recursive"
|
||||
@@ -2088,7 +2103,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-template-recursive -> This scope recursive access to the complete `$TEMPLATE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-template-recursive -> This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-template-recursive"
|
||||
@@ -2109,7 +2124,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-video-recursive -> This scope recursive access to the complete `$VIDEO` folder, including sub directories and files.",
|
||||
"description": "fs:scope-video-recursive -> This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-video-recursive"
|
||||
@@ -2190,6 +2205,7 @@
|
||||
"identifier": {
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "shell:default -> 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",
|
||||
"enum": [
|
||||
"shell:default"
|
||||
@@ -2366,6 +2382,13 @@
|
||||
"app:allow-app-show"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "app:allow-default-window-icon -> Enables the default_window_icon command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"app:allow-default-window-icon"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "app:allow-name -> Enables the name command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -2401,6 +2424,13 @@
|
||||
"app:deny-app-show"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "app:deny-default-window-icon -> Denies the default_window_icon command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"app:deny-default-window-icon"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "app:deny-name -> Denies the name command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -2423,6 +2453,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:default -> 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",
|
||||
"enum": [
|
||||
"clipboard-manager:default"
|
||||
@@ -2513,6 +2544,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "dialog:default -> 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",
|
||||
"enum": [
|
||||
"dialog:default"
|
||||
@@ -3709,7 +3741,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"description": "fs:default -> 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": [
|
||||
"fs:default"
|
||||
@@ -3883,6 +3915,13 @@
|
||||
"fs:allow-write-text-file"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:create-app-specific-dirs -> This permissions allows to create the application specific directories.\n",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:create-app-specific-dirs"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:deny-copy-file -> Denies the copy_file command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -4072,6 +4111,13 @@
|
||||
"fs:read-all"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:read-app-specific-dirs-recursive -> This permission allows recursive read functionality on the application\nspecific base directories. \n",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:read-app-specific-dirs-recursive"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:read-dirs -> This enables directory read and file metadata related commands without any pre-configured accessible paths.",
|
||||
"type": "string",
|
||||
@@ -4115,7 +4161,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-app-recursive -> This scope recursive access to the complete `$APP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-app-recursive -> This scope permits recursive access to the complete `$APP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-app-recursive"
|
||||
@@ -4136,7 +4182,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appcache-recursive -> This scope recursive access to the complete `$APPCACHE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appcache-recursive -> This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appcache-recursive"
|
||||
@@ -4157,7 +4203,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appconfig-recursive -> This scope recursive access to the complete `$APPCONFIG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appconfig-recursive -> This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appconfig-recursive"
|
||||
@@ -4178,7 +4224,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appdata-recursive -> This scope recursive access to the complete `$APPDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-appdata-recursive -> This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appdata-recursive"
|
||||
@@ -4199,7 +4245,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-applocaldata-recursive -> This scope recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-applocaldata-recursive -> This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-applocaldata-recursive"
|
||||
@@ -4220,7 +4266,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-applog-recursive -> This scope recursive access to the complete `$APPLOG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-applog-recursive -> This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-applog-recursive"
|
||||
@@ -4241,7 +4287,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-audio-recursive -> This scope recursive access to the complete `$AUDIO` folder, including sub directories and files.",
|
||||
"description": "fs:scope-audio-recursive -> This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-audio-recursive"
|
||||
@@ -4262,7 +4308,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-cache-recursive -> This scope recursive access to the complete `$CACHE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-cache-recursive -> This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-cache-recursive"
|
||||
@@ -4283,7 +4329,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-config-recursive -> This scope recursive access to the complete `$CONFIG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-config-recursive -> This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-config-recursive"
|
||||
@@ -4304,7 +4350,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-data-recursive -> This scope recursive access to the complete `$DATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-data-recursive -> This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-data-recursive"
|
||||
@@ -4325,7 +4371,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-desktop-recursive -> This scope recursive access to the complete `$DESKTOP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-desktop-recursive -> This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-desktop-recursive"
|
||||
@@ -4346,7 +4392,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-document-recursive -> This scope recursive access to the complete `$DOCUMENT` folder, including sub directories and files.",
|
||||
"description": "fs:scope-document-recursive -> This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-document-recursive"
|
||||
@@ -4367,7 +4413,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-download-recursive -> This scope recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.",
|
||||
"description": "fs:scope-download-recursive -> This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-download-recursive"
|
||||
@@ -4388,7 +4434,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-exe-recursive -> This scope recursive access to the complete `$EXE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-exe-recursive -> This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-exe-recursive"
|
||||
@@ -4409,7 +4455,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-font-recursive -> This scope recursive access to the complete `$FONT` folder, including sub directories and files.",
|
||||
"description": "fs:scope-font-recursive -> This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-font-recursive"
|
||||
@@ -4430,7 +4476,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-home-recursive -> This scope recursive access to the complete `$HOME` folder, including sub directories and files.",
|
||||
"description": "fs:scope-home-recursive -> This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-home-recursive"
|
||||
@@ -4451,7 +4497,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-localdata-recursive -> This scope recursive access to the complete `$LOCALDATA` folder, including sub directories and files.",
|
||||
"description": "fs:scope-localdata-recursive -> This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-localdata-recursive"
|
||||
@@ -4472,7 +4518,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-log-recursive -> This scope recursive access to the complete `$LOG` folder, including sub directories and files.",
|
||||
"description": "fs:scope-log-recursive -> This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-log-recursive"
|
||||
@@ -4493,7 +4539,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-picture-recursive -> This scope recursive access to the complete `$PICTURE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-picture-recursive -> This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-picture-recursive"
|
||||
@@ -4514,7 +4560,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-public-recursive -> This scope recursive access to the complete `$PUBLIC` folder, including sub directories and files.",
|
||||
"description": "fs:scope-public-recursive -> This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-public-recursive"
|
||||
@@ -4535,7 +4581,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-resource-recursive -> This scope recursive access to the complete `$RESOURCE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-resource-recursive -> This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-resource-recursive"
|
||||
@@ -4556,7 +4602,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-runtime-recursive -> This scope recursive access to the complete `$RUNTIME` folder, including sub directories and files.",
|
||||
"description": "fs:scope-runtime-recursive -> This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-runtime-recursive"
|
||||
@@ -4577,7 +4623,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-temp-recursive -> This scope recursive access to the complete `$TEMP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-temp-recursive -> This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-temp-recursive"
|
||||
@@ -4598,7 +4644,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-template-recursive -> This scope recursive access to the complete `$TEMPLATE` folder, including sub directories and files.",
|
||||
"description": "fs:scope-template-recursive -> This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-template-recursive"
|
||||
@@ -4619,7 +4665,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-video-recursive -> This scope recursive access to the complete `$VIDEO` folder, including sub directories and files.",
|
||||
"description": "fs:scope-video-recursive -> This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-video-recursive"
|
||||
@@ -5053,6 +5099,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "os:default -> 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",
|
||||
"enum": [
|
||||
"os:default"
|
||||
@@ -5311,6 +5358,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "shell:default -> 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",
|
||||
"enum": [
|
||||
"shell:default"
|
||||
@@ -5548,7 +5596,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "updater:default -> Allows checking for new updates and installing them",
|
||||
"description": "updater:default -> 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",
|
||||
"enum": [
|
||||
"updater:default"
|
||||
@@ -6170,6 +6218,13 @@
|
||||
"window:allow-set-title"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "window:allow-set-title-bar-style -> Enables the set_title_bar_style command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"window:allow-set-title-bar-style"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "window:allow-set-visible-on-all-workspaces -> Enables the set_visible_on_all_workspaces command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -6611,6 +6666,13 @@
|
||||
"window:deny-set-title"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "window:deny-set-title-bar-style -> Denies the set_title_bar_style command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"window:deny-set-title-bar-style"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "window:deny-set-visible-on-all-workspaces -> Denies the set_visible_on_all_workspaces command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -6675,6 +6737,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "window-state:default -> 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",
|
||||
"enum": [
|
||||
"window-state:default"
|
||||
|
||||
@@ -21,3 +21,4 @@ uuid = { version = "1.7.0", features = ["v4"] }
|
||||
tauri = { version = "2.0.0-beta" }
|
||||
tauri-plugin-shell = "2.0.0-beta"
|
||||
md5 = "0.7.0"
|
||||
dunce = "1.0.4"
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
use std::env::temp_dir;
|
||||
use std::ops::Deref;
|
||||
use std::path::PathBuf;
|
||||
use std::str::{from_utf8, FromStr};
|
||||
use std::str::FromStr;
|
||||
|
||||
use anyhow::anyhow;
|
||||
use hyper::client::HttpConnector;
|
||||
use hyper::Client;
|
||||
use hyper_rustls::{HttpsConnector, HttpsConnectorBuilder};
|
||||
use log::{debug, info, warn};
|
||||
use log::{debug, warn};
|
||||
use prost::Message;
|
||||
use prost_reflect::{DescriptorPool, MethodDescriptor};
|
||||
use prost_types::{FileDescriptorProto, FileDescriptorSet};
|
||||
use tauri::path::BaseDirectory;
|
||||
use tauri::{AppHandle, Manager};
|
||||
use tauri_plugin_shell::process::CommandEvent;
|
||||
use tauri_plugin_shell::ShellExt;
|
||||
use tokio::fs;
|
||||
use tokio_stream::StreamExt;
|
||||
@@ -38,11 +37,17 @@ pub async fn fill_pool_from_files(
|
||||
.resolve("protoc-include", BaseDirectory::Resource)
|
||||
.expect("failed to resolve protoc include directory");
|
||||
|
||||
// HACK: Remove UNC prefix for Windows paths
|
||||
let global_import_dir = dunce::simplified(global_import_dir.as_path())
|
||||
.to_string_lossy()
|
||||
.to_string();
|
||||
let desc_path = dunce::simplified(desc_path.as_path());
|
||||
|
||||
let mut args = vec![
|
||||
"--include_imports".to_string(),
|
||||
"--include_source_info".to_string(),
|
||||
"-I".to_string(),
|
||||
global_import_dir.to_string_lossy().to_string(),
|
||||
global_import_dir,
|
||||
"-o".to_string(),
|
||||
desc_path.to_string_lossy().to_string(),
|
||||
];
|
||||
@@ -65,56 +70,29 @@ pub async fn fill_pool_from_files(
|
||||
}
|
||||
}
|
||||
|
||||
let (mut rx, _child) = app_handle
|
||||
let out = app_handle
|
||||
.shell()
|
||||
.sidecar("protoc")
|
||||
.expect("protoc not found")
|
||||
.sidecar("yaakprotoc")
|
||||
.expect("yaakprotoc not found")
|
||||
.args(args)
|
||||
.spawn()
|
||||
.expect("protoc failed to start");
|
||||
.output()
|
||||
.await
|
||||
.expect("yaakprotoc failed to run");
|
||||
|
||||
while let Some(event) = rx.recv().await {
|
||||
match event {
|
||||
CommandEvent::Stdout(line) => {
|
||||
info!(
|
||||
"protoc stdout: {}",
|
||||
from_utf8(line.as_slice()).unwrap_or_default().to_string()
|
||||
);
|
||||
}
|
||||
CommandEvent::Stderr(line) => {
|
||||
info!(
|
||||
"protoc stderr: {}",
|
||||
from_utf8(line.as_slice()).unwrap_or_default().to_string()
|
||||
);
|
||||
}
|
||||
CommandEvent::Error(e) => {
|
||||
return Err(e.to_string());
|
||||
}
|
||||
CommandEvent::Terminated(c) => {
|
||||
match c.code {
|
||||
Some(0) => {
|
||||
// success
|
||||
}
|
||||
Some(code) => {
|
||||
return Err(format!("protoc failed with exit code: {}", code,));
|
||||
}
|
||||
None => {
|
||||
return Err("protoc failed with no exit code".to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
};
|
||||
if !out.status.success() {
|
||||
return Err(format!(
|
||||
"protoc failed with status {}: {}",
|
||||
out.status.code().unwrap(),
|
||||
String::from_utf8_lossy(out.stderr.as_slice())
|
||||
));
|
||||
}
|
||||
|
||||
let bytes = fs::read(desc_path.as_path())
|
||||
.await
|
||||
.map_err(|e| e.to_string())?;
|
||||
let bytes = fs::read(desc_path).await.map_err(|e| e.to_string())?;
|
||||
let fdp = FileDescriptorSet::decode(bytes.deref()).map_err(|e| e.to_string())?;
|
||||
pool.add_file_descriptor_set(fdp)
|
||||
.map_err(|e| e.to_string())?;
|
||||
|
||||
fs::remove_file(desc_path.as_path())
|
||||
fs::remove_file(desc_path)
|
||||
.await
|
||||
.map_err(|e| e.to_string())?;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ use base64::Engine;
|
||||
use http::header::{ACCEPT, USER_AGENT};
|
||||
use http::{HeaderMap, HeaderName, HeaderValue};
|
||||
use log::{error, info, warn};
|
||||
use mime_guess::Mime;
|
||||
use reqwest::redirect::Policy;
|
||||
use reqwest::Method;
|
||||
use reqwest::{multipart, Url};
|
||||
@@ -318,13 +319,21 @@ pub async fn send_http_request(
|
||||
.as_str()
|
||||
.unwrap_or_default();
|
||||
|
||||
// Set or guess mimetype
|
||||
if !ct_raw.is_empty() {
|
||||
let content_type = render::render(ct_raw, &vars);
|
||||
part = part
|
||||
.mime_str(content_type.as_str())
|
||||
.map_err(|e| e.to_string())?;
|
||||
} else if !file_path.is_empty() {
|
||||
let default_mime = Mime::from_str("application/octet-stream").unwrap();
|
||||
let mime = mime_guess::from_path(file_path).first_or(default_mime);
|
||||
part = part
|
||||
.mime_str(mime.essence_str())
|
||||
.map_err(|e| e.to_string())?;
|
||||
}
|
||||
|
||||
// Set fil path if not empty
|
||||
if !file_path.is_empty() {
|
||||
let filename = PathBuf::from(file_path)
|
||||
.file_name()
|
||||
|
||||
@@ -6,7 +6,7 @@ extern crate objc;
|
||||
use std::collections::HashMap;
|
||||
use std::env::current_dir;
|
||||
use std::fs;
|
||||
use std::fs::{create_dir_all, read_to_string, File};
|
||||
use std::fs::{create_dir_all, File, read_to_string};
|
||||
use std::path::PathBuf;
|
||||
use std::process::exit;
|
||||
use std::str::FromStr;
|
||||
@@ -17,43 +17,44 @@ use fern::colors::ColoredLevelConfig;
|
||||
use log::{debug, error, info, warn};
|
||||
use rand::random;
|
||||
use serde_json::{json, Value};
|
||||
use sqlx::{Pool, Sqlite, SqlitePool};
|
||||
use sqlx::migrate::Migrator;
|
||||
use sqlx::sqlite::SqliteConnectOptions;
|
||||
use sqlx::types::Json;
|
||||
use sqlx::{Pool, Sqlite, SqlitePool};
|
||||
use tauri::{AppHandle, Emitter, LogicalSize, RunEvent, State, WebviewUrl, WebviewWindow};
|
||||
use tauri::{Manager, WindowEvent};
|
||||
use tauri::Listener;
|
||||
use tauri::path::BaseDirectory;
|
||||
#[cfg(target_os = "macos")]
|
||||
use tauri::TitleBarStyle;
|
||||
use tauri::{AppHandle, LogicalSize, RunEvent, State, WebviewUrl, WebviewWindow};
|
||||
use tauri::{Manager, WindowEvent};
|
||||
use tauri_plugin_log::{fern, Target, TargetKind};
|
||||
use tauri_plugin_shell::ShellExt;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
use ::grpc::{Code, deserialize_message, serialize_message, ServiceDefinition};
|
||||
use ::grpc::manager::{DynamicMessage, GrpcHandle};
|
||||
use ::grpc::{deserialize_message, serialize_message, Code, ServiceDefinition};
|
||||
use plugin_runtime::manager::PluginManager;
|
||||
|
||||
use crate::analytics::{AnalyticsAction, AnalyticsResource};
|
||||
use crate::grpc::metadata_to_map;
|
||||
use crate::http_request::send_http_request;
|
||||
use crate::models::ImportResult;
|
||||
use crate::models::{
|
||||
cancel_pending_grpc_connections, cancel_pending_responses, create_http_response,
|
||||
delete_all_grpc_connections, delete_all_http_responses, delete_cookie_jar, delete_environment,
|
||||
delete_folder, delete_grpc_connection, delete_grpc_request, delete_http_request,
|
||||
delete_http_response, delete_workspace, duplicate_grpc_request, duplicate_http_request,
|
||||
generate_model_id, get_cookie_jar, get_environment, get_folder, get_grpc_connection,
|
||||
cancel_pending_grpc_connections, cancel_pending_responses, CookieJar,
|
||||
create_http_response, delete_all_grpc_connections, delete_all_http_responses, delete_cookie_jar,
|
||||
delete_environment, delete_folder, delete_grpc_connection, delete_grpc_request,
|
||||
delete_http_request, delete_http_response, delete_workspace, duplicate_grpc_request,
|
||||
duplicate_http_request, Environment, EnvironmentVariable, Folder, generate_model_id,
|
||||
get_cookie_jar, get_environment, get_folder, get_grpc_connection,
|
||||
get_grpc_request, get_http_request, get_http_response, get_key_value_raw,
|
||||
get_or_create_settings, get_workspace, get_workspace_export_resources, list_cookie_jars,
|
||||
list_environments, list_folders, list_grpc_connections, list_grpc_events, list_grpc_requests,
|
||||
list_http_requests, list_responses, list_workspaces, set_key_value_raw, update_response_if_id,
|
||||
update_settings, upsert_cookie_jar, upsert_environment, upsert_folder, upsert_grpc_connection,
|
||||
upsert_grpc_event, upsert_grpc_request, upsert_http_request, upsert_workspace, CookieJar,
|
||||
Environment, EnvironmentVariable, Folder, GrpcConnection, GrpcEvent, GrpcEventType,
|
||||
GrpcRequest, HttpRequest, HttpResponse, KeyValue, ModelType, Settings, Workspace,
|
||||
get_or_create_settings, get_workspace, get_workspace_export_resources, GrpcConnection, GrpcEvent,
|
||||
GrpcEventType, GrpcRequest, HttpRequest, HttpResponse, KeyValue,
|
||||
list_cookie_jars, list_environments, list_folders, list_grpc_connections, list_grpc_events,
|
||||
list_grpc_requests, list_http_requests, list_responses, list_workspaces, ModelType,
|
||||
set_key_value_raw, Settings, update_response_if_id, update_settings, upsert_cookie_jar, upsert_environment,
|
||||
upsert_folder, upsert_grpc_connection, upsert_grpc_event, upsert_grpc_request, upsert_http_request, upsert_workspace, Workspace,
|
||||
WorkspaceExportResources,
|
||||
};
|
||||
use crate::models::ImportResult;
|
||||
use crate::notifications::YaakNotifier;
|
||||
use crate::render::{render_request, variables_from_environment};
|
||||
use crate::updates::{UpdateMode, YaakUpdater};
|
||||
@@ -717,6 +718,7 @@ async fn cmd_send_ephemeral_request(
|
||||
async fn cmd_filter_response(
|
||||
w: WebviewWindow,
|
||||
response_id: &str,
|
||||
plugin_manager: State<'_, Mutex<PluginManager>>,
|
||||
filter: &str,
|
||||
) -> Result<String, String> {
|
||||
let response = get_http_response(&w, response_id)
|
||||
@@ -738,9 +740,9 @@ async fn cmd_filter_response(
|
||||
let body = read_to_string(response.body_path.unwrap()).unwrap();
|
||||
|
||||
// TODO: Have plugins register their own content type (regex?)
|
||||
let manager: State<PluginManager> = w.app_handle().state();
|
||||
manager
|
||||
.inner()
|
||||
plugin_manager
|
||||
.lock()
|
||||
.await
|
||||
.run_response_filter(filter, &body, &content_type)
|
||||
.await
|
||||
.map(|r| r.data)
|
||||
@@ -749,14 +751,18 @@ async fn cmd_filter_response(
|
||||
#[tauri::command]
|
||||
async fn cmd_import_data(
|
||||
w: WebviewWindow,
|
||||
plugin_manager: State<'_, Mutex<PluginManager>>,
|
||||
file_path: &str,
|
||||
_workspace_id: &str,
|
||||
) -> Result<WorkspaceExportResources, String> {
|
||||
let file =
|
||||
read_to_string(file_path).unwrap_or_else(|_| panic!("Unable to read file {}", file_path));
|
||||
let file_contents = file.as_str();
|
||||
let manager: State<PluginManager> = w.app_handle().state();
|
||||
let import_response = manager.inner().run_import(file_contents).await?;
|
||||
let import_response = plugin_manager
|
||||
.lock()
|
||||
.await
|
||||
.run_import(file_contents)
|
||||
.await?;
|
||||
let import_result: ImportResult =
|
||||
serde_json::from_str(import_response.data.as_str()).map_err(|e| e.to_string())?;
|
||||
|
||||
@@ -881,6 +887,7 @@ async fn cmd_import_data(
|
||||
async fn cmd_request_to_curl(
|
||||
app: AppHandle,
|
||||
request_id: &str,
|
||||
plugin_manager: State<'_, Mutex<PluginManager>>,
|
||||
environment_id: Option<&str>,
|
||||
) -> Result<String, String> {
|
||||
let request = get_http_request(&app, request_id)
|
||||
@@ -896,9 +903,9 @@ async fn cmd_request_to_curl(
|
||||
let rendered = render_request(&request, &workspace, environment.as_ref());
|
||||
let request_json = serde_json::to_string(&rendered).map_err(|e| e.to_string())?;
|
||||
|
||||
let manager: State<PluginManager> = app.state();
|
||||
let import_response = manager
|
||||
.inner()
|
||||
let import_response = plugin_manager
|
||||
.lock()
|
||||
.await
|
||||
.run_export_curl(request_json.as_str())
|
||||
.await?;
|
||||
Ok(import_response.data)
|
||||
@@ -906,12 +913,11 @@ async fn cmd_request_to_curl(
|
||||
|
||||
#[tauri::command]
|
||||
async fn cmd_curl_to_request(
|
||||
app_handle: AppHandle,
|
||||
command: &str,
|
||||
plugin_manager: State<'_, Mutex<PluginManager>>,
|
||||
workspace_id: &str,
|
||||
) -> Result<HttpRequest, String> {
|
||||
let manager: State<PluginManager> = app_handle.state();
|
||||
let import_response = manager.inner().run_import(command).await?;
|
||||
let import_response = plugin_manager.lock().await.run_import(command).await?;
|
||||
let import_result: ImportResult =
|
||||
serde_json::from_str(import_response.data.as_str()).map_err(|e| e.to_string())?;
|
||||
import_result
|
||||
@@ -982,15 +988,14 @@ async fn cmd_save_response(
|
||||
#[tauri::command]
|
||||
async fn cmd_send_http_request(
|
||||
window: WebviewWindow,
|
||||
request_id: &str,
|
||||
environment_id: Option<&str>,
|
||||
cookie_jar_id: Option<&str>,
|
||||
download_dir: Option<&str>,
|
||||
// NOTE: We receive the entire request because to account for the race
|
||||
// condition where the user may have just edited a field before sending
|
||||
// that has not yet been saved in the DB.
|
||||
request: HttpRequest,
|
||||
) -> Result<HttpResponse, String> {
|
||||
let request = get_http_request(&window, request_id)
|
||||
.await
|
||||
.expect("Failed to get request");
|
||||
|
||||
let environment = match environment_id {
|
||||
Some(id) => match get_environment(&window, id).await {
|
||||
Ok(env) => Some(env),
|
||||
@@ -1759,7 +1764,6 @@ pub fn run() {
|
||||
});
|
||||
}
|
||||
RunEvent::WindowEvent {
|
||||
label: _label,
|
||||
event: WindowEvent::Focused(true),
|
||||
..
|
||||
} => {
|
||||
@@ -1858,6 +1862,7 @@ fn create_window(handle: &AppHandle, url: &str) -> WebviewWindow {
|
||||
100.0 + random::<f64>() * 30.0,
|
||||
100.0 + random::<f64>() * 30.0,
|
||||
)
|
||||
.min_inner_size(300.0, 300.0)
|
||||
.title(handle.package_info().name.to_string());
|
||||
|
||||
// Add macOS-only things
|
||||
@@ -1894,7 +1899,7 @@ fn create_window(handle: &AppHandle, url: &str) -> WebviewWindow {
|
||||
_ = webview_window
|
||||
.app_handle()
|
||||
.shell()
|
||||
.open("https://yaak.canny.io", None)
|
||||
.open("https://yaak.app/roadmap", None)
|
||||
}
|
||||
|
||||
// Commands for development
|
||||
|
||||
@@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize};
|
||||
use sqlx::types::chrono::NaiveDateTime;
|
||||
use sqlx::types::{Json, JsonValue};
|
||||
use sqlx::{Pool, Sqlite};
|
||||
use tauri::{AppHandle, Manager, WebviewWindow, Wry};
|
||||
use tauri::{AppHandle, Emitter, Manager, WebviewWindow, Wry};
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
pub enum ModelType {
|
||||
|
||||
@@ -4,7 +4,7 @@ use chrono::{DateTime, Duration, Utc};
|
||||
use log::debug;
|
||||
use reqwest::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tauri::{AppHandle, Manager};
|
||||
use tauri::{AppHandle, Emitter};
|
||||
|
||||
use crate::analytics::get_num_launches;
|
||||
use crate::models::{get_key_value_raw, set_key_value_raw};
|
||||
@@ -70,20 +70,19 @@ impl YaakNotifier {
|
||||
("launches", num_launches.to_string()),
|
||||
]);
|
||||
let resp = req.send().await.map_err(|e| e.to_string())?;
|
||||
if resp.status().to_string() != "200" {
|
||||
if resp.status() != 200 {
|
||||
debug!("Skipping notification status code {}", resp.status());
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
||||
let notification = resp
|
||||
.json::<YaakNotification>()
|
||||
.await
|
||||
.map_err(|e| e.to_string())?;
|
||||
|
||||
let age = notification
|
||||
.timestamp
|
||||
.signed_duration_since(Utc::now());
|
||||
let age = notification.timestamp.signed_duration_since(Utc::now());
|
||||
let seen = get_kv(app).await?;
|
||||
if seen.contains(¬ification.id) || (age > Duration::days(1)) {
|
||||
if seen.contains(¬ification.id) || (age > Duration::days(2)) {
|
||||
debug!("Already seen notification {}", notification.id);
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
@@ -2,10 +2,7 @@ use hex_color::HexColor;
|
||||
use log::warn;
|
||||
use objc::{msg_send, sel, sel_impl};
|
||||
use rand::{distributions::Alphanumeric, Rng};
|
||||
use tauri::{
|
||||
plugin::{Builder, TauriPlugin},
|
||||
Manager, Runtime, Window, WindowEvent,
|
||||
};
|
||||
use tauri::{plugin::{Builder, TauriPlugin}, Manager, Runtime, Window, WindowEvent, Emitter, Listener};
|
||||
|
||||
const WINDOW_CONTROL_PAD_X: f64 = 13.0;
|
||||
const WINDOW_CONTROL_PAD_Y: f64 = 18.0;
|
||||
@@ -424,7 +421,7 @@ pub fn setup_traffic_light_positioner<R: Runtime>(window: &Window<R>) {
|
||||
}
|
||||
}
|
||||
|
||||
// Are we de-allocing this properly ? (I miss safe Rust :( )
|
||||
// Are we de-allocing this properly? (I miss safe Rust :( )
|
||||
let window_label = window.label().to_string();
|
||||
|
||||
let app_state = WindowState {
|
||||
|
||||
@@ -5,8 +5,10 @@ edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.86"
|
||||
command-group = "5.0.1"
|
||||
dunce = "1.0.4"
|
||||
log = "0.4.21"
|
||||
prost = "0.12"
|
||||
prost = "0.13.1"
|
||||
rand = "0.8.5"
|
||||
reqwest = { version = "0.12.5", features = ["stream"] }
|
||||
serde = { version = "1.0.198", features = ["derive"] }
|
||||
@@ -14,7 +16,7 @@ serde_json = "1.0.113"
|
||||
tauri = { version = "2.0.0-beta" }
|
||||
tauri-plugin-shell = "2.0.0-beta"
|
||||
tokio = { version = "1.0", features = ["macros", "rt-multi-thread", "process"] }
|
||||
tonic = "0.11"
|
||||
tonic = "0.12.1"
|
||||
|
||||
[build-dependencies]
|
||||
tonic-build = "0.11"
|
||||
tonic-build = "0.12.1"
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
extern crate core;
|
||||
|
||||
use tauri::plugin::{Builder, TauriPlugin};
|
||||
use tauri::{Manager, Runtime};
|
||||
|
||||
use crate::manager::PluginManager;
|
||||
use log::info;
|
||||
use std::process::exit;
|
||||
use tauri::plugin::{Builder, TauriPlugin};
|
||||
use tauri::{Manager, RunEvent, Runtime, State};
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
pub mod manager;
|
||||
mod nodejs;
|
||||
@@ -17,9 +19,23 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
|
||||
.setup(|app, _| {
|
||||
tauri::async_runtime::block_on(async move {
|
||||
let manager = PluginManager::new(&app).await;
|
||||
app.manage(manager);
|
||||
let manager_state = Mutex::new(manager);
|
||||
app.manage(manager_state);
|
||||
Ok(())
|
||||
})
|
||||
})
|
||||
.on_event(|app, e| match e {
|
||||
// TODO: Also exit when app is force-quit (eg. cmd+r in IntelliJ runner)
|
||||
RunEvent::ExitRequested { api, .. } => {
|
||||
api.prevent_exit();
|
||||
tauri::async_runtime::block_on(async move {
|
||||
info!("Exiting plugin runtime due to app exit");
|
||||
let manager: State<Mutex<PluginManager>> = app.state();
|
||||
manager.lock().await.cleanup().await;
|
||||
exit(0);
|
||||
});
|
||||
}
|
||||
_ => {}
|
||||
})
|
||||
.build()
|
||||
}
|
||||
|
||||
@@ -1,40 +1,46 @@
|
||||
use log::{debug, info};
|
||||
use std::time::Duration;
|
||||
use tauri::{AppHandle, Manager, Runtime};
|
||||
use tokio::sync::Mutex;
|
||||
use tokio::sync::watch::Sender;
|
||||
use tonic::transport::Channel;
|
||||
|
||||
use crate::nodejs::node_start;
|
||||
use crate::plugin_runtime::plugin_runtime_client::PluginRuntimeClient;
|
||||
use crate::plugin_runtime::{HookExportRequest, HookImportRequest, HookResponse, HookResponseFilterRequest};
|
||||
use crate::plugin_runtime::{
|
||||
HookExportRequest, HookImportRequest, HookResponse, HookResponseFilterRequest,
|
||||
};
|
||||
|
||||
pub struct PluginManager {
|
||||
client: Mutex<PluginRuntimeClient<Channel>>,
|
||||
client: PluginRuntimeClient<Channel>,
|
||||
kill_tx: Sender<bool>,
|
||||
}
|
||||
|
||||
impl PluginManager {
|
||||
pub async fn new<R: Runtime>(app_handle: &AppHandle<R>) -> PluginManager {
|
||||
let temp_dir = app_handle.path().temp_dir().unwrap();
|
||||
|
||||
let addr = node_start(app_handle, &temp_dir).await;
|
||||
info!("Connecting to gRPC client at {addr}");
|
||||
let (kill_tx, kill_rx) = tokio::sync::watch::channel(false);
|
||||
let start_resp = node_start(app_handle, &temp_dir, &kill_rx).await;
|
||||
info!("Connecting to gRPC client at {}", start_resp.addr);
|
||||
|
||||
let client = match PluginRuntimeClient::connect(addr.clone()).await {
|
||||
let client = match PluginRuntimeClient::connect(start_resp.addr.clone()).await {
|
||||
Ok(v) => v,
|
||||
Err(err) => {
|
||||
panic!("{}", err.to_string());
|
||||
}
|
||||
Err(err) => panic!("{}", err.to_string()),
|
||||
};
|
||||
|
||||
PluginManager {
|
||||
client: Mutex::new(client),
|
||||
}
|
||||
PluginManager { client, kill_tx }
|
||||
}
|
||||
|
||||
pub async fn run_import(&self, data: &str) -> Result<HookResponse, String> {
|
||||
pub async fn cleanup(&mut self) {
|
||||
self.kill_tx.send_replace(true);
|
||||
|
||||
// Give it a bit of time to kill
|
||||
tokio::time::sleep(Duration::from_millis(500)).await;
|
||||
}
|
||||
|
||||
pub async fn run_import(&mut self, data: &str) -> Result<HookResponse, String> {
|
||||
let response = self
|
||||
.client
|
||||
.lock()
|
||||
.await
|
||||
.hook_import(tonic::Request::new(HookImportRequest {
|
||||
data: data.to_string(),
|
||||
}))
|
||||
@@ -44,11 +50,9 @@ impl PluginManager {
|
||||
Ok(response.into_inner())
|
||||
}
|
||||
|
||||
pub async fn run_export_curl(&self, request: &str) -> Result<HookResponse, String> {
|
||||
pub async fn run_export_curl(&mut self, request: &str) -> Result<HookResponse, String> {
|
||||
let response = self
|
||||
.client
|
||||
.lock()
|
||||
.await
|
||||
.hook_export(tonic::Request::new(HookExportRequest {
|
||||
request: request.to_string(),
|
||||
}))
|
||||
@@ -59,7 +63,7 @@ impl PluginManager {
|
||||
}
|
||||
|
||||
pub async fn run_response_filter(
|
||||
&self,
|
||||
&mut self,
|
||||
filter: &str,
|
||||
body: &str,
|
||||
content_type: &str,
|
||||
@@ -67,8 +71,6 @@ impl PluginManager {
|
||||
debug!("Running plugin filter");
|
||||
let response = self
|
||||
.client
|
||||
.lock()
|
||||
.await
|
||||
.hook_response_filter(tonic::Request::new(HookResponseFilterRequest {
|
||||
filter: filter.to_string(),
|
||||
body: body.to_string(),
|
||||
|
||||
@@ -7,9 +7,9 @@ use serde;
|
||||
use serde::Deserialize;
|
||||
use tauri::path::BaseDirectory;
|
||||
use tauri::{AppHandle, Manager, Runtime};
|
||||
use tauri_plugin_shell::process::CommandEvent;
|
||||
use tauri_plugin_shell::ShellExt;
|
||||
use tokio::fs;
|
||||
use tokio::sync::watch::Receiver;
|
||||
|
||||
#[derive(Deserialize, Default)]
|
||||
#[serde(default, rename_all = "camelCase")]
|
||||
@@ -17,49 +17,67 @@ struct PortFile {
|
||||
port: i32,
|
||||
}
|
||||
|
||||
pub async fn node_start<R: Runtime>(app: &AppHandle<R>, temp_dir: &PathBuf) -> String {
|
||||
pub struct StartResp {
|
||||
pub addr: String,
|
||||
}
|
||||
|
||||
pub async fn node_start<R: Runtime>(
|
||||
app: &AppHandle<R>,
|
||||
temp_dir: &PathBuf,
|
||||
kill_rx: &Receiver<bool>,
|
||||
) -> StartResp {
|
||||
let port_file_path = temp_dir.join(Alphanumeric.sample_string(&mut rand::thread_rng(), 10));
|
||||
|
||||
let plugins_dir = app
|
||||
.path()
|
||||
.resolve("plugins", BaseDirectory::Resource)
|
||||
.expect("failed to resolve plugin directory resource")
|
||||
.expect("failed to resolve plugin directory resource");
|
||||
|
||||
let plugin_runtime_main = app
|
||||
.path()
|
||||
.resolve("plugin-runtime", BaseDirectory::Resource)
|
||||
.expect("failed to resolve plugin runtime resource")
|
||||
.join("index.cjs");
|
||||
|
||||
// HACK: Remove UNC prefix for Windows paths to pass to sidecar
|
||||
|
||||
let plugins_dir = dunce::simplified(plugins_dir.as_path())
|
||||
.to_string_lossy()
|
||||
.to_string();
|
||||
let plugin_runtime_main = dunce::simplified(plugin_runtime_main.as_path())
|
||||
.to_string_lossy()
|
||||
.to_string();
|
||||
|
||||
let plugin_runtime_dir = app
|
||||
.path()
|
||||
.resolve("plugin-runtime", BaseDirectory::Resource)
|
||||
.expect("failed to resolve plugin runtime resource");
|
||||
|
||||
// HACK: Remove UNC prefix for Windows paths
|
||||
let plugins_dir = plugins_dir.replace("\\\\?\\", "");
|
||||
|
||||
info!(
|
||||
"Starting plugin runtime port_file={} plugins_dir={}",
|
||||
"Starting plugin runtime\n → port_file={}\n → plugins_dir={}\n → runtime_dir={}",
|
||||
port_file_path.to_string_lossy(),
|
||||
plugins_dir,
|
||||
plugin_runtime_main,
|
||||
);
|
||||
|
||||
let (mut rx, _child) = app
|
||||
let cmd = app
|
||||
.shell()
|
||||
.sidecar("node")
|
||||
.unwrap()
|
||||
.sidecar("yaaknode")
|
||||
.expect("yaaknode not found")
|
||||
.env("YAAK_GRPC_PORT_FILE_PATH", port_file_path.clone())
|
||||
.env("YAAK_PLUGINS_DIR", plugins_dir)
|
||||
.args(&[plugin_runtime_dir.join("index.cjs")])
|
||||
.spawn()
|
||||
.unwrap();
|
||||
.args(&[plugin_runtime_main]);
|
||||
|
||||
tauri::async_runtime::spawn(async move {
|
||||
// read events such as stdout
|
||||
while let Some(event) = rx.recv().await {
|
||||
if let CommandEvent::Stdout(line) = event {
|
||||
print!("{}", String::from_utf8_lossy(line.as_slice()));
|
||||
} else if let CommandEvent::Stderr(line) = event {
|
||||
print!("{}", String::from_utf8_lossy(line.as_slice()));
|
||||
}
|
||||
}
|
||||
println!("Waiting on plugin runtime");
|
||||
let (_, child) = cmd.spawn().expect("yaaknode failed to start");
|
||||
|
||||
let mut kill_rx = kill_rx.clone();
|
||||
|
||||
// Check on child
|
||||
tokio::spawn(async move {
|
||||
kill_rx
|
||||
.wait_for(|b| *b == true)
|
||||
.await
|
||||
.expect("Kill channel errored");
|
||||
info!("Killing plugin runtime");
|
||||
child.kill().expect("Failed to kill plugin runtime");
|
||||
info!("Killed plugin runtime");
|
||||
return;
|
||||
});
|
||||
|
||||
let start = std::time::Instant::now();
|
||||
@@ -79,5 +97,7 @@ pub async fn node_start<R: Runtime>(app: &AppHandle<R>, temp_dir: &PathBuf) -> S
|
||||
|
||||
let port_file: PortFile = serde_json::from_str(port_file_contents.as_str()).unwrap();
|
||||
info!("Started plugin runtime on :{}", port_file.port);
|
||||
format!("http://localhost:{}", port_file.port)
|
||||
let addr = format!("http://localhost:{}", port_file.port);
|
||||
|
||||
StartResp { addr }
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
"active": true,
|
||||
"category": "DeveloperTool",
|
||||
"externalBin": [
|
||||
"vendored/protoc/protoc",
|
||||
"vendored/node/node"
|
||||
"vendored/protoc/yaakprotoc",
|
||||
"vendored/node/yaaknode"
|
||||
],
|
||||
"icon": [
|
||||
"icons/release/32x32.png",
|
||||
@@ -60,14 +60,14 @@
|
||||
},
|
||||
"shortDescription": "Play with APIs, intuitively",
|
||||
"targets": [
|
||||
"deb",
|
||||
"rpm",
|
||||
"appimage",
|
||||
"nsis",
|
||||
"app",
|
||||
"appimage",
|
||||
"deb",
|
||||
"dmg",
|
||||
"updater"
|
||||
"nsis",
|
||||
"rpm"
|
||||
],
|
||||
"createUpdaterArtifacts": "v1Compatible",
|
||||
"iOS": {
|
||||
"developmentTeam": "7PU3P6ELJ8"
|
||||
},
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { open } from '@tauri-apps/plugin-dialog';
|
||||
import mime from 'mime';
|
||||
import { useKeyValue } from '../hooks/useKeyValue';
|
||||
import type { HttpRequest } from '../lib/models';
|
||||
@@ -6,6 +5,7 @@ import { Banner } from './core/Banner';
|
||||
import { Button } from './core/Button';
|
||||
import { InlineCode } from './core/InlineCode';
|
||||
import { HStack, VStack } from './core/Stacks';
|
||||
import { SelectFile } from './SelectFile';
|
||||
|
||||
type Props = {
|
||||
requestId: string;
|
||||
@@ -28,33 +28,17 @@ export function BinaryFileEditor({
|
||||
fallback: false,
|
||||
});
|
||||
|
||||
const handleClick = async () => {
|
||||
const handleChange = async ({ filePath }: { filePath: string | null }) => {
|
||||
await ignoreContentType.set(false);
|
||||
const selected = await open({
|
||||
title: 'Select File',
|
||||
multiple: false,
|
||||
});
|
||||
if (selected == null) {
|
||||
return;
|
||||
}
|
||||
onChange({ filePath: selected.path });
|
||||
onChange({ filePath: filePath ?? undefined });
|
||||
};
|
||||
|
||||
const filePath = typeof body.filePath === 'string' ? body.filePath : undefined;
|
||||
const filePath = typeof body.filePath === 'string' ? body.filePath : null;
|
||||
const mimeType = mime.getType(filePath ?? '') ?? 'application/octet-stream';
|
||||
|
||||
return (
|
||||
<VStack space={2}>
|
||||
<HStack space={2}>
|
||||
<Button variant="border" color="secondary" size="sm" onClick={handleClick}>
|
||||
Choose File
|
||||
</Button>
|
||||
<div className="text-sm font-mono truncate rtl pr-3 text-fg">
|
||||
{/* Special character to insert ltr text in rtl element without making things wonky */}
|
||||
‎
|
||||
{filePath ?? 'Select File'}
|
||||
</div>
|
||||
</HStack>
|
||||
<SelectFile onChange={handleChange} filePath={filePath} />
|
||||
{filePath != null && mimeType !== contentType && !ignoreContentType.value && (
|
||||
<Banner className="mt-3 !py-5">
|
||||
<div className="mb-4 text-center">
|
||||
|
||||
24
src-web/components/CopyButton.tsx
Normal file
24
src-web/components/CopyButton.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import { useClipboardText } from '../hooks/useClipboardText';
|
||||
import { useTimedBoolean } from '../hooks/useTimedBoolean';
|
||||
import type { ButtonProps } from './core/Button';
|
||||
import { Button } from './core/Button';
|
||||
|
||||
interface Props extends ButtonProps {
|
||||
text: string;
|
||||
}
|
||||
|
||||
export function CopyButton({ text, ...props }: Props) {
|
||||
const [, copy] = useClipboardText({ disableToast: true });
|
||||
const [copied, setCopied] = useTimedBoolean();
|
||||
return (
|
||||
<Button
|
||||
{...props}
|
||||
onClick={() => {
|
||||
copy(text);
|
||||
setCopied();
|
||||
}}
|
||||
>
|
||||
{copied ? 'Copied' : 'Copy'}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import { getCurrent } from '@tauri-apps/api/webviewWindow';
|
||||
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
|
||||
import { useEffect } from 'react';
|
||||
import { useAtiveWorkspaceChangedToast } from '../hooks/useAtiveWorkspaceChangedToast';
|
||||
import { useClipboardText } from '../hooks/useClipboardText';
|
||||
@@ -86,7 +86,7 @@ export function GlobalHooks() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (model.model === 'http_request' && windowLabel !== getCurrent().label) {
|
||||
if (model.model === 'http_request' && windowLabel !== getCurrentWebviewWindow().label) {
|
||||
wasUpdatedExternally(model.id);
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ export function GlobalHooks() {
|
||||
}
|
||||
|
||||
const { interfaceScale, interfaceFontSize, editorFontSize } = settings;
|
||||
getCurrent().setZoom(interfaceScale).catch(console.error);
|
||||
getCurrentWebviewWindow().setZoom(interfaceScale).catch(console.error);
|
||||
document.documentElement.style.setProperty('font-size', `${interfaceFontSize}px`);
|
||||
document.documentElement.style.setProperty('--editor-font-size', `${editorFontSize}px`);
|
||||
}, [settings]);
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { VStack } from './core/Stacks';
|
||||
import { Button } from './core/Button';
|
||||
import React, { useState } from 'react';
|
||||
import { Banner } from './core/Banner';
|
||||
import { Icon } from './core/Icon';
|
||||
import { Button } from './core/Button';
|
||||
import { VStack } from './core/Stacks';
|
||||
import { SelectFile } from './SelectFile';
|
||||
|
||||
interface Props {
|
||||
importData: () => Promise<void>;
|
||||
importData: (filePath: string) => Promise<void>;
|
||||
}
|
||||
|
||||
export function ImportDataDialog({ importData }: Props) {
|
||||
const [isLoading, setIsLoading] = useState<boolean>(false);
|
||||
const [filePath, setFilePath] = useState<string | null>(null);
|
||||
return (
|
||||
<VStack space={5} className="pb-4">
|
||||
<VStack space={1}>
|
||||
@@ -18,27 +18,32 @@ export function ImportDataDialog({ importData }: Props) {
|
||||
<li>Postman Collection v2, v2.1</li>
|
||||
<li>Insomnia v4+</li>
|
||||
<li>Swagger 2.0</li>
|
||||
<li>Curl commands</li>
|
||||
<li>
|
||||
Curl commands <em className="text-fg-subtle">(or paste into URL)</em>
|
||||
</li>
|
||||
</ul>
|
||||
<Banner className="mt-3 flex items-center gap-2">
|
||||
<Icon icon="magicWand" />
|
||||
Paste any Curl command into URL bar
|
||||
</Banner>
|
||||
</VStack>
|
||||
<Button
|
||||
color="primary"
|
||||
isLoading={isLoading}
|
||||
onClick={async () => {
|
||||
setIsLoading(true);
|
||||
try {
|
||||
await importData();
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{isLoading ? 'Importing' : 'Select File'}
|
||||
</Button>
|
||||
<VStack space={2}>
|
||||
<SelectFile filePath={filePath} onChange={({ filePath }) => setFilePath(filePath)} />
|
||||
{filePath && (
|
||||
<Button
|
||||
color="primary"
|
||||
disabled={!filePath || isLoading}
|
||||
isLoading={isLoading}
|
||||
size="sm"
|
||||
onClick={async () => {
|
||||
setIsLoading(true);
|
||||
try {
|
||||
await importData(filePath);
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{isLoading ? 'Importing' : 'Import'}
|
||||
</Button>
|
||||
)}
|
||||
</VStack>
|
||||
</VStack>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import { open } from '@tauri-apps/plugin-shell';
|
||||
import type { HttpResponse } from '../lib/models';
|
||||
import { IconButton } from './core/IconButton';
|
||||
import { KeyValueRow, KeyValueRows } from './core/KeyValueRow';
|
||||
import { Separator } from './core/Separator';
|
||||
|
||||
interface Props {
|
||||
response: HttpResponse;
|
||||
@@ -13,33 +10,9 @@ export function ResponseHeaders({ response }: Props) {
|
||||
<div className="overflow-auto h-full pb-4">
|
||||
<KeyValueRows>
|
||||
{response.headers.map((h, i) => (
|
||||
<KeyValueRow key={i} label={h.name} value={h.value} labelClassName="!text-violet-600" />
|
||||
<KeyValueRow labelColor="primary" key={i} label={h.name} value={h.value} />
|
||||
))}
|
||||
</KeyValueRows>
|
||||
<Separator className="my-4">Other Info</Separator>
|
||||
<KeyValueRows>
|
||||
<KeyValueRow label="Version" value={response.version} />
|
||||
<KeyValueRow label="Remote Address" value={response.remoteAddr} />
|
||||
<KeyValueRow
|
||||
label={
|
||||
<div className="flex items-center">
|
||||
URL
|
||||
<IconButton
|
||||
iconSize="sm"
|
||||
className="inline-block w-auto ml-1 !h-auto opacity-50 hover:opacity-100"
|
||||
icon="externalLink"
|
||||
onClick={() => open(response.url)}
|
||||
title="Open in browser"
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
value={
|
||||
<div className="flex">
|
||||
<span className="select-text cursor-text">{response.url}</span>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
</KeyValueRows>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
39
src-web/components/ResponseInfo.tsx
Normal file
39
src-web/components/ResponseInfo.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
import { open } from '@tauri-apps/plugin-shell';
|
||||
import type { HttpResponse } from '../lib/models';
|
||||
import { IconButton } from './core/IconButton';
|
||||
import { KeyValueRow, KeyValueRows } from './core/KeyValueRow';
|
||||
|
||||
interface Props {
|
||||
response: HttpResponse;
|
||||
}
|
||||
|
||||
export function ResponseInfo({ response }: Props) {
|
||||
return (
|
||||
<div className="overflow-auto h-full pb-4">
|
||||
<KeyValueRows>
|
||||
<KeyValueRow labelColor="info" label="Version" value={response.version} />
|
||||
<KeyValueRow labelColor="info" label="Remote Address" value={response.remoteAddr} />
|
||||
<KeyValueRow
|
||||
labelColor="info"
|
||||
label={
|
||||
<div className="flex items-center">
|
||||
URL
|
||||
<IconButton
|
||||
iconSize="sm"
|
||||
className="inline-block w-auto ml-1 !h-auto opacity-50 hover:opacity-100"
|
||||
icon="externalLink"
|
||||
onClick={() => open(response.url)}
|
||||
title="Open in browser"
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
value={
|
||||
<div className="flex">
|
||||
<span className="select-text cursor-text">{response.url}</span>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
</KeyValueRows>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import { TabContent, Tabs } from './core/Tabs/Tabs';
|
||||
import { EmptyStateText } from './EmptyStateText';
|
||||
import { RecentResponsesDropdown } from './RecentResponsesDropdown';
|
||||
import { ResponseHeaders } from './ResponseHeaders';
|
||||
import { ResponseInfo } from './ResponseInfo';
|
||||
import { AudioViewer } from './responseViewers/AudioViewer';
|
||||
import { CsvViewer } from './responseViewers/CsvViewer';
|
||||
import { ImageViewer } from './responseViewers/ImageViewer';
|
||||
@@ -46,7 +47,7 @@ export const ResponsePane = memo(function ResponsePane({ style, className, activ
|
||||
() => [
|
||||
{
|
||||
value: 'body',
|
||||
label: 'Preview',
|
||||
label: 'Preview Mode',
|
||||
options: {
|
||||
value: viewMode,
|
||||
onChange: setViewMode,
|
||||
@@ -67,6 +68,10 @@ export const ResponsePane = memo(function ResponsePane({ style, className, activ
|
||||
),
|
||||
value: 'headers',
|
||||
},
|
||||
{
|
||||
label: 'Info',
|
||||
value: 'info',
|
||||
},
|
||||
],
|
||||
[activeResponse?.headers, contentType, setViewMode, viewMode],
|
||||
);
|
||||
@@ -148,6 +153,9 @@ export const ResponsePane = memo(function ResponsePane({ style, className, activ
|
||||
<TabContent value="headers">
|
||||
<ResponseHeaders response={activeResponse} />
|
||||
</TabContent>
|
||||
<TabContent value="info">
|
||||
<ResponseInfo response={activeResponse} />
|
||||
</TabContent>
|
||||
<TabContent value="body">
|
||||
{!activeResponse.contentLength ? (
|
||||
<div className="pb-2 h-full">
|
||||
@@ -166,6 +174,8 @@ export const ResponsePane = memo(function ResponsePane({ style, className, activ
|
||||
) : viewMode === 'pretty' && contentType?.includes('html') ? (
|
||||
<WebPageViewer response={activeResponse} />
|
||||
) : (
|
||||
// ) : viewMode === 'pretty' && contentType?.includes('json') ? (
|
||||
// <JsonAttributeTree attrValue={activeResponse} />
|
||||
<TextViewer
|
||||
className="-mr-2" // Pull to the right
|
||||
response={activeResponse}
|
||||
|
||||
65
src-web/components/SelectFile.tsx
Normal file
65
src-web/components/SelectFile.tsx
Normal file
@@ -0,0 +1,65 @@
|
||||
import { open } from '@tauri-apps/plugin-dialog';
|
||||
import classNames from 'classnames';
|
||||
import mime from 'mime';
|
||||
import type { ButtonProps } from './core/Button';
|
||||
import { Button } from './core/Button';
|
||||
import { IconButton } from './core/IconButton';
|
||||
import { HStack } from './core/Stacks';
|
||||
|
||||
type Props = ButtonProps & {
|
||||
onChange: (value: { filePath: string | null; contentType: string | null }) => void;
|
||||
filePath: string | null;
|
||||
inline?: boolean;
|
||||
};
|
||||
|
||||
// Special character to insert ltr text in rtl element
|
||||
const rtlEscapeChar = <>‎</>;
|
||||
|
||||
export function SelectFile({ onChange, filePath, inline, className }: Props) {
|
||||
const handleClick = async () => {
|
||||
const selected = await open({
|
||||
title: 'Select File',
|
||||
multiple: false,
|
||||
});
|
||||
if (selected == null) return;
|
||||
|
||||
const filePath = selected.path;
|
||||
const contentType = typeof filePath === 'string' && filePath ? mime.getType(filePath) : null;
|
||||
onChange({ filePath, contentType });
|
||||
};
|
||||
|
||||
const handleClear = async () => {
|
||||
onChange({ filePath: null, contentType: null });
|
||||
};
|
||||
|
||||
return (
|
||||
<HStack space={1.5} className="group relative justify-stretch">
|
||||
<Button
|
||||
className={classNames(className, 'font-mono text-xs rtl', inline && 'w-full')}
|
||||
color="secondary"
|
||||
size="sm"
|
||||
onClick={handleClick}
|
||||
>
|
||||
{rtlEscapeChar}
|
||||
{inline ? <>{filePath || 'Select File'}</> : <>Select File</>}
|
||||
</Button>
|
||||
{!inline && (
|
||||
<>
|
||||
{filePath && (
|
||||
<IconButton
|
||||
size="sm"
|
||||
variant="border"
|
||||
icon="x"
|
||||
title="Unset File"
|
||||
onClick={handleClear}
|
||||
/>
|
||||
)}
|
||||
<div className="text-sm font-mono truncate rtl pr-3 text-fg">
|
||||
{rtlEscapeChar}
|
||||
{filePath ?? 'No file selected'}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</HStack>
|
||||
);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getCurrent } from '@tauri-apps/api/webviewWindow';
|
||||
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
|
||||
import classNames from 'classnames';
|
||||
import React from 'react';
|
||||
import { useKeyPressEvent, useLocalStorage } from 'react-use';
|
||||
@@ -24,7 +24,7 @@ export const Settings = () => {
|
||||
|
||||
// Close settings window on escape
|
||||
// TODO: Could this be put in a better place? Eg. in Rust key listener when creating the window
|
||||
useKeyPressEvent('Escape', () => getCurrent().close());
|
||||
useKeyPressEvent('Escape', () => getCurrentWebviewWindow().close());
|
||||
|
||||
return (
|
||||
<div className={classNames('grid grid-rows-[auto_minmax(0,1fr)] h-full')}>
|
||||
|
||||
@@ -85,7 +85,7 @@ export function SettingsDropdown() {
|
||||
label: 'Feedback',
|
||||
leftSlot: <Icon icon="chat" />,
|
||||
rightSlot: <Icon icon="externalLink" />,
|
||||
onSelect: () => open('https://yaak.canny.io'),
|
||||
onSelect: () => open('https://yaak.app/roadmap'),
|
||||
},
|
||||
{
|
||||
key: 'changelog',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getCurrent } from '@tauri-apps/api/webviewWindow';
|
||||
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
|
||||
import classNames from 'classnames';
|
||||
import React, { useState } from 'react';
|
||||
import { useOsInfo } from '../hooks/useOsInfo';
|
||||
@@ -25,7 +25,7 @@ export function WindowControls({ className, onlyX }: Props) {
|
||||
<Button
|
||||
className="!h-full px-4 text-fg-subtle hocus:text-fg hocus:bg-background-highlight-secondary rounded-none"
|
||||
color="custom"
|
||||
onClick={() => getCurrent().minimize()}
|
||||
onClick={() => getCurrentWebviewWindow().minimize()}
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<path fill="currentColor" d="M14 8v1H3V8z" />
|
||||
@@ -35,7 +35,7 @@ export function WindowControls({ className, onlyX }: Props) {
|
||||
className="!h-full px-4 text-fg-subtle hocus:text-fg hocus:bg-background-highlight rounded-none"
|
||||
color="custom"
|
||||
onClick={async () => {
|
||||
const w = getCurrent();
|
||||
const w = getCurrentWebviewWindow();
|
||||
await w.toggleMaximize();
|
||||
setMaximized(await w.isMaximized());
|
||||
}}
|
||||
@@ -58,7 +58,7 @@ export function WindowControls({ className, onlyX }: Props) {
|
||||
<Button
|
||||
color="custom"
|
||||
className="!h-full px-4 text-fg-subtle rounded-none hocus:bg-fg-danger hocus:text-fg"
|
||||
onClick={() => getCurrent().close()}
|
||||
onClick={() => getCurrentWebviewWindow().close()}
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<path
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { HotkeyAction } from '../../hooks/useHotKey';
|
||||
import { useFormattedHotkey, useHotKey } from '../../hooks/useHotKey';
|
||||
import { Icon } from './Icon';
|
||||
|
||||
export type ButtonProps = Omit<HTMLAttributes<HTMLButtonElement>, 'color'> & {
|
||||
export type ButtonProps = Omit<HTMLAttributes<HTMLButtonElement>, 'color' | 'onChange'> & {
|
||||
innerClassName?: string;
|
||||
color?:
|
||||
| 'custom'
|
||||
|
||||
@@ -9,9 +9,16 @@ interface Props {
|
||||
attrValue: any;
|
||||
attrKey?: string | number;
|
||||
attrKeyJsonPath?: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const JsonAttributeTree = ({ depth = 0, attrKey, attrValue, attrKeyJsonPath }: Props) => {
|
||||
export const JsonAttributeTree = ({
|
||||
depth = 0,
|
||||
attrKey,
|
||||
attrValue,
|
||||
attrKeyJsonPath,
|
||||
className,
|
||||
}: Props) => {
|
||||
attrKeyJsonPath = attrKeyJsonPath ?? `${attrKey}`;
|
||||
|
||||
const [isExpanded, setIsExpanded] = useState(true);
|
||||
@@ -59,7 +66,7 @@ export const JsonAttributeTree = ({ depth = 0, attrKey, attrValue, attrKeyJsonPa
|
||||
: null,
|
||||
isExpandable: attrValue.length > 0,
|
||||
label: isExpanded ? `[${attrValue.length || ' '}]` : `[⋯]`,
|
||||
labelClassName: 'text-subtler',
|
||||
labelClassName: 'text-fg-subtler',
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
@@ -77,10 +84,18 @@ export const JsonAttributeTree = ({ depth = 0, attrKey, attrValue, attrKeyJsonPa
|
||||
}, [attrValue, attrKeyJsonPath, isExpanded, depth]);
|
||||
|
||||
const labelEl = (
|
||||
<span className={classNames(labelClassName, 'select-text group-hover:text-fg')}>{label}</span>
|
||||
<span className={classNames(labelClassName, 'select-text group-hover:text-fg-subtle')}>
|
||||
{label}
|
||||
</span>
|
||||
);
|
||||
return (
|
||||
<div className={classNames(/*depth === 0 && '-ml-4',*/ 'font-mono text-xs')}>
|
||||
<div
|
||||
className={classNames(
|
||||
className,
|
||||
/*depth === 0 && '-ml-4',*/ 'font-mono text-xs',
|
||||
depth === 0 && 'h-full overflow-y-auto pb-2',
|
||||
)}
|
||||
>
|
||||
<div className="flex items-center">
|
||||
{isExpandable ? (
|
||||
<button className="group relative flex items-center pl-4 w-full" onClick={toggleExpanded}>
|
||||
|
||||
@@ -24,13 +24,20 @@ interface Props {
|
||||
label: ReactNode;
|
||||
value: ReactNode;
|
||||
labelClassName?: string;
|
||||
labelColor?: 'secondary' | 'primary' | 'info';
|
||||
}
|
||||
|
||||
export function KeyValueRow({ label, value, labelClassName }: Props) {
|
||||
export function KeyValueRow({ label, value, labelColor = 'secondary', labelClassName }: Props) {
|
||||
return (
|
||||
<>
|
||||
<td
|
||||
className={classNames('py-0.5 pr-2 text-fg-subtle select-text cursor-text', labelClassName)}
|
||||
className={classNames(
|
||||
'py-0.5 pr-2 select-text cursor-text',
|
||||
labelClassName,
|
||||
labelColor === 'primary' && 'text-fg-primary',
|
||||
labelColor === 'secondary' && 'text-fg-subtle',
|
||||
labelColor === 'info' && 'text-fg-info',
|
||||
)}
|
||||
>
|
||||
{label}
|
||||
</td>
|
||||
|
||||
@@ -35,5 +35,5 @@ export function Link({ href, children, className, ...other }: Props) {
|
||||
}
|
||||
|
||||
export function FeedbackLink() {
|
||||
return <Link href="https://yaak.canny.io">Feedback</Link>;
|
||||
return <Link href="https://yaak.app/roadmap">Feedback</Link>;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { open } from '@tauri-apps/plugin-dialog';
|
||||
import classNames from 'classnames';
|
||||
import type { EditorView } from 'codemirror';
|
||||
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
@@ -7,7 +6,7 @@ import { useDrag, useDrop } from 'react-dnd';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { usePrompt } from '../../hooks/usePrompt';
|
||||
import { DropMarker } from '../DropMarker';
|
||||
import { Button } from './Button';
|
||||
import { SelectFile } from '../SelectFile';
|
||||
import { Checkbox } from './Checkbox';
|
||||
import { Dropdown } from './Dropdown';
|
||||
import type { GenericCompletionConfig } from './Editor/genericCompletion';
|
||||
@@ -286,7 +285,12 @@ function PairEditorRow({
|
||||
);
|
||||
|
||||
const handleChangeValueFile = useMemo(
|
||||
() => (value: string) => onChange({ id, pair: { ...pairContainer.pair, value, isFile: true } }),
|
||||
() =>
|
||||
({ filePath }: { filePath: string | null }) =>
|
||||
onChange({
|
||||
id,
|
||||
pair: { ...pairContainer.pair, value: filePath ?? '', isFile: true },
|
||||
}),
|
||||
[onChange, id, pairContainer.pair],
|
||||
);
|
||||
|
||||
@@ -386,27 +390,12 @@ function PairEditorRow({
|
||||
/>
|
||||
<div className="w-full grid grid-cols-[minmax(0,1fr)_auto] gap-1 items-center">
|
||||
{pairContainer.pair.isFile ? (
|
||||
<Button
|
||||
<SelectFile
|
||||
inline
|
||||
size="xs"
|
||||
color="secondary"
|
||||
className="font-mono text-2xs rtl"
|
||||
onClick={async (e) => {
|
||||
e.preventDefault();
|
||||
const selected = await open({
|
||||
title: 'Select file',
|
||||
multiple: false,
|
||||
});
|
||||
if (selected == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
handleChangeValueFile(selected.path);
|
||||
}}
|
||||
>
|
||||
{/* Special character to insert ltr text in rtl element without making things wonky */}
|
||||
‎
|
||||
{pairContainer.pair.value || 'Select File'}
|
||||
</Button>
|
||||
filePath={pairContainer.pair.value}
|
||||
onChange={handleChangeValueFile}
|
||||
/>
|
||||
) : (
|
||||
<Input
|
||||
hideLabel
|
||||
@@ -432,7 +421,7 @@ function PairEditorRow({
|
||||
<RadioDropdown
|
||||
value={pairContainer.pair.isFile ? 'file' : 'text'}
|
||||
onChange={(v) => {
|
||||
if (v === 'file') handleChangeValueFile('');
|
||||
if (v === 'file') handleChangeValueFile({ filePath: '' });
|
||||
else handleChangeValueText('');
|
||||
}}
|
||||
items={[
|
||||
@@ -444,6 +433,7 @@ function PairEditorRow({
|
||||
key: 'mime',
|
||||
label: 'Set Content-Type',
|
||||
leftSlot: <Icon icon="pencil" />,
|
||||
hidden: !pairContainer.pair.isFile,
|
||||
onSelect: async () => {
|
||||
const v = await prompt({
|
||||
id: 'content-type',
|
||||
@@ -459,6 +449,15 @@ function PairEditorRow({
|
||||
handleChangeValueContentType(v);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'clear-file',
|
||||
label: 'Unset File',
|
||||
leftSlot: <Icon icon="x" />,
|
||||
hidden: !pairContainer.pair.isFile,
|
||||
onSelect: async () => {
|
||||
handleChangeValueFile({ filePath: null });
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'delete',
|
||||
label: 'Delete',
|
||||
|
||||
@@ -60,10 +60,11 @@ type BaseStackProps = HTMLAttributes<HTMLElement> & {
|
||||
space?: keyof typeof gapClasses;
|
||||
alignItems?: 'start' | 'center' | 'stretch' | 'end';
|
||||
justifyContent?: 'start' | 'center' | 'end' | 'between';
|
||||
wrap?: boolean;
|
||||
};
|
||||
|
||||
const BaseStack = forwardRef(function BaseStack(
|
||||
{ className, alignItems, justifyContent, children, as, ...props }: BaseStackProps,
|
||||
{ className, alignItems, justifyContent, wrap, children, as, ...props }: BaseStackProps,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
ref: ForwardedRef<any>,
|
||||
) {
|
||||
@@ -74,6 +75,7 @@ const BaseStack = forwardRef(function BaseStack(
|
||||
className={classNames(
|
||||
className,
|
||||
'flex',
|
||||
wrap && 'flex-wrap',
|
||||
alignItems === 'center' && 'items-center',
|
||||
alignItems === 'start' && 'items-start',
|
||||
alignItems === 'stretch' && 'items-stretch',
|
||||
|
||||
@@ -6,16 +6,24 @@ import { useContentTypeFromHeaders } from '../../hooks/useContentTypeFromHeaders
|
||||
import { useDebouncedValue } from '../../hooks/useDebouncedValue';
|
||||
import { useFilterResponse } from '../../hooks/useFilterResponse';
|
||||
import { useResponseBodyText } from '../../hooks/useResponseBodyText';
|
||||
import { useSaveResponse } from '../../hooks/useSaveResponse';
|
||||
import { useToggle } from '../../hooks/useToggle';
|
||||
import { tryFormatJson, tryFormatXml } from '../../lib/formatters';
|
||||
import type { HttpResponse } from '../../lib/models';
|
||||
import { CopyButton } from '../CopyButton';
|
||||
import { Banner } from '../core/Banner';
|
||||
import { Button } from '../core/Button';
|
||||
import { Editor } from '../core/Editor';
|
||||
import { hyperlink } from '../core/Editor/hyperlink/extension';
|
||||
import { IconButton } from '../core/IconButton';
|
||||
import { InlineCode } from '../core/InlineCode';
|
||||
import { Input } from '../core/Input';
|
||||
import { EmptyStateText } from '../EmptyStateText';
|
||||
import { SizeTag } from '../core/SizeTag';
|
||||
import { HStack } from '../core/Stacks';
|
||||
import { BinaryViewer } from './BinaryViewer';
|
||||
|
||||
const extraExtensions = [hyperlink];
|
||||
const LARGE_RESPONSE_BYTES = 2 * 1000 * 1000;
|
||||
|
||||
interface Props {
|
||||
response: HttpResponse;
|
||||
@@ -27,6 +35,7 @@ const useFilterText = createGlobalState<Record<string, string | null>>({});
|
||||
|
||||
export function TextViewer({ response, pretty, className }: Props) {
|
||||
const [filterTextMap, setFilterTextMap] = useFilterText();
|
||||
const [showLargeResponse, toggleShowLargeResponse] = useToggle();
|
||||
const filterText = filterTextMap[response.id] ?? null;
|
||||
const debouncedFilterText = useDebouncedValue(filterText, 200);
|
||||
const setFilterText = useCallback(
|
||||
@@ -36,6 +45,7 @@ export function TextViewer({ response, pretty, className }: Props) {
|
||||
[setFilterTextMap, response],
|
||||
);
|
||||
|
||||
const saveResponse = useSaveResponse(response);
|
||||
const contentType = useContentTypeFromHeaders(response.headers);
|
||||
const rawBody = useResponseBodyText(response);
|
||||
const isSearching = filterText != null;
|
||||
@@ -117,8 +127,32 @@ export function TextViewer({ response, pretty, className }: Props) {
|
||||
return <BinaryViewer response={response} />;
|
||||
}
|
||||
|
||||
if ((response.contentLength ?? 0) > 2 * 1000 * 1000) {
|
||||
return <EmptyStateText>Cannot preview text responses larger than 2MB</EmptyStateText>;
|
||||
if (!showLargeResponse && (response.contentLength ?? 0) > LARGE_RESPONSE_BYTES) {
|
||||
return (
|
||||
<Banner color="primary" className="h-full flex flex-col gap-3">
|
||||
<p>
|
||||
Showing responses over{' '}
|
||||
<InlineCode>
|
||||
<SizeTag contentLength={LARGE_RESPONSE_BYTES} />
|
||||
</InlineCode>{' '}
|
||||
may impact performance
|
||||
</p>
|
||||
<HStack wrap space={2}>
|
||||
<Button color="primary" size="xs" onClick={toggleShowLargeResponse}>
|
||||
Reveal Response
|
||||
</Button>
|
||||
<Button variant="border" size="xs" onClick={() => saveResponse.mutate()}>
|
||||
Save to File
|
||||
</Button>
|
||||
<CopyButton
|
||||
variant="border"
|
||||
size="xs"
|
||||
onClick={() => saveResponse.mutate()}
|
||||
text={rawBody.data}
|
||||
/>
|
||||
</HStack>
|
||||
</Banner>
|
||||
);
|
||||
}
|
||||
|
||||
const formattedBody =
|
||||
|
||||
@@ -6,7 +6,7 @@ import { createGlobalState } from 'react-use';
|
||||
|
||||
const useClipboardTextState = createGlobalState<string>('');
|
||||
|
||||
export function useClipboardText() {
|
||||
export function useClipboardText({ disableToast }: { disableToast?: boolean } = {}) {
|
||||
const [value, setValue] = useClipboardTextState();
|
||||
const focused = useWindowFocus();
|
||||
const toast = useToast();
|
||||
@@ -18,7 +18,7 @@ export function useClipboardText() {
|
||||
const setText = useCallback(
|
||||
(text: string) => {
|
||||
writeText(text).catch(console.error);
|
||||
if (text != '') {
|
||||
if (text != '' && !disableToast) {
|
||||
toast.show({
|
||||
id: 'copied',
|
||||
variant: 'copied',
|
||||
@@ -27,7 +27,7 @@ export function useClipboardText() {
|
||||
}
|
||||
setValue(text);
|
||||
},
|
||||
[setValue, toast],
|
||||
[disableToast, setValue, toast],
|
||||
);
|
||||
|
||||
return [value, setText] as const;
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
import { open } from '@tauri-apps/plugin-dialog';
|
||||
import { Button } from '../components/core/Button';
|
||||
import { FormattedError } from '../components/core/FormattedError';
|
||||
import { VStack } from '../components/core/Stacks';
|
||||
import { useDialog } from '../components/DialogContext';
|
||||
import { ImportDataDialog } from '../components/ImportDataDialog';
|
||||
import type { Environment, Folder, GrpcRequest, HttpRequest, Workspace } from '../lib/models';
|
||||
import { count } from '../lib/pluralize';
|
||||
import { invokeCmd } from '../lib/tauri';
|
||||
import { useActiveWorkspaceId } from './useActiveWorkspaceId';
|
||||
import { useAlert } from './useAlert';
|
||||
import { useAppRoutes } from './useAppRoutes';
|
||||
import { ImportDataDialog } from '../components/ImportDataDialog';
|
||||
|
||||
export function useImportData() {
|
||||
const routes = useAppRoutes();
|
||||
@@ -18,15 +17,7 @@ export function useImportData() {
|
||||
const alert = useAlert();
|
||||
const activeWorkspaceId = useActiveWorkspaceId();
|
||||
|
||||
const importData = async (): Promise<boolean> => {
|
||||
const selected = await open({
|
||||
filters: [{ name: 'Export File', extensions: ['json', 'yaml', 'sh', 'txt'] }],
|
||||
multiple: false,
|
||||
});
|
||||
if (selected == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const importData = async (filePath: string): Promise<boolean> => {
|
||||
const imported: {
|
||||
workspaces: Workspace[];
|
||||
environments: Environment[];
|
||||
@@ -34,7 +25,7 @@ export function useImportData() {
|
||||
httpRequests: HttpRequest[];
|
||||
grpcRequests: GrpcRequest[];
|
||||
} = await invokeCmd('cmd_import_data', {
|
||||
filePath: selected.path,
|
||||
filePath,
|
||||
workspaceId: activeWorkspaceId,
|
||||
});
|
||||
|
||||
@@ -93,9 +84,9 @@ export function useImportData() {
|
||||
title: 'Import Data',
|
||||
size: 'sm',
|
||||
render: ({ hide }) => {
|
||||
const importAndHide = async () => {
|
||||
const importAndHide = async (filePath: string) => {
|
||||
try {
|
||||
const didImport = await importData();
|
||||
const didImport = await importData(filePath);
|
||||
if (!didImport) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { getCurrent } from '@tauri-apps/api/webviewWindow';
|
||||
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
|
||||
import { useWindowSize } from 'react-use';
|
||||
import { useDebouncedValue } from './useDebouncedValue';
|
||||
|
||||
@@ -15,7 +15,7 @@ export function useIsFullscreen() {
|
||||
useQuery({
|
||||
queryKey: ['is_fullscreen', debouncedWindowWidth],
|
||||
queryFn: async () => {
|
||||
return getCurrent().isFullscreen();
|
||||
return getCurrentWebviewWindow().isFullscreen();
|
||||
},
|
||||
}).data ?? false
|
||||
);
|
||||
|
||||
@@ -20,6 +20,7 @@ export function useNotificationToast() {
|
||||
label: string;
|
||||
};
|
||||
}>('notification', ({ payload }) => {
|
||||
console.log('Got notification event', payload);
|
||||
const actionUrl = payload.action?.url;
|
||||
const actionLabel = payload.action?.label;
|
||||
toast.show({
|
||||
|
||||
@@ -20,7 +20,7 @@ export function useSaveResponse(response: HttpResponse) {
|
||||
|
||||
const contentType = getContentTypeHeader(response.headers) ?? 'unknown';
|
||||
const ext = mime.getExtension(contentType);
|
||||
const slug = slugify(request.name ?? 'response', { lower: true });
|
||||
const slug = slugify(request.name || 'response', { lower: true });
|
||||
const filepath = await save({
|
||||
defaultPath: ext ? `${slug}.${ext}` : slug,
|
||||
title: 'Save Response',
|
||||
|
||||
@@ -3,20 +3,21 @@ import { save } from '@tauri-apps/plugin-dialog';
|
||||
import slugify from 'slugify';
|
||||
import { trackEvent } from '../lib/analytics';
|
||||
import type { HttpResponse } from '../lib/models';
|
||||
import { getHttpRequest } from '../lib/store';
|
||||
import { invokeCmd } from '../lib/tauri';
|
||||
import { useActiveCookieJar } from './useActiveCookieJar';
|
||||
import { useActiveEnvironment } from './useActiveEnvironment';
|
||||
import { useAlert } from './useAlert';
|
||||
import { useHttpRequests } from './useHttpRequests';
|
||||
|
||||
export function useSendAnyHttpRequest(options: { download?: boolean } = {}) {
|
||||
const environment = useActiveEnvironment();
|
||||
const alert = useAlert();
|
||||
const { activeCookieJar } = useActiveCookieJar();
|
||||
const requests = useHttpRequests();
|
||||
return useMutation<HttpResponse | null, string, string | null>({
|
||||
mutationKey: ['send_any_request'],
|
||||
mutationFn: async (id) => {
|
||||
const request = await getHttpRequest(id);
|
||||
const request = requests.find((r) => r.id === id) ?? null;
|
||||
if (request == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -33,7 +34,7 @@ export function useSendAnyHttpRequest(options: { download?: boolean } = {}) {
|
||||
}
|
||||
|
||||
return invokeCmd('cmd_send_http_request', {
|
||||
requestId: id,
|
||||
request,
|
||||
environmentId: environment?.id,
|
||||
downloadDir: downloadDir,
|
||||
cookieJarId: activeCookieJar?.id,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getCurrent } from '@tauri-apps/api/webviewWindow';
|
||||
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
|
||||
import { useEffect } from 'react';
|
||||
import { fallbackRequestName } from '../lib/fallbackRequestName';
|
||||
import { useActiveEnvironment } from './useActiveEnvironment';
|
||||
@@ -30,7 +30,7 @@ export function useSyncWorkspaceRequestTitle() {
|
||||
// TODO: This resets the stoplight position so we can't use it on macOS yet. So we send
|
||||
// a custom command instead
|
||||
if (osInfo?.osType !== 'macos') {
|
||||
getCurrent().setTitle(newTitle).catch(console.error);
|
||||
getCurrentWebviewWindow().setTitle(newTitle).catch(console.error);
|
||||
} else {
|
||||
emit('yaak_title_changed', newTitle).catch(console.error);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useRef, useState } from 'react';
|
||||
import { useUnmount } from 'react-use';
|
||||
|
||||
/** Returns a boolean that is true for a given number of milliseconds. */
|
||||
export function useTimedBoolean(millis = 1000): [boolean, () => void] {
|
||||
export function useTimedBoolean(millis = 1500): [boolean, () => void] {
|
||||
const [value, setValue] = useState(false);
|
||||
const timeout = useRef<NodeJS.Timeout | null>(null);
|
||||
const reset = () => timeout.current && clearTimeout(timeout.current);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getCurrent } from '@tauri-apps/api/webviewWindow';
|
||||
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
export function useWindowFocus() {
|
||||
@@ -6,7 +6,7 @@ export function useWindowFocus() {
|
||||
|
||||
useEffect(() => {
|
||||
let unsub: undefined | (() => void) = undefined;
|
||||
getCurrent()
|
||||
getCurrentWebviewWindow()
|
||||
.onFocusChanged((e) => {
|
||||
setVisible(e.payload);
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getCurrent } from '@tauri-apps/api/webviewWindow';
|
||||
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
|
||||
import type { Appearance } from './window';
|
||||
|
||||
export function getCSSAppearance(): Appearance {
|
||||
@@ -6,7 +6,7 @@ export function getCSSAppearance(): Appearance {
|
||||
}
|
||||
|
||||
export async function getWindowAppearance(): Promise<Appearance> {
|
||||
const a = await getCurrent().theme();
|
||||
const a = await getCurrentWebviewWindow().theme();
|
||||
return a ?? getCSSAppearance();
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ export function subscribeToWindowAppearanceChange(
|
||||
): () => void {
|
||||
const container = { unsubscribe: () => {} };
|
||||
|
||||
getCurrent()
|
||||
getCurrentWebviewWindow()
|
||||
.onThemeChanged((t) => {
|
||||
cb(t.payload);
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getCurrent } from '@tauri-apps/api/webviewWindow';
|
||||
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
|
||||
import { type } from '@tauri-apps/plugin-os';
|
||||
import { StrictMode } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
@@ -15,7 +15,7 @@ pdfjs.GlobalWorkerOptions.workerSrc = new URL(
|
||||
// Hide decorations here because it doesn't work in Rust for some reason (bug?)
|
||||
const osType = await type();
|
||||
if (osType !== 'macos') {
|
||||
await getCurrent().setDecorations(false);
|
||||
await getCurrentWebviewWindow().setDecorations(false);
|
||||
}
|
||||
|
||||
await attachConsole();
|
||||
|
||||
Reference in New Issue
Block a user