From c8be8082c5e2c16951cafefc658331c98ad51846 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 31 Jan 2025 09:00:11 -0800 Subject: [PATCH] Websocket Support (#159) --- package-lock.json | 742 ++++++++++++++++-- package.json | 3 +- src-tauri/Cargo.lock | 257 ++++-- src-tauri/Cargo.toml | 40 +- src-tauri/bindings/analytics.ts | 2 +- src-tauri/capabilities/capabilities.json | 3 +- src-tauri/gen/schemas/acl-manifests.json | 2 +- src-tauri/gen/schemas/capabilities.json | 2 +- src-tauri/gen/schemas/desktop-schema.json | 145 ++++ src-tauri/gen/schemas/macOS-schema.json | 145 ++++ .../migrations/20250128155623_websockets.sql | 66 ++ src-tauri/src/analytics.rs | 3 + src-tauri/src/http_request.rs | 21 +- src-tauri/src/lib.rs | 45 +- src-tauri/src/plugin_events.rs | 2 +- src-tauri/src/render.rs | 146 +--- src-tauri/src/tauri_plugin_mac_window.rs | 5 +- src-tauri/yaak-grpc/Cargo.toml | 6 +- src-tauri/yaak-grpc/src/transport.rs | 29 +- src-tauri/yaak-license/Cargo.toml | 2 +- src-tauri/yaak-models/bindings/gen_models.ts | 16 +- src-tauri/yaak-models/src/lib.rs | 1 + src-tauri/yaak-models/src/models.rs | 282 ++++++- src-tauri/yaak-models/src/queries.rs | 393 +++++++++- src-tauri/yaak-models/src/render.rs | 34 + src-tauri/yaak-plugins/Cargo.toml | 3 +- src-tauri/yaak-plugins/bindings/gen_events.ts | 3 +- src-tauri/yaak-plugins/bindings/gen_models.ts | 2 + src-tauri/yaak-plugins/src/error.rs | 6 - src-tauri/yaak-plugins/src/events.rs | 3 +- src-tauri/yaak-plugins/src/lib.rs | 3 +- src-tauri/yaak-plugins/src/manager.rs | 4 +- .../src/template_callback.rs | 4 +- src-tauri/yaak-plugins/src/util.rs | 5 +- src-tauri/yaak-sync/Cargo.toml | 2 +- src-tauri/yaak-sync/bindings/gen_models.ts | 4 +- src-tauri/yaak-sync/src/models.rs | 17 +- src-tauri/yaak-sync/src/sync.rs | 15 +- src-tauri/yaak-templates/Cargo.toml | 1 + src-tauri/yaak-templates/src/format.rs | 2 +- src-tauri/yaak-templates/src/renderer.rs | 106 ++- src-tauri/yaak-ws/Cargo.toml | 26 + src-tauri/yaak-ws/build.rs | 17 + src-tauri/yaak-ws/index.ts | 77 ++ src-tauri/yaak-ws/package.json | 6 + .../autogenerated/commands/cancel.toml | 13 + .../autogenerated/commands/close.toml | 13 + .../autogenerated/commands/connect.toml | 13 + .../commands/delete_connection.toml | 13 + .../commands/delete_connections.toml | 13 + .../commands/delete_request.toml | 13 + .../commands/list_connections.toml | 13 + .../autogenerated/commands/list_events.toml | 13 + .../autogenerated/commands/list_requests.toml | 13 + .../commands/list_websocket_connections.toml | 13 + .../commands/list_websocket_requests.toml | 13 + .../autogenerated/commands/send.toml | 13 + .../commands/upsert_request.toml | 13 + .../commands/upsert_websocket_request.toml | 13 + .../permissions/autogenerated/reference.md | 388 +++++++++ src-tauri/yaak-ws/permissions/default.toml | 14 + .../yaak-ws/permissions/schemas/schema.json | 445 +++++++++++ src-tauri/yaak-ws/src/cmd.rs | 330 ++++++++ src-tauri/yaak-ws/src/connect.rs | 80 ++ src-tauri/yaak-ws/src/error.rs | 29 + src-tauri/yaak-ws/src/lib.rs | 37 + src-tauri/yaak-ws/src/manager.rs | 62 ++ src-tauri/yaak-ws/src/render.rs | 40 + src-web/commands/deleteWebsocketConnection.ts | 14 + .../commands/deleteWebsocketConnections.ts | 14 + src-web/commands/deleteWebsocketRequest.tsx | 31 + src-web/commands/upsertWebsocketRequest.ts | 27 + src-web/commands/upsertWorkspace.ts | 3 +- .../components/GrpcConnectionMessagesPane.tsx | 29 +- .../components/GrpcConnectionSetupPane.tsx | 1 + src-web/components/GrpcEditor.tsx | 2 +- src-web/components/HeadersEditor.tsx | 13 +- .../components/HttpAuthenticationEditor.tsx | 9 +- src-web/components/HttpRequestLayout.tsx | 8 +- .../{RequestPane.tsx => HttpRequestPane.tsx} | 16 +- ...{ResponsePane.tsx => HttpResponsePane.tsx} | 14 +- src-web/components/LicenseBadge.tsx | 2 +- src-web/components/MoveToWorkspaceDialog.tsx | 17 +- ....tsx => RecentGrpcConnectionsDropdown.tsx} | 6 +- ...wn.tsx => RecentHttpResponsesDropdown.tsx} | 4 +- src-web/components/RecentRequestsDropdown.tsx | 5 +- .../RecentWebsocketConnectionsDropdown.tsx | 69 ++ src-web/components/UrlBar.tsx | 11 +- src-web/components/WebsocketRequestLayout.tsx | 42 + src-web/components/WebsocketRequestPane.tsx | 325 ++++++++ src-web/components/WebsocketResponsePane.tsx | 229 ++++++ src-web/components/Workspace.tsx | 40 +- src-web/components/WorkspaceHeader.tsx | 2 +- src-web/components/core/HttpMethodTag.tsx | 16 +- src-web/components/core/StatusTag.tsx | 6 +- src-web/components/{ => sidebar}/Sidebar.tsx | 54 +- .../{ => sidebar}/SidebarActions.tsx | 14 +- .../components/{ => sidebar}/SidebarAtoms.ts | 22 +- .../components/{ => sidebar}/SidebarItem.tsx | 46 +- .../{ => sidebar}/SidebarItemContextMenu.tsx | 36 +- .../components/{ => sidebar}/SidebarItems.tsx | 4 +- src-web/hooks/useActiveRequest.ts | 10 +- src-web/hooks/useCopy.ts | 2 +- src-web/hooks/useCreateDropdownItems.tsx | 32 +- src-web/hooks/useDeleteAnyGrpcRequest.tsx | 16 +- src-web/hooks/useDeleteAnyHttpRequest.tsx | 16 +- src-web/hooks/useDeleteAnyRequest.tsx | 17 +- src-web/hooks/useDeleteSendHistory.tsx | 9 +- src-web/hooks/useHotKey.ts | 10 + src-web/hooks/useHttpAuthenticationConfig.ts | 4 +- src-web/hooks/useMoveToWorkspace.tsx | 5 +- src-web/hooks/usePinnedWebsocketConnection.ts | 18 + src-web/hooks/useRequestUpdateKey.ts | 9 +- src-web/hooks/useRequests.ts | 12 +- src-web/hooks/useSyncModelStores.ts | 33 +- src-web/hooks/useSyncWorkspaceChildModels.ts | 5 + src-web/hooks/useWebsocketConnections.ts | 17 + src-web/hooks/useWebsocketEvents.ts | 21 + src-web/hooks/useWebsocketRequests.ts | 13 + src-web/lib/contentType.ts | 2 + src-web/lib/fallbackRequestName.ts | 12 +- src-web/package.json | 7 +- 122 files changed, 5090 insertions(+), 616 deletions(-) create mode 100644 src-tauri/migrations/20250128155623_websockets.sql create mode 100644 src-tauri/yaak-models/src/render.rs rename src-tauri/{ => yaak-plugins}/src/template_callback.rs (95%) create mode 100644 src-tauri/yaak-ws/Cargo.toml create mode 100644 src-tauri/yaak-ws/build.rs create mode 100644 src-tauri/yaak-ws/index.ts create mode 100644 src-tauri/yaak-ws/package.json create mode 100644 src-tauri/yaak-ws/permissions/autogenerated/commands/cancel.toml create mode 100644 src-tauri/yaak-ws/permissions/autogenerated/commands/close.toml create mode 100644 src-tauri/yaak-ws/permissions/autogenerated/commands/connect.toml create mode 100644 src-tauri/yaak-ws/permissions/autogenerated/commands/delete_connection.toml create mode 100644 src-tauri/yaak-ws/permissions/autogenerated/commands/delete_connections.toml create mode 100644 src-tauri/yaak-ws/permissions/autogenerated/commands/delete_request.toml create mode 100644 src-tauri/yaak-ws/permissions/autogenerated/commands/list_connections.toml create mode 100644 src-tauri/yaak-ws/permissions/autogenerated/commands/list_events.toml create mode 100644 src-tauri/yaak-ws/permissions/autogenerated/commands/list_requests.toml create mode 100644 src-tauri/yaak-ws/permissions/autogenerated/commands/list_websocket_connections.toml create mode 100644 src-tauri/yaak-ws/permissions/autogenerated/commands/list_websocket_requests.toml create mode 100644 src-tauri/yaak-ws/permissions/autogenerated/commands/send.toml create mode 100644 src-tauri/yaak-ws/permissions/autogenerated/commands/upsert_request.toml create mode 100644 src-tauri/yaak-ws/permissions/autogenerated/commands/upsert_websocket_request.toml create mode 100644 src-tauri/yaak-ws/permissions/autogenerated/reference.md create mode 100644 src-tauri/yaak-ws/permissions/default.toml create mode 100644 src-tauri/yaak-ws/permissions/schemas/schema.json create mode 100644 src-tauri/yaak-ws/src/cmd.rs create mode 100644 src-tauri/yaak-ws/src/connect.rs create mode 100644 src-tauri/yaak-ws/src/error.rs create mode 100644 src-tauri/yaak-ws/src/lib.rs create mode 100644 src-tauri/yaak-ws/src/manager.rs create mode 100644 src-tauri/yaak-ws/src/render.rs create mode 100644 src-web/commands/deleteWebsocketConnection.ts create mode 100644 src-web/commands/deleteWebsocketConnections.ts create mode 100644 src-web/commands/deleteWebsocketRequest.tsx create mode 100644 src-web/commands/upsertWebsocketRequest.ts rename src-web/components/{RequestPane.tsx => HttpRequestPane.tsx} (98%) rename src-web/components/{ResponsePane.tsx => HttpResponsePane.tsx} (96%) rename src-web/components/{RecentConnectionsDropdown.tsx => RecentGrpcConnectionsDropdown.tsx} (94%) rename src-web/components/{RecentResponsesDropdown.tsx => RecentHttpResponsesDropdown.tsx} (96%) create mode 100644 src-web/components/RecentWebsocketConnectionsDropdown.tsx create mode 100644 src-web/components/WebsocketRequestLayout.tsx create mode 100644 src-web/components/WebsocketRequestPane.tsx create mode 100644 src-web/components/WebsocketResponsePane.tsx rename src-web/components/{ => sidebar}/Sidebar.tsx (85%) rename src-web/components/{ => sidebar}/SidebarActions.tsx (73%) rename src-web/components/{ => sidebar}/SidebarAtoms.ts (81%) rename src-web/components/{ => sidebar}/SidebarItem.tsx (86%) rename src-web/components/{ => sidebar}/SidebarItemContextMenu.tsx (79%) rename src-web/components/{ => sidebar}/SidebarItems.tsx (97%) create mode 100644 src-web/hooks/usePinnedWebsocketConnection.ts create mode 100644 src-web/hooks/useWebsocketConnections.ts create mode 100644 src-web/hooks/useWebsocketEvents.ts create mode 100644 src-web/hooks/useWebsocketRequests.ts diff --git a/package-lock.json b/package-lock.json index 44f05b52..67067f6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,10 +17,11 @@ "src-tauri/yaak-sse", "src-tauri/yaak-sync", "src-tauri/yaak-templates", + "src-tauri/yaak-ws", "src-web" ], "devDependencies": { - "@tauri-apps/cli": "^2.2.5", + "@tauri-apps/cli": "^2.2.7", "@typescript-eslint/eslint-plugin": "^8.18.1", "@typescript-eslint/parser": "^8.18.1", "eslint": "^8", @@ -705,6 +706,7 @@ "os": [ "aix" ], + "peer": true, "engines": { "node": ">=12" } @@ -722,6 +724,7 @@ "os": [ "android" ], + "peer": true, "engines": { "node": ">=12" } @@ -739,6 +742,7 @@ "os": [ "android" ], + "peer": true, "engines": { "node": ">=12" } @@ -756,6 +760,7 @@ "os": [ "android" ], + "peer": true, "engines": { "node": ">=12" } @@ -773,6 +778,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": ">=12" } @@ -790,6 +796,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": ">=12" } @@ -807,6 +814,7 @@ "os": [ "freebsd" ], + "peer": true, "engines": { "node": ">=12" } @@ -824,6 +832,7 @@ "os": [ "freebsd" ], + "peer": true, "engines": { "node": ">=12" } @@ -841,6 +850,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } @@ -858,6 +868,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } @@ -875,6 +886,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } @@ -892,6 +904,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } @@ -909,6 +922,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } @@ -926,6 +940,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } @@ -943,6 +958,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } @@ -960,6 +976,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } @@ -977,10 +994,28 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.24.2.tgz", + "integrity": "sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@esbuild/netbsd-x64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", @@ -994,6 +1029,7 @@ "os": [ "netbsd" ], + "peer": true, "engines": { "node": ">=12" } @@ -1028,6 +1064,7 @@ "os": [ "openbsd" ], + "peer": true, "engines": { "node": ">=12" } @@ -1045,6 +1082,7 @@ "os": [ "sunos" ], + "peer": true, "engines": { "node": ">=12" } @@ -1062,6 +1100,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">=12" } @@ -1079,6 +1118,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">=12" } @@ -1096,6 +1136,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">=12" } @@ -1663,15 +1704,15 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.2.tgz", - "integrity": "sha512-/FIdS3PyZ39bjZlwqFnWqCOVnW7o963LtKMwQOD0NhQqw22gSr2YY1afu3FxRip4ZCZNsD5jq6Aaz6QV3D/Njw==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz", + "integrity": "sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==", "dev": true, "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", - "picomatch": "^2.3.1" + "picomatch": "^4.0.2" }, "engines": { "node": ">=14.0.0" @@ -1685,6 +1726,19 @@ } } }, + "node_modules/@rollup/pluginutils/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.24.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.0.tgz", @@ -2709,9 +2763,9 @@ } }, "node_modules/@tauri-apps/cli": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli/-/cli-2.2.5.tgz", - "integrity": "sha512-PaefTQUCYYqvZWdH8EhXQkyJEjQwtoy/OHGoPcZx7Gk3D3K6AtGSxZ9OlHIz3Bu5LDGgVBk36vKtHW0WYsWnbw==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli/-/cli-2.2.7.tgz", + "integrity": "sha512-ZnsS2B4BplwXP37celanNANiIy8TCYhvg5RT09n72uR/o+navFZtGpFSqljV8fy1Y4ixIPds8FrGSXJCN2BerA==", "dev": true, "license": "Apache-2.0 OR MIT", "bin": { @@ -2725,22 +2779,22 @@ "url": "https://opencollective.com/tauri" }, "optionalDependencies": { - "@tauri-apps/cli-darwin-arm64": "2.2.5", - "@tauri-apps/cli-darwin-x64": "2.2.5", - "@tauri-apps/cli-linux-arm-gnueabihf": "2.2.5", - "@tauri-apps/cli-linux-arm64-gnu": "2.2.5", - "@tauri-apps/cli-linux-arm64-musl": "2.2.5", - "@tauri-apps/cli-linux-x64-gnu": "2.2.5", - "@tauri-apps/cli-linux-x64-musl": "2.2.5", - "@tauri-apps/cli-win32-arm64-msvc": "2.2.5", - "@tauri-apps/cli-win32-ia32-msvc": "2.2.5", - "@tauri-apps/cli-win32-x64-msvc": "2.2.5" + "@tauri-apps/cli-darwin-arm64": "2.2.7", + "@tauri-apps/cli-darwin-x64": "2.2.7", + "@tauri-apps/cli-linux-arm-gnueabihf": "2.2.7", + "@tauri-apps/cli-linux-arm64-gnu": "2.2.7", + "@tauri-apps/cli-linux-arm64-musl": "2.2.7", + "@tauri-apps/cli-linux-x64-gnu": "2.2.7", + "@tauri-apps/cli-linux-x64-musl": "2.2.7", + "@tauri-apps/cli-win32-arm64-msvc": "2.2.7", + "@tauri-apps/cli-win32-ia32-msvc": "2.2.7", + "@tauri-apps/cli-win32-x64-msvc": "2.2.7" } }, "node_modules/@tauri-apps/cli-darwin-arm64": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.2.5.tgz", - "integrity": "sha512-qdPmypQE7qj62UJy3Wl/ccCJZwsv5gyBByOrAaG7u5c/PB3QSxhNPegice2k4EHeIuApaVJOoe/CEYVgm/og2Q==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.2.7.tgz", + "integrity": "sha512-54kcpxZ3X1Rq+pPTzk3iIcjEVY4yv493uRx/80rLoAA95vAC0c//31Whz75UVddDjJfZvXlXZ3uSZ+bnCOnt0A==", "cpu": [ "arm64" ], @@ -2755,9 +2809,9 @@ } }, "node_modules/@tauri-apps/cli-darwin-x64": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.2.5.tgz", - "integrity": "sha512-8JVlCAb2c3n0EcGW7n/1kU4Rq831SsoLDD/0hNp85Um8HGIH2Mg/qos/MLOc8Qv2mOaoKcRKf4hd0I1y0Rl9Cg==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.2.7.tgz", + "integrity": "sha512-Vgu2XtBWemLnarB+6LqQeLanDlRj7CeFN//H8bVVdjbNzxcSxsvbLYMBP8+3boa7eBnjDrqMImRySSgL6IrwTw==", "cpu": [ "x64" ], @@ -2772,9 +2826,9 @@ } }, "node_modules/@tauri-apps/cli-linux-arm-gnueabihf": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.2.5.tgz", - "integrity": "sha512-mzxQCqZg7ljRVgekPpXQ5TOehCNgnXh/DNWU6kFjALaBvaw4fGzc369/hV94wOt29htNFyxf8ty2DaQaYljEHw==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.2.7.tgz", + "integrity": "sha512-+Clha2iQAiK9zoY/KKW0KLHkR0k36O78YLx5Sl98tWkwI3OBZFg5H5WT1plH/4sbZIS2aLFN6dw58/JlY9Bu/g==", "cpu": [ "arm" ], @@ -2789,9 +2843,9 @@ } }, "node_modules/@tauri-apps/cli-linux-arm64-gnu": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.2.5.tgz", - "integrity": "sha512-M9nkzx5jsSJSNpp7aSza0qv0/N13SUNzH8ysYSZ7IaCN8coGeMg2KgQ5qC6tqUVij2rbg8A/X1n0pPo/gtLx0A==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.2.7.tgz", + "integrity": "sha512-Z/Lp4SQe6BUEOays9BQAEum2pvZF4w9igyXijP+WbkOejZx4cDvarFJ5qXrqSLmBh7vxrdZcLwoLk9U//+yQrg==", "cpu": [ "arm64" ], @@ -2806,9 +2860,9 @@ } }, "node_modules/@tauri-apps/cli-linux-arm64-musl": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.2.5.tgz", - "integrity": "sha512-tFhZu950HNRLR1RM5Q9Xj5gAlA6AhyyiZgeoXGFAWto+s2jpWmmA3Qq2GUxnVDr7Xui8PF4UY5kANDIOschuwg==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.2.7.tgz", + "integrity": "sha512-+8HZ+txff/Y3YjAh80XcLXcX8kpGXVdr1P8AfjLHxHdS6QD4Md+acSxGTTNbplmHuBaSHJvuTvZf9tU1eDCTDg==", "cpu": [ "arm64" ], @@ -2823,9 +2877,9 @@ } }, "node_modules/@tauri-apps/cli-linux-x64-gnu": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.2.5.tgz", - "integrity": "sha512-eaGhTQLr3EKeksGsp2tK/Ndi7/oyo3P53Pye6kg0zqXiqu8LQjg1CgvDm1l+5oit04S60zR4AqlDFpoeEtDGgw==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.2.7.tgz", + "integrity": "sha512-ahlSnuCnUntblp9dG7/w5ZWZOdzRFi3zl0oScgt7GF4KNAOEa7duADsxPA4/FT2hLRa0SvpqtD4IYFvCxoVv3Q==", "cpu": [ "x64" ], @@ -2840,9 +2894,9 @@ } }, "node_modules/@tauri-apps/cli-linux-x64-musl": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.2.5.tgz", - "integrity": "sha512-NLAO/SymDxeGuOWWQZCpwoED1K1jaHUvW+u9ip+rTetnxFPLvf3zXthx4QVKfCZLdj2WLQz4cLjHyQdMDXAM+w==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.2.7.tgz", + "integrity": "sha512-+qKAWnJRSX+pjjRbKAQgTdFY8ecdcu8UdJ69i7wn3ZcRn2nMMzOO2LOMOTQV42B7/Q64D1pIpmZj9yblTMvadA==", "cpu": [ "x64" ], @@ -2857,9 +2911,9 @@ } }, "node_modules/@tauri-apps/cli-win32-arm64-msvc": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.2.5.tgz", - "integrity": "sha512-yG5KFbqrHfGjkAQAaaCD4i7cJklBjmMxZ2C92DEnqCOujSsEuLxrwwoKxQ4+hqEHOmF3lyX0vfqhgZcS03H38w==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.2.7.tgz", + "integrity": "sha512-aa86nRnrwT04u9D9fhf5JVssuAZlUCCc8AjqQjqODQjMd4BMA2+d4K9qBMpEG/1kVh95vZaNsLogjEaqSTTw4A==", "cpu": [ "arm64" ], @@ -2874,9 +2928,9 @@ } }, "node_modules/@tauri-apps/cli-win32-ia32-msvc": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.2.5.tgz", - "integrity": "sha512-G5lq+2EdxOc8ttg3uhME5t9U3hMGTxwaKz0X4DplTG2Iv4lcNWqw/AESIJVHa5a+EB+ZCC8I+yOfIykp/Cd5mQ==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.2.7.tgz", + "integrity": "sha512-EiJ5/25tLSQOSGvv+t6o3ZBfOTKB5S3vb+hHQuKbfmKdRF0XQu2YPdIi1CQw1DU97ZAE0Dq4frvnyYEKWgMzVQ==", "cpu": [ "ia32" ], @@ -2891,9 +2945,9 @@ } }, "node_modules/@tauri-apps/cli-win32-x64-msvc": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.2.5.tgz", - "integrity": "sha512-vw4fPVOo0rIQIlqw6xUvK2nwiRFBHNgayDE2Z/SomJlQJAJ1q4VgpHOPl12ouuicmTjK1gWKm7RTouQe3Nig0Q==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.2.7.tgz", + "integrity": "sha512-ZB8Kw90j8Ld+9tCWyD2fWCYfIrzbQohJ4DJSidNwbnehlZzP7wAz6Z3xjsvUdKtQ3ibtfoeTqVInzCCEpI+pWg==", "cpu": [ "x64" ], @@ -3479,6 +3533,10 @@ "resolved": "src-tauri/yaak-templates", "link": true }, + "node_modules/@yaakapp-internal/ws": { + "resolved": "src-tauri/yaak-ws", + "link": true + }, "node_modules/@yaakapp/api": { "resolved": "packages/plugin-runtime-types", "link": true @@ -5944,6 +6002,7 @@ "dev": true, "hasInstallScript": true, "license": "MIT", + "peer": true, "bin": { "esbuild": "bin/esbuild" }, @@ -7529,6 +7588,18 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/hexy": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/hexy/-/hexy-0.3.5.tgz", + "integrity": "sha512-UCP7TIZPXz5kxYJnNOym+9xaenxCLor/JyhKieo8y8/bJWunGh9xbhy3YrgYJUQ87WwfXGm05X330DszOfINZw==", + "license": "MIT", + "bin": { + "hexy": "bin/hexy_cmd.js" + }, + "engines": { + "node": ">=10.4" + } + }, "node_modules/history": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/history/-/history-5.3.0.tgz", @@ -9977,9 +10048,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "funding": [ { "type": "github", @@ -10968,9 +11039,9 @@ "license": "MIT" }, "node_modules/picocolors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", - "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "license": "ISC" }, "node_modules/picomatch": { @@ -11051,9 +11122,9 @@ } }, "node_modules/postcss": { - "version": "8.4.47", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", - "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.1.tgz", + "integrity": "sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==", "funding": [ { "type": "opencollective", @@ -11070,8 +11141,8 @@ ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.1.0", + "nanoid": "^3.3.8", + "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, "engines": { @@ -14747,6 +14818,7 @@ "integrity": "sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", @@ -14802,9 +14874,9 @@ } }, "node_modules/vite-plugin-static-copy": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/vite-plugin-static-copy/-/vite-plugin-static-copy-1.0.6.tgz", - "integrity": "sha512-3uSvsMwDVFZRitqoWHj0t4137Kz7UynnJeq1EZlRW7e25h2068fyIZX4ORCCOAkfp1FklGxJNVJBkBOD+PZIew==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/vite-plugin-static-copy/-/vite-plugin-static-copy-2.2.0.tgz", + "integrity": "sha512-ytMrKdR9iWEYHbUxs6x53m+MRl4SJsOSoMu1U1+Pfg0DjPeMlsRVx3RR5jvoonineDquIue83Oq69JvNsFSU5w==", "dev": true, "license": "MIT", "dependencies": { @@ -14817,7 +14889,7 @@ "node": "^18.0.0 || >=20.0.0" }, "peerDependencies": { - "vite": "^5.0.0" + "vite": "^5.0.0 || ^6.0.0" } }, "node_modules/vite-plugin-static-copy/node_modules/fs-extra": { @@ -14859,18 +14931,18 @@ } }, "node_modules/vite-plugin-svgr": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/vite-plugin-svgr/-/vite-plugin-svgr-4.2.0.tgz", - "integrity": "sha512-SC7+FfVtNQk7So0XMjrrtLAbEC8qjFPifyD7+fs/E6aaNdVde6umlVVh0QuwDLdOMu7vp5RiGFsB70nj5yo0XA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/vite-plugin-svgr/-/vite-plugin-svgr-4.3.0.tgz", + "integrity": "sha512-Jy9qLB2/PyWklpYy0xk0UU3TlU0t2UMpJXZvf+hWII1lAmRHrOUKi11Uw8N3rxoNk7atZNYO3pR3vI1f7oi+6w==", "dev": true, "license": "MIT", "dependencies": { - "@rollup/pluginutils": "^5.0.5", + "@rollup/pluginutils": "^5.1.3", "@svgr/core": "^8.1.0", "@svgr/plugin-jsx": "^8.1.0" }, "peerDependencies": { - "vite": "^2.6.0 || 3 || 4 || 5" + "vite": ">=2.6.0" } }, "node_modules/vite-plugin-top-level-await": { @@ -15419,7 +15491,7 @@ }, "packages/plugin-runtime-types": { "name": "@yaakapp/api", - "version": "0.3.4", + "version": "0.4.0", "dependencies": { "@types/node": "^22.5.4" }, @@ -15537,6 +15609,10 @@ "name": "@yaakapp-internal/templates", "version": "1.0.0" }, + "src-tauri/yaak-ws": { + "name": "@yaakapp-internal/ws", + "version": "1.0.0" + }, "src-web": { "name": "@yaakapp/app", "version": "1.0.0", @@ -15577,6 +15653,7 @@ "format-graphql": "^1.5.0", "framer-motion": "^11.5.4", "fuzzbunny": "^1.0.1", + "hexy": "^0.3.5", "history": "^5.3.0", "jotai": "^2.9.3", "js-md5": "^0.8.3", @@ -15623,12 +15700,461 @@ "postcss-nesting": "^13.0.0", "react-devtools": "^5.3.1", "tailwindcss": "^3.4.10", - "vite": "^5.4.6", - "vite-plugin-static-copy": "^1.0.6", - "vite-plugin-svgr": "^4.2.0", + "vite": "6.0.9", + "vite-plugin-static-copy": "^2.2.0", + "vite-plugin-svgr": "^4.3.0", "vite-plugin-top-level-await": "^1.4.4" } }, + "src-web/node_modules/@esbuild/aix-ppc64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.2.tgz", + "integrity": "sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/android-arm": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.2.tgz", + "integrity": "sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/android-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.2.tgz", + "integrity": "sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/android-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.2.tgz", + "integrity": "sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/darwin-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.2.tgz", + "integrity": "sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/darwin-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.2.tgz", + "integrity": "sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/freebsd-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.2.tgz", + "integrity": "sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/freebsd-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.2.tgz", + "integrity": "sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/linux-arm": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.2.tgz", + "integrity": "sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/linux-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.2.tgz", + "integrity": "sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/linux-ia32": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.2.tgz", + "integrity": "sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/linux-loong64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.2.tgz", + "integrity": "sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/linux-mips64el": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.2.tgz", + "integrity": "sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/linux-ppc64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.2.tgz", + "integrity": "sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/linux-riscv64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.2.tgz", + "integrity": "sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/linux-s390x": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.2.tgz", + "integrity": "sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/linux-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.2.tgz", + "integrity": "sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/netbsd-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.2.tgz", + "integrity": "sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/openbsd-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.2.tgz", + "integrity": "sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/openbsd-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.2.tgz", + "integrity": "sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/sunos-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.2.tgz", + "integrity": "sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/win32-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.2.tgz", + "integrity": "sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/win32-ia32": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.2.tgz", + "integrity": "sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/@esbuild/win32-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.2.tgz", + "integrity": "sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "src-web/node_modules/esbuild": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.2.tgz", + "integrity": "sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.24.2", + "@esbuild/android-arm": "0.24.2", + "@esbuild/android-arm64": "0.24.2", + "@esbuild/android-x64": "0.24.2", + "@esbuild/darwin-arm64": "0.24.2", + "@esbuild/darwin-x64": "0.24.2", + "@esbuild/freebsd-arm64": "0.24.2", + "@esbuild/freebsd-x64": "0.24.2", + "@esbuild/linux-arm": "0.24.2", + "@esbuild/linux-arm64": "0.24.2", + "@esbuild/linux-ia32": "0.24.2", + "@esbuild/linux-loong64": "0.24.2", + "@esbuild/linux-mips64el": "0.24.2", + "@esbuild/linux-ppc64": "0.24.2", + "@esbuild/linux-riscv64": "0.24.2", + "@esbuild/linux-s390x": "0.24.2", + "@esbuild/linux-x64": "0.24.2", + "@esbuild/netbsd-arm64": "0.24.2", + "@esbuild/netbsd-x64": "0.24.2", + "@esbuild/openbsd-arm64": "0.24.2", + "@esbuild/openbsd-x64": "0.24.2", + "@esbuild/sunos-x64": "0.24.2", + "@esbuild/win32-arm64": "0.24.2", + "@esbuild/win32-ia32": "0.24.2", + "@esbuild/win32-x64": "0.24.2" + } + }, "src-web/node_modules/nanoid": { "version": "5.0.9", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.9.tgz", @@ -15646,6 +16172,78 @@ "engines": { "node": "^18 || >=20" } + }, + "src-web/node_modules/vite": { + "version": "6.0.9", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.9.tgz", + "integrity": "sha512-MSgUxHcaXLtnBPktkbUSoQUANApKYuxZ6DrbVENlIorbhL2dZydTLaZ01tjUoE3szeFzlFk9ANOKk0xurh4MKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.24.2", + "postcss": "^8.4.49", + "rollup": "^4.23.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "jiti": ">=1.21.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } } } } diff --git a/package.json b/package.json index 98ef0054..18f27fbc 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "src-tauri/yaak-sse", "src-tauri/yaak-sync", "src-tauri/yaak-templates", + "src-tauri/yaak-ws", "src-web" ], "scripts": { @@ -34,7 +35,7 @@ "tauri-before-dev": "npm run --workspaces --if-present dev" }, "devDependencies": { - "@tauri-apps/cli": "^2.2.5", + "@tauri-apps/cli": "^2.2.7", "@typescript-eslint/eslint-plugin": "^8.18.1", "@typescript-eslint/parser": "^8.18.1", "eslint": "^8", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 9d29c4f9..39c80d7a 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -43,7 +43,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check 0.9.5", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -1236,7 +1236,16 @@ version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ - "dirs-sys", + "dirs-sys 0.4.1", +] + +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys 0.5.0", ] [[package]] @@ -1247,10 +1256,22 @@ checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ "libc", "option-ext", - "redox_users", + "redox_users 0.4.5", "windows-sys 0.48.0", ] +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users 0.5.0", + "windows-sys 0.59.0", +] + [[package]] name = "dispatch" version = "0.2.0" @@ -1670,9 +1691,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" @@ -1698,9 +1719,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" @@ -1717,9 +1738,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", @@ -1728,21 +1749,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", "futures-io", @@ -1915,6 +1936,18 @@ dependencies = [ "wasi 0.11.0+wasi-snapshot-preview1", ] +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets 0.52.6", +] + [[package]] name = "gimli" version = "0.29.0" @@ -2281,7 +2314,6 @@ dependencies = [ "hyper-util", "rustls", "rustls-pki-types", - "rustls-platform-verifier", "tokio", "tokio-rustls", "tower-service", @@ -2695,9 +2727,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.155" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libloading" @@ -3864,7 +3896,7 @@ version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -4162,6 +4194,17 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "rand" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.0", + "zerocopy 0.8.14", +] + [[package]] name = "rand_chacha" version = "0.2.2" @@ -4182,6 +4225,16 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.0", +] + [[package]] name = "rand_core" version = "0.5.1" @@ -4200,6 +4253,16 @@ dependencies = [ "getrandom 0.2.15", ] +[[package]] +name = "rand_core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b08f3c9802962f7e1b25113931d94f43ed9725bebc59db9d0c3e9a23b67e15ff" +dependencies = [ + "getrandom 0.3.1", + "zerocopy 0.8.14", +] + [[package]] name = "rand_hc" version = "0.2.0" @@ -4259,6 +4322,17 @@ dependencies = [ "thiserror 1.0.63", ] +[[package]] +name = "redox_users" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" +dependencies = [ + "getrandom 0.2.15", + "libredox", + "thiserror 2.0.11", +] + [[package]] name = "regex" version = "1.11.0" @@ -4518,9 +4592,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.21" +version = "0.23.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" dependencies = [ "once_cell", "ring", @@ -4783,9 +4857,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.215" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] @@ -4813,9 +4887,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", @@ -5553,13 +5627,13 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.2.3" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f6efc261c7905839b4914889a5b25df07f0ff89c63fb4afd6ff8c96af15e4d" +checksum = "58a998b6be84104ca05c7e9a21f2180ddec020c8b84ea59a8fc8530a2a19588d" dependencies = [ "anyhow", "bytes", - "dirs", + "dirs 6.0.0", "dunce", "embed_plist", "futures-util", @@ -5610,7 +5684,7 @@ checksum = "8e950124f6779c6cf98e3260c7a6c8488a74aa6350dd54c6950fdaa349bca2df" dependencies = [ "anyhow", "cargo_toml", - "dirs", + "dirs 5.0.1", "glob", "heck 0.5.0", "json-patch", @@ -5667,9 +5741,9 @@ dependencies = [ [[package]] name = "tauri-plugin" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e753f2a30933a9bbf0a202fa47d7cc4a3401f06e8d6dcc53b79aa62954828c79" +checksum = "5841b9a0200e954ef7457f8d327091424328891e267a97b641dc246cc54d0dec" dependencies = [ "anyhow", "glob", @@ -5684,9 +5758,9 @@ dependencies = [ [[package]] name = "tauri-plugin-clipboard-manager" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be2c6f5d82396c1a86d5b16052cc97976a82e92244bf074dd6e2f6272d8619d" +checksum = "54de1e3a2ea008687954d5d72952800e87b09f6fbea6d0960d99e58050537642" dependencies = [ "arboard", "log", @@ -5740,16 +5814,16 @@ dependencies = [ [[package]] name = "tauri-plugin-log" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eddd784c138c08a43954bc3e735402e6b2b2ee8d8c254a7391f4e77c01273dd5" +checksum = "367a28a5e0ca39eac98005699466e8906edc4a2a8f8e13a5f1a71dc0bea6c677" dependencies = [ "android_logger", "byte-unit", - "cocoa 0.26.0", "fern", "log", - "objc", + "objc2", + "objc2-foundation", "serde", "serde_json", "serde_repr", @@ -5762,9 +5836,9 @@ dependencies = [ [[package]] name = "tauri-plugin-opener" -version = "2.2.4" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1270bd2f3aabffc2becc05b6aafab3d24fe5679db91bec369fb44865afd7de13" +checksum = "635ed7c580dc3cdc61c94097d38ef517d749ffc0141c806d904e68e4b0cf1c2a" dependencies = [ "dunce", "glob", @@ -5838,12 +5912,12 @@ dependencies = [ [[package]] name = "tauri-plugin-updater" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce2d39224390c41ba544f02b4f1721f42256320b3fb8c371e9425cbddeb4a68c" +checksum = "ad3de2b9203bb00b9765e637a9878aaace34df40ae484878b8cea7a5bd5f9188" dependencies = [ "base64 0.22.1", - "dirs", + "dirs 5.0.1", "flate2", "futures-util", "http", @@ -5868,9 +5942,9 @@ dependencies = [ [[package]] name = "tauri-plugin-window-state" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234dd891cc7960fa28f93ea911f3e0d9ce8375ebf9ff303831bdd7a3443d5714" +checksum = "35e344b512b0d99d9d06225f235d87d6c66d89496a3bf323d9b578d940596e6c" dependencies = [ "bitflags 2.6.0", "log", @@ -6113,9 +6187,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.42.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "bytes", @@ -6131,9 +6205,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", @@ -6163,9 +6237,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -6180,7 +6254,11 @@ checksum = "be4bf6fecd69fcdede0ec680aaf474cdab988f9de6bc73d3758f0160e3b7025a" dependencies = [ "futures-util", "log", + "rustls", + "rustls-native-certs", + "rustls-pki-types", "tokio", + "tokio-rustls", "tungstenite", ] @@ -6397,7 +6475,7 @@ checksum = "533fc2d4105e0e3d96ce1c71f2d308c9fbbe2ef9c587cab63dd627ab5bde218f" dependencies = [ "core-graphics 0.24.0", "crossbeam-channel", - "dirs", + "dirs 5.0.1", "libappindicator", "muda", "objc2", @@ -6454,6 +6532,8 @@ dependencies = [ "httparse", "log", "rand 0.8.5", + "rustls", + "rustls-pki-types", "sha1", "thiserror 2.0.11", "utf-8", @@ -6633,9 +6713,9 @@ checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" [[package]] name = "uuid" -version = "1.10.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b" dependencies = [ "getrandom 0.2.15", "rand 0.8.5", @@ -6723,6 +6803,15 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasite" version = "0.1.0" @@ -7371,6 +7460,15 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags 2.6.0", +] + [[package]] name = "wry" version = "0.48.0" @@ -7498,7 +7596,7 @@ dependencies = [ "mime_guess", "objc", "openssl-sys", - "rand 0.8.5", + "rand 0.9.0", "regex", "reqwest", "reqwest_cookie_store", @@ -7530,6 +7628,7 @@ dependencies = [ "yaak-sse", "yaak-sync", "yaak-templates", + "yaak-ws", ] [[package]] @@ -7547,6 +7646,8 @@ dependencies = [ "prost", "prost-reflect", "prost-types", + "rustls", + "rustls-platform-verifier", "serde", "serde_json", "tauri", @@ -7603,7 +7704,7 @@ dependencies = [ "log", "md5", "path-slash", - "rand 0.8.5", + "rand 0.9.0", "regex", "serde", "serde_json", @@ -7614,6 +7715,7 @@ dependencies = [ "tokio-tungstenite", "ts-rs", "yaak-models", + "yaak-templates", ] [[package]] @@ -7650,10 +7752,33 @@ version = "0.1.0" dependencies = [ "log", "serde", + "serde_json", "tokio", "ts-rs", ] +[[package]] +name = "yaak-ws" +version = "0.1.0" +dependencies = [ + "chrono", + "futures-util", + "log", + "md5", + "rustls", + "rustls-platform-verifier", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "thiserror 2.0.11", + "tokio", + "tokio-tungstenite", + "yaak-models", + "yaak-plugins", + "yaak-templates", +] + [[package]] name = "zbus" version = "4.0.1" @@ -7783,7 +7908,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "byteorder", - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a367f292d93d4eab890745e75a778da40909cab4d6ff8173693812f79c4a2468" +dependencies = [ + "zerocopy-derive 0.8.14", ] [[package]] @@ -7797,6 +7931,17 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "zerocopy-derive" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3931cb58c62c13adec22e38686b559c86a30565e16ad6e8510a337cedc611e1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "zeroize" version = "1.8.1" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index cc4bc81e..458ba946 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -7,6 +7,7 @@ members = [ "yaak-sse", "yaak-sync", "yaak-templates", + "yaak-ws", ] [package] @@ -40,53 +41,56 @@ openssl-sys = { version = "0.9", features = ["vendored"] } # For Ubuntu installa [dependencies] chrono = { version = "0.4.31", features = ["serde"] } datetime = "0.5.2" +encoding_rs = "0.8.35" eventsource-client = { git = "https://github.com/yaakapp/rust-eventsource-client", version = "0.14.0" } hex_color = "3.0.0" http = { version = "1.2.0", default-features = false } log = "0.4.21" md5 = "0.7.0" -rand = "0.8.5" +mime_guess = "2.0.5" +rand = "0.9.0" regex = "1.10.2" reqwest = { workspace = true, features = ["multipart", "cookies", "gzip", "brotli", "deflate", "json", "rustls-tls-manual-roots-no-provider"] } reqwest_cookie_store = "0.8.0" -rustls = { version = "0.23.21", default-features = false } +rustls = { version = "0.23.22", default-features = false, features = ["custom-provider", "ring"] } rustls-platform-verifier = "0.5.0" serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["raw_value"] } tauri = { workspace = true, features = ["devtools", "protocol-asset"] } -tauri-plugin-clipboard-manager = "2.2.0" +tauri-plugin-clipboard-manager = "2.2.1" tauri-plugin-dialog = "2.2.0" tauri-plugin-fs = "2.2.0" -tauri-plugin-log = { version = "2.2.0", features = ["colored"] } -tauri-plugin-opener = "2.2.4" +tauri-plugin-log = { version = "2.2.1", features = ["colored"] } +tauri-plugin-opener = "2.2.5" tauri-plugin-os = "2.2.0" tauri-plugin-shell = { workspace = true } tauri-plugin-single-instance = "2.2.1" -tauri-plugin-updater = "2.3.1" -tauri-plugin-window-state = "2.2.0" -tokio = { version = "1.36.0", features = ["sync"] } -tokio-stream = "0.1.15" +tauri-plugin-updater = "2.4.0" +tauri-plugin-window-state = "2.2.1" +tokio = { version = "1.43.0", features = ["sync"] } +tokio-stream = "0.1.17" ts-rs = { workspace = true } -mime_guess = "2.0.5" urlencoding = "2.1.3" -uuid = "1.7.0" +uuid = "1.12.1" yaak-grpc = { path = "yaak-grpc" } yaak-license = { path = "yaak-license" } yaak-models = { workspace = true } yaak-plugins = { workspace = true } yaak-sse = { workspace = true } yaak-sync = { path = "yaak-sync" } -yaak-templates = { path = "yaak-templates" } -encoding_rs = "0.8.35" +yaak-templates = { workspace = true } +yaak-ws = { path = "yaak-ws" } [workspace.dependencies] -yaak-models = { path = "yaak-models" } -yaak-sse = { path = "yaak-sse" } -yaak-plugins = { path = "yaak-plugins" } +reqwest = "0.12.12" serde = "1.0.215" serde_json = "1.0.132" +tauri = "2.2.5" +tauri-plugin = "2.0.4" tauri-plugin-shell = "2.2.0" -tauri = "2.2.3" thiserror = "2.0.3" ts-rs = "10.0.0" -reqwest = "0.12.12" +yaak-models = { path = "yaak-models" } +yaak-plugins = { path = "yaak-plugins" } +yaak-sse = { path = "yaak-sse" } +yaak-templates = { path = "yaak-templates" } diff --git a/src-tauri/bindings/analytics.ts b/src-tauri/bindings/analytics.ts index 554ae988..fd29157e 100644 --- a/src-tauri/bindings/analytics.ts +++ b/src-tauri/bindings/analytics.ts @@ -2,4 +2,4 @@ export type AnalyticsAction = "cancel" | "click" | "commit" | "create" | "delete" | "delete_many" | "duplicate" | "error" | "export" | "hide" | "import" | "launch" | "launch_first" | "launch_update" | "send" | "show" | "toggle" | "update" | "upsert"; -export type AnalyticsResource = "app" | "appearance" | "button" | "checkbox" | "cookie_jar" | "dialog" | "environment" | "folder" | "grpc_connection" | "grpc_event" | "grpc_request" | "http_request" | "http_response" | "key_value" | "link" | "mutation" | "plugin" | "select" | "setting" | "sidebar" | "tab" | "theme" | "workspace"; +export type AnalyticsResource = "app" | "appearance" | "button" | "checkbox" | "cookie_jar" | "dialog" | "environment" | "folder" | "grpc_connection" | "grpc_event" | "grpc_request" | "http_request" | "http_response" | "key_value" | "link" | "mutation" | "plugin" | "select" | "setting" | "sidebar" | "tab" | "theme" | "websocket_connection" | "websocket_event" | "websocket_request" | "workspace"; diff --git a/src-tauri/capabilities/capabilities.json b/src-tauri/capabilities/capabilities.json index 29ce0e6f..16096f02 100644 --- a/src-tauri/capabilities/capabilities.json +++ b/src-tauri/capabilities/capabilities.json @@ -51,6 +51,7 @@ "opener:allow-reveal-item-in-dir", "shell:allow-open", "yaak-license:default", - "yaak-sync:default" + "yaak-sync:default", + "yaak-ws:default" ] } diff --git a/src-tauri/gen/schemas/acl-manifests.json b/src-tauri/gen/schemas/acl-manifests.json index 9866b462..0ae5952b 100644 --- a/src-tauri/gen/schemas/acl-manifests.json +++ b/src-tauri/gen/schemas/acl-manifests.json @@ -1 +1 @@ -{"clipboard-manager":{"default_permission":{"identifier":"default","description":"No features are enabled by default, as we believe\nthe clipboard can be inherently dangerous and it is \napplication specific if read and/or write access is needed.\n\nClipboard interaction needs to be explicitly enabled.\n","permissions":[]},"permissions":{"allow-clear":{"identifier":"allow-clear","description":"Enables the clear command without any pre-configured scope.","commands":{"allow":["clear"],"deny":[]}},"allow-read-image":{"identifier":"allow-read-image","description":"Enables the read_image command without any pre-configured scope.","commands":{"allow":["read_image"],"deny":[]}},"allow-read-text":{"identifier":"allow-read-text","description":"Enables the read_text command without any pre-configured scope.","commands":{"allow":["read_text"],"deny":[]}},"allow-write-html":{"identifier":"allow-write-html","description":"Enables the write_html command without any pre-configured scope.","commands":{"allow":["write_html"],"deny":[]}},"allow-write-image":{"identifier":"allow-write-image","description":"Enables the write_image command without any pre-configured scope.","commands":{"allow":["write_image"],"deny":[]}},"allow-write-text":{"identifier":"allow-write-text","description":"Enables the write_text command without any pre-configured scope.","commands":{"allow":["write_text"],"deny":[]}},"deny-clear":{"identifier":"deny-clear","description":"Denies the clear command without any pre-configured scope.","commands":{"allow":[],"deny":["clear"]}},"deny-read-image":{"identifier":"deny-read-image","description":"Denies the read_image command without any pre-configured scope.","commands":{"allow":[],"deny":["read_image"]}},"deny-read-text":{"identifier":"deny-read-text","description":"Denies the read_text command without any pre-configured scope.","commands":{"allow":[],"deny":["read_text"]}},"deny-write-html":{"identifier":"deny-write-html","description":"Denies the write_html command without any pre-configured scope.","commands":{"allow":[],"deny":["write_html"]}},"deny-write-image":{"identifier":"deny-write-image","description":"Denies the write_image command without any pre-configured scope.","commands":{"allow":[],"deny":["write_image"]}},"deny-write-text":{"identifier":"deny-write-text","description":"Denies the write_text command without any pre-configured scope.","commands":{"allow":[],"deny":["write_text"]}}},"permission_sets":{},"global_scope_schema":null},"core":{"default_permission":{"identifier":"default","description":"Default core plugins set which includes:\n- 'core:path:default'\n- 'core:event:default'\n- 'core:window:default'\n- 'core:webview:default'\n- 'core:app:default'\n- 'core:image:default'\n- 'core:resources:default'\n- 'core:menu:default'\n- 'core:tray:default'\n","permissions":["core:path:default","core:event:default","core:window:default","core:webview:default","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default"]},"permissions":{},"permission_sets":{},"global_scope_schema":null},"core:app":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-version","allow-name","allow-tauri-version"]},"permissions":{"allow-app-hide":{"identifier":"allow-app-hide","description":"Enables the app_hide command without any pre-configured scope.","commands":{"allow":["app_hide"],"deny":[]}},"allow-app-show":{"identifier":"allow-app-show","description":"Enables the app_show command without any pre-configured scope.","commands":{"allow":["app_show"],"deny":[]}},"allow-default-window-icon":{"identifier":"allow-default-window-icon","description":"Enables the default_window_icon command without any pre-configured scope.","commands":{"allow":["default_window_icon"],"deny":[]}},"allow-name":{"identifier":"allow-name","description":"Enables the name command without any pre-configured scope.","commands":{"allow":["name"],"deny":[]}},"allow-set-app-theme":{"identifier":"allow-set-app-theme","description":"Enables the set_app_theme command without any pre-configured scope.","commands":{"allow":["set_app_theme"],"deny":[]}},"allow-tauri-version":{"identifier":"allow-tauri-version","description":"Enables the tauri_version command without any pre-configured scope.","commands":{"allow":["tauri_version"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-app-hide":{"identifier":"deny-app-hide","description":"Denies the app_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["app_hide"]}},"deny-app-show":{"identifier":"deny-app-show","description":"Denies the app_show command without any pre-configured scope.","commands":{"allow":[],"deny":["app_show"]}},"deny-default-window-icon":{"identifier":"deny-default-window-icon","description":"Denies the default_window_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["default_window_icon"]}},"deny-name":{"identifier":"deny-name","description":"Denies the name command without any pre-configured scope.","commands":{"allow":[],"deny":["name"]}},"deny-set-app-theme":{"identifier":"deny-set-app-theme","description":"Denies the set_app_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_app_theme"]}},"deny-tauri-version":{"identifier":"deny-tauri-version","description":"Denies the tauri_version command without any pre-configured scope.","commands":{"allow":[],"deny":["tauri_version"]}},"deny-version":{"identifier":"deny-version","description":"Denies the version command without any pre-configured scope.","commands":{"allow":[],"deny":["version"]}}},"permission_sets":{},"global_scope_schema":null},"core:event":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-listen","allow-unlisten","allow-emit","allow-emit-to"]},"permissions":{"allow-emit":{"identifier":"allow-emit","description":"Enables the emit command without any pre-configured scope.","commands":{"allow":["emit"],"deny":[]}},"allow-emit-to":{"identifier":"allow-emit-to","description":"Enables the emit_to command without any pre-configured scope.","commands":{"allow":["emit_to"],"deny":[]}},"allow-listen":{"identifier":"allow-listen","description":"Enables the listen command without any pre-configured scope.","commands":{"allow":["listen"],"deny":[]}},"allow-unlisten":{"identifier":"allow-unlisten","description":"Enables the unlisten command without any pre-configured scope.","commands":{"allow":["unlisten"],"deny":[]}},"deny-emit":{"identifier":"deny-emit","description":"Denies the emit command without any pre-configured scope.","commands":{"allow":[],"deny":["emit"]}},"deny-emit-to":{"identifier":"deny-emit-to","description":"Denies the emit_to command without any pre-configured scope.","commands":{"allow":[],"deny":["emit_to"]}},"deny-listen":{"identifier":"deny-listen","description":"Denies the listen command without any pre-configured scope.","commands":{"allow":[],"deny":["listen"]}},"deny-unlisten":{"identifier":"deny-unlisten","description":"Denies the unlisten command without any pre-configured scope.","commands":{"allow":[],"deny":["unlisten"]}}},"permission_sets":{},"global_scope_schema":null},"core:image":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-new","allow-from-bytes","allow-from-path","allow-rgba","allow-size"]},"permissions":{"allow-from-bytes":{"identifier":"allow-from-bytes","description":"Enables the from_bytes command without any pre-configured scope.","commands":{"allow":["from_bytes"],"deny":[]}},"allow-from-path":{"identifier":"allow-from-path","description":"Enables the from_path command without any pre-configured scope.","commands":{"allow":["from_path"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-rgba":{"identifier":"allow-rgba","description":"Enables the rgba command without any pre-configured scope.","commands":{"allow":["rgba"],"deny":[]}},"allow-size":{"identifier":"allow-size","description":"Enables the size command without any pre-configured scope.","commands":{"allow":["size"],"deny":[]}},"deny-from-bytes":{"identifier":"deny-from-bytes","description":"Denies the from_bytes command without any pre-configured scope.","commands":{"allow":[],"deny":["from_bytes"]}},"deny-from-path":{"identifier":"deny-from-path","description":"Denies the from_path command without any pre-configured scope.","commands":{"allow":[],"deny":["from_path"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-rgba":{"identifier":"deny-rgba","description":"Denies the rgba command without any pre-configured scope.","commands":{"allow":[],"deny":["rgba"]}},"deny-size":{"identifier":"deny-size","description":"Denies the size command without any pre-configured scope.","commands":{"allow":[],"deny":["size"]}}},"permission_sets":{},"global_scope_schema":null},"core:menu":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-new","allow-append","allow-prepend","allow-insert","allow-remove","allow-remove-at","allow-items","allow-get","allow-popup","allow-create-default","allow-set-as-app-menu","allow-set-as-window-menu","allow-text","allow-set-text","allow-is-enabled","allow-set-enabled","allow-set-accelerator","allow-set-as-windows-menu-for-nsapp","allow-set-as-help-menu-for-nsapp","allow-is-checked","allow-set-checked","allow-set-icon"]},"permissions":{"allow-append":{"identifier":"allow-append","description":"Enables the append command without any pre-configured scope.","commands":{"allow":["append"],"deny":[]}},"allow-create-default":{"identifier":"allow-create-default","description":"Enables the create_default command without any pre-configured scope.","commands":{"allow":["create_default"],"deny":[]}},"allow-get":{"identifier":"allow-get","description":"Enables the get command without any pre-configured scope.","commands":{"allow":["get"],"deny":[]}},"allow-insert":{"identifier":"allow-insert","description":"Enables the insert command without any pre-configured scope.","commands":{"allow":["insert"],"deny":[]}},"allow-is-checked":{"identifier":"allow-is-checked","description":"Enables the is_checked command without any pre-configured scope.","commands":{"allow":["is_checked"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-items":{"identifier":"allow-items","description":"Enables the items command without any pre-configured scope.","commands":{"allow":["items"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-popup":{"identifier":"allow-popup","description":"Enables the popup command without any pre-configured scope.","commands":{"allow":["popup"],"deny":[]}},"allow-prepend":{"identifier":"allow-prepend","description":"Enables the prepend command without any pre-configured scope.","commands":{"allow":["prepend"],"deny":[]}},"allow-remove":{"identifier":"allow-remove","description":"Enables the remove command without any pre-configured scope.","commands":{"allow":["remove"],"deny":[]}},"allow-remove-at":{"identifier":"allow-remove-at","description":"Enables the remove_at command without any pre-configured scope.","commands":{"allow":["remove_at"],"deny":[]}},"allow-set-accelerator":{"identifier":"allow-set-accelerator","description":"Enables the set_accelerator command without any pre-configured scope.","commands":{"allow":["set_accelerator"],"deny":[]}},"allow-set-as-app-menu":{"identifier":"allow-set-as-app-menu","description":"Enables the set_as_app_menu command without any pre-configured scope.","commands":{"allow":["set_as_app_menu"],"deny":[]}},"allow-set-as-help-menu-for-nsapp":{"identifier":"allow-set-as-help-menu-for-nsapp","description":"Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_help_menu_for_nsapp"],"deny":[]}},"allow-set-as-window-menu":{"identifier":"allow-set-as-window-menu","description":"Enables the set_as_window_menu command without any pre-configured scope.","commands":{"allow":["set_as_window_menu"],"deny":[]}},"allow-set-as-windows-menu-for-nsapp":{"identifier":"allow-set-as-windows-menu-for-nsapp","description":"Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_windows_menu_for_nsapp"],"deny":[]}},"allow-set-checked":{"identifier":"allow-set-checked","description":"Enables the set_checked command without any pre-configured scope.","commands":{"allow":["set_checked"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-text":{"identifier":"allow-set-text","description":"Enables the set_text command without any pre-configured scope.","commands":{"allow":["set_text"],"deny":[]}},"allow-text":{"identifier":"allow-text","description":"Enables the text command without any pre-configured scope.","commands":{"allow":["text"],"deny":[]}},"deny-append":{"identifier":"deny-append","description":"Denies the append command without any pre-configured scope.","commands":{"allow":[],"deny":["append"]}},"deny-create-default":{"identifier":"deny-create-default","description":"Denies the create_default command without any pre-configured scope.","commands":{"allow":[],"deny":["create_default"]}},"deny-get":{"identifier":"deny-get","description":"Denies the get command without any pre-configured scope.","commands":{"allow":[],"deny":["get"]}},"deny-insert":{"identifier":"deny-insert","description":"Denies the insert command without any pre-configured scope.","commands":{"allow":[],"deny":["insert"]}},"deny-is-checked":{"identifier":"deny-is-checked","description":"Denies the is_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["is_checked"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-items":{"identifier":"deny-items","description":"Denies the items command without any pre-configured scope.","commands":{"allow":[],"deny":["items"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-popup":{"identifier":"deny-popup","description":"Denies the popup command without any pre-configured scope.","commands":{"allow":[],"deny":["popup"]}},"deny-prepend":{"identifier":"deny-prepend","description":"Denies the prepend command without any pre-configured scope.","commands":{"allow":[],"deny":["prepend"]}},"deny-remove":{"identifier":"deny-remove","description":"Denies the remove command without any pre-configured scope.","commands":{"allow":[],"deny":["remove"]}},"deny-remove-at":{"identifier":"deny-remove-at","description":"Denies the remove_at command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_at"]}},"deny-set-accelerator":{"identifier":"deny-set-accelerator","description":"Denies the set_accelerator command without any pre-configured scope.","commands":{"allow":[],"deny":["set_accelerator"]}},"deny-set-as-app-menu":{"identifier":"deny-set-as-app-menu","description":"Denies the set_as_app_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_app_menu"]}},"deny-set-as-help-menu-for-nsapp":{"identifier":"deny-set-as-help-menu-for-nsapp","description":"Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_help_menu_for_nsapp"]}},"deny-set-as-window-menu":{"identifier":"deny-set-as-window-menu","description":"Denies the set_as_window_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_window_menu"]}},"deny-set-as-windows-menu-for-nsapp":{"identifier":"deny-set-as-windows-menu-for-nsapp","description":"Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_windows_menu_for_nsapp"]}},"deny-set-checked":{"identifier":"deny-set-checked","description":"Denies the set_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["set_checked"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-text":{"identifier":"deny-set-text","description":"Denies the set_text command without any pre-configured scope.","commands":{"allow":[],"deny":["set_text"]}},"deny-text":{"identifier":"deny-text","description":"Denies the text command without any pre-configured scope.","commands":{"allow":[],"deny":["text"]}}},"permission_sets":{},"global_scope_schema":null},"core:path":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-resolve-directory","allow-resolve","allow-normalize","allow-join","allow-dirname","allow-extname","allow-basename","allow-is-absolute"]},"permissions":{"allow-basename":{"identifier":"allow-basename","description":"Enables the basename command without any pre-configured scope.","commands":{"allow":["basename"],"deny":[]}},"allow-dirname":{"identifier":"allow-dirname","description":"Enables the dirname command without any pre-configured scope.","commands":{"allow":["dirname"],"deny":[]}},"allow-extname":{"identifier":"allow-extname","description":"Enables the extname command without any pre-configured scope.","commands":{"allow":["extname"],"deny":[]}},"allow-is-absolute":{"identifier":"allow-is-absolute","description":"Enables the is_absolute command without any pre-configured scope.","commands":{"allow":["is_absolute"],"deny":[]}},"allow-join":{"identifier":"allow-join","description":"Enables the join command without any pre-configured scope.","commands":{"allow":["join"],"deny":[]}},"allow-normalize":{"identifier":"allow-normalize","description":"Enables the normalize command without any pre-configured scope.","commands":{"allow":["normalize"],"deny":[]}},"allow-resolve":{"identifier":"allow-resolve","description":"Enables the resolve command without any pre-configured scope.","commands":{"allow":["resolve"],"deny":[]}},"allow-resolve-directory":{"identifier":"allow-resolve-directory","description":"Enables the resolve_directory command without any pre-configured scope.","commands":{"allow":["resolve_directory"],"deny":[]}},"deny-basename":{"identifier":"deny-basename","description":"Denies the basename command without any pre-configured scope.","commands":{"allow":[],"deny":["basename"]}},"deny-dirname":{"identifier":"deny-dirname","description":"Denies the dirname command without any pre-configured scope.","commands":{"allow":[],"deny":["dirname"]}},"deny-extname":{"identifier":"deny-extname","description":"Denies the extname command without any pre-configured scope.","commands":{"allow":[],"deny":["extname"]}},"deny-is-absolute":{"identifier":"deny-is-absolute","description":"Denies the is_absolute command without any pre-configured scope.","commands":{"allow":[],"deny":["is_absolute"]}},"deny-join":{"identifier":"deny-join","description":"Denies the join command without any pre-configured scope.","commands":{"allow":[],"deny":["join"]}},"deny-normalize":{"identifier":"deny-normalize","description":"Denies the normalize command without any pre-configured scope.","commands":{"allow":[],"deny":["normalize"]}},"deny-resolve":{"identifier":"deny-resolve","description":"Denies the resolve command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve"]}},"deny-resolve-directory":{"identifier":"deny-resolve-directory","description":"Denies the resolve_directory command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve_directory"]}}},"permission_sets":{},"global_scope_schema":null},"core:resources":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-close"]},"permissions":{"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}}},"permission_sets":{},"global_scope_schema":null},"core:tray":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-new","allow-get-by-id","allow-remove-by-id","allow-set-icon","allow-set-menu","allow-set-tooltip","allow-set-title","allow-set-visible","allow-set-temp-dir-path","allow-set-icon-as-template","allow-set-show-menu-on-left-click"]},"permissions":{"allow-get-by-id":{"identifier":"allow-get-by-id","description":"Enables the get_by_id command without any pre-configured scope.","commands":{"allow":["get_by_id"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-remove-by-id":{"identifier":"allow-remove-by-id","description":"Enables the remove_by_id command without any pre-configured scope.","commands":{"allow":["remove_by_id"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-icon-as-template":{"identifier":"allow-set-icon-as-template","description":"Enables the set_icon_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_as_template"],"deny":[]}},"allow-set-menu":{"identifier":"allow-set-menu","description":"Enables the set_menu command without any pre-configured scope.","commands":{"allow":["set_menu"],"deny":[]}},"allow-set-show-menu-on-left-click":{"identifier":"allow-set-show-menu-on-left-click","description":"Enables the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":["set_show_menu_on_left_click"],"deny":[]}},"allow-set-temp-dir-path":{"identifier":"allow-set-temp-dir-path","description":"Enables the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":["set_temp_dir_path"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-tooltip":{"identifier":"allow-set-tooltip","description":"Enables the set_tooltip command without any pre-configured scope.","commands":{"allow":["set_tooltip"],"deny":[]}},"allow-set-visible":{"identifier":"allow-set-visible","description":"Enables the set_visible command without any pre-configured scope.","commands":{"allow":["set_visible"],"deny":[]}},"deny-get-by-id":{"identifier":"deny-get-by-id","description":"Denies the get_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["get_by_id"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-remove-by-id":{"identifier":"deny-remove-by-id","description":"Denies the remove_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_by_id"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-icon-as-template":{"identifier":"deny-set-icon-as-template","description":"Denies the set_icon_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_as_template"]}},"deny-set-menu":{"identifier":"deny-set-menu","description":"Denies the set_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_menu"]}},"deny-set-show-menu-on-left-click":{"identifier":"deny-set-show-menu-on-left-click","description":"Denies the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":[],"deny":["set_show_menu_on_left_click"]}},"deny-set-temp-dir-path":{"identifier":"deny-set-temp-dir-path","description":"Denies the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":[],"deny":["set_temp_dir_path"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-tooltip":{"identifier":"deny-set-tooltip","description":"Denies the set_tooltip command without any pre-configured scope.","commands":{"allow":[],"deny":["set_tooltip"]}},"deny-set-visible":{"identifier":"deny-set-visible","description":"Denies the set_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible"]}}},"permission_sets":{},"global_scope_schema":null},"core:webview":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-webviews","allow-webview-position","allow-webview-size","allow-internal-toggle-devtools"]},"permissions":{"allow-clear-all-browsing-data":{"identifier":"allow-clear-all-browsing-data","description":"Enables the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":["clear_all_browsing_data"],"deny":[]}},"allow-create-webview":{"identifier":"allow-create-webview","description":"Enables the create_webview command without any pre-configured scope.","commands":{"allow":["create_webview"],"deny":[]}},"allow-create-webview-window":{"identifier":"allow-create-webview-window","description":"Enables the create_webview_window command without any pre-configured scope.","commands":{"allow":["create_webview_window"],"deny":[]}},"allow-get-all-webviews":{"identifier":"allow-get-all-webviews","description":"Enables the get_all_webviews command without any pre-configured scope.","commands":{"allow":["get_all_webviews"],"deny":[]}},"allow-internal-toggle-devtools":{"identifier":"allow-internal-toggle-devtools","description":"Enables the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":["internal_toggle_devtools"],"deny":[]}},"allow-print":{"identifier":"allow-print","description":"Enables the print command without any pre-configured scope.","commands":{"allow":["print"],"deny":[]}},"allow-reparent":{"identifier":"allow-reparent","description":"Enables the reparent command without any pre-configured scope.","commands":{"allow":["reparent"],"deny":[]}},"allow-set-webview-background-color":{"identifier":"allow-set-webview-background-color","description":"Enables the set_webview_background_color command without any pre-configured scope.","commands":{"allow":["set_webview_background_color"],"deny":[]}},"allow-set-webview-focus":{"identifier":"allow-set-webview-focus","description":"Enables the set_webview_focus command without any pre-configured scope.","commands":{"allow":["set_webview_focus"],"deny":[]}},"allow-set-webview-position":{"identifier":"allow-set-webview-position","description":"Enables the set_webview_position command without any pre-configured scope.","commands":{"allow":["set_webview_position"],"deny":[]}},"allow-set-webview-size":{"identifier":"allow-set-webview-size","description":"Enables the set_webview_size command without any pre-configured scope.","commands":{"allow":["set_webview_size"],"deny":[]}},"allow-set-webview-zoom":{"identifier":"allow-set-webview-zoom","description":"Enables the set_webview_zoom command without any pre-configured scope.","commands":{"allow":["set_webview_zoom"],"deny":[]}},"allow-webview-close":{"identifier":"allow-webview-close","description":"Enables the webview_close command without any pre-configured scope.","commands":{"allow":["webview_close"],"deny":[]}},"allow-webview-hide":{"identifier":"allow-webview-hide","description":"Enables the webview_hide command without any pre-configured scope.","commands":{"allow":["webview_hide"],"deny":[]}},"allow-webview-position":{"identifier":"allow-webview-position","description":"Enables the webview_position command without any pre-configured scope.","commands":{"allow":["webview_position"],"deny":[]}},"allow-webview-show":{"identifier":"allow-webview-show","description":"Enables the webview_show command without any pre-configured scope.","commands":{"allow":["webview_show"],"deny":[]}},"allow-webview-size":{"identifier":"allow-webview-size","description":"Enables the webview_size command without any pre-configured scope.","commands":{"allow":["webview_size"],"deny":[]}},"deny-clear-all-browsing-data":{"identifier":"deny-clear-all-browsing-data","description":"Denies the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":[],"deny":["clear_all_browsing_data"]}},"deny-create-webview":{"identifier":"deny-create-webview","description":"Denies the create_webview command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview"]}},"deny-create-webview-window":{"identifier":"deny-create-webview-window","description":"Denies the create_webview_window command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview_window"]}},"deny-get-all-webviews":{"identifier":"deny-get-all-webviews","description":"Denies the get_all_webviews command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_webviews"]}},"deny-internal-toggle-devtools":{"identifier":"deny-internal-toggle-devtools","description":"Denies the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_devtools"]}},"deny-print":{"identifier":"deny-print","description":"Denies the print command without any pre-configured scope.","commands":{"allow":[],"deny":["print"]}},"deny-reparent":{"identifier":"deny-reparent","description":"Denies the reparent command without any pre-configured scope.","commands":{"allow":[],"deny":["reparent"]}},"deny-set-webview-background-color":{"identifier":"deny-set-webview-background-color","description":"Denies the set_webview_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_background_color"]}},"deny-set-webview-focus":{"identifier":"deny-set-webview-focus","description":"Denies the set_webview_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_focus"]}},"deny-set-webview-position":{"identifier":"deny-set-webview-position","description":"Denies the set_webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_position"]}},"deny-set-webview-size":{"identifier":"deny-set-webview-size","description":"Denies the set_webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_size"]}},"deny-set-webview-zoom":{"identifier":"deny-set-webview-zoom","description":"Denies the set_webview_zoom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_zoom"]}},"deny-webview-close":{"identifier":"deny-webview-close","description":"Denies the webview_close command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_close"]}},"deny-webview-hide":{"identifier":"deny-webview-hide","description":"Denies the webview_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_hide"]}},"deny-webview-position":{"identifier":"deny-webview-position","description":"Denies the webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_position"]}},"deny-webview-show":{"identifier":"deny-webview-show","description":"Denies the webview_show command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_show"]}},"deny-webview-size":{"identifier":"deny-webview-size","description":"Denies the webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_size"]}}},"permission_sets":{},"global_scope_schema":null},"core:window":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-windows","allow-scale-factor","allow-inner-position","allow-outer-position","allow-inner-size","allow-outer-size","allow-is-fullscreen","allow-is-minimized","allow-is-maximized","allow-is-focused","allow-is-decorated","allow-is-resizable","allow-is-maximizable","allow-is-minimizable","allow-is-closable","allow-is-visible","allow-is-enabled","allow-title","allow-current-monitor","allow-primary-monitor","allow-monitor-from-point","allow-available-monitors","allow-cursor-position","allow-theme","allow-internal-toggle-maximize"]},"permissions":{"allow-available-monitors":{"identifier":"allow-available-monitors","description":"Enables the available_monitors command without any pre-configured scope.","commands":{"allow":["available_monitors"],"deny":[]}},"allow-center":{"identifier":"allow-center","description":"Enables the center command without any pre-configured scope.","commands":{"allow":["center"],"deny":[]}},"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"allow-create":{"identifier":"allow-create","description":"Enables the create command without any pre-configured scope.","commands":{"allow":["create"],"deny":[]}},"allow-current-monitor":{"identifier":"allow-current-monitor","description":"Enables the current_monitor command without any pre-configured scope.","commands":{"allow":["current_monitor"],"deny":[]}},"allow-cursor-position":{"identifier":"allow-cursor-position","description":"Enables the cursor_position command without any pre-configured scope.","commands":{"allow":["cursor_position"],"deny":[]}},"allow-destroy":{"identifier":"allow-destroy","description":"Enables the destroy command without any pre-configured scope.","commands":{"allow":["destroy"],"deny":[]}},"allow-get-all-windows":{"identifier":"allow-get-all-windows","description":"Enables the get_all_windows command without any pre-configured scope.","commands":{"allow":["get_all_windows"],"deny":[]}},"allow-hide":{"identifier":"allow-hide","description":"Enables the hide command without any pre-configured scope.","commands":{"allow":["hide"],"deny":[]}},"allow-inner-position":{"identifier":"allow-inner-position","description":"Enables the inner_position command without any pre-configured scope.","commands":{"allow":["inner_position"],"deny":[]}},"allow-inner-size":{"identifier":"allow-inner-size","description":"Enables the inner_size command without any pre-configured scope.","commands":{"allow":["inner_size"],"deny":[]}},"allow-internal-toggle-maximize":{"identifier":"allow-internal-toggle-maximize","description":"Enables the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":["internal_toggle_maximize"],"deny":[]}},"allow-is-closable":{"identifier":"allow-is-closable","description":"Enables the is_closable command without any pre-configured scope.","commands":{"allow":["is_closable"],"deny":[]}},"allow-is-decorated":{"identifier":"allow-is-decorated","description":"Enables the is_decorated command without any pre-configured scope.","commands":{"allow":["is_decorated"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-is-focused":{"identifier":"allow-is-focused","description":"Enables the is_focused command without any pre-configured scope.","commands":{"allow":["is_focused"],"deny":[]}},"allow-is-fullscreen":{"identifier":"allow-is-fullscreen","description":"Enables the is_fullscreen command without any pre-configured scope.","commands":{"allow":["is_fullscreen"],"deny":[]}},"allow-is-maximizable":{"identifier":"allow-is-maximizable","description":"Enables the is_maximizable command without any pre-configured scope.","commands":{"allow":["is_maximizable"],"deny":[]}},"allow-is-maximized":{"identifier":"allow-is-maximized","description":"Enables the is_maximized command without any pre-configured scope.","commands":{"allow":["is_maximized"],"deny":[]}},"allow-is-minimizable":{"identifier":"allow-is-minimizable","description":"Enables the is_minimizable command without any pre-configured scope.","commands":{"allow":["is_minimizable"],"deny":[]}},"allow-is-minimized":{"identifier":"allow-is-minimized","description":"Enables the is_minimized command without any pre-configured scope.","commands":{"allow":["is_minimized"],"deny":[]}},"allow-is-resizable":{"identifier":"allow-is-resizable","description":"Enables the is_resizable command without any pre-configured scope.","commands":{"allow":["is_resizable"],"deny":[]}},"allow-is-visible":{"identifier":"allow-is-visible","description":"Enables the is_visible command without any pre-configured scope.","commands":{"allow":["is_visible"],"deny":[]}},"allow-maximize":{"identifier":"allow-maximize","description":"Enables the maximize command without any pre-configured scope.","commands":{"allow":["maximize"],"deny":[]}},"allow-minimize":{"identifier":"allow-minimize","description":"Enables the minimize command without any pre-configured scope.","commands":{"allow":["minimize"],"deny":[]}},"allow-monitor-from-point":{"identifier":"allow-monitor-from-point","description":"Enables the monitor_from_point command without any pre-configured scope.","commands":{"allow":["monitor_from_point"],"deny":[]}},"allow-outer-position":{"identifier":"allow-outer-position","description":"Enables the outer_position command without any pre-configured scope.","commands":{"allow":["outer_position"],"deny":[]}},"allow-outer-size":{"identifier":"allow-outer-size","description":"Enables the outer_size command without any pre-configured scope.","commands":{"allow":["outer_size"],"deny":[]}},"allow-primary-monitor":{"identifier":"allow-primary-monitor","description":"Enables the primary_monitor command without any pre-configured scope.","commands":{"allow":["primary_monitor"],"deny":[]}},"allow-request-user-attention":{"identifier":"allow-request-user-attention","description":"Enables the request_user_attention command without any pre-configured scope.","commands":{"allow":["request_user_attention"],"deny":[]}},"allow-scale-factor":{"identifier":"allow-scale-factor","description":"Enables the scale_factor command without any pre-configured scope.","commands":{"allow":["scale_factor"],"deny":[]}},"allow-set-always-on-bottom":{"identifier":"allow-set-always-on-bottom","description":"Enables the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":["set_always_on_bottom"],"deny":[]}},"allow-set-always-on-top":{"identifier":"allow-set-always-on-top","description":"Enables the set_always_on_top command without any pre-configured scope.","commands":{"allow":["set_always_on_top"],"deny":[]}},"allow-set-background-color":{"identifier":"allow-set-background-color","description":"Enables the set_background_color command without any pre-configured scope.","commands":{"allow":["set_background_color"],"deny":[]}},"allow-set-badge-count":{"identifier":"allow-set-badge-count","description":"Enables the set_badge_count command without any pre-configured scope.","commands":{"allow":["set_badge_count"],"deny":[]}},"allow-set-badge-label":{"identifier":"allow-set-badge-label","description":"Enables the set_badge_label command without any pre-configured scope.","commands":{"allow":["set_badge_label"],"deny":[]}},"allow-set-closable":{"identifier":"allow-set-closable","description":"Enables the set_closable command without any pre-configured scope.","commands":{"allow":["set_closable"],"deny":[]}},"allow-set-content-protected":{"identifier":"allow-set-content-protected","description":"Enables the set_content_protected command without any pre-configured scope.","commands":{"allow":["set_content_protected"],"deny":[]}},"allow-set-cursor-grab":{"identifier":"allow-set-cursor-grab","description":"Enables the set_cursor_grab command without any pre-configured scope.","commands":{"allow":["set_cursor_grab"],"deny":[]}},"allow-set-cursor-icon":{"identifier":"allow-set-cursor-icon","description":"Enables the set_cursor_icon command without any pre-configured scope.","commands":{"allow":["set_cursor_icon"],"deny":[]}},"allow-set-cursor-position":{"identifier":"allow-set-cursor-position","description":"Enables the set_cursor_position command without any pre-configured scope.","commands":{"allow":["set_cursor_position"],"deny":[]}},"allow-set-cursor-visible":{"identifier":"allow-set-cursor-visible","description":"Enables the set_cursor_visible command without any pre-configured scope.","commands":{"allow":["set_cursor_visible"],"deny":[]}},"allow-set-decorations":{"identifier":"allow-set-decorations","description":"Enables the set_decorations command without any pre-configured scope.","commands":{"allow":["set_decorations"],"deny":[]}},"allow-set-effects":{"identifier":"allow-set-effects","description":"Enables the set_effects command without any pre-configured scope.","commands":{"allow":["set_effects"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-focus":{"identifier":"allow-set-focus","description":"Enables the set_focus command without any pre-configured scope.","commands":{"allow":["set_focus"],"deny":[]}},"allow-set-fullscreen":{"identifier":"allow-set-fullscreen","description":"Enables the set_fullscreen command without any pre-configured scope.","commands":{"allow":["set_fullscreen"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-ignore-cursor-events":{"identifier":"allow-set-ignore-cursor-events","description":"Enables the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":["set_ignore_cursor_events"],"deny":[]}},"allow-set-max-size":{"identifier":"allow-set-max-size","description":"Enables the set_max_size command without any pre-configured scope.","commands":{"allow":["set_max_size"],"deny":[]}},"allow-set-maximizable":{"identifier":"allow-set-maximizable","description":"Enables the set_maximizable command without any pre-configured scope.","commands":{"allow":["set_maximizable"],"deny":[]}},"allow-set-min-size":{"identifier":"allow-set-min-size","description":"Enables the set_min_size command without any pre-configured scope.","commands":{"allow":["set_min_size"],"deny":[]}},"allow-set-minimizable":{"identifier":"allow-set-minimizable","description":"Enables the set_minimizable command without any pre-configured scope.","commands":{"allow":["set_minimizable"],"deny":[]}},"allow-set-overlay-icon":{"identifier":"allow-set-overlay-icon","description":"Enables the set_overlay_icon command without any pre-configured scope.","commands":{"allow":["set_overlay_icon"],"deny":[]}},"allow-set-position":{"identifier":"allow-set-position","description":"Enables the set_position command without any pre-configured scope.","commands":{"allow":["set_position"],"deny":[]}},"allow-set-progress-bar":{"identifier":"allow-set-progress-bar","description":"Enables the set_progress_bar command without any pre-configured scope.","commands":{"allow":["set_progress_bar"],"deny":[]}},"allow-set-resizable":{"identifier":"allow-set-resizable","description":"Enables the set_resizable command without any pre-configured scope.","commands":{"allow":["set_resizable"],"deny":[]}},"allow-set-shadow":{"identifier":"allow-set-shadow","description":"Enables the set_shadow command without any pre-configured scope.","commands":{"allow":["set_shadow"],"deny":[]}},"allow-set-size":{"identifier":"allow-set-size","description":"Enables the set_size command without any pre-configured scope.","commands":{"allow":["set_size"],"deny":[]}},"allow-set-size-constraints":{"identifier":"allow-set-size-constraints","description":"Enables the set_size_constraints command without any pre-configured scope.","commands":{"allow":["set_size_constraints"],"deny":[]}},"allow-set-skip-taskbar":{"identifier":"allow-set-skip-taskbar","description":"Enables the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":["set_skip_taskbar"],"deny":[]}},"allow-set-theme":{"identifier":"allow-set-theme","description":"Enables the set_theme command without any pre-configured scope.","commands":{"allow":["set_theme"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-title-bar-style":{"identifier":"allow-set-title-bar-style","description":"Enables the set_title_bar_style command without any pre-configured scope.","commands":{"allow":["set_title_bar_style"],"deny":[]}},"allow-set-visible-on-all-workspaces":{"identifier":"allow-set-visible-on-all-workspaces","description":"Enables the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":["set_visible_on_all_workspaces"],"deny":[]}},"allow-show":{"identifier":"allow-show","description":"Enables the show command without any pre-configured scope.","commands":{"allow":["show"],"deny":[]}},"allow-start-dragging":{"identifier":"allow-start-dragging","description":"Enables the start_dragging command without any pre-configured scope.","commands":{"allow":["start_dragging"],"deny":[]}},"allow-start-resize-dragging":{"identifier":"allow-start-resize-dragging","description":"Enables the start_resize_dragging command without any pre-configured scope.","commands":{"allow":["start_resize_dragging"],"deny":[]}},"allow-theme":{"identifier":"allow-theme","description":"Enables the theme command without any pre-configured scope.","commands":{"allow":["theme"],"deny":[]}},"allow-title":{"identifier":"allow-title","description":"Enables the title command without any pre-configured scope.","commands":{"allow":["title"],"deny":[]}},"allow-toggle-maximize":{"identifier":"allow-toggle-maximize","description":"Enables the toggle_maximize command without any pre-configured scope.","commands":{"allow":["toggle_maximize"],"deny":[]}},"allow-unmaximize":{"identifier":"allow-unmaximize","description":"Enables the unmaximize command without any pre-configured scope.","commands":{"allow":["unmaximize"],"deny":[]}},"allow-unminimize":{"identifier":"allow-unminimize","description":"Enables the unminimize command without any pre-configured scope.","commands":{"allow":["unminimize"],"deny":[]}},"deny-available-monitors":{"identifier":"deny-available-monitors","description":"Denies the available_monitors command without any pre-configured scope.","commands":{"allow":[],"deny":["available_monitors"]}},"deny-center":{"identifier":"deny-center","description":"Denies the center command without any pre-configured scope.","commands":{"allow":[],"deny":["center"]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}},"deny-create":{"identifier":"deny-create","description":"Denies the create command without any pre-configured scope.","commands":{"allow":[],"deny":["create"]}},"deny-current-monitor":{"identifier":"deny-current-monitor","description":"Denies the current_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["current_monitor"]}},"deny-cursor-position":{"identifier":"deny-cursor-position","description":"Denies the cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["cursor_position"]}},"deny-destroy":{"identifier":"deny-destroy","description":"Denies the destroy command without any pre-configured scope.","commands":{"allow":[],"deny":["destroy"]}},"deny-get-all-windows":{"identifier":"deny-get-all-windows","description":"Denies the get_all_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_windows"]}},"deny-hide":{"identifier":"deny-hide","description":"Denies the hide command without any pre-configured scope.","commands":{"allow":[],"deny":["hide"]}},"deny-inner-position":{"identifier":"deny-inner-position","description":"Denies the inner_position command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_position"]}},"deny-inner-size":{"identifier":"deny-inner-size","description":"Denies the inner_size command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_size"]}},"deny-internal-toggle-maximize":{"identifier":"deny-internal-toggle-maximize","description":"Denies the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_maximize"]}},"deny-is-closable":{"identifier":"deny-is-closable","description":"Denies the is_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_closable"]}},"deny-is-decorated":{"identifier":"deny-is-decorated","description":"Denies the is_decorated command without any pre-configured scope.","commands":{"allow":[],"deny":["is_decorated"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-is-focused":{"identifier":"deny-is-focused","description":"Denies the is_focused command without any pre-configured scope.","commands":{"allow":[],"deny":["is_focused"]}},"deny-is-fullscreen":{"identifier":"deny-is-fullscreen","description":"Denies the is_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["is_fullscreen"]}},"deny-is-maximizable":{"identifier":"deny-is-maximizable","description":"Denies the is_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximizable"]}},"deny-is-maximized":{"identifier":"deny-is-maximized","description":"Denies the is_maximized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximized"]}},"deny-is-minimizable":{"identifier":"deny-is-minimizable","description":"Denies the is_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimizable"]}},"deny-is-minimized":{"identifier":"deny-is-minimized","description":"Denies the is_minimized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimized"]}},"deny-is-resizable":{"identifier":"deny-is-resizable","description":"Denies the is_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_resizable"]}},"deny-is-visible":{"identifier":"deny-is-visible","description":"Denies the is_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["is_visible"]}},"deny-maximize":{"identifier":"deny-maximize","description":"Denies the maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["maximize"]}},"deny-minimize":{"identifier":"deny-minimize","description":"Denies the minimize command without any pre-configured scope.","commands":{"allow":[],"deny":["minimize"]}},"deny-monitor-from-point":{"identifier":"deny-monitor-from-point","description":"Denies the monitor_from_point command without any pre-configured scope.","commands":{"allow":[],"deny":["monitor_from_point"]}},"deny-outer-position":{"identifier":"deny-outer-position","description":"Denies the outer_position command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_position"]}},"deny-outer-size":{"identifier":"deny-outer-size","description":"Denies the outer_size command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_size"]}},"deny-primary-monitor":{"identifier":"deny-primary-monitor","description":"Denies the primary_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["primary_monitor"]}},"deny-request-user-attention":{"identifier":"deny-request-user-attention","description":"Denies the request_user_attention command without any pre-configured scope.","commands":{"allow":[],"deny":["request_user_attention"]}},"deny-scale-factor":{"identifier":"deny-scale-factor","description":"Denies the scale_factor command without any pre-configured scope.","commands":{"allow":[],"deny":["scale_factor"]}},"deny-set-always-on-bottom":{"identifier":"deny-set-always-on-bottom","description":"Denies the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_bottom"]}},"deny-set-always-on-top":{"identifier":"deny-set-always-on-top","description":"Denies the set_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_top"]}},"deny-set-background-color":{"identifier":"deny-set-background-color","description":"Denies the set_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_background_color"]}},"deny-set-badge-count":{"identifier":"deny-set-badge-count","description":"Denies the set_badge_count command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_count"]}},"deny-set-badge-label":{"identifier":"deny-set-badge-label","description":"Denies the set_badge_label command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_label"]}},"deny-set-closable":{"identifier":"deny-set-closable","description":"Denies the set_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_closable"]}},"deny-set-content-protected":{"identifier":"deny-set-content-protected","description":"Denies the set_content_protected command without any pre-configured scope.","commands":{"allow":[],"deny":["set_content_protected"]}},"deny-set-cursor-grab":{"identifier":"deny-set-cursor-grab","description":"Denies the set_cursor_grab command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_grab"]}},"deny-set-cursor-icon":{"identifier":"deny-set-cursor-icon","description":"Denies the set_cursor_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_icon"]}},"deny-set-cursor-position":{"identifier":"deny-set-cursor-position","description":"Denies the set_cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_position"]}},"deny-set-cursor-visible":{"identifier":"deny-set-cursor-visible","description":"Denies the set_cursor_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_visible"]}},"deny-set-decorations":{"identifier":"deny-set-decorations","description":"Denies the set_decorations command without any pre-configured scope.","commands":{"allow":[],"deny":["set_decorations"]}},"deny-set-effects":{"identifier":"deny-set-effects","description":"Denies the set_effects command without any pre-configured scope.","commands":{"allow":[],"deny":["set_effects"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-focus":{"identifier":"deny-set-focus","description":"Denies the set_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focus"]}},"deny-set-fullscreen":{"identifier":"deny-set-fullscreen","description":"Denies the set_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_fullscreen"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-ignore-cursor-events":{"identifier":"deny-set-ignore-cursor-events","description":"Denies the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":[],"deny":["set_ignore_cursor_events"]}},"deny-set-max-size":{"identifier":"deny-set-max-size","description":"Denies the set_max_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_max_size"]}},"deny-set-maximizable":{"identifier":"deny-set-maximizable","description":"Denies the set_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_maximizable"]}},"deny-set-min-size":{"identifier":"deny-set-min-size","description":"Denies the set_min_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_min_size"]}},"deny-set-minimizable":{"identifier":"deny-set-minimizable","description":"Denies the set_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_minimizable"]}},"deny-set-overlay-icon":{"identifier":"deny-set-overlay-icon","description":"Denies the set_overlay_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_overlay_icon"]}},"deny-set-position":{"identifier":"deny-set-position","description":"Denies the set_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_position"]}},"deny-set-progress-bar":{"identifier":"deny-set-progress-bar","description":"Denies the set_progress_bar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_progress_bar"]}},"deny-set-resizable":{"identifier":"deny-set-resizable","description":"Denies the set_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_resizable"]}},"deny-set-shadow":{"identifier":"deny-set-shadow","description":"Denies the set_shadow command without any pre-configured scope.","commands":{"allow":[],"deny":["set_shadow"]}},"deny-set-size":{"identifier":"deny-set-size","description":"Denies the set_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size"]}},"deny-set-size-constraints":{"identifier":"deny-set-size-constraints","description":"Denies the set_size_constraints command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size_constraints"]}},"deny-set-skip-taskbar":{"identifier":"deny-set-skip-taskbar","description":"Denies the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_skip_taskbar"]}},"deny-set-theme":{"identifier":"deny-set-theme","description":"Denies the set_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_theme"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-title-bar-style":{"identifier":"deny-set-title-bar-style","description":"Denies the set_title_bar_style command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title_bar_style"]}},"deny-set-visible-on-all-workspaces":{"identifier":"deny-set-visible-on-all-workspaces","description":"Denies the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible_on_all_workspaces"]}},"deny-show":{"identifier":"deny-show","description":"Denies the show command without any pre-configured scope.","commands":{"allow":[],"deny":["show"]}},"deny-start-dragging":{"identifier":"deny-start-dragging","description":"Denies the start_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_dragging"]}},"deny-start-resize-dragging":{"identifier":"deny-start-resize-dragging","description":"Denies the start_resize_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_resize_dragging"]}},"deny-theme":{"identifier":"deny-theme","description":"Denies the theme command without any pre-configured scope.","commands":{"allow":[],"deny":["theme"]}},"deny-title":{"identifier":"deny-title","description":"Denies the title command without any pre-configured scope.","commands":{"allow":[],"deny":["title"]}},"deny-toggle-maximize":{"identifier":"deny-toggle-maximize","description":"Denies the toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["toggle_maximize"]}},"deny-unmaximize":{"identifier":"deny-unmaximize","description":"Denies the unmaximize command without any pre-configured scope.","commands":{"allow":[],"deny":["unmaximize"]}},"deny-unminimize":{"identifier":"deny-unminimize","description":"Denies the unminimize command without any pre-configured scope.","commands":{"allow":[],"deny":["unminimize"]}}},"permission_sets":{},"global_scope_schema":null},"dialog":{"default_permission":{"identifier":"default","description":"This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n","permissions":["allow-ask","allow-confirm","allow-message","allow-save","allow-open"]},"permissions":{"allow-ask":{"identifier":"allow-ask","description":"Enables the ask command without any pre-configured scope.","commands":{"allow":["ask"],"deny":[]}},"allow-confirm":{"identifier":"allow-confirm","description":"Enables the confirm command without any pre-configured scope.","commands":{"allow":["confirm"],"deny":[]}},"allow-message":{"identifier":"allow-message","description":"Enables the message command without any pre-configured scope.","commands":{"allow":["message"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-save":{"identifier":"allow-save","description":"Enables the save command without any pre-configured scope.","commands":{"allow":["save"],"deny":[]}},"deny-ask":{"identifier":"deny-ask","description":"Denies the ask command without any pre-configured scope.","commands":{"allow":[],"deny":["ask"]}},"deny-confirm":{"identifier":"deny-confirm","description":"Denies the confirm command without any pre-configured scope.","commands":{"allow":[],"deny":["confirm"]}},"deny-message":{"identifier":"deny-message","description":"Denies the message command without any pre-configured scope.","commands":{"allow":[],"deny":["message"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-save":{"identifier":"deny-save","description":"Denies the save command without any pre-configured scope.","commands":{"allow":[],"deny":["save"]}}},"permission_sets":{},"global_scope_schema":null},"fs":{"default_permission":{"identifier":"default","description":"This set of permissions describes the what kind of\nfile system access the `fs` plugin has enabled or denied by default.\n\n#### Granted Permissions\n\nThis default permission set enables read access to the\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\nAppLog) and all files and sub directories created in it.\nThe location of these directories depends on the operating system,\nwhere the application is run.\n\nIn general these directories need to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\nTherefore, it is also allowed to create all of these folders via\nthe `mkdir` command.\n\n#### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\nOn Windows the webview data folder access is denied.\n\n#### Included permissions within this default permission set:\n","permissions":["create-app-specific-dirs","read-app-specific-dirs-recursive","deny-default"]},"permissions":{"allow-copy-file":{"identifier":"allow-copy-file","description":"Enables the copy_file command without any pre-configured scope.","commands":{"allow":["copy_file"],"deny":[]}},"allow-create":{"identifier":"allow-create","description":"Enables the create command without any pre-configured scope.","commands":{"allow":["create"],"deny":[]}},"allow-exists":{"identifier":"allow-exists","description":"Enables the exists command without any pre-configured scope.","commands":{"allow":["exists"],"deny":[]}},"allow-fstat":{"identifier":"allow-fstat","description":"Enables the fstat command without any pre-configured scope.","commands":{"allow":["fstat"],"deny":[]}},"allow-ftruncate":{"identifier":"allow-ftruncate","description":"Enables the ftruncate command without any pre-configured scope.","commands":{"allow":["ftruncate"],"deny":[]}},"allow-lstat":{"identifier":"allow-lstat","description":"Enables the lstat command without any pre-configured scope.","commands":{"allow":["lstat"],"deny":[]}},"allow-mkdir":{"identifier":"allow-mkdir","description":"Enables the mkdir command without any pre-configured scope.","commands":{"allow":["mkdir"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-read":{"identifier":"allow-read","description":"Enables the read command without any pre-configured scope.","commands":{"allow":["read"],"deny":[]}},"allow-read-dir":{"identifier":"allow-read-dir","description":"Enables the read_dir command without any pre-configured scope.","commands":{"allow":["read_dir"],"deny":[]}},"allow-read-file":{"identifier":"allow-read-file","description":"Enables the read_file command without any pre-configured scope.","commands":{"allow":["read_file"],"deny":[]}},"allow-read-text-file":{"identifier":"allow-read-text-file","description":"Enables the read_text_file command without any pre-configured scope.","commands":{"allow":["read_text_file"],"deny":[]}},"allow-read-text-file-lines":{"identifier":"allow-read-text-file-lines","description":"Enables the read_text_file_lines command without any pre-configured scope.","commands":{"allow":["read_text_file_lines","read_text_file_lines_next"],"deny":[]}},"allow-read-text-file-lines-next":{"identifier":"allow-read-text-file-lines-next","description":"Enables the read_text_file_lines_next command without any pre-configured scope.","commands":{"allow":["read_text_file_lines_next"],"deny":[]}},"allow-remove":{"identifier":"allow-remove","description":"Enables the remove command without any pre-configured scope.","commands":{"allow":["remove"],"deny":[]}},"allow-rename":{"identifier":"allow-rename","description":"Enables the rename command without any pre-configured scope.","commands":{"allow":["rename"],"deny":[]}},"allow-seek":{"identifier":"allow-seek","description":"Enables the seek command without any pre-configured scope.","commands":{"allow":["seek"],"deny":[]}},"allow-size":{"identifier":"allow-size","description":"Enables the size command without any pre-configured scope.","commands":{"allow":["size"],"deny":[]}},"allow-stat":{"identifier":"allow-stat","description":"Enables the stat command without any pre-configured scope.","commands":{"allow":["stat"],"deny":[]}},"allow-truncate":{"identifier":"allow-truncate","description":"Enables the truncate command without any pre-configured scope.","commands":{"allow":["truncate"],"deny":[]}},"allow-unwatch":{"identifier":"allow-unwatch","description":"Enables the unwatch command without any pre-configured scope.","commands":{"allow":["unwatch"],"deny":[]}},"allow-watch":{"identifier":"allow-watch","description":"Enables the watch command without any pre-configured scope.","commands":{"allow":["watch"],"deny":[]}},"allow-write":{"identifier":"allow-write","description":"Enables the write command without any pre-configured scope.","commands":{"allow":["write"],"deny":[]}},"allow-write-file":{"identifier":"allow-write-file","description":"Enables the write_file command without any pre-configured scope.","commands":{"allow":["write_file","open","write"],"deny":[]}},"allow-write-text-file":{"identifier":"allow-write-text-file","description":"Enables the write_text_file command without any pre-configured scope.","commands":{"allow":["write_text_file"],"deny":[]}},"create-app-specific-dirs":{"identifier":"create-app-specific-dirs","description":"This permissions allows to create the application specific directories.\n","commands":{"allow":["mkdir","scope-app-index"],"deny":[]}},"deny-copy-file":{"identifier":"deny-copy-file","description":"Denies the copy_file command without any pre-configured scope.","commands":{"allow":[],"deny":["copy_file"]}},"deny-create":{"identifier":"deny-create","description":"Denies the create command without any pre-configured scope.","commands":{"allow":[],"deny":["create"]}},"deny-exists":{"identifier":"deny-exists","description":"Denies the exists command without any pre-configured scope.","commands":{"allow":[],"deny":["exists"]}},"deny-fstat":{"identifier":"deny-fstat","description":"Denies the fstat command without any pre-configured scope.","commands":{"allow":[],"deny":["fstat"]}},"deny-ftruncate":{"identifier":"deny-ftruncate","description":"Denies the ftruncate command without any pre-configured scope.","commands":{"allow":[],"deny":["ftruncate"]}},"deny-lstat":{"identifier":"deny-lstat","description":"Denies the lstat command without any pre-configured scope.","commands":{"allow":[],"deny":["lstat"]}},"deny-mkdir":{"identifier":"deny-mkdir","description":"Denies the mkdir command without any pre-configured scope.","commands":{"allow":[],"deny":["mkdir"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-read":{"identifier":"deny-read","description":"Denies the read command without any pre-configured scope.","commands":{"allow":[],"deny":["read"]}},"deny-read-dir":{"identifier":"deny-read-dir","description":"Denies the read_dir command without any pre-configured scope.","commands":{"allow":[],"deny":["read_dir"]}},"deny-read-file":{"identifier":"deny-read-file","description":"Denies the read_file command without any pre-configured scope.","commands":{"allow":[],"deny":["read_file"]}},"deny-read-text-file":{"identifier":"deny-read-text-file","description":"Denies the read_text_file command without any pre-configured scope.","commands":{"allow":[],"deny":["read_text_file"]}},"deny-read-text-file-lines":{"identifier":"deny-read-text-file-lines","description":"Denies the read_text_file_lines command without any pre-configured scope.","commands":{"allow":[],"deny":["read_text_file_lines"]}},"deny-read-text-file-lines-next":{"identifier":"deny-read-text-file-lines-next","description":"Denies the read_text_file_lines_next command without any pre-configured scope.","commands":{"allow":[],"deny":["read_text_file_lines_next"]}},"deny-remove":{"identifier":"deny-remove","description":"Denies the remove command without any pre-configured scope.","commands":{"allow":[],"deny":["remove"]}},"deny-rename":{"identifier":"deny-rename","description":"Denies the rename command without any pre-configured scope.","commands":{"allow":[],"deny":["rename"]}},"deny-seek":{"identifier":"deny-seek","description":"Denies the seek command without any pre-configured scope.","commands":{"allow":[],"deny":["seek"]}},"deny-size":{"identifier":"deny-size","description":"Denies the size command without any pre-configured scope.","commands":{"allow":[],"deny":["size"]}},"deny-stat":{"identifier":"deny-stat","description":"Denies the stat command without any pre-configured scope.","commands":{"allow":[],"deny":["stat"]}},"deny-truncate":{"identifier":"deny-truncate","description":"Denies the truncate command without any pre-configured scope.","commands":{"allow":[],"deny":["truncate"]}},"deny-unwatch":{"identifier":"deny-unwatch","description":"Denies the unwatch command without any pre-configured scope.","commands":{"allow":[],"deny":["unwatch"]}},"deny-watch":{"identifier":"deny-watch","description":"Denies the watch command without any pre-configured scope.","commands":{"allow":[],"deny":["watch"]}},"deny-webview-data-linux":{"identifier":"deny-webview-data-linux","description":"This denies read access to the\n`$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.","commands":{"allow":[],"deny":[]}},"deny-webview-data-windows":{"identifier":"deny-webview-data-windows","description":"This denies read access to the\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.","commands":{"allow":[],"deny":[]}},"deny-write":{"identifier":"deny-write","description":"Denies the write command without any pre-configured scope.","commands":{"allow":[],"deny":["write"]}},"deny-write-file":{"identifier":"deny-write-file","description":"Denies the write_file command without any pre-configured scope.","commands":{"allow":[],"deny":["write_file"]}},"deny-write-text-file":{"identifier":"deny-write-text-file","description":"Denies the write_text_file command without any pre-configured scope.","commands":{"allow":[],"deny":["write_text_file"]}},"read-all":{"identifier":"read-all","description":"This enables all read related commands without any pre-configured accessible paths.","commands":{"allow":["read_dir","read_file","read","open","read_text_file","read_text_file_lines","read_text_file_lines_next","seek","stat","lstat","fstat","exists","watch","unwatch"],"deny":[]}},"read-app-specific-dirs-recursive":{"identifier":"read-app-specific-dirs-recursive","description":"This permission allows recursive read functionality on the application\nspecific base directories. \n","commands":{"allow":["read_dir","read_file","read_text_file","read_text_file_lines","read_text_file_lines_next","exists","scope-app-recursive"],"deny":[]}},"read-dirs":{"identifier":"read-dirs","description":"This enables directory read and file metadata related commands without any pre-configured accessible paths.","commands":{"allow":["read_dir","stat","lstat","fstat","exists"],"deny":[]}},"read-files":{"identifier":"read-files","description":"This enables file read related commands without any pre-configured accessible paths.","commands":{"allow":["read_file","read","open","read_text_file","read_text_file_lines","read_text_file_lines_next","seek","stat","lstat","fstat","exists"],"deny":[]}},"read-meta":{"identifier":"read-meta","description":"This enables all index or metadata related commands without any pre-configured accessible paths.","commands":{"allow":["read_dir","stat","lstat","fstat","exists","size"],"deny":[]}},"scope":{"identifier":"scope","description":"An empty permission you can use to modify the global scope.","commands":{"allow":[],"deny":[]}},"scope-app":{"identifier":"scope-app","description":"This scope permits access to all files and list content of top level directories in the application folders.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPCONFIG/*"},{"path":"$APPDATA"},{"path":"$APPDATA/*"},{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/*"},{"path":"$APPCACHE"},{"path":"$APPCACHE/*"},{"path":"$APPLOG"},{"path":"$APPLOG/*"}]}},"scope-app-index":{"identifier":"scope-app-index","description":"This scope permits to list all files and folders in the application directories.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPDATA"},{"path":"$APPLOCALDATA"},{"path":"$APPCACHE"},{"path":"$APPLOG"}]}},"scope-app-recursive":{"identifier":"scope-app-recursive","description":"This scope permits recursive access to the complete application folders, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPCONFIG/**"},{"path":"$APPDATA"},{"path":"$APPDATA/**"},{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/**"},{"path":"$APPCACHE"},{"path":"$APPCACHE/**"},{"path":"$APPLOG"},{"path":"$APPLOG/**"}]}},"scope-appcache":{"identifier":"scope-appcache","description":"This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCACHE"},{"path":"$APPCACHE/*"}]}},"scope-appcache-index":{"identifier":"scope-appcache-index","description":"This scope permits to list all files and folders in the `$APPCACHE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCACHE"}]}},"scope-appcache-recursive":{"identifier":"scope-appcache-recursive","description":"This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCACHE"},{"path":"$APPCACHE/**"}]}},"scope-appconfig":{"identifier":"scope-appconfig","description":"This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPCONFIG/*"}]}},"scope-appconfig-index":{"identifier":"scope-appconfig-index","description":"This scope permits to list all files and folders in the `$APPCONFIG`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"}]}},"scope-appconfig-recursive":{"identifier":"scope-appconfig-recursive","description":"This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPCONFIG/**"}]}},"scope-appdata":{"identifier":"scope-appdata","description":"This scope permits access to all files and list content of top level directories in the `$APPDATA` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPDATA"},{"path":"$APPDATA/*"}]}},"scope-appdata-index":{"identifier":"scope-appdata-index","description":"This scope permits to list all files and folders in the `$APPDATA`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPDATA"}]}},"scope-appdata-recursive":{"identifier":"scope-appdata-recursive","description":"This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPDATA"},{"path":"$APPDATA/**"}]}},"scope-applocaldata":{"identifier":"scope-applocaldata","description":"This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/*"}]}},"scope-applocaldata-index":{"identifier":"scope-applocaldata-index","description":"This scope permits to list all files and folders in the `$APPLOCALDATA`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOCALDATA"}]}},"scope-applocaldata-recursive":{"identifier":"scope-applocaldata-recursive","description":"This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/**"}]}},"scope-applog":{"identifier":"scope-applog","description":"This scope permits access to all files and list content of top level directories in the `$APPLOG` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOG"},{"path":"$APPLOG/*"}]}},"scope-applog-index":{"identifier":"scope-applog-index","description":"This scope permits to list all files and folders in the `$APPLOG`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOG"}]}},"scope-applog-recursive":{"identifier":"scope-applog-recursive","description":"This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOG"},{"path":"$APPLOG/**"}]}},"scope-audio":{"identifier":"scope-audio","description":"This scope permits access to all files and list content of top level directories in the `$AUDIO` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$AUDIO"},{"path":"$AUDIO/*"}]}},"scope-audio-index":{"identifier":"scope-audio-index","description":"This scope permits to list all files and folders in the `$AUDIO`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$AUDIO"}]}},"scope-audio-recursive":{"identifier":"scope-audio-recursive","description":"This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$AUDIO"},{"path":"$AUDIO/**"}]}},"scope-cache":{"identifier":"scope-cache","description":"This scope permits access to all files and list content of top level directories in the `$CACHE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CACHE"},{"path":"$CACHE/*"}]}},"scope-cache-index":{"identifier":"scope-cache-index","description":"This scope permits to list all files and folders in the `$CACHE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CACHE"}]}},"scope-cache-recursive":{"identifier":"scope-cache-recursive","description":"This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CACHE"},{"path":"$CACHE/**"}]}},"scope-config":{"identifier":"scope-config","description":"This scope permits access to all files and list content of top level directories in the `$CONFIG` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CONFIG"},{"path":"$CONFIG/*"}]}},"scope-config-index":{"identifier":"scope-config-index","description":"This scope permits to list all files and folders in the `$CONFIG`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CONFIG"}]}},"scope-config-recursive":{"identifier":"scope-config-recursive","description":"This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CONFIG"},{"path":"$CONFIG/**"}]}},"scope-data":{"identifier":"scope-data","description":"This scope permits access to all files and list content of top level directories in the `$DATA` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DATA"},{"path":"$DATA/*"}]}},"scope-data-index":{"identifier":"scope-data-index","description":"This scope permits to list all files and folders in the `$DATA`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DATA"}]}},"scope-data-recursive":{"identifier":"scope-data-recursive","description":"This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DATA"},{"path":"$DATA/**"}]}},"scope-desktop":{"identifier":"scope-desktop","description":"This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DESKTOP"},{"path":"$DESKTOP/*"}]}},"scope-desktop-index":{"identifier":"scope-desktop-index","description":"This scope permits to list all files and folders in the `$DESKTOP`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DESKTOP"}]}},"scope-desktop-recursive":{"identifier":"scope-desktop-recursive","description":"This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DESKTOP"},{"path":"$DESKTOP/**"}]}},"scope-document":{"identifier":"scope-document","description":"This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOCUMENT"},{"path":"$DOCUMENT/*"}]}},"scope-document-index":{"identifier":"scope-document-index","description":"This scope permits to list all files and folders in the `$DOCUMENT`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOCUMENT"}]}},"scope-document-recursive":{"identifier":"scope-document-recursive","description":"This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOCUMENT"},{"path":"$DOCUMENT/**"}]}},"scope-download":{"identifier":"scope-download","description":"This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOWNLOAD"},{"path":"$DOWNLOAD/*"}]}},"scope-download-index":{"identifier":"scope-download-index","description":"This scope permits to list all files and folders in the `$DOWNLOAD`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOWNLOAD"}]}},"scope-download-recursive":{"identifier":"scope-download-recursive","description":"This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOWNLOAD"},{"path":"$DOWNLOAD/**"}]}},"scope-exe":{"identifier":"scope-exe","description":"This scope permits access to all files and list content of top level directories in the `$EXE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$EXE"},{"path":"$EXE/*"}]}},"scope-exe-index":{"identifier":"scope-exe-index","description":"This scope permits to list all files and folders in the `$EXE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$EXE"}]}},"scope-exe-recursive":{"identifier":"scope-exe-recursive","description":"This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$EXE"},{"path":"$EXE/**"}]}},"scope-font":{"identifier":"scope-font","description":"This scope permits access to all files and list content of top level directories in the `$FONT` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$FONT"},{"path":"$FONT/*"}]}},"scope-font-index":{"identifier":"scope-font-index","description":"This scope permits to list all files and folders in the `$FONT`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$FONT"}]}},"scope-font-recursive":{"identifier":"scope-font-recursive","description":"This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$FONT"},{"path":"$FONT/**"}]}},"scope-home":{"identifier":"scope-home","description":"This scope permits access to all files and list content of top level directories in the `$HOME` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$HOME"},{"path":"$HOME/*"}]}},"scope-home-index":{"identifier":"scope-home-index","description":"This scope permits to list all files and folders in the `$HOME`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$HOME"}]}},"scope-home-recursive":{"identifier":"scope-home-recursive","description":"This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$HOME"},{"path":"$HOME/**"}]}},"scope-localdata":{"identifier":"scope-localdata","description":"This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOCALDATA"},{"path":"$LOCALDATA/*"}]}},"scope-localdata-index":{"identifier":"scope-localdata-index","description":"This scope permits to list all files and folders in the `$LOCALDATA`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOCALDATA"}]}},"scope-localdata-recursive":{"identifier":"scope-localdata-recursive","description":"This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOCALDATA"},{"path":"$LOCALDATA/**"}]}},"scope-log":{"identifier":"scope-log","description":"This scope permits access to all files and list content of top level directories in the `$LOG` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOG"},{"path":"$LOG/*"}]}},"scope-log-index":{"identifier":"scope-log-index","description":"This scope permits to list all files and folders in the `$LOG`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOG"}]}},"scope-log-recursive":{"identifier":"scope-log-recursive","description":"This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOG"},{"path":"$LOG/**"}]}},"scope-picture":{"identifier":"scope-picture","description":"This scope permits access to all files and list content of top level directories in the `$PICTURE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PICTURE"},{"path":"$PICTURE/*"}]}},"scope-picture-index":{"identifier":"scope-picture-index","description":"This scope permits to list all files and folders in the `$PICTURE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PICTURE"}]}},"scope-picture-recursive":{"identifier":"scope-picture-recursive","description":"This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PICTURE"},{"path":"$PICTURE/**"}]}},"scope-public":{"identifier":"scope-public","description":"This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PUBLIC"},{"path":"$PUBLIC/*"}]}},"scope-public-index":{"identifier":"scope-public-index","description":"This scope permits to list all files and folders in the `$PUBLIC`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PUBLIC"}]}},"scope-public-recursive":{"identifier":"scope-public-recursive","description":"This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PUBLIC"},{"path":"$PUBLIC/**"}]}},"scope-resource":{"identifier":"scope-resource","description":"This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RESOURCE"},{"path":"$RESOURCE/*"}]}},"scope-resource-index":{"identifier":"scope-resource-index","description":"This scope permits to list all files and folders in the `$RESOURCE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RESOURCE"}]}},"scope-resource-recursive":{"identifier":"scope-resource-recursive","description":"This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RESOURCE"},{"path":"$RESOURCE/**"}]}},"scope-runtime":{"identifier":"scope-runtime","description":"This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RUNTIME"},{"path":"$RUNTIME/*"}]}},"scope-runtime-index":{"identifier":"scope-runtime-index","description":"This scope permits to list all files and folders in the `$RUNTIME`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RUNTIME"}]}},"scope-runtime-recursive":{"identifier":"scope-runtime-recursive","description":"This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RUNTIME"},{"path":"$RUNTIME/**"}]}},"scope-temp":{"identifier":"scope-temp","description":"This scope permits access to all files and list content of top level directories in the `$TEMP` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMP"},{"path":"$TEMP/*"}]}},"scope-temp-index":{"identifier":"scope-temp-index","description":"This scope permits to list all files and folders in the `$TEMP`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMP"}]}},"scope-temp-recursive":{"identifier":"scope-temp-recursive","description":"This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMP"},{"path":"$TEMP/**"}]}},"scope-template":{"identifier":"scope-template","description":"This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMPLATE"},{"path":"$TEMPLATE/*"}]}},"scope-template-index":{"identifier":"scope-template-index","description":"This scope permits to list all files and folders in the `$TEMPLATE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMPLATE"}]}},"scope-template-recursive":{"identifier":"scope-template-recursive","description":"This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMPLATE"},{"path":"$TEMPLATE/**"}]}},"scope-video":{"identifier":"scope-video","description":"This scope permits access to all files and list content of top level directories in the `$VIDEO` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$VIDEO"},{"path":"$VIDEO/*"}]}},"scope-video-index":{"identifier":"scope-video-index","description":"This scope permits to list all files and folders in the `$VIDEO`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$VIDEO"}]}},"scope-video-recursive":{"identifier":"scope-video-recursive","description":"This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$VIDEO"},{"path":"$VIDEO/**"}]}},"write-all":{"identifier":"write-all","description":"This enables all write related commands without any pre-configured accessible paths.","commands":{"allow":["mkdir","create","copy_file","remove","rename","truncate","ftruncate","write","write_file","write_text_file"],"deny":[]}},"write-files":{"identifier":"write-files","description":"This enables all file write related commands without any pre-configured accessible paths.","commands":{"allow":["create","copy_file","remove","rename","truncate","ftruncate","write","write_file","write_text_file"],"deny":[]}}},"permission_sets":{"allow-app-meta":{"identifier":"allow-app-meta","description":"This allows non-recursive read access to metadata of the application folders, including file listing and statistics.","permissions":["read-meta","scope-app-index"]},"allow-app-meta-recursive":{"identifier":"allow-app-meta-recursive","description":"This allows full recursive read access to metadata of the application folders, including file listing and statistics.","permissions":["read-meta","scope-app-recursive"]},"allow-app-read":{"identifier":"allow-app-read","description":"This allows non-recursive read access to the application folders.","permissions":["read-all","scope-app"]},"allow-app-read-recursive":{"identifier":"allow-app-read-recursive","description":"This allows full recursive read access to the complete application folders, files and subdirectories.","permissions":["read-all","scope-app-recursive"]},"allow-app-write":{"identifier":"allow-app-write","description":"This allows non-recursive write access to the application folders.","permissions":["write-all","scope-app"]},"allow-app-write-recursive":{"identifier":"allow-app-write-recursive","description":"This allows full recursive write access to the complete application folders, files and subdirectories.","permissions":["write-all","scope-app-recursive"]},"allow-appcache-meta":{"identifier":"allow-appcache-meta","description":"This allows non-recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.","permissions":["read-meta","scope-appcache-index"]},"allow-appcache-meta-recursive":{"identifier":"allow-appcache-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.","permissions":["read-meta","scope-appcache-recursive"]},"allow-appcache-read":{"identifier":"allow-appcache-read","description":"This allows non-recursive read access to the `$APPCACHE` folder.","permissions":["read-all","scope-appcache"]},"allow-appcache-read-recursive":{"identifier":"allow-appcache-read-recursive","description":"This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.","permissions":["read-all","scope-appcache-recursive"]},"allow-appcache-write":{"identifier":"allow-appcache-write","description":"This allows non-recursive write access to the `$APPCACHE` folder.","permissions":["write-all","scope-appcache"]},"allow-appcache-write-recursive":{"identifier":"allow-appcache-write-recursive","description":"This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.","permissions":["write-all","scope-appcache-recursive"]},"allow-appconfig-meta":{"identifier":"allow-appconfig-meta","description":"This allows non-recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.","permissions":["read-meta","scope-appconfig-index"]},"allow-appconfig-meta-recursive":{"identifier":"allow-appconfig-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.","permissions":["read-meta","scope-appconfig-recursive"]},"allow-appconfig-read":{"identifier":"allow-appconfig-read","description":"This allows non-recursive read access to the `$APPCONFIG` folder.","permissions":["read-all","scope-appconfig"]},"allow-appconfig-read-recursive":{"identifier":"allow-appconfig-read-recursive","description":"This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.","permissions":["read-all","scope-appconfig-recursive"]},"allow-appconfig-write":{"identifier":"allow-appconfig-write","description":"This allows non-recursive write access to the `$APPCONFIG` folder.","permissions":["write-all","scope-appconfig"]},"allow-appconfig-write-recursive":{"identifier":"allow-appconfig-write-recursive","description":"This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.","permissions":["write-all","scope-appconfig-recursive"]},"allow-appdata-meta":{"identifier":"allow-appdata-meta","description":"This allows non-recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-appdata-index"]},"allow-appdata-meta-recursive":{"identifier":"allow-appdata-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-appdata-recursive"]},"allow-appdata-read":{"identifier":"allow-appdata-read","description":"This allows non-recursive read access to the `$APPDATA` folder.","permissions":["read-all","scope-appdata"]},"allow-appdata-read-recursive":{"identifier":"allow-appdata-read-recursive","description":"This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.","permissions":["read-all","scope-appdata-recursive"]},"allow-appdata-write":{"identifier":"allow-appdata-write","description":"This allows non-recursive write access to the `$APPDATA` folder.","permissions":["write-all","scope-appdata"]},"allow-appdata-write-recursive":{"identifier":"allow-appdata-write-recursive","description":"This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.","permissions":["write-all","scope-appdata-recursive"]},"allow-applocaldata-meta":{"identifier":"allow-applocaldata-meta","description":"This allows non-recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-applocaldata-index"]},"allow-applocaldata-meta-recursive":{"identifier":"allow-applocaldata-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-applocaldata-recursive"]},"allow-applocaldata-read":{"identifier":"allow-applocaldata-read","description":"This allows non-recursive read access to the `$APPLOCALDATA` folder.","permissions":["read-all","scope-applocaldata"]},"allow-applocaldata-read-recursive":{"identifier":"allow-applocaldata-read-recursive","description":"This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.","permissions":["read-all","scope-applocaldata-recursive"]},"allow-applocaldata-write":{"identifier":"allow-applocaldata-write","description":"This allows non-recursive write access to the `$APPLOCALDATA` folder.","permissions":["write-all","scope-applocaldata"]},"allow-applocaldata-write-recursive":{"identifier":"allow-applocaldata-write-recursive","description":"This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.","permissions":["write-all","scope-applocaldata-recursive"]},"allow-applog-meta":{"identifier":"allow-applog-meta","description":"This allows non-recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.","permissions":["read-meta","scope-applog-index"]},"allow-applog-meta-recursive":{"identifier":"allow-applog-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.","permissions":["read-meta","scope-applog-recursive"]},"allow-applog-read":{"identifier":"allow-applog-read","description":"This allows non-recursive read access to the `$APPLOG` folder.","permissions":["read-all","scope-applog"]},"allow-applog-read-recursive":{"identifier":"allow-applog-read-recursive","description":"This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.","permissions":["read-all","scope-applog-recursive"]},"allow-applog-write":{"identifier":"allow-applog-write","description":"This allows non-recursive write access to the `$APPLOG` folder.","permissions":["write-all","scope-applog"]},"allow-applog-write-recursive":{"identifier":"allow-applog-write-recursive","description":"This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.","permissions":["write-all","scope-applog-recursive"]},"allow-audio-meta":{"identifier":"allow-audio-meta","description":"This allows non-recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.","permissions":["read-meta","scope-audio-index"]},"allow-audio-meta-recursive":{"identifier":"allow-audio-meta-recursive","description":"This allows full recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.","permissions":["read-meta","scope-audio-recursive"]},"allow-audio-read":{"identifier":"allow-audio-read","description":"This allows non-recursive read access to the `$AUDIO` folder.","permissions":["read-all","scope-audio"]},"allow-audio-read-recursive":{"identifier":"allow-audio-read-recursive","description":"This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.","permissions":["read-all","scope-audio-recursive"]},"allow-audio-write":{"identifier":"allow-audio-write","description":"This allows non-recursive write access to the `$AUDIO` folder.","permissions":["write-all","scope-audio"]},"allow-audio-write-recursive":{"identifier":"allow-audio-write-recursive","description":"This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.","permissions":["write-all","scope-audio-recursive"]},"allow-cache-meta":{"identifier":"allow-cache-meta","description":"This allows non-recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.","permissions":["read-meta","scope-cache-index"]},"allow-cache-meta-recursive":{"identifier":"allow-cache-meta-recursive","description":"This allows full recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.","permissions":["read-meta","scope-cache-recursive"]},"allow-cache-read":{"identifier":"allow-cache-read","description":"This allows non-recursive read access to the `$CACHE` folder.","permissions":["read-all","scope-cache"]},"allow-cache-read-recursive":{"identifier":"allow-cache-read-recursive","description":"This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.","permissions":["read-all","scope-cache-recursive"]},"allow-cache-write":{"identifier":"allow-cache-write","description":"This allows non-recursive write access to the `$CACHE` folder.","permissions":["write-all","scope-cache"]},"allow-cache-write-recursive":{"identifier":"allow-cache-write-recursive","description":"This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.","permissions":["write-all","scope-cache-recursive"]},"allow-config-meta":{"identifier":"allow-config-meta","description":"This allows non-recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.","permissions":["read-meta","scope-config-index"]},"allow-config-meta-recursive":{"identifier":"allow-config-meta-recursive","description":"This allows full recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.","permissions":["read-meta","scope-config-recursive"]},"allow-config-read":{"identifier":"allow-config-read","description":"This allows non-recursive read access to the `$CONFIG` folder.","permissions":["read-all","scope-config"]},"allow-config-read-recursive":{"identifier":"allow-config-read-recursive","description":"This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.","permissions":["read-all","scope-config-recursive"]},"allow-config-write":{"identifier":"allow-config-write","description":"This allows non-recursive write access to the `$CONFIG` folder.","permissions":["write-all","scope-config"]},"allow-config-write-recursive":{"identifier":"allow-config-write-recursive","description":"This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.","permissions":["write-all","scope-config-recursive"]},"allow-data-meta":{"identifier":"allow-data-meta","description":"This allows non-recursive read access to metadata of the `$DATA` folder, including file listing and statistics.","permissions":["read-meta","scope-data-index"]},"allow-data-meta-recursive":{"identifier":"allow-data-meta-recursive","description":"This allows full recursive read access to metadata of the `$DATA` folder, including file listing and statistics.","permissions":["read-meta","scope-data-recursive"]},"allow-data-read":{"identifier":"allow-data-read","description":"This allows non-recursive read access to the `$DATA` folder.","permissions":["read-all","scope-data"]},"allow-data-read-recursive":{"identifier":"allow-data-read-recursive","description":"This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.","permissions":["read-all","scope-data-recursive"]},"allow-data-write":{"identifier":"allow-data-write","description":"This allows non-recursive write access to the `$DATA` folder.","permissions":["write-all","scope-data"]},"allow-data-write-recursive":{"identifier":"allow-data-write-recursive","description":"This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.","permissions":["write-all","scope-data-recursive"]},"allow-desktop-meta":{"identifier":"allow-desktop-meta","description":"This allows non-recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.","permissions":["read-meta","scope-desktop-index"]},"allow-desktop-meta-recursive":{"identifier":"allow-desktop-meta-recursive","description":"This allows full recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.","permissions":["read-meta","scope-desktop-recursive"]},"allow-desktop-read":{"identifier":"allow-desktop-read","description":"This allows non-recursive read access to the `$DESKTOP` folder.","permissions":["read-all","scope-desktop"]},"allow-desktop-read-recursive":{"identifier":"allow-desktop-read-recursive","description":"This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.","permissions":["read-all","scope-desktop-recursive"]},"allow-desktop-write":{"identifier":"allow-desktop-write","description":"This allows non-recursive write access to the `$DESKTOP` folder.","permissions":["write-all","scope-desktop"]},"allow-desktop-write-recursive":{"identifier":"allow-desktop-write-recursive","description":"This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.","permissions":["write-all","scope-desktop-recursive"]},"allow-document-meta":{"identifier":"allow-document-meta","description":"This allows non-recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.","permissions":["read-meta","scope-document-index"]},"allow-document-meta-recursive":{"identifier":"allow-document-meta-recursive","description":"This allows full recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.","permissions":["read-meta","scope-document-recursive"]},"allow-document-read":{"identifier":"allow-document-read","description":"This allows non-recursive read access to the `$DOCUMENT` folder.","permissions":["read-all","scope-document"]},"allow-document-read-recursive":{"identifier":"allow-document-read-recursive","description":"This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.","permissions":["read-all","scope-document-recursive"]},"allow-document-write":{"identifier":"allow-document-write","description":"This allows non-recursive write access to the `$DOCUMENT` folder.","permissions":["write-all","scope-document"]},"allow-document-write-recursive":{"identifier":"allow-document-write-recursive","description":"This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.","permissions":["write-all","scope-document-recursive"]},"allow-download-meta":{"identifier":"allow-download-meta","description":"This allows non-recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.","permissions":["read-meta","scope-download-index"]},"allow-download-meta-recursive":{"identifier":"allow-download-meta-recursive","description":"This allows full recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.","permissions":["read-meta","scope-download-recursive"]},"allow-download-read":{"identifier":"allow-download-read","description":"This allows non-recursive read access to the `$DOWNLOAD` folder.","permissions":["read-all","scope-download"]},"allow-download-read-recursive":{"identifier":"allow-download-read-recursive","description":"This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.","permissions":["read-all","scope-download-recursive"]},"allow-download-write":{"identifier":"allow-download-write","description":"This allows non-recursive write access to the `$DOWNLOAD` folder.","permissions":["write-all","scope-download"]},"allow-download-write-recursive":{"identifier":"allow-download-write-recursive","description":"This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.","permissions":["write-all","scope-download-recursive"]},"allow-exe-meta":{"identifier":"allow-exe-meta","description":"This allows non-recursive read access to metadata of the `$EXE` folder, including file listing and statistics.","permissions":["read-meta","scope-exe-index"]},"allow-exe-meta-recursive":{"identifier":"allow-exe-meta-recursive","description":"This allows full recursive read access to metadata of the `$EXE` folder, including file listing and statistics.","permissions":["read-meta","scope-exe-recursive"]},"allow-exe-read":{"identifier":"allow-exe-read","description":"This allows non-recursive read access to the `$EXE` folder.","permissions":["read-all","scope-exe"]},"allow-exe-read-recursive":{"identifier":"allow-exe-read-recursive","description":"This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.","permissions":["read-all","scope-exe-recursive"]},"allow-exe-write":{"identifier":"allow-exe-write","description":"This allows non-recursive write access to the `$EXE` folder.","permissions":["write-all","scope-exe"]},"allow-exe-write-recursive":{"identifier":"allow-exe-write-recursive","description":"This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.","permissions":["write-all","scope-exe-recursive"]},"allow-font-meta":{"identifier":"allow-font-meta","description":"This allows non-recursive read access to metadata of the `$FONT` folder, including file listing and statistics.","permissions":["read-meta","scope-font-index"]},"allow-font-meta-recursive":{"identifier":"allow-font-meta-recursive","description":"This allows full recursive read access to metadata of the `$FONT` folder, including file listing and statistics.","permissions":["read-meta","scope-font-recursive"]},"allow-font-read":{"identifier":"allow-font-read","description":"This allows non-recursive read access to the `$FONT` folder.","permissions":["read-all","scope-font"]},"allow-font-read-recursive":{"identifier":"allow-font-read-recursive","description":"This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.","permissions":["read-all","scope-font-recursive"]},"allow-font-write":{"identifier":"allow-font-write","description":"This allows non-recursive write access to the `$FONT` folder.","permissions":["write-all","scope-font"]},"allow-font-write-recursive":{"identifier":"allow-font-write-recursive","description":"This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.","permissions":["write-all","scope-font-recursive"]},"allow-home-meta":{"identifier":"allow-home-meta","description":"This allows non-recursive read access to metadata of the `$HOME` folder, including file listing and statistics.","permissions":["read-meta","scope-home-index"]},"allow-home-meta-recursive":{"identifier":"allow-home-meta-recursive","description":"This allows full recursive read access to metadata of the `$HOME` folder, including file listing and statistics.","permissions":["read-meta","scope-home-recursive"]},"allow-home-read":{"identifier":"allow-home-read","description":"This allows non-recursive read access to the `$HOME` folder.","permissions":["read-all","scope-home"]},"allow-home-read-recursive":{"identifier":"allow-home-read-recursive","description":"This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.","permissions":["read-all","scope-home-recursive"]},"allow-home-write":{"identifier":"allow-home-write","description":"This allows non-recursive write access to the `$HOME` folder.","permissions":["write-all","scope-home"]},"allow-home-write-recursive":{"identifier":"allow-home-write-recursive","description":"This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.","permissions":["write-all","scope-home-recursive"]},"allow-localdata-meta":{"identifier":"allow-localdata-meta","description":"This allows non-recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-localdata-index"]},"allow-localdata-meta-recursive":{"identifier":"allow-localdata-meta-recursive","description":"This allows full recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-localdata-recursive"]},"allow-localdata-read":{"identifier":"allow-localdata-read","description":"This allows non-recursive read access to the `$LOCALDATA` folder.","permissions":["read-all","scope-localdata"]},"allow-localdata-read-recursive":{"identifier":"allow-localdata-read-recursive","description":"This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.","permissions":["read-all","scope-localdata-recursive"]},"allow-localdata-write":{"identifier":"allow-localdata-write","description":"This allows non-recursive write access to the `$LOCALDATA` folder.","permissions":["write-all","scope-localdata"]},"allow-localdata-write-recursive":{"identifier":"allow-localdata-write-recursive","description":"This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.","permissions":["write-all","scope-localdata-recursive"]},"allow-log-meta":{"identifier":"allow-log-meta","description":"This allows non-recursive read access to metadata of the `$LOG` folder, including file listing and statistics.","permissions":["read-meta","scope-log-index"]},"allow-log-meta-recursive":{"identifier":"allow-log-meta-recursive","description":"This allows full recursive read access to metadata of the `$LOG` folder, including file listing and statistics.","permissions":["read-meta","scope-log-recursive"]},"allow-log-read":{"identifier":"allow-log-read","description":"This allows non-recursive read access to the `$LOG` folder.","permissions":["read-all","scope-log"]},"allow-log-read-recursive":{"identifier":"allow-log-read-recursive","description":"This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.","permissions":["read-all","scope-log-recursive"]},"allow-log-write":{"identifier":"allow-log-write","description":"This allows non-recursive write access to the `$LOG` folder.","permissions":["write-all","scope-log"]},"allow-log-write-recursive":{"identifier":"allow-log-write-recursive","description":"This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.","permissions":["write-all","scope-log-recursive"]},"allow-picture-meta":{"identifier":"allow-picture-meta","description":"This allows non-recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.","permissions":["read-meta","scope-picture-index"]},"allow-picture-meta-recursive":{"identifier":"allow-picture-meta-recursive","description":"This allows full recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.","permissions":["read-meta","scope-picture-recursive"]},"allow-picture-read":{"identifier":"allow-picture-read","description":"This allows non-recursive read access to the `$PICTURE` folder.","permissions":["read-all","scope-picture"]},"allow-picture-read-recursive":{"identifier":"allow-picture-read-recursive","description":"This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.","permissions":["read-all","scope-picture-recursive"]},"allow-picture-write":{"identifier":"allow-picture-write","description":"This allows non-recursive write access to the `$PICTURE` folder.","permissions":["write-all","scope-picture"]},"allow-picture-write-recursive":{"identifier":"allow-picture-write-recursive","description":"This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.","permissions":["write-all","scope-picture-recursive"]},"allow-public-meta":{"identifier":"allow-public-meta","description":"This allows non-recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.","permissions":["read-meta","scope-public-index"]},"allow-public-meta-recursive":{"identifier":"allow-public-meta-recursive","description":"This allows full recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.","permissions":["read-meta","scope-public-recursive"]},"allow-public-read":{"identifier":"allow-public-read","description":"This allows non-recursive read access to the `$PUBLIC` folder.","permissions":["read-all","scope-public"]},"allow-public-read-recursive":{"identifier":"allow-public-read-recursive","description":"This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.","permissions":["read-all","scope-public-recursive"]},"allow-public-write":{"identifier":"allow-public-write","description":"This allows non-recursive write access to the `$PUBLIC` folder.","permissions":["write-all","scope-public"]},"allow-public-write-recursive":{"identifier":"allow-public-write-recursive","description":"This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.","permissions":["write-all","scope-public-recursive"]},"allow-resource-meta":{"identifier":"allow-resource-meta","description":"This allows non-recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.","permissions":["read-meta","scope-resource-index"]},"allow-resource-meta-recursive":{"identifier":"allow-resource-meta-recursive","description":"This allows full recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.","permissions":["read-meta","scope-resource-recursive"]},"allow-resource-read":{"identifier":"allow-resource-read","description":"This allows non-recursive read access to the `$RESOURCE` folder.","permissions":["read-all","scope-resource"]},"allow-resource-read-recursive":{"identifier":"allow-resource-read-recursive","description":"This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.","permissions":["read-all","scope-resource-recursive"]},"allow-resource-write":{"identifier":"allow-resource-write","description":"This allows non-recursive write access to the `$RESOURCE` folder.","permissions":["write-all","scope-resource"]},"allow-resource-write-recursive":{"identifier":"allow-resource-write-recursive","description":"This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.","permissions":["write-all","scope-resource-recursive"]},"allow-runtime-meta":{"identifier":"allow-runtime-meta","description":"This allows non-recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.","permissions":["read-meta","scope-runtime-index"]},"allow-runtime-meta-recursive":{"identifier":"allow-runtime-meta-recursive","description":"This allows full recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.","permissions":["read-meta","scope-runtime-recursive"]},"allow-runtime-read":{"identifier":"allow-runtime-read","description":"This allows non-recursive read access to the `$RUNTIME` folder.","permissions":["read-all","scope-runtime"]},"allow-runtime-read-recursive":{"identifier":"allow-runtime-read-recursive","description":"This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.","permissions":["read-all","scope-runtime-recursive"]},"allow-runtime-write":{"identifier":"allow-runtime-write","description":"This allows non-recursive write access to the `$RUNTIME` folder.","permissions":["write-all","scope-runtime"]},"allow-runtime-write-recursive":{"identifier":"allow-runtime-write-recursive","description":"This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.","permissions":["write-all","scope-runtime-recursive"]},"allow-temp-meta":{"identifier":"allow-temp-meta","description":"This allows non-recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.","permissions":["read-meta","scope-temp-index"]},"allow-temp-meta-recursive":{"identifier":"allow-temp-meta-recursive","description":"This allows full recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.","permissions":["read-meta","scope-temp-recursive"]},"allow-temp-read":{"identifier":"allow-temp-read","description":"This allows non-recursive read access to the `$TEMP` folder.","permissions":["read-all","scope-temp"]},"allow-temp-read-recursive":{"identifier":"allow-temp-read-recursive","description":"This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.","permissions":["read-all","scope-temp-recursive"]},"allow-temp-write":{"identifier":"allow-temp-write","description":"This allows non-recursive write access to the `$TEMP` folder.","permissions":["write-all","scope-temp"]},"allow-temp-write-recursive":{"identifier":"allow-temp-write-recursive","description":"This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.","permissions":["write-all","scope-temp-recursive"]},"allow-template-meta":{"identifier":"allow-template-meta","description":"This allows non-recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.","permissions":["read-meta","scope-template-index"]},"allow-template-meta-recursive":{"identifier":"allow-template-meta-recursive","description":"This allows full recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.","permissions":["read-meta","scope-template-recursive"]},"allow-template-read":{"identifier":"allow-template-read","description":"This allows non-recursive read access to the `$TEMPLATE` folder.","permissions":["read-all","scope-template"]},"allow-template-read-recursive":{"identifier":"allow-template-read-recursive","description":"This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.","permissions":["read-all","scope-template-recursive"]},"allow-template-write":{"identifier":"allow-template-write","description":"This allows non-recursive write access to the `$TEMPLATE` folder.","permissions":["write-all","scope-template"]},"allow-template-write-recursive":{"identifier":"allow-template-write-recursive","description":"This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.","permissions":["write-all","scope-template-recursive"]},"allow-video-meta":{"identifier":"allow-video-meta","description":"This allows non-recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.","permissions":["read-meta","scope-video-index"]},"allow-video-meta-recursive":{"identifier":"allow-video-meta-recursive","description":"This allows full recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.","permissions":["read-meta","scope-video-recursive"]},"allow-video-read":{"identifier":"allow-video-read","description":"This allows non-recursive read access to the `$VIDEO` folder.","permissions":["read-all","scope-video"]},"allow-video-read-recursive":{"identifier":"allow-video-read-recursive","description":"This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.","permissions":["read-all","scope-video-recursive"]},"allow-video-write":{"identifier":"allow-video-write","description":"This allows non-recursive write access to the `$VIDEO` folder.","permissions":["write-all","scope-video"]},"allow-video-write-recursive":{"identifier":"allow-video-write-recursive","description":"This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.","permissions":["write-all","scope-video-recursive"]},"deny-default":{"identifier":"deny-default","description":"This denies access to dangerous Tauri relevant files and folders by default.","permissions":["deny-webview-data-linux","deny-webview-data-windows"]}},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"description":"A path that can be accessed by the webview when using the fs APIs. FS scope path pattern.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"},{"properties":{"path":{"description":"A path that can be accessed by the webview when using the fs APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"}},"required":["path"],"type":"object"}],"description":"FS scope entry.","title":"FsScopeEntry"}},"log":{"default_permission":{"identifier":"default","description":"Allows the log command","permissions":["allow-log"]},"permissions":{"allow-log":{"identifier":"allow-log","description":"Enables the log command without any pre-configured scope.","commands":{"allow":["log"],"deny":[]}},"deny-log":{"identifier":"deny-log","description":"Denies the log command without any pre-configured scope.","commands":{"allow":[],"deny":["log"]}}},"permission_sets":{},"global_scope_schema":null},"opener":{"default_permission":{"identifier":"default","description":"This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer","permissions":["allow-open-url","allow-reveal-item-in-dir","allow-default-urls"]},"permissions":{"allow-default-urls":{"identifier":"allow-default-urls","description":"This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"url":"mailto:*"},{"url":"tel:*"},{"url":"http://*"},{"url":"https://*"}]}},"allow-open-path":{"identifier":"allow-open-path","description":"Enables the open_path command without any pre-configured scope.","commands":{"allow":["open_path"],"deny":[]}},"allow-open-url":{"identifier":"allow-open-url","description":"Enables the open_url command without any pre-configured scope.","commands":{"allow":["open_url"],"deny":[]}},"allow-reveal-item-in-dir":{"identifier":"allow-reveal-item-in-dir","description":"Enables the reveal_item_in_dir command without any pre-configured scope.","commands":{"allow":["reveal_item_in_dir"],"deny":[]}},"deny-open-path":{"identifier":"deny-open-path","description":"Denies the open_path command without any pre-configured scope.","commands":{"allow":[],"deny":["open_path"]}},"deny-open-url":{"identifier":"deny-open-url","description":"Denies the open_url command without any pre-configured scope.","commands":{"allow":[],"deny":["open_url"]}},"deny-reveal-item-in-dir":{"identifier":"deny-reveal-item-in-dir","description":"Denies the reveal_item_in_dir command without any pre-configured scope.","commands":{"allow":[],"deny":["reveal_item_in_dir"]}}},"permission_sets":{},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"properties":{"app":{"allOf":[{"$ref":"#/definitions/Application"}],"description":"An application to open this url with, for example: firefox."},"url":{"description":"A URL that can be opened by the webview when using the Opener APIs.\n\nWildcards can be used following the UNIX glob pattern.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"","type":"string"}},"required":["url"],"type":"object"},{"properties":{"app":{"allOf":[{"$ref":"#/definitions/Application"}],"description":"An application to open this path with, for example: xdg-open."},"path":{"description":"A path that can be opened by the webview when using the Opener APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"}},"required":["path"],"type":"object"}],"definitions":{"Application":{"anyOf":[{"description":"Open in default application.","type":"null"},{"description":"If true, allow open with any application.","type":"boolean"},{"description":"Allow specific application to open with.","type":"string"}],"description":"Opener scope application."}},"description":"Opener scope entry.","title":"OpenerScopeEntry"}},"os":{"default_permission":{"identifier":"default","description":"This permission set configures which\noperating system information are available\nto gather from the frontend.\n\n#### Granted Permissions\n\nAll information except the host name are available.\n\n","permissions":["allow-arch","allow-exe-extension","allow-family","allow-locale","allow-os-type","allow-platform","allow-version"]},"permissions":{"allow-arch":{"identifier":"allow-arch","description":"Enables the arch command without any pre-configured scope.","commands":{"allow":["arch"],"deny":[]}},"allow-exe-extension":{"identifier":"allow-exe-extension","description":"Enables the exe_extension command without any pre-configured scope.","commands":{"allow":["exe_extension"],"deny":[]}},"allow-family":{"identifier":"allow-family","description":"Enables the family command without any pre-configured scope.","commands":{"allow":["family"],"deny":[]}},"allow-hostname":{"identifier":"allow-hostname","description":"Enables the hostname command without any pre-configured scope.","commands":{"allow":["hostname"],"deny":[]}},"allow-locale":{"identifier":"allow-locale","description":"Enables the locale command without any pre-configured scope.","commands":{"allow":["locale"],"deny":[]}},"allow-os-type":{"identifier":"allow-os-type","description":"Enables the os_type command without any pre-configured scope.","commands":{"allow":["os_type"],"deny":[]}},"allow-platform":{"identifier":"allow-platform","description":"Enables the platform command without any pre-configured scope.","commands":{"allow":["platform"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-arch":{"identifier":"deny-arch","description":"Denies the arch command without any pre-configured scope.","commands":{"allow":[],"deny":["arch"]}},"deny-exe-extension":{"identifier":"deny-exe-extension","description":"Denies the exe_extension command without any pre-configured scope.","commands":{"allow":[],"deny":["exe_extension"]}},"deny-family":{"identifier":"deny-family","description":"Denies the family command without any pre-configured scope.","commands":{"allow":[],"deny":["family"]}},"deny-hostname":{"identifier":"deny-hostname","description":"Denies the hostname command without any pre-configured scope.","commands":{"allow":[],"deny":["hostname"]}},"deny-locale":{"identifier":"deny-locale","description":"Denies the locale command without any pre-configured scope.","commands":{"allow":[],"deny":["locale"]}},"deny-os-type":{"identifier":"deny-os-type","description":"Denies the os_type command without any pre-configured scope.","commands":{"allow":[],"deny":["os_type"]}},"deny-platform":{"identifier":"deny-platform","description":"Denies the platform command without any pre-configured scope.","commands":{"allow":[],"deny":["platform"]}},"deny-version":{"identifier":"deny-version","description":"Denies the version command without any pre-configured scope.","commands":{"allow":[],"deny":["version"]}}},"permission_sets":{},"global_scope_schema":null},"shell":{"default_permission":{"identifier":"default","description":"This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality without any specific\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n","permissions":["allow-open"]},"permissions":{"allow-execute":{"identifier":"allow-execute","description":"Enables the execute command without any pre-configured scope.","commands":{"allow":["execute"],"deny":[]}},"allow-kill":{"identifier":"allow-kill","description":"Enables the kill command without any pre-configured scope.","commands":{"allow":["kill"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-spawn":{"identifier":"allow-spawn","description":"Enables the spawn command without any pre-configured scope.","commands":{"allow":["spawn"],"deny":[]}},"allow-stdin-write":{"identifier":"allow-stdin-write","description":"Enables the stdin_write command without any pre-configured scope.","commands":{"allow":["stdin_write"],"deny":[]}},"deny-execute":{"identifier":"deny-execute","description":"Denies the execute command without any pre-configured scope.","commands":{"allow":[],"deny":["execute"]}},"deny-kill":{"identifier":"deny-kill","description":"Denies the kill command without any pre-configured scope.","commands":{"allow":[],"deny":["kill"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-spawn":{"identifier":"deny-spawn","description":"Denies the spawn command without any pre-configured scope.","commands":{"allow":[],"deny":["spawn"]}},"deny-stdin-write":{"identifier":"deny-stdin-write","description":"Denies the stdin_write command without any pre-configured scope.","commands":{"allow":[],"deny":["stdin_write"]}}},"permission_sets":{},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"additionalProperties":false,"properties":{"args":{"allOf":[{"$ref":"#/definitions/ShellScopeEntryAllowedArgs"}],"description":"The allowed arguments for the command execution."},"cmd":{"description":"The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"},"name":{"description":"The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.","type":"string"}},"required":["cmd","name"],"type":"object"},{"additionalProperties":false,"properties":{"args":{"allOf":[{"$ref":"#/definitions/ShellScopeEntryAllowedArgs"}],"description":"The allowed arguments for the command execution."},"name":{"description":"The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.","type":"string"},"sidecar":{"description":"If this command is a sidecar command.","type":"boolean"}},"required":["name","sidecar"],"type":"object"}],"definitions":{"ShellScopeEntryAllowedArg":{"anyOf":[{"description":"A non-configurable argument that is passed to the command in the order it was specified.","type":"string"},{"additionalProperties":false,"description":"A variable that is set while calling the command from the webview API.","properties":{"raw":{"default":false,"description":"Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime.\n\nThis means the regex will not match on the entire string by default, which might be exploited if your regex allow unexpected input to be considered valid. When using this option, make sure your regex is correct.","type":"boolean"},"validator":{"description":"[regex] validator to require passed values to conform to an expected input.\n\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\n\nThe regex string is by default surrounded by `^...$` to match the full string. For example the `https?://\\w+` regex would be registered as `^https?://\\w+$`.\n\n[regex]: ","type":"string"}},"required":["validator"],"type":"object"}],"description":"A command argument allowed to be executed by the webview API."},"ShellScopeEntryAllowedArgs":{"anyOf":[{"description":"Use a simple boolean to allow all or disable all arguments to this command configuration.","type":"boolean"},{"description":"A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.","items":{"$ref":"#/definitions/ShellScopeEntryAllowedArg"},"type":"array"}],"description":"A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration."}},"description":"Shell scope entry.","title":"ShellScopeEntry"}},"updater":{"default_permission":{"identifier":"default","description":"This permission set configures which kind of\nupdater functions are exposed to the frontend.\n\n#### Granted Permissions\n\nThe full workflow from checking for updates to installing them\nis enabled.\n\n","permissions":["allow-check","allow-download","allow-install","allow-download-and-install"]},"permissions":{"allow-check":{"identifier":"allow-check","description":"Enables the check command without any pre-configured scope.","commands":{"allow":["check"],"deny":[]}},"allow-download":{"identifier":"allow-download","description":"Enables the download command without any pre-configured scope.","commands":{"allow":["download"],"deny":[]}},"allow-download-and-install":{"identifier":"allow-download-and-install","description":"Enables the download_and_install command without any pre-configured scope.","commands":{"allow":["download_and_install"],"deny":[]}},"allow-install":{"identifier":"allow-install","description":"Enables the install command without any pre-configured scope.","commands":{"allow":["install"],"deny":[]}},"deny-check":{"identifier":"deny-check","description":"Denies the check command without any pre-configured scope.","commands":{"allow":[],"deny":["check"]}},"deny-download":{"identifier":"deny-download","description":"Denies the download command without any pre-configured scope.","commands":{"allow":[],"deny":["download"]}},"deny-download-and-install":{"identifier":"deny-download-and-install","description":"Denies the download_and_install command without any pre-configured scope.","commands":{"allow":[],"deny":["download_and_install"]}},"deny-install":{"identifier":"deny-install","description":"Denies the install command without any pre-configured scope.","commands":{"allow":[],"deny":["install"]}}},"permission_sets":{},"global_scope_schema":null},"window-state":{"default_permission":{"identifier":"default","description":"This permission set configures what kind of\noperations are available from the window state plugin.\n\n#### Granted Permissions\n\nAll operations are enabled by default.\n\n","permissions":["allow-filename","allow-restore-state","allow-save-window-state"]},"permissions":{"allow-filename":{"identifier":"allow-filename","description":"Enables the filename command without any pre-configured scope.","commands":{"allow":["filename"],"deny":[]}},"allow-restore-state":{"identifier":"allow-restore-state","description":"Enables the restore_state command without any pre-configured scope.","commands":{"allow":["restore_state"],"deny":[]}},"allow-save-window-state":{"identifier":"allow-save-window-state","description":"Enables the save_window_state command without any pre-configured scope.","commands":{"allow":["save_window_state"],"deny":[]}},"deny-filename":{"identifier":"deny-filename","description":"Denies the filename command without any pre-configured scope.","commands":{"allow":[],"deny":["filename"]}},"deny-restore-state":{"identifier":"deny-restore-state","description":"Denies the restore_state command without any pre-configured scope.","commands":{"allow":[],"deny":["restore_state"]}},"deny-save-window-state":{"identifier":"deny-save-window-state","description":"Denies the save_window_state command without any pre-configured scope.","commands":{"allow":[],"deny":["save_window_state"]}}},"permission_sets":{},"global_scope_schema":null},"yaak-license":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin","permissions":["allow-check","allow-activate"]},"permissions":{"allow-activate":{"identifier":"allow-activate","description":"Enables the activate command without any pre-configured scope.","commands":{"allow":["activate"],"deny":[]}},"allow-check":{"identifier":"allow-check","description":"Enables the check command without any pre-configured scope.","commands":{"allow":["check"],"deny":[]}},"deny-activate":{"identifier":"deny-activate","description":"Denies the activate command without any pre-configured scope.","commands":{"allow":[],"deny":["activate"]}},"deny-check":{"identifier":"deny-check","description":"Denies the check command without any pre-configured scope.","commands":{"allow":[],"deny":["check"]}}},"permission_sets":{},"global_scope_schema":null},"yaak-sync":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin","permissions":["allow-calculate","allow-calculate-fs","allow-apply","allow-watch"]},"permissions":{"allow-apply":{"identifier":"allow-apply","description":"Enables the apply command without any pre-configured scope.","commands":{"allow":["apply"],"deny":[]}},"allow-calculate":{"identifier":"allow-calculate","description":"Enables the calculate command without any pre-configured scope.","commands":{"allow":["calculate"],"deny":[]}},"allow-calculate-fs":{"identifier":"allow-calculate-fs","description":"Enables the calculate_fs command without any pre-configured scope.","commands":{"allow":["calculate_fs"],"deny":[]}},"allow-watch":{"identifier":"allow-watch","description":"Enables the watch command without any pre-configured scope.","commands":{"allow":["watch"],"deny":[]}},"deny-apply":{"identifier":"deny-apply","description":"Denies the apply command without any pre-configured scope.","commands":{"allow":[],"deny":["apply"]}},"deny-calculate":{"identifier":"deny-calculate","description":"Denies the calculate command without any pre-configured scope.","commands":{"allow":[],"deny":["calculate"]}},"deny-calculate-fs":{"identifier":"deny-calculate-fs","description":"Denies the calculate_fs command without any pre-configured scope.","commands":{"allow":[],"deny":["calculate_fs"]}},"deny-watch":{"identifier":"deny-watch","description":"Denies the watch command without any pre-configured scope.","commands":{"allow":[],"deny":["watch"]}}},"permission_sets":{},"global_scope_schema":null}} \ No newline at end of file +{"clipboard-manager":{"default_permission":{"identifier":"default","description":"No features are enabled by default, as we believe\nthe clipboard can be inherently dangerous and it is \napplication specific if read and/or write access is needed.\n\nClipboard interaction needs to be explicitly enabled.\n","permissions":[]},"permissions":{"allow-clear":{"identifier":"allow-clear","description":"Enables the clear command without any pre-configured scope.","commands":{"allow":["clear"],"deny":[]}},"allow-read-image":{"identifier":"allow-read-image","description":"Enables the read_image command without any pre-configured scope.","commands":{"allow":["read_image"],"deny":[]}},"allow-read-text":{"identifier":"allow-read-text","description":"Enables the read_text command without any pre-configured scope.","commands":{"allow":["read_text"],"deny":[]}},"allow-write-html":{"identifier":"allow-write-html","description":"Enables the write_html command without any pre-configured scope.","commands":{"allow":["write_html"],"deny":[]}},"allow-write-image":{"identifier":"allow-write-image","description":"Enables the write_image command without any pre-configured scope.","commands":{"allow":["write_image"],"deny":[]}},"allow-write-text":{"identifier":"allow-write-text","description":"Enables the write_text command without any pre-configured scope.","commands":{"allow":["write_text"],"deny":[]}},"deny-clear":{"identifier":"deny-clear","description":"Denies the clear command without any pre-configured scope.","commands":{"allow":[],"deny":["clear"]}},"deny-read-image":{"identifier":"deny-read-image","description":"Denies the read_image command without any pre-configured scope.","commands":{"allow":[],"deny":["read_image"]}},"deny-read-text":{"identifier":"deny-read-text","description":"Denies the read_text command without any pre-configured scope.","commands":{"allow":[],"deny":["read_text"]}},"deny-write-html":{"identifier":"deny-write-html","description":"Denies the write_html command without any pre-configured scope.","commands":{"allow":[],"deny":["write_html"]}},"deny-write-image":{"identifier":"deny-write-image","description":"Denies the write_image command without any pre-configured scope.","commands":{"allow":[],"deny":["write_image"]}},"deny-write-text":{"identifier":"deny-write-text","description":"Denies the write_text command without any pre-configured scope.","commands":{"allow":[],"deny":["write_text"]}}},"permission_sets":{},"global_scope_schema":null},"core":{"default_permission":{"identifier":"default","description":"Default core plugins set which includes:\n- 'core:path:default'\n- 'core:event:default'\n- 'core:window:default'\n- 'core:webview:default'\n- 'core:app:default'\n- 'core:image:default'\n- 'core:resources:default'\n- 'core:menu:default'\n- 'core:tray:default'\n","permissions":["core:path:default","core:event:default","core:window:default","core:webview:default","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default"]},"permissions":{},"permission_sets":{},"global_scope_schema":null},"core:app":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-version","allow-name","allow-tauri-version"]},"permissions":{"allow-app-hide":{"identifier":"allow-app-hide","description":"Enables the app_hide command without any pre-configured scope.","commands":{"allow":["app_hide"],"deny":[]}},"allow-app-show":{"identifier":"allow-app-show","description":"Enables the app_show command without any pre-configured scope.","commands":{"allow":["app_show"],"deny":[]}},"allow-default-window-icon":{"identifier":"allow-default-window-icon","description":"Enables the default_window_icon command without any pre-configured scope.","commands":{"allow":["default_window_icon"],"deny":[]}},"allow-name":{"identifier":"allow-name","description":"Enables the name command without any pre-configured scope.","commands":{"allow":["name"],"deny":[]}},"allow-set-app-theme":{"identifier":"allow-set-app-theme","description":"Enables the set_app_theme command without any pre-configured scope.","commands":{"allow":["set_app_theme"],"deny":[]}},"allow-tauri-version":{"identifier":"allow-tauri-version","description":"Enables the tauri_version command without any pre-configured scope.","commands":{"allow":["tauri_version"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-app-hide":{"identifier":"deny-app-hide","description":"Denies the app_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["app_hide"]}},"deny-app-show":{"identifier":"deny-app-show","description":"Denies the app_show command without any pre-configured scope.","commands":{"allow":[],"deny":["app_show"]}},"deny-default-window-icon":{"identifier":"deny-default-window-icon","description":"Denies the default_window_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["default_window_icon"]}},"deny-name":{"identifier":"deny-name","description":"Denies the name command without any pre-configured scope.","commands":{"allow":[],"deny":["name"]}},"deny-set-app-theme":{"identifier":"deny-set-app-theme","description":"Denies the set_app_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_app_theme"]}},"deny-tauri-version":{"identifier":"deny-tauri-version","description":"Denies the tauri_version command without any pre-configured scope.","commands":{"allow":[],"deny":["tauri_version"]}},"deny-version":{"identifier":"deny-version","description":"Denies the version command without any pre-configured scope.","commands":{"allow":[],"deny":["version"]}}},"permission_sets":{},"global_scope_schema":null},"core:event":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-listen","allow-unlisten","allow-emit","allow-emit-to"]},"permissions":{"allow-emit":{"identifier":"allow-emit","description":"Enables the emit command without any pre-configured scope.","commands":{"allow":["emit"],"deny":[]}},"allow-emit-to":{"identifier":"allow-emit-to","description":"Enables the emit_to command without any pre-configured scope.","commands":{"allow":["emit_to"],"deny":[]}},"allow-listen":{"identifier":"allow-listen","description":"Enables the listen command without any pre-configured scope.","commands":{"allow":["listen"],"deny":[]}},"allow-unlisten":{"identifier":"allow-unlisten","description":"Enables the unlisten command without any pre-configured scope.","commands":{"allow":["unlisten"],"deny":[]}},"deny-emit":{"identifier":"deny-emit","description":"Denies the emit command without any pre-configured scope.","commands":{"allow":[],"deny":["emit"]}},"deny-emit-to":{"identifier":"deny-emit-to","description":"Denies the emit_to command without any pre-configured scope.","commands":{"allow":[],"deny":["emit_to"]}},"deny-listen":{"identifier":"deny-listen","description":"Denies the listen command without any pre-configured scope.","commands":{"allow":[],"deny":["listen"]}},"deny-unlisten":{"identifier":"deny-unlisten","description":"Denies the unlisten command without any pre-configured scope.","commands":{"allow":[],"deny":["unlisten"]}}},"permission_sets":{},"global_scope_schema":null},"core:image":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-new","allow-from-bytes","allow-from-path","allow-rgba","allow-size"]},"permissions":{"allow-from-bytes":{"identifier":"allow-from-bytes","description":"Enables the from_bytes command without any pre-configured scope.","commands":{"allow":["from_bytes"],"deny":[]}},"allow-from-path":{"identifier":"allow-from-path","description":"Enables the from_path command without any pre-configured scope.","commands":{"allow":["from_path"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-rgba":{"identifier":"allow-rgba","description":"Enables the rgba command without any pre-configured scope.","commands":{"allow":["rgba"],"deny":[]}},"allow-size":{"identifier":"allow-size","description":"Enables the size command without any pre-configured scope.","commands":{"allow":["size"],"deny":[]}},"deny-from-bytes":{"identifier":"deny-from-bytes","description":"Denies the from_bytes command without any pre-configured scope.","commands":{"allow":[],"deny":["from_bytes"]}},"deny-from-path":{"identifier":"deny-from-path","description":"Denies the from_path command without any pre-configured scope.","commands":{"allow":[],"deny":["from_path"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-rgba":{"identifier":"deny-rgba","description":"Denies the rgba command without any pre-configured scope.","commands":{"allow":[],"deny":["rgba"]}},"deny-size":{"identifier":"deny-size","description":"Denies the size command without any pre-configured scope.","commands":{"allow":[],"deny":["size"]}}},"permission_sets":{},"global_scope_schema":null},"core:menu":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-new","allow-append","allow-prepend","allow-insert","allow-remove","allow-remove-at","allow-items","allow-get","allow-popup","allow-create-default","allow-set-as-app-menu","allow-set-as-window-menu","allow-text","allow-set-text","allow-is-enabled","allow-set-enabled","allow-set-accelerator","allow-set-as-windows-menu-for-nsapp","allow-set-as-help-menu-for-nsapp","allow-is-checked","allow-set-checked","allow-set-icon"]},"permissions":{"allow-append":{"identifier":"allow-append","description":"Enables the append command without any pre-configured scope.","commands":{"allow":["append"],"deny":[]}},"allow-create-default":{"identifier":"allow-create-default","description":"Enables the create_default command without any pre-configured scope.","commands":{"allow":["create_default"],"deny":[]}},"allow-get":{"identifier":"allow-get","description":"Enables the get command without any pre-configured scope.","commands":{"allow":["get"],"deny":[]}},"allow-insert":{"identifier":"allow-insert","description":"Enables the insert command without any pre-configured scope.","commands":{"allow":["insert"],"deny":[]}},"allow-is-checked":{"identifier":"allow-is-checked","description":"Enables the is_checked command without any pre-configured scope.","commands":{"allow":["is_checked"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-items":{"identifier":"allow-items","description":"Enables the items command without any pre-configured scope.","commands":{"allow":["items"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-popup":{"identifier":"allow-popup","description":"Enables the popup command without any pre-configured scope.","commands":{"allow":["popup"],"deny":[]}},"allow-prepend":{"identifier":"allow-prepend","description":"Enables the prepend command without any pre-configured scope.","commands":{"allow":["prepend"],"deny":[]}},"allow-remove":{"identifier":"allow-remove","description":"Enables the remove command without any pre-configured scope.","commands":{"allow":["remove"],"deny":[]}},"allow-remove-at":{"identifier":"allow-remove-at","description":"Enables the remove_at command without any pre-configured scope.","commands":{"allow":["remove_at"],"deny":[]}},"allow-set-accelerator":{"identifier":"allow-set-accelerator","description":"Enables the set_accelerator command without any pre-configured scope.","commands":{"allow":["set_accelerator"],"deny":[]}},"allow-set-as-app-menu":{"identifier":"allow-set-as-app-menu","description":"Enables the set_as_app_menu command without any pre-configured scope.","commands":{"allow":["set_as_app_menu"],"deny":[]}},"allow-set-as-help-menu-for-nsapp":{"identifier":"allow-set-as-help-menu-for-nsapp","description":"Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_help_menu_for_nsapp"],"deny":[]}},"allow-set-as-window-menu":{"identifier":"allow-set-as-window-menu","description":"Enables the set_as_window_menu command without any pre-configured scope.","commands":{"allow":["set_as_window_menu"],"deny":[]}},"allow-set-as-windows-menu-for-nsapp":{"identifier":"allow-set-as-windows-menu-for-nsapp","description":"Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_windows_menu_for_nsapp"],"deny":[]}},"allow-set-checked":{"identifier":"allow-set-checked","description":"Enables the set_checked command without any pre-configured scope.","commands":{"allow":["set_checked"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-text":{"identifier":"allow-set-text","description":"Enables the set_text command without any pre-configured scope.","commands":{"allow":["set_text"],"deny":[]}},"allow-text":{"identifier":"allow-text","description":"Enables the text command without any pre-configured scope.","commands":{"allow":["text"],"deny":[]}},"deny-append":{"identifier":"deny-append","description":"Denies the append command without any pre-configured scope.","commands":{"allow":[],"deny":["append"]}},"deny-create-default":{"identifier":"deny-create-default","description":"Denies the create_default command without any pre-configured scope.","commands":{"allow":[],"deny":["create_default"]}},"deny-get":{"identifier":"deny-get","description":"Denies the get command without any pre-configured scope.","commands":{"allow":[],"deny":["get"]}},"deny-insert":{"identifier":"deny-insert","description":"Denies the insert command without any pre-configured scope.","commands":{"allow":[],"deny":["insert"]}},"deny-is-checked":{"identifier":"deny-is-checked","description":"Denies the is_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["is_checked"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-items":{"identifier":"deny-items","description":"Denies the items command without any pre-configured scope.","commands":{"allow":[],"deny":["items"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-popup":{"identifier":"deny-popup","description":"Denies the popup command without any pre-configured scope.","commands":{"allow":[],"deny":["popup"]}},"deny-prepend":{"identifier":"deny-prepend","description":"Denies the prepend command without any pre-configured scope.","commands":{"allow":[],"deny":["prepend"]}},"deny-remove":{"identifier":"deny-remove","description":"Denies the remove command without any pre-configured scope.","commands":{"allow":[],"deny":["remove"]}},"deny-remove-at":{"identifier":"deny-remove-at","description":"Denies the remove_at command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_at"]}},"deny-set-accelerator":{"identifier":"deny-set-accelerator","description":"Denies the set_accelerator command without any pre-configured scope.","commands":{"allow":[],"deny":["set_accelerator"]}},"deny-set-as-app-menu":{"identifier":"deny-set-as-app-menu","description":"Denies the set_as_app_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_app_menu"]}},"deny-set-as-help-menu-for-nsapp":{"identifier":"deny-set-as-help-menu-for-nsapp","description":"Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_help_menu_for_nsapp"]}},"deny-set-as-window-menu":{"identifier":"deny-set-as-window-menu","description":"Denies the set_as_window_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_window_menu"]}},"deny-set-as-windows-menu-for-nsapp":{"identifier":"deny-set-as-windows-menu-for-nsapp","description":"Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_windows_menu_for_nsapp"]}},"deny-set-checked":{"identifier":"deny-set-checked","description":"Denies the set_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["set_checked"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-text":{"identifier":"deny-set-text","description":"Denies the set_text command without any pre-configured scope.","commands":{"allow":[],"deny":["set_text"]}},"deny-text":{"identifier":"deny-text","description":"Denies the text command without any pre-configured scope.","commands":{"allow":[],"deny":["text"]}}},"permission_sets":{},"global_scope_schema":null},"core:path":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-resolve-directory","allow-resolve","allow-normalize","allow-join","allow-dirname","allow-extname","allow-basename","allow-is-absolute"]},"permissions":{"allow-basename":{"identifier":"allow-basename","description":"Enables the basename command without any pre-configured scope.","commands":{"allow":["basename"],"deny":[]}},"allow-dirname":{"identifier":"allow-dirname","description":"Enables the dirname command without any pre-configured scope.","commands":{"allow":["dirname"],"deny":[]}},"allow-extname":{"identifier":"allow-extname","description":"Enables the extname command without any pre-configured scope.","commands":{"allow":["extname"],"deny":[]}},"allow-is-absolute":{"identifier":"allow-is-absolute","description":"Enables the is_absolute command without any pre-configured scope.","commands":{"allow":["is_absolute"],"deny":[]}},"allow-join":{"identifier":"allow-join","description":"Enables the join command without any pre-configured scope.","commands":{"allow":["join"],"deny":[]}},"allow-normalize":{"identifier":"allow-normalize","description":"Enables the normalize command without any pre-configured scope.","commands":{"allow":["normalize"],"deny":[]}},"allow-resolve":{"identifier":"allow-resolve","description":"Enables the resolve command without any pre-configured scope.","commands":{"allow":["resolve"],"deny":[]}},"allow-resolve-directory":{"identifier":"allow-resolve-directory","description":"Enables the resolve_directory command without any pre-configured scope.","commands":{"allow":["resolve_directory"],"deny":[]}},"deny-basename":{"identifier":"deny-basename","description":"Denies the basename command without any pre-configured scope.","commands":{"allow":[],"deny":["basename"]}},"deny-dirname":{"identifier":"deny-dirname","description":"Denies the dirname command without any pre-configured scope.","commands":{"allow":[],"deny":["dirname"]}},"deny-extname":{"identifier":"deny-extname","description":"Denies the extname command without any pre-configured scope.","commands":{"allow":[],"deny":["extname"]}},"deny-is-absolute":{"identifier":"deny-is-absolute","description":"Denies the is_absolute command without any pre-configured scope.","commands":{"allow":[],"deny":["is_absolute"]}},"deny-join":{"identifier":"deny-join","description":"Denies the join command without any pre-configured scope.","commands":{"allow":[],"deny":["join"]}},"deny-normalize":{"identifier":"deny-normalize","description":"Denies the normalize command without any pre-configured scope.","commands":{"allow":[],"deny":["normalize"]}},"deny-resolve":{"identifier":"deny-resolve","description":"Denies the resolve command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve"]}},"deny-resolve-directory":{"identifier":"deny-resolve-directory","description":"Denies the resolve_directory command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve_directory"]}}},"permission_sets":{},"global_scope_schema":null},"core:resources":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-close"]},"permissions":{"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}}},"permission_sets":{},"global_scope_schema":null},"core:tray":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-new","allow-get-by-id","allow-remove-by-id","allow-set-icon","allow-set-menu","allow-set-tooltip","allow-set-title","allow-set-visible","allow-set-temp-dir-path","allow-set-icon-as-template","allow-set-show-menu-on-left-click"]},"permissions":{"allow-get-by-id":{"identifier":"allow-get-by-id","description":"Enables the get_by_id command without any pre-configured scope.","commands":{"allow":["get_by_id"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-remove-by-id":{"identifier":"allow-remove-by-id","description":"Enables the remove_by_id command without any pre-configured scope.","commands":{"allow":["remove_by_id"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-icon-as-template":{"identifier":"allow-set-icon-as-template","description":"Enables the set_icon_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_as_template"],"deny":[]}},"allow-set-menu":{"identifier":"allow-set-menu","description":"Enables the set_menu command without any pre-configured scope.","commands":{"allow":["set_menu"],"deny":[]}},"allow-set-show-menu-on-left-click":{"identifier":"allow-set-show-menu-on-left-click","description":"Enables the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":["set_show_menu_on_left_click"],"deny":[]}},"allow-set-temp-dir-path":{"identifier":"allow-set-temp-dir-path","description":"Enables the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":["set_temp_dir_path"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-tooltip":{"identifier":"allow-set-tooltip","description":"Enables the set_tooltip command without any pre-configured scope.","commands":{"allow":["set_tooltip"],"deny":[]}},"allow-set-visible":{"identifier":"allow-set-visible","description":"Enables the set_visible command without any pre-configured scope.","commands":{"allow":["set_visible"],"deny":[]}},"deny-get-by-id":{"identifier":"deny-get-by-id","description":"Denies the get_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["get_by_id"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-remove-by-id":{"identifier":"deny-remove-by-id","description":"Denies the remove_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_by_id"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-icon-as-template":{"identifier":"deny-set-icon-as-template","description":"Denies the set_icon_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_as_template"]}},"deny-set-menu":{"identifier":"deny-set-menu","description":"Denies the set_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_menu"]}},"deny-set-show-menu-on-left-click":{"identifier":"deny-set-show-menu-on-left-click","description":"Denies the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":[],"deny":["set_show_menu_on_left_click"]}},"deny-set-temp-dir-path":{"identifier":"deny-set-temp-dir-path","description":"Denies the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":[],"deny":["set_temp_dir_path"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-tooltip":{"identifier":"deny-set-tooltip","description":"Denies the set_tooltip command without any pre-configured scope.","commands":{"allow":[],"deny":["set_tooltip"]}},"deny-set-visible":{"identifier":"deny-set-visible","description":"Denies the set_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible"]}}},"permission_sets":{},"global_scope_schema":null},"core:webview":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-webviews","allow-webview-position","allow-webview-size","allow-internal-toggle-devtools"]},"permissions":{"allow-clear-all-browsing-data":{"identifier":"allow-clear-all-browsing-data","description":"Enables the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":["clear_all_browsing_data"],"deny":[]}},"allow-create-webview":{"identifier":"allow-create-webview","description":"Enables the create_webview command without any pre-configured scope.","commands":{"allow":["create_webview"],"deny":[]}},"allow-create-webview-window":{"identifier":"allow-create-webview-window","description":"Enables the create_webview_window command without any pre-configured scope.","commands":{"allow":["create_webview_window"],"deny":[]}},"allow-get-all-webviews":{"identifier":"allow-get-all-webviews","description":"Enables the get_all_webviews command without any pre-configured scope.","commands":{"allow":["get_all_webviews"],"deny":[]}},"allow-internal-toggle-devtools":{"identifier":"allow-internal-toggle-devtools","description":"Enables the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":["internal_toggle_devtools"],"deny":[]}},"allow-print":{"identifier":"allow-print","description":"Enables the print command without any pre-configured scope.","commands":{"allow":["print"],"deny":[]}},"allow-reparent":{"identifier":"allow-reparent","description":"Enables the reparent command without any pre-configured scope.","commands":{"allow":["reparent"],"deny":[]}},"allow-set-webview-background-color":{"identifier":"allow-set-webview-background-color","description":"Enables the set_webview_background_color command without any pre-configured scope.","commands":{"allow":["set_webview_background_color"],"deny":[]}},"allow-set-webview-focus":{"identifier":"allow-set-webview-focus","description":"Enables the set_webview_focus command without any pre-configured scope.","commands":{"allow":["set_webview_focus"],"deny":[]}},"allow-set-webview-position":{"identifier":"allow-set-webview-position","description":"Enables the set_webview_position command without any pre-configured scope.","commands":{"allow":["set_webview_position"],"deny":[]}},"allow-set-webview-size":{"identifier":"allow-set-webview-size","description":"Enables the set_webview_size command without any pre-configured scope.","commands":{"allow":["set_webview_size"],"deny":[]}},"allow-set-webview-zoom":{"identifier":"allow-set-webview-zoom","description":"Enables the set_webview_zoom command without any pre-configured scope.","commands":{"allow":["set_webview_zoom"],"deny":[]}},"allow-webview-close":{"identifier":"allow-webview-close","description":"Enables the webview_close command without any pre-configured scope.","commands":{"allow":["webview_close"],"deny":[]}},"allow-webview-hide":{"identifier":"allow-webview-hide","description":"Enables the webview_hide command without any pre-configured scope.","commands":{"allow":["webview_hide"],"deny":[]}},"allow-webview-position":{"identifier":"allow-webview-position","description":"Enables the webview_position command without any pre-configured scope.","commands":{"allow":["webview_position"],"deny":[]}},"allow-webview-show":{"identifier":"allow-webview-show","description":"Enables the webview_show command without any pre-configured scope.","commands":{"allow":["webview_show"],"deny":[]}},"allow-webview-size":{"identifier":"allow-webview-size","description":"Enables the webview_size command without any pre-configured scope.","commands":{"allow":["webview_size"],"deny":[]}},"deny-clear-all-browsing-data":{"identifier":"deny-clear-all-browsing-data","description":"Denies the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":[],"deny":["clear_all_browsing_data"]}},"deny-create-webview":{"identifier":"deny-create-webview","description":"Denies the create_webview command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview"]}},"deny-create-webview-window":{"identifier":"deny-create-webview-window","description":"Denies the create_webview_window command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview_window"]}},"deny-get-all-webviews":{"identifier":"deny-get-all-webviews","description":"Denies the get_all_webviews command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_webviews"]}},"deny-internal-toggle-devtools":{"identifier":"deny-internal-toggle-devtools","description":"Denies the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_devtools"]}},"deny-print":{"identifier":"deny-print","description":"Denies the print command without any pre-configured scope.","commands":{"allow":[],"deny":["print"]}},"deny-reparent":{"identifier":"deny-reparent","description":"Denies the reparent command without any pre-configured scope.","commands":{"allow":[],"deny":["reparent"]}},"deny-set-webview-background-color":{"identifier":"deny-set-webview-background-color","description":"Denies the set_webview_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_background_color"]}},"deny-set-webview-focus":{"identifier":"deny-set-webview-focus","description":"Denies the set_webview_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_focus"]}},"deny-set-webview-position":{"identifier":"deny-set-webview-position","description":"Denies the set_webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_position"]}},"deny-set-webview-size":{"identifier":"deny-set-webview-size","description":"Denies the set_webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_size"]}},"deny-set-webview-zoom":{"identifier":"deny-set-webview-zoom","description":"Denies the set_webview_zoom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_zoom"]}},"deny-webview-close":{"identifier":"deny-webview-close","description":"Denies the webview_close command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_close"]}},"deny-webview-hide":{"identifier":"deny-webview-hide","description":"Denies the webview_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_hide"]}},"deny-webview-position":{"identifier":"deny-webview-position","description":"Denies the webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_position"]}},"deny-webview-show":{"identifier":"deny-webview-show","description":"Denies the webview_show command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_show"]}},"deny-webview-size":{"identifier":"deny-webview-size","description":"Denies the webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_size"]}}},"permission_sets":{},"global_scope_schema":null},"core:window":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-windows","allow-scale-factor","allow-inner-position","allow-outer-position","allow-inner-size","allow-outer-size","allow-is-fullscreen","allow-is-minimized","allow-is-maximized","allow-is-focused","allow-is-decorated","allow-is-resizable","allow-is-maximizable","allow-is-minimizable","allow-is-closable","allow-is-visible","allow-is-enabled","allow-title","allow-current-monitor","allow-primary-monitor","allow-monitor-from-point","allow-available-monitors","allow-cursor-position","allow-theme","allow-internal-toggle-maximize"]},"permissions":{"allow-available-monitors":{"identifier":"allow-available-monitors","description":"Enables the available_monitors command without any pre-configured scope.","commands":{"allow":["available_monitors"],"deny":[]}},"allow-center":{"identifier":"allow-center","description":"Enables the center command without any pre-configured scope.","commands":{"allow":["center"],"deny":[]}},"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"allow-create":{"identifier":"allow-create","description":"Enables the create command without any pre-configured scope.","commands":{"allow":["create"],"deny":[]}},"allow-current-monitor":{"identifier":"allow-current-monitor","description":"Enables the current_monitor command without any pre-configured scope.","commands":{"allow":["current_monitor"],"deny":[]}},"allow-cursor-position":{"identifier":"allow-cursor-position","description":"Enables the cursor_position command without any pre-configured scope.","commands":{"allow":["cursor_position"],"deny":[]}},"allow-destroy":{"identifier":"allow-destroy","description":"Enables the destroy command without any pre-configured scope.","commands":{"allow":["destroy"],"deny":[]}},"allow-get-all-windows":{"identifier":"allow-get-all-windows","description":"Enables the get_all_windows command without any pre-configured scope.","commands":{"allow":["get_all_windows"],"deny":[]}},"allow-hide":{"identifier":"allow-hide","description":"Enables the hide command without any pre-configured scope.","commands":{"allow":["hide"],"deny":[]}},"allow-inner-position":{"identifier":"allow-inner-position","description":"Enables the inner_position command without any pre-configured scope.","commands":{"allow":["inner_position"],"deny":[]}},"allow-inner-size":{"identifier":"allow-inner-size","description":"Enables the inner_size command without any pre-configured scope.","commands":{"allow":["inner_size"],"deny":[]}},"allow-internal-toggle-maximize":{"identifier":"allow-internal-toggle-maximize","description":"Enables the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":["internal_toggle_maximize"],"deny":[]}},"allow-is-closable":{"identifier":"allow-is-closable","description":"Enables the is_closable command without any pre-configured scope.","commands":{"allow":["is_closable"],"deny":[]}},"allow-is-decorated":{"identifier":"allow-is-decorated","description":"Enables the is_decorated command without any pre-configured scope.","commands":{"allow":["is_decorated"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-is-focused":{"identifier":"allow-is-focused","description":"Enables the is_focused command without any pre-configured scope.","commands":{"allow":["is_focused"],"deny":[]}},"allow-is-fullscreen":{"identifier":"allow-is-fullscreen","description":"Enables the is_fullscreen command without any pre-configured scope.","commands":{"allow":["is_fullscreen"],"deny":[]}},"allow-is-maximizable":{"identifier":"allow-is-maximizable","description":"Enables the is_maximizable command without any pre-configured scope.","commands":{"allow":["is_maximizable"],"deny":[]}},"allow-is-maximized":{"identifier":"allow-is-maximized","description":"Enables the is_maximized command without any pre-configured scope.","commands":{"allow":["is_maximized"],"deny":[]}},"allow-is-minimizable":{"identifier":"allow-is-minimizable","description":"Enables the is_minimizable command without any pre-configured scope.","commands":{"allow":["is_minimizable"],"deny":[]}},"allow-is-minimized":{"identifier":"allow-is-minimized","description":"Enables the is_minimized command without any pre-configured scope.","commands":{"allow":["is_minimized"],"deny":[]}},"allow-is-resizable":{"identifier":"allow-is-resizable","description":"Enables the is_resizable command without any pre-configured scope.","commands":{"allow":["is_resizable"],"deny":[]}},"allow-is-visible":{"identifier":"allow-is-visible","description":"Enables the is_visible command without any pre-configured scope.","commands":{"allow":["is_visible"],"deny":[]}},"allow-maximize":{"identifier":"allow-maximize","description":"Enables the maximize command without any pre-configured scope.","commands":{"allow":["maximize"],"deny":[]}},"allow-minimize":{"identifier":"allow-minimize","description":"Enables the minimize command without any pre-configured scope.","commands":{"allow":["minimize"],"deny":[]}},"allow-monitor-from-point":{"identifier":"allow-monitor-from-point","description":"Enables the monitor_from_point command without any pre-configured scope.","commands":{"allow":["monitor_from_point"],"deny":[]}},"allow-outer-position":{"identifier":"allow-outer-position","description":"Enables the outer_position command without any pre-configured scope.","commands":{"allow":["outer_position"],"deny":[]}},"allow-outer-size":{"identifier":"allow-outer-size","description":"Enables the outer_size command without any pre-configured scope.","commands":{"allow":["outer_size"],"deny":[]}},"allow-primary-monitor":{"identifier":"allow-primary-monitor","description":"Enables the primary_monitor command without any pre-configured scope.","commands":{"allow":["primary_monitor"],"deny":[]}},"allow-request-user-attention":{"identifier":"allow-request-user-attention","description":"Enables the request_user_attention command without any pre-configured scope.","commands":{"allow":["request_user_attention"],"deny":[]}},"allow-scale-factor":{"identifier":"allow-scale-factor","description":"Enables the scale_factor command without any pre-configured scope.","commands":{"allow":["scale_factor"],"deny":[]}},"allow-set-always-on-bottom":{"identifier":"allow-set-always-on-bottom","description":"Enables the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":["set_always_on_bottom"],"deny":[]}},"allow-set-always-on-top":{"identifier":"allow-set-always-on-top","description":"Enables the set_always_on_top command without any pre-configured scope.","commands":{"allow":["set_always_on_top"],"deny":[]}},"allow-set-background-color":{"identifier":"allow-set-background-color","description":"Enables the set_background_color command without any pre-configured scope.","commands":{"allow":["set_background_color"],"deny":[]}},"allow-set-badge-count":{"identifier":"allow-set-badge-count","description":"Enables the set_badge_count command without any pre-configured scope.","commands":{"allow":["set_badge_count"],"deny":[]}},"allow-set-badge-label":{"identifier":"allow-set-badge-label","description":"Enables the set_badge_label command without any pre-configured scope.","commands":{"allow":["set_badge_label"],"deny":[]}},"allow-set-closable":{"identifier":"allow-set-closable","description":"Enables the set_closable command without any pre-configured scope.","commands":{"allow":["set_closable"],"deny":[]}},"allow-set-content-protected":{"identifier":"allow-set-content-protected","description":"Enables the set_content_protected command without any pre-configured scope.","commands":{"allow":["set_content_protected"],"deny":[]}},"allow-set-cursor-grab":{"identifier":"allow-set-cursor-grab","description":"Enables the set_cursor_grab command without any pre-configured scope.","commands":{"allow":["set_cursor_grab"],"deny":[]}},"allow-set-cursor-icon":{"identifier":"allow-set-cursor-icon","description":"Enables the set_cursor_icon command without any pre-configured scope.","commands":{"allow":["set_cursor_icon"],"deny":[]}},"allow-set-cursor-position":{"identifier":"allow-set-cursor-position","description":"Enables the set_cursor_position command without any pre-configured scope.","commands":{"allow":["set_cursor_position"],"deny":[]}},"allow-set-cursor-visible":{"identifier":"allow-set-cursor-visible","description":"Enables the set_cursor_visible command without any pre-configured scope.","commands":{"allow":["set_cursor_visible"],"deny":[]}},"allow-set-decorations":{"identifier":"allow-set-decorations","description":"Enables the set_decorations command without any pre-configured scope.","commands":{"allow":["set_decorations"],"deny":[]}},"allow-set-effects":{"identifier":"allow-set-effects","description":"Enables the set_effects command without any pre-configured scope.","commands":{"allow":["set_effects"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-focus":{"identifier":"allow-set-focus","description":"Enables the set_focus command without any pre-configured scope.","commands":{"allow":["set_focus"],"deny":[]}},"allow-set-fullscreen":{"identifier":"allow-set-fullscreen","description":"Enables the set_fullscreen command without any pre-configured scope.","commands":{"allow":["set_fullscreen"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-ignore-cursor-events":{"identifier":"allow-set-ignore-cursor-events","description":"Enables the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":["set_ignore_cursor_events"],"deny":[]}},"allow-set-max-size":{"identifier":"allow-set-max-size","description":"Enables the set_max_size command without any pre-configured scope.","commands":{"allow":["set_max_size"],"deny":[]}},"allow-set-maximizable":{"identifier":"allow-set-maximizable","description":"Enables the set_maximizable command without any pre-configured scope.","commands":{"allow":["set_maximizable"],"deny":[]}},"allow-set-min-size":{"identifier":"allow-set-min-size","description":"Enables the set_min_size command without any pre-configured scope.","commands":{"allow":["set_min_size"],"deny":[]}},"allow-set-minimizable":{"identifier":"allow-set-minimizable","description":"Enables the set_minimizable command without any pre-configured scope.","commands":{"allow":["set_minimizable"],"deny":[]}},"allow-set-overlay-icon":{"identifier":"allow-set-overlay-icon","description":"Enables the set_overlay_icon command without any pre-configured scope.","commands":{"allow":["set_overlay_icon"],"deny":[]}},"allow-set-position":{"identifier":"allow-set-position","description":"Enables the set_position command without any pre-configured scope.","commands":{"allow":["set_position"],"deny":[]}},"allow-set-progress-bar":{"identifier":"allow-set-progress-bar","description":"Enables the set_progress_bar command without any pre-configured scope.","commands":{"allow":["set_progress_bar"],"deny":[]}},"allow-set-resizable":{"identifier":"allow-set-resizable","description":"Enables the set_resizable command without any pre-configured scope.","commands":{"allow":["set_resizable"],"deny":[]}},"allow-set-shadow":{"identifier":"allow-set-shadow","description":"Enables the set_shadow command without any pre-configured scope.","commands":{"allow":["set_shadow"],"deny":[]}},"allow-set-size":{"identifier":"allow-set-size","description":"Enables the set_size command without any pre-configured scope.","commands":{"allow":["set_size"],"deny":[]}},"allow-set-size-constraints":{"identifier":"allow-set-size-constraints","description":"Enables the set_size_constraints command without any pre-configured scope.","commands":{"allow":["set_size_constraints"],"deny":[]}},"allow-set-skip-taskbar":{"identifier":"allow-set-skip-taskbar","description":"Enables the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":["set_skip_taskbar"],"deny":[]}},"allow-set-theme":{"identifier":"allow-set-theme","description":"Enables the set_theme command without any pre-configured scope.","commands":{"allow":["set_theme"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-title-bar-style":{"identifier":"allow-set-title-bar-style","description":"Enables the set_title_bar_style command without any pre-configured scope.","commands":{"allow":["set_title_bar_style"],"deny":[]}},"allow-set-visible-on-all-workspaces":{"identifier":"allow-set-visible-on-all-workspaces","description":"Enables the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":["set_visible_on_all_workspaces"],"deny":[]}},"allow-show":{"identifier":"allow-show","description":"Enables the show command without any pre-configured scope.","commands":{"allow":["show"],"deny":[]}},"allow-start-dragging":{"identifier":"allow-start-dragging","description":"Enables the start_dragging command without any pre-configured scope.","commands":{"allow":["start_dragging"],"deny":[]}},"allow-start-resize-dragging":{"identifier":"allow-start-resize-dragging","description":"Enables the start_resize_dragging command without any pre-configured scope.","commands":{"allow":["start_resize_dragging"],"deny":[]}},"allow-theme":{"identifier":"allow-theme","description":"Enables the theme command without any pre-configured scope.","commands":{"allow":["theme"],"deny":[]}},"allow-title":{"identifier":"allow-title","description":"Enables the title command without any pre-configured scope.","commands":{"allow":["title"],"deny":[]}},"allow-toggle-maximize":{"identifier":"allow-toggle-maximize","description":"Enables the toggle_maximize command without any pre-configured scope.","commands":{"allow":["toggle_maximize"],"deny":[]}},"allow-unmaximize":{"identifier":"allow-unmaximize","description":"Enables the unmaximize command without any pre-configured scope.","commands":{"allow":["unmaximize"],"deny":[]}},"allow-unminimize":{"identifier":"allow-unminimize","description":"Enables the unminimize command without any pre-configured scope.","commands":{"allow":["unminimize"],"deny":[]}},"deny-available-monitors":{"identifier":"deny-available-monitors","description":"Denies the available_monitors command without any pre-configured scope.","commands":{"allow":[],"deny":["available_monitors"]}},"deny-center":{"identifier":"deny-center","description":"Denies the center command without any pre-configured scope.","commands":{"allow":[],"deny":["center"]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}},"deny-create":{"identifier":"deny-create","description":"Denies the create command without any pre-configured scope.","commands":{"allow":[],"deny":["create"]}},"deny-current-monitor":{"identifier":"deny-current-monitor","description":"Denies the current_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["current_monitor"]}},"deny-cursor-position":{"identifier":"deny-cursor-position","description":"Denies the cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["cursor_position"]}},"deny-destroy":{"identifier":"deny-destroy","description":"Denies the destroy command without any pre-configured scope.","commands":{"allow":[],"deny":["destroy"]}},"deny-get-all-windows":{"identifier":"deny-get-all-windows","description":"Denies the get_all_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_windows"]}},"deny-hide":{"identifier":"deny-hide","description":"Denies the hide command without any pre-configured scope.","commands":{"allow":[],"deny":["hide"]}},"deny-inner-position":{"identifier":"deny-inner-position","description":"Denies the inner_position command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_position"]}},"deny-inner-size":{"identifier":"deny-inner-size","description":"Denies the inner_size command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_size"]}},"deny-internal-toggle-maximize":{"identifier":"deny-internal-toggle-maximize","description":"Denies the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_maximize"]}},"deny-is-closable":{"identifier":"deny-is-closable","description":"Denies the is_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_closable"]}},"deny-is-decorated":{"identifier":"deny-is-decorated","description":"Denies the is_decorated command without any pre-configured scope.","commands":{"allow":[],"deny":["is_decorated"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-is-focused":{"identifier":"deny-is-focused","description":"Denies the is_focused command without any pre-configured scope.","commands":{"allow":[],"deny":["is_focused"]}},"deny-is-fullscreen":{"identifier":"deny-is-fullscreen","description":"Denies the is_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["is_fullscreen"]}},"deny-is-maximizable":{"identifier":"deny-is-maximizable","description":"Denies the is_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximizable"]}},"deny-is-maximized":{"identifier":"deny-is-maximized","description":"Denies the is_maximized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximized"]}},"deny-is-minimizable":{"identifier":"deny-is-minimizable","description":"Denies the is_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimizable"]}},"deny-is-minimized":{"identifier":"deny-is-minimized","description":"Denies the is_minimized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimized"]}},"deny-is-resizable":{"identifier":"deny-is-resizable","description":"Denies the is_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_resizable"]}},"deny-is-visible":{"identifier":"deny-is-visible","description":"Denies the is_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["is_visible"]}},"deny-maximize":{"identifier":"deny-maximize","description":"Denies the maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["maximize"]}},"deny-minimize":{"identifier":"deny-minimize","description":"Denies the minimize command without any pre-configured scope.","commands":{"allow":[],"deny":["minimize"]}},"deny-monitor-from-point":{"identifier":"deny-monitor-from-point","description":"Denies the monitor_from_point command without any pre-configured scope.","commands":{"allow":[],"deny":["monitor_from_point"]}},"deny-outer-position":{"identifier":"deny-outer-position","description":"Denies the outer_position command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_position"]}},"deny-outer-size":{"identifier":"deny-outer-size","description":"Denies the outer_size command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_size"]}},"deny-primary-monitor":{"identifier":"deny-primary-monitor","description":"Denies the primary_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["primary_monitor"]}},"deny-request-user-attention":{"identifier":"deny-request-user-attention","description":"Denies the request_user_attention command without any pre-configured scope.","commands":{"allow":[],"deny":["request_user_attention"]}},"deny-scale-factor":{"identifier":"deny-scale-factor","description":"Denies the scale_factor command without any pre-configured scope.","commands":{"allow":[],"deny":["scale_factor"]}},"deny-set-always-on-bottom":{"identifier":"deny-set-always-on-bottom","description":"Denies the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_bottom"]}},"deny-set-always-on-top":{"identifier":"deny-set-always-on-top","description":"Denies the set_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_top"]}},"deny-set-background-color":{"identifier":"deny-set-background-color","description":"Denies the set_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_background_color"]}},"deny-set-badge-count":{"identifier":"deny-set-badge-count","description":"Denies the set_badge_count command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_count"]}},"deny-set-badge-label":{"identifier":"deny-set-badge-label","description":"Denies the set_badge_label command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_label"]}},"deny-set-closable":{"identifier":"deny-set-closable","description":"Denies the set_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_closable"]}},"deny-set-content-protected":{"identifier":"deny-set-content-protected","description":"Denies the set_content_protected command without any pre-configured scope.","commands":{"allow":[],"deny":["set_content_protected"]}},"deny-set-cursor-grab":{"identifier":"deny-set-cursor-grab","description":"Denies the set_cursor_grab command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_grab"]}},"deny-set-cursor-icon":{"identifier":"deny-set-cursor-icon","description":"Denies the set_cursor_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_icon"]}},"deny-set-cursor-position":{"identifier":"deny-set-cursor-position","description":"Denies the set_cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_position"]}},"deny-set-cursor-visible":{"identifier":"deny-set-cursor-visible","description":"Denies the set_cursor_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_visible"]}},"deny-set-decorations":{"identifier":"deny-set-decorations","description":"Denies the set_decorations command without any pre-configured scope.","commands":{"allow":[],"deny":["set_decorations"]}},"deny-set-effects":{"identifier":"deny-set-effects","description":"Denies the set_effects command without any pre-configured scope.","commands":{"allow":[],"deny":["set_effects"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-focus":{"identifier":"deny-set-focus","description":"Denies the set_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focus"]}},"deny-set-fullscreen":{"identifier":"deny-set-fullscreen","description":"Denies the set_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_fullscreen"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-ignore-cursor-events":{"identifier":"deny-set-ignore-cursor-events","description":"Denies the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":[],"deny":["set_ignore_cursor_events"]}},"deny-set-max-size":{"identifier":"deny-set-max-size","description":"Denies the set_max_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_max_size"]}},"deny-set-maximizable":{"identifier":"deny-set-maximizable","description":"Denies the set_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_maximizable"]}},"deny-set-min-size":{"identifier":"deny-set-min-size","description":"Denies the set_min_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_min_size"]}},"deny-set-minimizable":{"identifier":"deny-set-minimizable","description":"Denies the set_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_minimizable"]}},"deny-set-overlay-icon":{"identifier":"deny-set-overlay-icon","description":"Denies the set_overlay_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_overlay_icon"]}},"deny-set-position":{"identifier":"deny-set-position","description":"Denies the set_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_position"]}},"deny-set-progress-bar":{"identifier":"deny-set-progress-bar","description":"Denies the set_progress_bar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_progress_bar"]}},"deny-set-resizable":{"identifier":"deny-set-resizable","description":"Denies the set_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_resizable"]}},"deny-set-shadow":{"identifier":"deny-set-shadow","description":"Denies the set_shadow command without any pre-configured scope.","commands":{"allow":[],"deny":["set_shadow"]}},"deny-set-size":{"identifier":"deny-set-size","description":"Denies the set_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size"]}},"deny-set-size-constraints":{"identifier":"deny-set-size-constraints","description":"Denies the set_size_constraints command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size_constraints"]}},"deny-set-skip-taskbar":{"identifier":"deny-set-skip-taskbar","description":"Denies the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_skip_taskbar"]}},"deny-set-theme":{"identifier":"deny-set-theme","description":"Denies the set_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_theme"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-title-bar-style":{"identifier":"deny-set-title-bar-style","description":"Denies the set_title_bar_style command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title_bar_style"]}},"deny-set-visible-on-all-workspaces":{"identifier":"deny-set-visible-on-all-workspaces","description":"Denies the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible_on_all_workspaces"]}},"deny-show":{"identifier":"deny-show","description":"Denies the show command without any pre-configured scope.","commands":{"allow":[],"deny":["show"]}},"deny-start-dragging":{"identifier":"deny-start-dragging","description":"Denies the start_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_dragging"]}},"deny-start-resize-dragging":{"identifier":"deny-start-resize-dragging","description":"Denies the start_resize_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_resize_dragging"]}},"deny-theme":{"identifier":"deny-theme","description":"Denies the theme command without any pre-configured scope.","commands":{"allow":[],"deny":["theme"]}},"deny-title":{"identifier":"deny-title","description":"Denies the title command without any pre-configured scope.","commands":{"allow":[],"deny":["title"]}},"deny-toggle-maximize":{"identifier":"deny-toggle-maximize","description":"Denies the toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["toggle_maximize"]}},"deny-unmaximize":{"identifier":"deny-unmaximize","description":"Denies the unmaximize command without any pre-configured scope.","commands":{"allow":[],"deny":["unmaximize"]}},"deny-unminimize":{"identifier":"deny-unminimize","description":"Denies the unminimize command without any pre-configured scope.","commands":{"allow":[],"deny":["unminimize"]}}},"permission_sets":{},"global_scope_schema":null},"dialog":{"default_permission":{"identifier":"default","description":"This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n","permissions":["allow-ask","allow-confirm","allow-message","allow-save","allow-open"]},"permissions":{"allow-ask":{"identifier":"allow-ask","description":"Enables the ask command without any pre-configured scope.","commands":{"allow":["ask"],"deny":[]}},"allow-confirm":{"identifier":"allow-confirm","description":"Enables the confirm command without any pre-configured scope.","commands":{"allow":["confirm"],"deny":[]}},"allow-message":{"identifier":"allow-message","description":"Enables the message command without any pre-configured scope.","commands":{"allow":["message"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-save":{"identifier":"allow-save","description":"Enables the save command without any pre-configured scope.","commands":{"allow":["save"],"deny":[]}},"deny-ask":{"identifier":"deny-ask","description":"Denies the ask command without any pre-configured scope.","commands":{"allow":[],"deny":["ask"]}},"deny-confirm":{"identifier":"deny-confirm","description":"Denies the confirm command without any pre-configured scope.","commands":{"allow":[],"deny":["confirm"]}},"deny-message":{"identifier":"deny-message","description":"Denies the message command without any pre-configured scope.","commands":{"allow":[],"deny":["message"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-save":{"identifier":"deny-save","description":"Denies the save command without any pre-configured scope.","commands":{"allow":[],"deny":["save"]}}},"permission_sets":{},"global_scope_schema":null},"fs":{"default_permission":{"identifier":"default","description":"This set of permissions describes the what kind of\nfile system access the `fs` plugin has enabled or denied by default.\n\n#### Granted Permissions\n\nThis default permission set enables read access to the\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\nAppLog) and all files and sub directories created in it.\nThe location of these directories depends on the operating system,\nwhere the application is run.\n\nIn general these directories need to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\nTherefore, it is also allowed to create all of these folders via\nthe `mkdir` command.\n\n#### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\nOn Windows the webview data folder access is denied.\n\n#### Included permissions within this default permission set:\n","permissions":["create-app-specific-dirs","read-app-specific-dirs-recursive","deny-default"]},"permissions":{"allow-copy-file":{"identifier":"allow-copy-file","description":"Enables the copy_file command without any pre-configured scope.","commands":{"allow":["copy_file"],"deny":[]}},"allow-create":{"identifier":"allow-create","description":"Enables the create command without any pre-configured scope.","commands":{"allow":["create"],"deny":[]}},"allow-exists":{"identifier":"allow-exists","description":"Enables the exists command without any pre-configured scope.","commands":{"allow":["exists"],"deny":[]}},"allow-fstat":{"identifier":"allow-fstat","description":"Enables the fstat command without any pre-configured scope.","commands":{"allow":["fstat"],"deny":[]}},"allow-ftruncate":{"identifier":"allow-ftruncate","description":"Enables the ftruncate command without any pre-configured scope.","commands":{"allow":["ftruncate"],"deny":[]}},"allow-lstat":{"identifier":"allow-lstat","description":"Enables the lstat command without any pre-configured scope.","commands":{"allow":["lstat"],"deny":[]}},"allow-mkdir":{"identifier":"allow-mkdir","description":"Enables the mkdir command without any pre-configured scope.","commands":{"allow":["mkdir"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-read":{"identifier":"allow-read","description":"Enables the read command without any pre-configured scope.","commands":{"allow":["read"],"deny":[]}},"allow-read-dir":{"identifier":"allow-read-dir","description":"Enables the read_dir command without any pre-configured scope.","commands":{"allow":["read_dir"],"deny":[]}},"allow-read-file":{"identifier":"allow-read-file","description":"Enables the read_file command without any pre-configured scope.","commands":{"allow":["read_file"],"deny":[]}},"allow-read-text-file":{"identifier":"allow-read-text-file","description":"Enables the read_text_file command without any pre-configured scope.","commands":{"allow":["read_text_file"],"deny":[]}},"allow-read-text-file-lines":{"identifier":"allow-read-text-file-lines","description":"Enables the read_text_file_lines command without any pre-configured scope.","commands":{"allow":["read_text_file_lines","read_text_file_lines_next"],"deny":[]}},"allow-read-text-file-lines-next":{"identifier":"allow-read-text-file-lines-next","description":"Enables the read_text_file_lines_next command without any pre-configured scope.","commands":{"allow":["read_text_file_lines_next"],"deny":[]}},"allow-remove":{"identifier":"allow-remove","description":"Enables the remove command without any pre-configured scope.","commands":{"allow":["remove"],"deny":[]}},"allow-rename":{"identifier":"allow-rename","description":"Enables the rename command without any pre-configured scope.","commands":{"allow":["rename"],"deny":[]}},"allow-seek":{"identifier":"allow-seek","description":"Enables the seek command without any pre-configured scope.","commands":{"allow":["seek"],"deny":[]}},"allow-size":{"identifier":"allow-size","description":"Enables the size command without any pre-configured scope.","commands":{"allow":["size"],"deny":[]}},"allow-stat":{"identifier":"allow-stat","description":"Enables the stat command without any pre-configured scope.","commands":{"allow":["stat"],"deny":[]}},"allow-truncate":{"identifier":"allow-truncate","description":"Enables the truncate command without any pre-configured scope.","commands":{"allow":["truncate"],"deny":[]}},"allow-unwatch":{"identifier":"allow-unwatch","description":"Enables the unwatch command without any pre-configured scope.","commands":{"allow":["unwatch"],"deny":[]}},"allow-watch":{"identifier":"allow-watch","description":"Enables the watch command without any pre-configured scope.","commands":{"allow":["watch"],"deny":[]}},"allow-write":{"identifier":"allow-write","description":"Enables the write command without any pre-configured scope.","commands":{"allow":["write"],"deny":[]}},"allow-write-file":{"identifier":"allow-write-file","description":"Enables the write_file command without any pre-configured scope.","commands":{"allow":["write_file","open","write"],"deny":[]}},"allow-write-text-file":{"identifier":"allow-write-text-file","description":"Enables the write_text_file command without any pre-configured scope.","commands":{"allow":["write_text_file"],"deny":[]}},"create-app-specific-dirs":{"identifier":"create-app-specific-dirs","description":"This permissions allows to create the application specific directories.\n","commands":{"allow":["mkdir","scope-app-index"],"deny":[]}},"deny-copy-file":{"identifier":"deny-copy-file","description":"Denies the copy_file command without any pre-configured scope.","commands":{"allow":[],"deny":["copy_file"]}},"deny-create":{"identifier":"deny-create","description":"Denies the create command without any pre-configured scope.","commands":{"allow":[],"deny":["create"]}},"deny-exists":{"identifier":"deny-exists","description":"Denies the exists command without any pre-configured scope.","commands":{"allow":[],"deny":["exists"]}},"deny-fstat":{"identifier":"deny-fstat","description":"Denies the fstat command without any pre-configured scope.","commands":{"allow":[],"deny":["fstat"]}},"deny-ftruncate":{"identifier":"deny-ftruncate","description":"Denies the ftruncate command without any pre-configured scope.","commands":{"allow":[],"deny":["ftruncate"]}},"deny-lstat":{"identifier":"deny-lstat","description":"Denies the lstat command without any pre-configured scope.","commands":{"allow":[],"deny":["lstat"]}},"deny-mkdir":{"identifier":"deny-mkdir","description":"Denies the mkdir command without any pre-configured scope.","commands":{"allow":[],"deny":["mkdir"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-read":{"identifier":"deny-read","description":"Denies the read command without any pre-configured scope.","commands":{"allow":[],"deny":["read"]}},"deny-read-dir":{"identifier":"deny-read-dir","description":"Denies the read_dir command without any pre-configured scope.","commands":{"allow":[],"deny":["read_dir"]}},"deny-read-file":{"identifier":"deny-read-file","description":"Denies the read_file command without any pre-configured scope.","commands":{"allow":[],"deny":["read_file"]}},"deny-read-text-file":{"identifier":"deny-read-text-file","description":"Denies the read_text_file command without any pre-configured scope.","commands":{"allow":[],"deny":["read_text_file"]}},"deny-read-text-file-lines":{"identifier":"deny-read-text-file-lines","description":"Denies the read_text_file_lines command without any pre-configured scope.","commands":{"allow":[],"deny":["read_text_file_lines"]}},"deny-read-text-file-lines-next":{"identifier":"deny-read-text-file-lines-next","description":"Denies the read_text_file_lines_next command without any pre-configured scope.","commands":{"allow":[],"deny":["read_text_file_lines_next"]}},"deny-remove":{"identifier":"deny-remove","description":"Denies the remove command without any pre-configured scope.","commands":{"allow":[],"deny":["remove"]}},"deny-rename":{"identifier":"deny-rename","description":"Denies the rename command without any pre-configured scope.","commands":{"allow":[],"deny":["rename"]}},"deny-seek":{"identifier":"deny-seek","description":"Denies the seek command without any pre-configured scope.","commands":{"allow":[],"deny":["seek"]}},"deny-size":{"identifier":"deny-size","description":"Denies the size command without any pre-configured scope.","commands":{"allow":[],"deny":["size"]}},"deny-stat":{"identifier":"deny-stat","description":"Denies the stat command without any pre-configured scope.","commands":{"allow":[],"deny":["stat"]}},"deny-truncate":{"identifier":"deny-truncate","description":"Denies the truncate command without any pre-configured scope.","commands":{"allow":[],"deny":["truncate"]}},"deny-unwatch":{"identifier":"deny-unwatch","description":"Denies the unwatch command without any pre-configured scope.","commands":{"allow":[],"deny":["unwatch"]}},"deny-watch":{"identifier":"deny-watch","description":"Denies the watch command without any pre-configured scope.","commands":{"allow":[],"deny":["watch"]}},"deny-webview-data-linux":{"identifier":"deny-webview-data-linux","description":"This denies read access to the\n`$APPLOCALDATA` folder on linux as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.","commands":{"allow":[],"deny":[]}},"deny-webview-data-windows":{"identifier":"deny-webview-data-windows","description":"This denies read access to the\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.","commands":{"allow":[],"deny":[]}},"deny-write":{"identifier":"deny-write","description":"Denies the write command without any pre-configured scope.","commands":{"allow":[],"deny":["write"]}},"deny-write-file":{"identifier":"deny-write-file","description":"Denies the write_file command without any pre-configured scope.","commands":{"allow":[],"deny":["write_file"]}},"deny-write-text-file":{"identifier":"deny-write-text-file","description":"Denies the write_text_file command without any pre-configured scope.","commands":{"allow":[],"deny":["write_text_file"]}},"read-all":{"identifier":"read-all","description":"This enables all read related commands without any pre-configured accessible paths.","commands":{"allow":["read_dir","read_file","read","open","read_text_file","read_text_file_lines","read_text_file_lines_next","seek","stat","lstat","fstat","exists","watch","unwatch"],"deny":[]}},"read-app-specific-dirs-recursive":{"identifier":"read-app-specific-dirs-recursive","description":"This permission allows recursive read functionality on the application\nspecific base directories. \n","commands":{"allow":["read_dir","read_file","read_text_file","read_text_file_lines","read_text_file_lines_next","exists","scope-app-recursive"],"deny":[]}},"read-dirs":{"identifier":"read-dirs","description":"This enables directory read and file metadata related commands without any pre-configured accessible paths.","commands":{"allow":["read_dir","stat","lstat","fstat","exists"],"deny":[]}},"read-files":{"identifier":"read-files","description":"This enables file read related commands without any pre-configured accessible paths.","commands":{"allow":["read_file","read","open","read_text_file","read_text_file_lines","read_text_file_lines_next","seek","stat","lstat","fstat","exists"],"deny":[]}},"read-meta":{"identifier":"read-meta","description":"This enables all index or metadata related commands without any pre-configured accessible paths.","commands":{"allow":["read_dir","stat","lstat","fstat","exists","size"],"deny":[]}},"scope":{"identifier":"scope","description":"An empty permission you can use to modify the global scope.","commands":{"allow":[],"deny":[]}},"scope-app":{"identifier":"scope-app","description":"This scope permits access to all files and list content of top level directories in the application folders.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPCONFIG/*"},{"path":"$APPDATA"},{"path":"$APPDATA/*"},{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/*"},{"path":"$APPCACHE"},{"path":"$APPCACHE/*"},{"path":"$APPLOG"},{"path":"$APPLOG/*"}]}},"scope-app-index":{"identifier":"scope-app-index","description":"This scope permits to list all files and folders in the application directories.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPDATA"},{"path":"$APPLOCALDATA"},{"path":"$APPCACHE"},{"path":"$APPLOG"}]}},"scope-app-recursive":{"identifier":"scope-app-recursive","description":"This scope permits recursive access to the complete application folders, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPCONFIG/**"},{"path":"$APPDATA"},{"path":"$APPDATA/**"},{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/**"},{"path":"$APPCACHE"},{"path":"$APPCACHE/**"},{"path":"$APPLOG"},{"path":"$APPLOG/**"}]}},"scope-appcache":{"identifier":"scope-appcache","description":"This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCACHE"},{"path":"$APPCACHE/*"}]}},"scope-appcache-index":{"identifier":"scope-appcache-index","description":"This scope permits to list all files and folders in the `$APPCACHE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCACHE"}]}},"scope-appcache-recursive":{"identifier":"scope-appcache-recursive","description":"This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCACHE"},{"path":"$APPCACHE/**"}]}},"scope-appconfig":{"identifier":"scope-appconfig","description":"This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPCONFIG/*"}]}},"scope-appconfig-index":{"identifier":"scope-appconfig-index","description":"This scope permits to list all files and folders in the `$APPCONFIG`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"}]}},"scope-appconfig-recursive":{"identifier":"scope-appconfig-recursive","description":"This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPCONFIG/**"}]}},"scope-appdata":{"identifier":"scope-appdata","description":"This scope permits access to all files and list content of top level directories in the `$APPDATA` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPDATA"},{"path":"$APPDATA/*"}]}},"scope-appdata-index":{"identifier":"scope-appdata-index","description":"This scope permits to list all files and folders in the `$APPDATA`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPDATA"}]}},"scope-appdata-recursive":{"identifier":"scope-appdata-recursive","description":"This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPDATA"},{"path":"$APPDATA/**"}]}},"scope-applocaldata":{"identifier":"scope-applocaldata","description":"This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/*"}]}},"scope-applocaldata-index":{"identifier":"scope-applocaldata-index","description":"This scope permits to list all files and folders in the `$APPLOCALDATA`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOCALDATA"}]}},"scope-applocaldata-recursive":{"identifier":"scope-applocaldata-recursive","description":"This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/**"}]}},"scope-applog":{"identifier":"scope-applog","description":"This scope permits access to all files and list content of top level directories in the `$APPLOG` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOG"},{"path":"$APPLOG/*"}]}},"scope-applog-index":{"identifier":"scope-applog-index","description":"This scope permits to list all files and folders in the `$APPLOG`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOG"}]}},"scope-applog-recursive":{"identifier":"scope-applog-recursive","description":"This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOG"},{"path":"$APPLOG/**"}]}},"scope-audio":{"identifier":"scope-audio","description":"This scope permits access to all files and list content of top level directories in the `$AUDIO` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$AUDIO"},{"path":"$AUDIO/*"}]}},"scope-audio-index":{"identifier":"scope-audio-index","description":"This scope permits to list all files and folders in the `$AUDIO`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$AUDIO"}]}},"scope-audio-recursive":{"identifier":"scope-audio-recursive","description":"This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$AUDIO"},{"path":"$AUDIO/**"}]}},"scope-cache":{"identifier":"scope-cache","description":"This scope permits access to all files and list content of top level directories in the `$CACHE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CACHE"},{"path":"$CACHE/*"}]}},"scope-cache-index":{"identifier":"scope-cache-index","description":"This scope permits to list all files and folders in the `$CACHE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CACHE"}]}},"scope-cache-recursive":{"identifier":"scope-cache-recursive","description":"This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CACHE"},{"path":"$CACHE/**"}]}},"scope-config":{"identifier":"scope-config","description":"This scope permits access to all files and list content of top level directories in the `$CONFIG` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CONFIG"},{"path":"$CONFIG/*"}]}},"scope-config-index":{"identifier":"scope-config-index","description":"This scope permits to list all files and folders in the `$CONFIG`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CONFIG"}]}},"scope-config-recursive":{"identifier":"scope-config-recursive","description":"This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CONFIG"},{"path":"$CONFIG/**"}]}},"scope-data":{"identifier":"scope-data","description":"This scope permits access to all files and list content of top level directories in the `$DATA` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DATA"},{"path":"$DATA/*"}]}},"scope-data-index":{"identifier":"scope-data-index","description":"This scope permits to list all files and folders in the `$DATA`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DATA"}]}},"scope-data-recursive":{"identifier":"scope-data-recursive","description":"This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DATA"},{"path":"$DATA/**"}]}},"scope-desktop":{"identifier":"scope-desktop","description":"This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DESKTOP"},{"path":"$DESKTOP/*"}]}},"scope-desktop-index":{"identifier":"scope-desktop-index","description":"This scope permits to list all files and folders in the `$DESKTOP`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DESKTOP"}]}},"scope-desktop-recursive":{"identifier":"scope-desktop-recursive","description":"This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DESKTOP"},{"path":"$DESKTOP/**"}]}},"scope-document":{"identifier":"scope-document","description":"This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOCUMENT"},{"path":"$DOCUMENT/*"}]}},"scope-document-index":{"identifier":"scope-document-index","description":"This scope permits to list all files and folders in the `$DOCUMENT`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOCUMENT"}]}},"scope-document-recursive":{"identifier":"scope-document-recursive","description":"This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOCUMENT"},{"path":"$DOCUMENT/**"}]}},"scope-download":{"identifier":"scope-download","description":"This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOWNLOAD"},{"path":"$DOWNLOAD/*"}]}},"scope-download-index":{"identifier":"scope-download-index","description":"This scope permits to list all files and folders in the `$DOWNLOAD`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOWNLOAD"}]}},"scope-download-recursive":{"identifier":"scope-download-recursive","description":"This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOWNLOAD"},{"path":"$DOWNLOAD/**"}]}},"scope-exe":{"identifier":"scope-exe","description":"This scope permits access to all files and list content of top level directories in the `$EXE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$EXE"},{"path":"$EXE/*"}]}},"scope-exe-index":{"identifier":"scope-exe-index","description":"This scope permits to list all files and folders in the `$EXE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$EXE"}]}},"scope-exe-recursive":{"identifier":"scope-exe-recursive","description":"This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$EXE"},{"path":"$EXE/**"}]}},"scope-font":{"identifier":"scope-font","description":"This scope permits access to all files and list content of top level directories in the `$FONT` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$FONT"},{"path":"$FONT/*"}]}},"scope-font-index":{"identifier":"scope-font-index","description":"This scope permits to list all files and folders in the `$FONT`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$FONT"}]}},"scope-font-recursive":{"identifier":"scope-font-recursive","description":"This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$FONT"},{"path":"$FONT/**"}]}},"scope-home":{"identifier":"scope-home","description":"This scope permits access to all files and list content of top level directories in the `$HOME` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$HOME"},{"path":"$HOME/*"}]}},"scope-home-index":{"identifier":"scope-home-index","description":"This scope permits to list all files and folders in the `$HOME`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$HOME"}]}},"scope-home-recursive":{"identifier":"scope-home-recursive","description":"This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$HOME"},{"path":"$HOME/**"}]}},"scope-localdata":{"identifier":"scope-localdata","description":"This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOCALDATA"},{"path":"$LOCALDATA/*"}]}},"scope-localdata-index":{"identifier":"scope-localdata-index","description":"This scope permits to list all files and folders in the `$LOCALDATA`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOCALDATA"}]}},"scope-localdata-recursive":{"identifier":"scope-localdata-recursive","description":"This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOCALDATA"},{"path":"$LOCALDATA/**"}]}},"scope-log":{"identifier":"scope-log","description":"This scope permits access to all files and list content of top level directories in the `$LOG` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOG"},{"path":"$LOG/*"}]}},"scope-log-index":{"identifier":"scope-log-index","description":"This scope permits to list all files and folders in the `$LOG`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOG"}]}},"scope-log-recursive":{"identifier":"scope-log-recursive","description":"This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOG"},{"path":"$LOG/**"}]}},"scope-picture":{"identifier":"scope-picture","description":"This scope permits access to all files and list content of top level directories in the `$PICTURE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PICTURE"},{"path":"$PICTURE/*"}]}},"scope-picture-index":{"identifier":"scope-picture-index","description":"This scope permits to list all files and folders in the `$PICTURE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PICTURE"}]}},"scope-picture-recursive":{"identifier":"scope-picture-recursive","description":"This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PICTURE"},{"path":"$PICTURE/**"}]}},"scope-public":{"identifier":"scope-public","description":"This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PUBLIC"},{"path":"$PUBLIC/*"}]}},"scope-public-index":{"identifier":"scope-public-index","description":"This scope permits to list all files and folders in the `$PUBLIC`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PUBLIC"}]}},"scope-public-recursive":{"identifier":"scope-public-recursive","description":"This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PUBLIC"},{"path":"$PUBLIC/**"}]}},"scope-resource":{"identifier":"scope-resource","description":"This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RESOURCE"},{"path":"$RESOURCE/*"}]}},"scope-resource-index":{"identifier":"scope-resource-index","description":"This scope permits to list all files and folders in the `$RESOURCE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RESOURCE"}]}},"scope-resource-recursive":{"identifier":"scope-resource-recursive","description":"This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RESOURCE"},{"path":"$RESOURCE/**"}]}},"scope-runtime":{"identifier":"scope-runtime","description":"This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RUNTIME"},{"path":"$RUNTIME/*"}]}},"scope-runtime-index":{"identifier":"scope-runtime-index","description":"This scope permits to list all files and folders in the `$RUNTIME`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RUNTIME"}]}},"scope-runtime-recursive":{"identifier":"scope-runtime-recursive","description":"This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RUNTIME"},{"path":"$RUNTIME/**"}]}},"scope-temp":{"identifier":"scope-temp","description":"This scope permits access to all files and list content of top level directories in the `$TEMP` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMP"},{"path":"$TEMP/*"}]}},"scope-temp-index":{"identifier":"scope-temp-index","description":"This scope permits to list all files and folders in the `$TEMP`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMP"}]}},"scope-temp-recursive":{"identifier":"scope-temp-recursive","description":"This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMP"},{"path":"$TEMP/**"}]}},"scope-template":{"identifier":"scope-template","description":"This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMPLATE"},{"path":"$TEMPLATE/*"}]}},"scope-template-index":{"identifier":"scope-template-index","description":"This scope permits to list all files and folders in the `$TEMPLATE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMPLATE"}]}},"scope-template-recursive":{"identifier":"scope-template-recursive","description":"This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMPLATE"},{"path":"$TEMPLATE/**"}]}},"scope-video":{"identifier":"scope-video","description":"This scope permits access to all files and list content of top level directories in the `$VIDEO` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$VIDEO"},{"path":"$VIDEO/*"}]}},"scope-video-index":{"identifier":"scope-video-index","description":"This scope permits to list all files and folders in the `$VIDEO`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$VIDEO"}]}},"scope-video-recursive":{"identifier":"scope-video-recursive","description":"This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$VIDEO"},{"path":"$VIDEO/**"}]}},"write-all":{"identifier":"write-all","description":"This enables all write related commands without any pre-configured accessible paths.","commands":{"allow":["mkdir","create","copy_file","remove","rename","truncate","ftruncate","write","write_file","write_text_file"],"deny":[]}},"write-files":{"identifier":"write-files","description":"This enables all file write related commands without any pre-configured accessible paths.","commands":{"allow":["create","copy_file","remove","rename","truncate","ftruncate","write","write_file","write_text_file"],"deny":[]}}},"permission_sets":{"allow-app-meta":{"identifier":"allow-app-meta","description":"This allows non-recursive read access to metadata of the application folders, including file listing and statistics.","permissions":["read-meta","scope-app-index"]},"allow-app-meta-recursive":{"identifier":"allow-app-meta-recursive","description":"This allows full recursive read access to metadata of the application folders, including file listing and statistics.","permissions":["read-meta","scope-app-recursive"]},"allow-app-read":{"identifier":"allow-app-read","description":"This allows non-recursive read access to the application folders.","permissions":["read-all","scope-app"]},"allow-app-read-recursive":{"identifier":"allow-app-read-recursive","description":"This allows full recursive read access to the complete application folders, files and subdirectories.","permissions":["read-all","scope-app-recursive"]},"allow-app-write":{"identifier":"allow-app-write","description":"This allows non-recursive write access to the application folders.","permissions":["write-all","scope-app"]},"allow-app-write-recursive":{"identifier":"allow-app-write-recursive","description":"This allows full recursive write access to the complete application folders, files and subdirectories.","permissions":["write-all","scope-app-recursive"]},"allow-appcache-meta":{"identifier":"allow-appcache-meta","description":"This allows non-recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.","permissions":["read-meta","scope-appcache-index"]},"allow-appcache-meta-recursive":{"identifier":"allow-appcache-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.","permissions":["read-meta","scope-appcache-recursive"]},"allow-appcache-read":{"identifier":"allow-appcache-read","description":"This allows non-recursive read access to the `$APPCACHE` folder.","permissions":["read-all","scope-appcache"]},"allow-appcache-read-recursive":{"identifier":"allow-appcache-read-recursive","description":"This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.","permissions":["read-all","scope-appcache-recursive"]},"allow-appcache-write":{"identifier":"allow-appcache-write","description":"This allows non-recursive write access to the `$APPCACHE` folder.","permissions":["write-all","scope-appcache"]},"allow-appcache-write-recursive":{"identifier":"allow-appcache-write-recursive","description":"This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.","permissions":["write-all","scope-appcache-recursive"]},"allow-appconfig-meta":{"identifier":"allow-appconfig-meta","description":"This allows non-recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.","permissions":["read-meta","scope-appconfig-index"]},"allow-appconfig-meta-recursive":{"identifier":"allow-appconfig-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.","permissions":["read-meta","scope-appconfig-recursive"]},"allow-appconfig-read":{"identifier":"allow-appconfig-read","description":"This allows non-recursive read access to the `$APPCONFIG` folder.","permissions":["read-all","scope-appconfig"]},"allow-appconfig-read-recursive":{"identifier":"allow-appconfig-read-recursive","description":"This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.","permissions":["read-all","scope-appconfig-recursive"]},"allow-appconfig-write":{"identifier":"allow-appconfig-write","description":"This allows non-recursive write access to the `$APPCONFIG` folder.","permissions":["write-all","scope-appconfig"]},"allow-appconfig-write-recursive":{"identifier":"allow-appconfig-write-recursive","description":"This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.","permissions":["write-all","scope-appconfig-recursive"]},"allow-appdata-meta":{"identifier":"allow-appdata-meta","description":"This allows non-recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-appdata-index"]},"allow-appdata-meta-recursive":{"identifier":"allow-appdata-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-appdata-recursive"]},"allow-appdata-read":{"identifier":"allow-appdata-read","description":"This allows non-recursive read access to the `$APPDATA` folder.","permissions":["read-all","scope-appdata"]},"allow-appdata-read-recursive":{"identifier":"allow-appdata-read-recursive","description":"This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.","permissions":["read-all","scope-appdata-recursive"]},"allow-appdata-write":{"identifier":"allow-appdata-write","description":"This allows non-recursive write access to the `$APPDATA` folder.","permissions":["write-all","scope-appdata"]},"allow-appdata-write-recursive":{"identifier":"allow-appdata-write-recursive","description":"This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.","permissions":["write-all","scope-appdata-recursive"]},"allow-applocaldata-meta":{"identifier":"allow-applocaldata-meta","description":"This allows non-recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-applocaldata-index"]},"allow-applocaldata-meta-recursive":{"identifier":"allow-applocaldata-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-applocaldata-recursive"]},"allow-applocaldata-read":{"identifier":"allow-applocaldata-read","description":"This allows non-recursive read access to the `$APPLOCALDATA` folder.","permissions":["read-all","scope-applocaldata"]},"allow-applocaldata-read-recursive":{"identifier":"allow-applocaldata-read-recursive","description":"This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.","permissions":["read-all","scope-applocaldata-recursive"]},"allow-applocaldata-write":{"identifier":"allow-applocaldata-write","description":"This allows non-recursive write access to the `$APPLOCALDATA` folder.","permissions":["write-all","scope-applocaldata"]},"allow-applocaldata-write-recursive":{"identifier":"allow-applocaldata-write-recursive","description":"This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.","permissions":["write-all","scope-applocaldata-recursive"]},"allow-applog-meta":{"identifier":"allow-applog-meta","description":"This allows non-recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.","permissions":["read-meta","scope-applog-index"]},"allow-applog-meta-recursive":{"identifier":"allow-applog-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.","permissions":["read-meta","scope-applog-recursive"]},"allow-applog-read":{"identifier":"allow-applog-read","description":"This allows non-recursive read access to the `$APPLOG` folder.","permissions":["read-all","scope-applog"]},"allow-applog-read-recursive":{"identifier":"allow-applog-read-recursive","description":"This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.","permissions":["read-all","scope-applog-recursive"]},"allow-applog-write":{"identifier":"allow-applog-write","description":"This allows non-recursive write access to the `$APPLOG` folder.","permissions":["write-all","scope-applog"]},"allow-applog-write-recursive":{"identifier":"allow-applog-write-recursive","description":"This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.","permissions":["write-all","scope-applog-recursive"]},"allow-audio-meta":{"identifier":"allow-audio-meta","description":"This allows non-recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.","permissions":["read-meta","scope-audio-index"]},"allow-audio-meta-recursive":{"identifier":"allow-audio-meta-recursive","description":"This allows full recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.","permissions":["read-meta","scope-audio-recursive"]},"allow-audio-read":{"identifier":"allow-audio-read","description":"This allows non-recursive read access to the `$AUDIO` folder.","permissions":["read-all","scope-audio"]},"allow-audio-read-recursive":{"identifier":"allow-audio-read-recursive","description":"This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.","permissions":["read-all","scope-audio-recursive"]},"allow-audio-write":{"identifier":"allow-audio-write","description":"This allows non-recursive write access to the `$AUDIO` folder.","permissions":["write-all","scope-audio"]},"allow-audio-write-recursive":{"identifier":"allow-audio-write-recursive","description":"This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.","permissions":["write-all","scope-audio-recursive"]},"allow-cache-meta":{"identifier":"allow-cache-meta","description":"This allows non-recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.","permissions":["read-meta","scope-cache-index"]},"allow-cache-meta-recursive":{"identifier":"allow-cache-meta-recursive","description":"This allows full recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.","permissions":["read-meta","scope-cache-recursive"]},"allow-cache-read":{"identifier":"allow-cache-read","description":"This allows non-recursive read access to the `$CACHE` folder.","permissions":["read-all","scope-cache"]},"allow-cache-read-recursive":{"identifier":"allow-cache-read-recursive","description":"This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.","permissions":["read-all","scope-cache-recursive"]},"allow-cache-write":{"identifier":"allow-cache-write","description":"This allows non-recursive write access to the `$CACHE` folder.","permissions":["write-all","scope-cache"]},"allow-cache-write-recursive":{"identifier":"allow-cache-write-recursive","description":"This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.","permissions":["write-all","scope-cache-recursive"]},"allow-config-meta":{"identifier":"allow-config-meta","description":"This allows non-recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.","permissions":["read-meta","scope-config-index"]},"allow-config-meta-recursive":{"identifier":"allow-config-meta-recursive","description":"This allows full recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.","permissions":["read-meta","scope-config-recursive"]},"allow-config-read":{"identifier":"allow-config-read","description":"This allows non-recursive read access to the `$CONFIG` folder.","permissions":["read-all","scope-config"]},"allow-config-read-recursive":{"identifier":"allow-config-read-recursive","description":"This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.","permissions":["read-all","scope-config-recursive"]},"allow-config-write":{"identifier":"allow-config-write","description":"This allows non-recursive write access to the `$CONFIG` folder.","permissions":["write-all","scope-config"]},"allow-config-write-recursive":{"identifier":"allow-config-write-recursive","description":"This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.","permissions":["write-all","scope-config-recursive"]},"allow-data-meta":{"identifier":"allow-data-meta","description":"This allows non-recursive read access to metadata of the `$DATA` folder, including file listing and statistics.","permissions":["read-meta","scope-data-index"]},"allow-data-meta-recursive":{"identifier":"allow-data-meta-recursive","description":"This allows full recursive read access to metadata of the `$DATA` folder, including file listing and statistics.","permissions":["read-meta","scope-data-recursive"]},"allow-data-read":{"identifier":"allow-data-read","description":"This allows non-recursive read access to the `$DATA` folder.","permissions":["read-all","scope-data"]},"allow-data-read-recursive":{"identifier":"allow-data-read-recursive","description":"This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.","permissions":["read-all","scope-data-recursive"]},"allow-data-write":{"identifier":"allow-data-write","description":"This allows non-recursive write access to the `$DATA` folder.","permissions":["write-all","scope-data"]},"allow-data-write-recursive":{"identifier":"allow-data-write-recursive","description":"This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.","permissions":["write-all","scope-data-recursive"]},"allow-desktop-meta":{"identifier":"allow-desktop-meta","description":"This allows non-recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.","permissions":["read-meta","scope-desktop-index"]},"allow-desktop-meta-recursive":{"identifier":"allow-desktop-meta-recursive","description":"This allows full recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.","permissions":["read-meta","scope-desktop-recursive"]},"allow-desktop-read":{"identifier":"allow-desktop-read","description":"This allows non-recursive read access to the `$DESKTOP` folder.","permissions":["read-all","scope-desktop"]},"allow-desktop-read-recursive":{"identifier":"allow-desktop-read-recursive","description":"This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.","permissions":["read-all","scope-desktop-recursive"]},"allow-desktop-write":{"identifier":"allow-desktop-write","description":"This allows non-recursive write access to the `$DESKTOP` folder.","permissions":["write-all","scope-desktop"]},"allow-desktop-write-recursive":{"identifier":"allow-desktop-write-recursive","description":"This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.","permissions":["write-all","scope-desktop-recursive"]},"allow-document-meta":{"identifier":"allow-document-meta","description":"This allows non-recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.","permissions":["read-meta","scope-document-index"]},"allow-document-meta-recursive":{"identifier":"allow-document-meta-recursive","description":"This allows full recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.","permissions":["read-meta","scope-document-recursive"]},"allow-document-read":{"identifier":"allow-document-read","description":"This allows non-recursive read access to the `$DOCUMENT` folder.","permissions":["read-all","scope-document"]},"allow-document-read-recursive":{"identifier":"allow-document-read-recursive","description":"This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.","permissions":["read-all","scope-document-recursive"]},"allow-document-write":{"identifier":"allow-document-write","description":"This allows non-recursive write access to the `$DOCUMENT` folder.","permissions":["write-all","scope-document"]},"allow-document-write-recursive":{"identifier":"allow-document-write-recursive","description":"This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.","permissions":["write-all","scope-document-recursive"]},"allow-download-meta":{"identifier":"allow-download-meta","description":"This allows non-recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.","permissions":["read-meta","scope-download-index"]},"allow-download-meta-recursive":{"identifier":"allow-download-meta-recursive","description":"This allows full recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.","permissions":["read-meta","scope-download-recursive"]},"allow-download-read":{"identifier":"allow-download-read","description":"This allows non-recursive read access to the `$DOWNLOAD` folder.","permissions":["read-all","scope-download"]},"allow-download-read-recursive":{"identifier":"allow-download-read-recursive","description":"This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.","permissions":["read-all","scope-download-recursive"]},"allow-download-write":{"identifier":"allow-download-write","description":"This allows non-recursive write access to the `$DOWNLOAD` folder.","permissions":["write-all","scope-download"]},"allow-download-write-recursive":{"identifier":"allow-download-write-recursive","description":"This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.","permissions":["write-all","scope-download-recursive"]},"allow-exe-meta":{"identifier":"allow-exe-meta","description":"This allows non-recursive read access to metadata of the `$EXE` folder, including file listing and statistics.","permissions":["read-meta","scope-exe-index"]},"allow-exe-meta-recursive":{"identifier":"allow-exe-meta-recursive","description":"This allows full recursive read access to metadata of the `$EXE` folder, including file listing and statistics.","permissions":["read-meta","scope-exe-recursive"]},"allow-exe-read":{"identifier":"allow-exe-read","description":"This allows non-recursive read access to the `$EXE` folder.","permissions":["read-all","scope-exe"]},"allow-exe-read-recursive":{"identifier":"allow-exe-read-recursive","description":"This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.","permissions":["read-all","scope-exe-recursive"]},"allow-exe-write":{"identifier":"allow-exe-write","description":"This allows non-recursive write access to the `$EXE` folder.","permissions":["write-all","scope-exe"]},"allow-exe-write-recursive":{"identifier":"allow-exe-write-recursive","description":"This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.","permissions":["write-all","scope-exe-recursive"]},"allow-font-meta":{"identifier":"allow-font-meta","description":"This allows non-recursive read access to metadata of the `$FONT` folder, including file listing and statistics.","permissions":["read-meta","scope-font-index"]},"allow-font-meta-recursive":{"identifier":"allow-font-meta-recursive","description":"This allows full recursive read access to metadata of the `$FONT` folder, including file listing and statistics.","permissions":["read-meta","scope-font-recursive"]},"allow-font-read":{"identifier":"allow-font-read","description":"This allows non-recursive read access to the `$FONT` folder.","permissions":["read-all","scope-font"]},"allow-font-read-recursive":{"identifier":"allow-font-read-recursive","description":"This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.","permissions":["read-all","scope-font-recursive"]},"allow-font-write":{"identifier":"allow-font-write","description":"This allows non-recursive write access to the `$FONT` folder.","permissions":["write-all","scope-font"]},"allow-font-write-recursive":{"identifier":"allow-font-write-recursive","description":"This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.","permissions":["write-all","scope-font-recursive"]},"allow-home-meta":{"identifier":"allow-home-meta","description":"This allows non-recursive read access to metadata of the `$HOME` folder, including file listing and statistics.","permissions":["read-meta","scope-home-index"]},"allow-home-meta-recursive":{"identifier":"allow-home-meta-recursive","description":"This allows full recursive read access to metadata of the `$HOME` folder, including file listing and statistics.","permissions":["read-meta","scope-home-recursive"]},"allow-home-read":{"identifier":"allow-home-read","description":"This allows non-recursive read access to the `$HOME` folder.","permissions":["read-all","scope-home"]},"allow-home-read-recursive":{"identifier":"allow-home-read-recursive","description":"This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.","permissions":["read-all","scope-home-recursive"]},"allow-home-write":{"identifier":"allow-home-write","description":"This allows non-recursive write access to the `$HOME` folder.","permissions":["write-all","scope-home"]},"allow-home-write-recursive":{"identifier":"allow-home-write-recursive","description":"This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.","permissions":["write-all","scope-home-recursive"]},"allow-localdata-meta":{"identifier":"allow-localdata-meta","description":"This allows non-recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-localdata-index"]},"allow-localdata-meta-recursive":{"identifier":"allow-localdata-meta-recursive","description":"This allows full recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-localdata-recursive"]},"allow-localdata-read":{"identifier":"allow-localdata-read","description":"This allows non-recursive read access to the `$LOCALDATA` folder.","permissions":["read-all","scope-localdata"]},"allow-localdata-read-recursive":{"identifier":"allow-localdata-read-recursive","description":"This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.","permissions":["read-all","scope-localdata-recursive"]},"allow-localdata-write":{"identifier":"allow-localdata-write","description":"This allows non-recursive write access to the `$LOCALDATA` folder.","permissions":["write-all","scope-localdata"]},"allow-localdata-write-recursive":{"identifier":"allow-localdata-write-recursive","description":"This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.","permissions":["write-all","scope-localdata-recursive"]},"allow-log-meta":{"identifier":"allow-log-meta","description":"This allows non-recursive read access to metadata of the `$LOG` folder, including file listing and statistics.","permissions":["read-meta","scope-log-index"]},"allow-log-meta-recursive":{"identifier":"allow-log-meta-recursive","description":"This allows full recursive read access to metadata of the `$LOG` folder, including file listing and statistics.","permissions":["read-meta","scope-log-recursive"]},"allow-log-read":{"identifier":"allow-log-read","description":"This allows non-recursive read access to the `$LOG` folder.","permissions":["read-all","scope-log"]},"allow-log-read-recursive":{"identifier":"allow-log-read-recursive","description":"This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.","permissions":["read-all","scope-log-recursive"]},"allow-log-write":{"identifier":"allow-log-write","description":"This allows non-recursive write access to the `$LOG` folder.","permissions":["write-all","scope-log"]},"allow-log-write-recursive":{"identifier":"allow-log-write-recursive","description":"This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.","permissions":["write-all","scope-log-recursive"]},"allow-picture-meta":{"identifier":"allow-picture-meta","description":"This allows non-recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.","permissions":["read-meta","scope-picture-index"]},"allow-picture-meta-recursive":{"identifier":"allow-picture-meta-recursive","description":"This allows full recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.","permissions":["read-meta","scope-picture-recursive"]},"allow-picture-read":{"identifier":"allow-picture-read","description":"This allows non-recursive read access to the `$PICTURE` folder.","permissions":["read-all","scope-picture"]},"allow-picture-read-recursive":{"identifier":"allow-picture-read-recursive","description":"This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.","permissions":["read-all","scope-picture-recursive"]},"allow-picture-write":{"identifier":"allow-picture-write","description":"This allows non-recursive write access to the `$PICTURE` folder.","permissions":["write-all","scope-picture"]},"allow-picture-write-recursive":{"identifier":"allow-picture-write-recursive","description":"This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.","permissions":["write-all","scope-picture-recursive"]},"allow-public-meta":{"identifier":"allow-public-meta","description":"This allows non-recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.","permissions":["read-meta","scope-public-index"]},"allow-public-meta-recursive":{"identifier":"allow-public-meta-recursive","description":"This allows full recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.","permissions":["read-meta","scope-public-recursive"]},"allow-public-read":{"identifier":"allow-public-read","description":"This allows non-recursive read access to the `$PUBLIC` folder.","permissions":["read-all","scope-public"]},"allow-public-read-recursive":{"identifier":"allow-public-read-recursive","description":"This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.","permissions":["read-all","scope-public-recursive"]},"allow-public-write":{"identifier":"allow-public-write","description":"This allows non-recursive write access to the `$PUBLIC` folder.","permissions":["write-all","scope-public"]},"allow-public-write-recursive":{"identifier":"allow-public-write-recursive","description":"This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.","permissions":["write-all","scope-public-recursive"]},"allow-resource-meta":{"identifier":"allow-resource-meta","description":"This allows non-recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.","permissions":["read-meta","scope-resource-index"]},"allow-resource-meta-recursive":{"identifier":"allow-resource-meta-recursive","description":"This allows full recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.","permissions":["read-meta","scope-resource-recursive"]},"allow-resource-read":{"identifier":"allow-resource-read","description":"This allows non-recursive read access to the `$RESOURCE` folder.","permissions":["read-all","scope-resource"]},"allow-resource-read-recursive":{"identifier":"allow-resource-read-recursive","description":"This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.","permissions":["read-all","scope-resource-recursive"]},"allow-resource-write":{"identifier":"allow-resource-write","description":"This allows non-recursive write access to the `$RESOURCE` folder.","permissions":["write-all","scope-resource"]},"allow-resource-write-recursive":{"identifier":"allow-resource-write-recursive","description":"This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.","permissions":["write-all","scope-resource-recursive"]},"allow-runtime-meta":{"identifier":"allow-runtime-meta","description":"This allows non-recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.","permissions":["read-meta","scope-runtime-index"]},"allow-runtime-meta-recursive":{"identifier":"allow-runtime-meta-recursive","description":"This allows full recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.","permissions":["read-meta","scope-runtime-recursive"]},"allow-runtime-read":{"identifier":"allow-runtime-read","description":"This allows non-recursive read access to the `$RUNTIME` folder.","permissions":["read-all","scope-runtime"]},"allow-runtime-read-recursive":{"identifier":"allow-runtime-read-recursive","description":"This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.","permissions":["read-all","scope-runtime-recursive"]},"allow-runtime-write":{"identifier":"allow-runtime-write","description":"This allows non-recursive write access to the `$RUNTIME` folder.","permissions":["write-all","scope-runtime"]},"allow-runtime-write-recursive":{"identifier":"allow-runtime-write-recursive","description":"This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.","permissions":["write-all","scope-runtime-recursive"]},"allow-temp-meta":{"identifier":"allow-temp-meta","description":"This allows non-recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.","permissions":["read-meta","scope-temp-index"]},"allow-temp-meta-recursive":{"identifier":"allow-temp-meta-recursive","description":"This allows full recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.","permissions":["read-meta","scope-temp-recursive"]},"allow-temp-read":{"identifier":"allow-temp-read","description":"This allows non-recursive read access to the `$TEMP` folder.","permissions":["read-all","scope-temp"]},"allow-temp-read-recursive":{"identifier":"allow-temp-read-recursive","description":"This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.","permissions":["read-all","scope-temp-recursive"]},"allow-temp-write":{"identifier":"allow-temp-write","description":"This allows non-recursive write access to the `$TEMP` folder.","permissions":["write-all","scope-temp"]},"allow-temp-write-recursive":{"identifier":"allow-temp-write-recursive","description":"This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.","permissions":["write-all","scope-temp-recursive"]},"allow-template-meta":{"identifier":"allow-template-meta","description":"This allows non-recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.","permissions":["read-meta","scope-template-index"]},"allow-template-meta-recursive":{"identifier":"allow-template-meta-recursive","description":"This allows full recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.","permissions":["read-meta","scope-template-recursive"]},"allow-template-read":{"identifier":"allow-template-read","description":"This allows non-recursive read access to the `$TEMPLATE` folder.","permissions":["read-all","scope-template"]},"allow-template-read-recursive":{"identifier":"allow-template-read-recursive","description":"This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.","permissions":["read-all","scope-template-recursive"]},"allow-template-write":{"identifier":"allow-template-write","description":"This allows non-recursive write access to the `$TEMPLATE` folder.","permissions":["write-all","scope-template"]},"allow-template-write-recursive":{"identifier":"allow-template-write-recursive","description":"This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.","permissions":["write-all","scope-template-recursive"]},"allow-video-meta":{"identifier":"allow-video-meta","description":"This allows non-recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.","permissions":["read-meta","scope-video-index"]},"allow-video-meta-recursive":{"identifier":"allow-video-meta-recursive","description":"This allows full recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.","permissions":["read-meta","scope-video-recursive"]},"allow-video-read":{"identifier":"allow-video-read","description":"This allows non-recursive read access to the `$VIDEO` folder.","permissions":["read-all","scope-video"]},"allow-video-read-recursive":{"identifier":"allow-video-read-recursive","description":"This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.","permissions":["read-all","scope-video-recursive"]},"allow-video-write":{"identifier":"allow-video-write","description":"This allows non-recursive write access to the `$VIDEO` folder.","permissions":["write-all","scope-video"]},"allow-video-write-recursive":{"identifier":"allow-video-write-recursive","description":"This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.","permissions":["write-all","scope-video-recursive"]},"deny-default":{"identifier":"deny-default","description":"This denies access to dangerous Tauri relevant files and folders by default.","permissions":["deny-webview-data-linux","deny-webview-data-windows"]}},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"description":"A path that can be accessed by the webview when using the fs APIs. FS scope path pattern.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"},{"properties":{"path":{"description":"A path that can be accessed by the webview when using the fs APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"}},"required":["path"],"type":"object"}],"description":"FS scope entry.","title":"FsScopeEntry"}},"log":{"default_permission":{"identifier":"default","description":"Allows the log command","permissions":["allow-log"]},"permissions":{"allow-log":{"identifier":"allow-log","description":"Enables the log command without any pre-configured scope.","commands":{"allow":["log"],"deny":[]}},"deny-log":{"identifier":"deny-log","description":"Denies the log command without any pre-configured scope.","commands":{"allow":[],"deny":["log"]}}},"permission_sets":{},"global_scope_schema":null},"opener":{"default_permission":{"identifier":"default","description":"This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer","permissions":["allow-open-url","allow-reveal-item-in-dir","allow-default-urls"]},"permissions":{"allow-default-urls":{"identifier":"allow-default-urls","description":"This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"url":"mailto:*"},{"url":"tel:*"},{"url":"http://*"},{"url":"https://*"}]}},"allow-open-path":{"identifier":"allow-open-path","description":"Enables the open_path command without any pre-configured scope.","commands":{"allow":["open_path"],"deny":[]}},"allow-open-url":{"identifier":"allow-open-url","description":"Enables the open_url command without any pre-configured scope.","commands":{"allow":["open_url"],"deny":[]}},"allow-reveal-item-in-dir":{"identifier":"allow-reveal-item-in-dir","description":"Enables the reveal_item_in_dir command without any pre-configured scope.","commands":{"allow":["reveal_item_in_dir"],"deny":[]}},"deny-open-path":{"identifier":"deny-open-path","description":"Denies the open_path command without any pre-configured scope.","commands":{"allow":[],"deny":["open_path"]}},"deny-open-url":{"identifier":"deny-open-url","description":"Denies the open_url command without any pre-configured scope.","commands":{"allow":[],"deny":["open_url"]}},"deny-reveal-item-in-dir":{"identifier":"deny-reveal-item-in-dir","description":"Denies the reveal_item_in_dir command without any pre-configured scope.","commands":{"allow":[],"deny":["reveal_item_in_dir"]}}},"permission_sets":{},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"properties":{"app":{"allOf":[{"$ref":"#/definitions/Application"}],"description":"An application to open this url with, for example: firefox."},"url":{"description":"A URL that can be opened by the webview when using the Opener APIs.\n\nWildcards can be used following the UNIX glob pattern.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"","type":"string"}},"required":["url"],"type":"object"},{"properties":{"app":{"allOf":[{"$ref":"#/definitions/Application"}],"description":"An application to open this path with, for example: xdg-open."},"path":{"description":"A path that can be opened by the webview when using the Opener APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"}},"required":["path"],"type":"object"}],"definitions":{"Application":{"anyOf":[{"description":"Open in default application.","type":"null"},{"description":"If true, allow open with any application.","type":"boolean"},{"description":"Allow specific application to open with.","type":"string"}],"description":"Opener scope application."}},"description":"Opener scope entry.","title":"OpenerScopeEntry"}},"os":{"default_permission":{"identifier":"default","description":"This permission set configures which\noperating system information are available\nto gather from the frontend.\n\n#### Granted Permissions\n\nAll information except the host name are available.\n\n","permissions":["allow-arch","allow-exe-extension","allow-family","allow-locale","allow-os-type","allow-platform","allow-version"]},"permissions":{"allow-arch":{"identifier":"allow-arch","description":"Enables the arch command without any pre-configured scope.","commands":{"allow":["arch"],"deny":[]}},"allow-exe-extension":{"identifier":"allow-exe-extension","description":"Enables the exe_extension command without any pre-configured scope.","commands":{"allow":["exe_extension"],"deny":[]}},"allow-family":{"identifier":"allow-family","description":"Enables the family command without any pre-configured scope.","commands":{"allow":["family"],"deny":[]}},"allow-hostname":{"identifier":"allow-hostname","description":"Enables the hostname command without any pre-configured scope.","commands":{"allow":["hostname"],"deny":[]}},"allow-locale":{"identifier":"allow-locale","description":"Enables the locale command without any pre-configured scope.","commands":{"allow":["locale"],"deny":[]}},"allow-os-type":{"identifier":"allow-os-type","description":"Enables the os_type command without any pre-configured scope.","commands":{"allow":["os_type"],"deny":[]}},"allow-platform":{"identifier":"allow-platform","description":"Enables the platform command without any pre-configured scope.","commands":{"allow":["platform"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-arch":{"identifier":"deny-arch","description":"Denies the arch command without any pre-configured scope.","commands":{"allow":[],"deny":["arch"]}},"deny-exe-extension":{"identifier":"deny-exe-extension","description":"Denies the exe_extension command without any pre-configured scope.","commands":{"allow":[],"deny":["exe_extension"]}},"deny-family":{"identifier":"deny-family","description":"Denies the family command without any pre-configured scope.","commands":{"allow":[],"deny":["family"]}},"deny-hostname":{"identifier":"deny-hostname","description":"Denies the hostname command without any pre-configured scope.","commands":{"allow":[],"deny":["hostname"]}},"deny-locale":{"identifier":"deny-locale","description":"Denies the locale command without any pre-configured scope.","commands":{"allow":[],"deny":["locale"]}},"deny-os-type":{"identifier":"deny-os-type","description":"Denies the os_type command without any pre-configured scope.","commands":{"allow":[],"deny":["os_type"]}},"deny-platform":{"identifier":"deny-platform","description":"Denies the platform command without any pre-configured scope.","commands":{"allow":[],"deny":["platform"]}},"deny-version":{"identifier":"deny-version","description":"Denies the version command without any pre-configured scope.","commands":{"allow":[],"deny":["version"]}}},"permission_sets":{},"global_scope_schema":null},"shell":{"default_permission":{"identifier":"default","description":"This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality without any specific\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n","permissions":["allow-open"]},"permissions":{"allow-execute":{"identifier":"allow-execute","description":"Enables the execute command without any pre-configured scope.","commands":{"allow":["execute"],"deny":[]}},"allow-kill":{"identifier":"allow-kill","description":"Enables the kill command without any pre-configured scope.","commands":{"allow":["kill"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-spawn":{"identifier":"allow-spawn","description":"Enables the spawn command without any pre-configured scope.","commands":{"allow":["spawn"],"deny":[]}},"allow-stdin-write":{"identifier":"allow-stdin-write","description":"Enables the stdin_write command without any pre-configured scope.","commands":{"allow":["stdin_write"],"deny":[]}},"deny-execute":{"identifier":"deny-execute","description":"Denies the execute command without any pre-configured scope.","commands":{"allow":[],"deny":["execute"]}},"deny-kill":{"identifier":"deny-kill","description":"Denies the kill command without any pre-configured scope.","commands":{"allow":[],"deny":["kill"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-spawn":{"identifier":"deny-spawn","description":"Denies the spawn command without any pre-configured scope.","commands":{"allow":[],"deny":["spawn"]}},"deny-stdin-write":{"identifier":"deny-stdin-write","description":"Denies the stdin_write command without any pre-configured scope.","commands":{"allow":[],"deny":["stdin_write"]}}},"permission_sets":{},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"additionalProperties":false,"properties":{"args":{"allOf":[{"$ref":"#/definitions/ShellScopeEntryAllowedArgs"}],"description":"The allowed arguments for the command execution."},"cmd":{"description":"The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"},"name":{"description":"The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.","type":"string"}},"required":["cmd","name"],"type":"object"},{"additionalProperties":false,"properties":{"args":{"allOf":[{"$ref":"#/definitions/ShellScopeEntryAllowedArgs"}],"description":"The allowed arguments for the command execution."},"name":{"description":"The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.","type":"string"},"sidecar":{"description":"If this command is a sidecar command.","type":"boolean"}},"required":["name","sidecar"],"type":"object"}],"definitions":{"ShellScopeEntryAllowedArg":{"anyOf":[{"description":"A non-configurable argument that is passed to the command in the order it was specified.","type":"string"},{"additionalProperties":false,"description":"A variable that is set while calling the command from the webview API.","properties":{"raw":{"default":false,"description":"Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime.\n\nThis means the regex will not match on the entire string by default, which might be exploited if your regex allow unexpected input to be considered valid. When using this option, make sure your regex is correct.","type":"boolean"},"validator":{"description":"[regex] validator to require passed values to conform to an expected input.\n\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\n\nThe regex string is by default surrounded by `^...$` to match the full string. For example the `https?://\\w+` regex would be registered as `^https?://\\w+$`.\n\n[regex]: ","type":"string"}},"required":["validator"],"type":"object"}],"description":"A command argument allowed to be executed by the webview API."},"ShellScopeEntryAllowedArgs":{"anyOf":[{"description":"Use a simple boolean to allow all or disable all arguments to this command configuration.","type":"boolean"},{"description":"A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.","items":{"$ref":"#/definitions/ShellScopeEntryAllowedArg"},"type":"array"}],"description":"A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration."}},"description":"Shell scope entry.","title":"ShellScopeEntry"}},"updater":{"default_permission":{"identifier":"default","description":"This permission set configures which kind of\nupdater functions are exposed to the frontend.\n\n#### Granted Permissions\n\nThe full workflow from checking for updates to installing them\nis enabled.\n\n","permissions":["allow-check","allow-download","allow-install","allow-download-and-install"]},"permissions":{"allow-check":{"identifier":"allow-check","description":"Enables the check command without any pre-configured scope.","commands":{"allow":["check"],"deny":[]}},"allow-download":{"identifier":"allow-download","description":"Enables the download command without any pre-configured scope.","commands":{"allow":["download"],"deny":[]}},"allow-download-and-install":{"identifier":"allow-download-and-install","description":"Enables the download_and_install command without any pre-configured scope.","commands":{"allow":["download_and_install"],"deny":[]}},"allow-install":{"identifier":"allow-install","description":"Enables the install command without any pre-configured scope.","commands":{"allow":["install"],"deny":[]}},"deny-check":{"identifier":"deny-check","description":"Denies the check command without any pre-configured scope.","commands":{"allow":[],"deny":["check"]}},"deny-download":{"identifier":"deny-download","description":"Denies the download command without any pre-configured scope.","commands":{"allow":[],"deny":["download"]}},"deny-download-and-install":{"identifier":"deny-download-and-install","description":"Denies the download_and_install command without any pre-configured scope.","commands":{"allow":[],"deny":["download_and_install"]}},"deny-install":{"identifier":"deny-install","description":"Denies the install command without any pre-configured scope.","commands":{"allow":[],"deny":["install"]}}},"permission_sets":{},"global_scope_schema":null},"window-state":{"default_permission":{"identifier":"default","description":"This permission set configures what kind of\noperations are available from the window state plugin.\n\n#### Granted Permissions\n\nAll operations are enabled by default.\n\n","permissions":["allow-filename","allow-restore-state","allow-save-window-state"]},"permissions":{"allow-filename":{"identifier":"allow-filename","description":"Enables the filename command without any pre-configured scope.","commands":{"allow":["filename"],"deny":[]}},"allow-restore-state":{"identifier":"allow-restore-state","description":"Enables the restore_state command without any pre-configured scope.","commands":{"allow":["restore_state"],"deny":[]}},"allow-save-window-state":{"identifier":"allow-save-window-state","description":"Enables the save_window_state command without any pre-configured scope.","commands":{"allow":["save_window_state"],"deny":[]}},"deny-filename":{"identifier":"deny-filename","description":"Denies the filename command without any pre-configured scope.","commands":{"allow":[],"deny":["filename"]}},"deny-restore-state":{"identifier":"deny-restore-state","description":"Denies the restore_state command without any pre-configured scope.","commands":{"allow":[],"deny":["restore_state"]}},"deny-save-window-state":{"identifier":"deny-save-window-state","description":"Denies the save_window_state command without any pre-configured scope.","commands":{"allow":[],"deny":["save_window_state"]}}},"permission_sets":{},"global_scope_schema":null},"yaak-license":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin","permissions":["allow-check","allow-activate"]},"permissions":{"allow-activate":{"identifier":"allow-activate","description":"Enables the activate command without any pre-configured scope.","commands":{"allow":["activate"],"deny":[]}},"allow-check":{"identifier":"allow-check","description":"Enables the check command without any pre-configured scope.","commands":{"allow":["check"],"deny":[]}},"deny-activate":{"identifier":"deny-activate","description":"Denies the activate command without any pre-configured scope.","commands":{"allow":[],"deny":["activate"]}},"deny-check":{"identifier":"deny-check","description":"Denies the check command without any pre-configured scope.","commands":{"allow":[],"deny":["check"]}}},"permission_sets":{},"global_scope_schema":null},"yaak-sync":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin","permissions":["allow-calculate","allow-calculate-fs","allow-apply","allow-watch"]},"permissions":{"allow-apply":{"identifier":"allow-apply","description":"Enables the apply command without any pre-configured scope.","commands":{"allow":["apply"],"deny":[]}},"allow-calculate":{"identifier":"allow-calculate","description":"Enables the calculate command without any pre-configured scope.","commands":{"allow":["calculate"],"deny":[]}},"allow-calculate-fs":{"identifier":"allow-calculate-fs","description":"Enables the calculate_fs command without any pre-configured scope.","commands":{"allow":["calculate_fs"],"deny":[]}},"allow-watch":{"identifier":"allow-watch","description":"Enables the watch command without any pre-configured scope.","commands":{"allow":["watch"],"deny":[]}},"deny-apply":{"identifier":"deny-apply","description":"Denies the apply command without any pre-configured scope.","commands":{"allow":[],"deny":["apply"]}},"deny-calculate":{"identifier":"deny-calculate","description":"Denies the calculate command without any pre-configured scope.","commands":{"allow":[],"deny":["calculate"]}},"deny-calculate-fs":{"identifier":"deny-calculate-fs","description":"Denies the calculate_fs command without any pre-configured scope.","commands":{"allow":[],"deny":["calculate_fs"]}},"deny-watch":{"identifier":"deny-watch","description":"Denies the watch command without any pre-configured scope.","commands":{"allow":[],"deny":["watch"]}}},"permission_sets":{},"global_scope_schema":null},"yaak-ws":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin","permissions":["allow-close","allow-connect","allow-delete-connection","allow-delete-connections","allow-delete-request","allow-list-connections","allow-list-events","allow-list-requests","allow-send","allow-upsert-request"]},"permissions":{"allow-cancel":{"identifier":"allow-cancel","description":"Enables the cancel command without any pre-configured scope.","commands":{"allow":["cancel"],"deny":[]}},"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"allow-connect":{"identifier":"allow-connect","description":"Enables the connect command without any pre-configured scope.","commands":{"allow":["connect"],"deny":[]}},"allow-delete-connection":{"identifier":"allow-delete-connection","description":"Enables the delete_connection command without any pre-configured scope.","commands":{"allow":["delete_connection"],"deny":[]}},"allow-delete-connections":{"identifier":"allow-delete-connections","description":"Enables the delete_connections command without any pre-configured scope.","commands":{"allow":["delete_connections"],"deny":[]}},"allow-delete-request":{"identifier":"allow-delete-request","description":"Enables the delete_request command without any pre-configured scope.","commands":{"allow":["delete_request"],"deny":[]}},"allow-list-connections":{"identifier":"allow-list-connections","description":"Enables the list_connections command without any pre-configured scope.","commands":{"allow":["list_connections"],"deny":[]}},"allow-list-events":{"identifier":"allow-list-events","description":"Enables the list_events command without any pre-configured scope.","commands":{"allow":["list_events"],"deny":[]}},"allow-list-requests":{"identifier":"allow-list-requests","description":"Enables the list_requests command without any pre-configured scope.","commands":{"allow":["list_requests"],"deny":[]}},"allow-list-websocket-connections":{"identifier":"allow-list-websocket-connections","description":"Enables the list_websocket_connections command without any pre-configured scope.","commands":{"allow":["list_websocket_connections"],"deny":[]}},"allow-list-websocket-requests":{"identifier":"allow-list-websocket-requests","description":"Enables the list_websocket_requests command without any pre-configured scope.","commands":{"allow":["list_websocket_requests"],"deny":[]}},"allow-send":{"identifier":"allow-send","description":"Enables the send command without any pre-configured scope.","commands":{"allow":["send"],"deny":[]}},"allow-upsert-request":{"identifier":"allow-upsert-request","description":"Enables the upsert_request command without any pre-configured scope.","commands":{"allow":["upsert_request"],"deny":[]}},"allow-upsert-websocket-request":{"identifier":"allow-upsert-websocket-request","description":"Enables the upsert_websocket_request command without any pre-configured scope.","commands":{"allow":["upsert_websocket_request"],"deny":[]}},"deny-cancel":{"identifier":"deny-cancel","description":"Denies the cancel command without any pre-configured scope.","commands":{"allow":[],"deny":["cancel"]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}},"deny-connect":{"identifier":"deny-connect","description":"Denies the connect command without any pre-configured scope.","commands":{"allow":[],"deny":["connect"]}},"deny-delete-connection":{"identifier":"deny-delete-connection","description":"Denies the delete_connection command without any pre-configured scope.","commands":{"allow":[],"deny":["delete_connection"]}},"deny-delete-connections":{"identifier":"deny-delete-connections","description":"Denies the delete_connections command without any pre-configured scope.","commands":{"allow":[],"deny":["delete_connections"]}},"deny-delete-request":{"identifier":"deny-delete-request","description":"Denies the delete_request command without any pre-configured scope.","commands":{"allow":[],"deny":["delete_request"]}},"deny-list-connections":{"identifier":"deny-list-connections","description":"Denies the list_connections command without any pre-configured scope.","commands":{"allow":[],"deny":["list_connections"]}},"deny-list-events":{"identifier":"deny-list-events","description":"Denies the list_events command without any pre-configured scope.","commands":{"allow":[],"deny":["list_events"]}},"deny-list-requests":{"identifier":"deny-list-requests","description":"Denies the list_requests command without any pre-configured scope.","commands":{"allow":[],"deny":["list_requests"]}},"deny-list-websocket-connections":{"identifier":"deny-list-websocket-connections","description":"Denies the list_websocket_connections command without any pre-configured scope.","commands":{"allow":[],"deny":["list_websocket_connections"]}},"deny-list-websocket-requests":{"identifier":"deny-list-websocket-requests","description":"Denies the list_websocket_requests command without any pre-configured scope.","commands":{"allow":[],"deny":["list_websocket_requests"]}},"deny-send":{"identifier":"deny-send","description":"Denies the send command without any pre-configured scope.","commands":{"allow":[],"deny":["send"]}},"deny-upsert-request":{"identifier":"deny-upsert-request","description":"Denies the upsert_request command without any pre-configured scope.","commands":{"allow":[],"deny":["upsert_request"]}},"deny-upsert-websocket-request":{"identifier":"deny-upsert-websocket-request","description":"Denies the upsert_websocket_request command without any pre-configured scope.","commands":{"allow":[],"deny":["upsert_websocket_request"]}}},"permission_sets":{},"global_scope_schema":null}} \ No newline at end of file diff --git a/src-tauri/gen/schemas/capabilities.json b/src-tauri/gen/schemas/capabilities.json index 3d1e4781..914c7a03 100644 --- a/src-tauri/gen/schemas/capabilities.json +++ b/src-tauri/gen/schemas/capabilities.json @@ -1 +1 @@ -{"main":{"identifier":"main","description":"Main permissions","local":true,"windows":["*"],"permissions":["core:event:allow-emit","core:event:allow-listen","core:event:allow-unlisten","os:allow-os-type","clipboard-manager:allow-clear","clipboard-manager:allow-write-text","clipboard-manager:allow-read-text","dialog:allow-open","dialog:allow-save","fs:allow-read-dir","fs:allow-read-file","fs:allow-read-text-file",{"identifier":"fs:scope","allow":[{"path":"$APPDATA"},{"path":"$APPDATA/**"}]},"clipboard-manager:allow-read-text","clipboard-manager:allow-write-text","core:webview:allow-set-webview-zoom","core:window:allow-close","core:window:allow-internal-toggle-maximize","core:window:allow-is-fullscreen","core:window:allow-is-maximized","core:window:allow-maximize","core:window:allow-minimize","core:window:allow-set-decorations","core:window:allow-set-title","core:window:allow-show","core:window:allow-start-dragging","core:window:allow-theme","core:window:allow-unmaximize","opener:allow-default-urls","opener:allow-open-path","opener:allow-open-url","opener:allow-reveal-item-in-dir","shell:allow-open","yaak-license:default","yaak-sync:default"]}} \ No newline at end of file +{"main":{"identifier":"main","description":"Main permissions","local":true,"windows":["*"],"permissions":["core:event:allow-emit","core:event:allow-listen","core:event:allow-unlisten","os:allow-os-type","clipboard-manager:allow-clear","clipboard-manager:allow-write-text","clipboard-manager:allow-read-text","dialog:allow-open","dialog:allow-save","fs:allow-read-dir","fs:allow-read-file","fs:allow-read-text-file",{"identifier":"fs:scope","allow":[{"path":"$APPDATA"},{"path":"$APPDATA/**"}]},"clipboard-manager:allow-read-text","clipboard-manager:allow-write-text","core:webview:allow-set-webview-zoom","core:window:allow-close","core:window:allow-internal-toggle-maximize","core:window:allow-is-fullscreen","core:window:allow-is-maximized","core:window:allow-maximize","core:window:allow-minimize","core:window:allow-set-decorations","core:window:allow-set-title","core:window:allow-show","core:window:allow-start-dragging","core:window:allow-theme","core:window:allow-unmaximize","opener:allow-default-urls","opener:allow-open-path","opener:allow-open-url","opener:allow-reveal-item-in-dir","shell:allow-open","yaak-license:default","yaak-sync:default","yaak-ws:default"]}} \ No newline at end of file diff --git a/src-tauri/gen/schemas/desktop-schema.json b/src-tauri/gen/schemas/desktop-schema.json index 0b678935..77a978ac 100644 --- a/src-tauri/gen/schemas/desktop-schema.json +++ b/src-tauri/gen/schemas/desktop-schema.json @@ -5481,6 +5481,151 @@ "description": "Denies the watch command without any pre-configured scope.", "type": "string", "const": "yaak-sync:deny-watch" + }, + { + "description": "Default permissions for the plugin", + "type": "string", + "const": "yaak-ws:default" + }, + { + "description": "Enables the cancel command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-cancel" + }, + { + "description": "Enables the close command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-close" + }, + { + "description": "Enables the connect command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-connect" + }, + { + "description": "Enables the delete_connection command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-delete-connection" + }, + { + "description": "Enables the delete_connections command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-delete-connections" + }, + { + "description": "Enables the delete_request command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-delete-request" + }, + { + "description": "Enables the list_connections command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-list-connections" + }, + { + "description": "Enables the list_events command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-list-events" + }, + { + "description": "Enables the list_requests command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-list-requests" + }, + { + "description": "Enables the list_websocket_connections command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-list-websocket-connections" + }, + { + "description": "Enables the list_websocket_requests command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-list-websocket-requests" + }, + { + "description": "Enables the send command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-send" + }, + { + "description": "Enables the upsert_request command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-upsert-request" + }, + { + "description": "Enables the upsert_websocket_request command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-upsert-websocket-request" + }, + { + "description": "Denies the cancel command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-cancel" + }, + { + "description": "Denies the close command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-close" + }, + { + "description": "Denies the connect command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-connect" + }, + { + "description": "Denies the delete_connection command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-delete-connection" + }, + { + "description": "Denies the delete_connections command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-delete-connections" + }, + { + "description": "Denies the delete_request command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-delete-request" + }, + { + "description": "Denies the list_connections command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-list-connections" + }, + { + "description": "Denies the list_events command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-list-events" + }, + { + "description": "Denies the list_requests command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-list-requests" + }, + { + "description": "Denies the list_websocket_connections command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-list-websocket-connections" + }, + { + "description": "Denies the list_websocket_requests command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-list-websocket-requests" + }, + { + "description": "Denies the send command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-send" + }, + { + "description": "Denies the upsert_request command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-upsert-request" + }, + { + "description": "Denies the upsert_websocket_request command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-upsert-websocket-request" } ] }, diff --git a/src-tauri/gen/schemas/macOS-schema.json b/src-tauri/gen/schemas/macOS-schema.json index 0b678935..77a978ac 100644 --- a/src-tauri/gen/schemas/macOS-schema.json +++ b/src-tauri/gen/schemas/macOS-schema.json @@ -5481,6 +5481,151 @@ "description": "Denies the watch command without any pre-configured scope.", "type": "string", "const": "yaak-sync:deny-watch" + }, + { + "description": "Default permissions for the plugin", + "type": "string", + "const": "yaak-ws:default" + }, + { + "description": "Enables the cancel command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-cancel" + }, + { + "description": "Enables the close command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-close" + }, + { + "description": "Enables the connect command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-connect" + }, + { + "description": "Enables the delete_connection command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-delete-connection" + }, + { + "description": "Enables the delete_connections command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-delete-connections" + }, + { + "description": "Enables the delete_request command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-delete-request" + }, + { + "description": "Enables the list_connections command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-list-connections" + }, + { + "description": "Enables the list_events command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-list-events" + }, + { + "description": "Enables the list_requests command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-list-requests" + }, + { + "description": "Enables the list_websocket_connections command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-list-websocket-connections" + }, + { + "description": "Enables the list_websocket_requests command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-list-websocket-requests" + }, + { + "description": "Enables the send command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-send" + }, + { + "description": "Enables the upsert_request command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-upsert-request" + }, + { + "description": "Enables the upsert_websocket_request command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:allow-upsert-websocket-request" + }, + { + "description": "Denies the cancel command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-cancel" + }, + { + "description": "Denies the close command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-close" + }, + { + "description": "Denies the connect command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-connect" + }, + { + "description": "Denies the delete_connection command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-delete-connection" + }, + { + "description": "Denies the delete_connections command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-delete-connections" + }, + { + "description": "Denies the delete_request command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-delete-request" + }, + { + "description": "Denies the list_connections command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-list-connections" + }, + { + "description": "Denies the list_events command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-list-events" + }, + { + "description": "Denies the list_requests command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-list-requests" + }, + { + "description": "Denies the list_websocket_connections command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-list-websocket-connections" + }, + { + "description": "Denies the list_websocket_requests command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-list-websocket-requests" + }, + { + "description": "Denies the send command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-send" + }, + { + "description": "Denies the upsert_request command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-upsert-request" + }, + { + "description": "Denies the upsert_websocket_request command without any pre-configured scope.", + "type": "string", + "const": "yaak-ws:deny-upsert-websocket-request" } ] }, diff --git a/src-tauri/migrations/20250128155623_websockets.sql b/src-tauri/migrations/20250128155623_websockets.sql new file mode 100644 index 00000000..d3e03ac2 --- /dev/null +++ b/src-tauri/migrations/20250128155623_websockets.sql @@ -0,0 +1,66 @@ +CREATE TABLE websocket_requests +( + id TEXT NOT NULL + PRIMARY KEY, + model TEXT DEFAULT 'websocket_request' NOT NULL, + workspace_id TEXT NOT NULL + REFERENCES workspaces + ON DELETE CASCADE, + folder_id TEXT + REFERENCES folders + ON DELETE CASCADE, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, + updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, + deleted_at DATETIME, + authentication TEXT DEFAULT '{}' NOT NULL, + authentication_type TEXT, + description TEXT NOT NULL, + name TEXT NOT NULL, + url TEXT NOT NULL, + headers TEXT NOT NULL, + message TEXT NOT NULL, + sort_priority REAL NOT NULL, + url_parameters TEXT DEFAULT '[]' NOT NULL +); + +CREATE TABLE websocket_connections +( + id TEXT NOT NULL + PRIMARY KEY, + model TEXT DEFAULT 'websocket_connection' NOT NULL, + workspace_id TEXT NOT NULL + REFERENCES workspaces + ON DELETE CASCADE, + request_id TEXT NOT NULL + REFERENCES websocket_requests + ON DELETE CASCADE, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, + updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, + url TEXT NOT NULL, + state TEXT NOT NULL, + status INTEGER DEFAULT -1 NOT NULL, + error TEXT NULL, + elapsed INTEGER DEFAULT 0 NOT NULL, + headers TEXT DEFAULT '{}' NOT NULL +); + +CREATE TABLE websocket_events +( + id TEXT NOT NULL + PRIMARY KEY, + model TEXT DEFAULT 'websocket_event' NOT NULL, + workspace_id TEXT NOT NULL + REFERENCES workspaces + ON DELETE CASCADE, + request_id TEXT NOT NULL + REFERENCES websocket_requests + ON DELETE CASCADE, + connection_id TEXT NOT NULL + REFERENCES websocket_connections + ON DELETE CASCADE, + created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')) NOT NULL, + updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')) NOT NULL, + is_server BOOLEAN NOT NULL, + message_type TEXT NOT NULL, + message BLOB NOT NULL +); diff --git a/src-tauri/src/analytics.rs b/src-tauri/src/analytics.rs index a3e8ff0b..fb2378a3 100644 --- a/src-tauri/src/analytics.rs +++ b/src-tauri/src/analytics.rs @@ -42,6 +42,9 @@ pub enum AnalyticsResource { Sidebar, Tab, Theme, + WebsocketConnection, + WebsocketEvent, + WebsocketRequest, Workspace, } diff --git a/src-tauri/src/http_request.rs b/src-tauri/src/http_request.rs index ad6ffae1..4ff1944d 100644 --- a/src-tauri/src/http_request.rs +++ b/src-tauri/src/http_request.rs @@ -1,6 +1,5 @@ use crate::render::render_http_request; use crate::response_err; -use crate::template_callback::PluginTemplateCallback; use http::header::{ACCEPT, USER_AGENT}; use http::{HeaderMap, HeaderName, HeaderValue, Uri}; use log::{debug, error, warn}; @@ -8,8 +7,9 @@ use mime_guess::Mime; use reqwest::redirect::Policy; use reqwest::{multipart, Proxy, Url}; use reqwest::{Method, Response}; +use rustls::crypto::ring; use rustls::ClientConfig; -use rustls_platform_verifier::ConfigVerifierExt; +use rustls_platform_verifier::BuilderVerifierExt; use serde_json::Value; use std::collections::BTreeMap; use std::path::PathBuf; @@ -34,6 +34,7 @@ use yaak_plugins::events::{ CallHttpAuthenticationRequest, HttpHeader, RenderPurpose, WindowContext, }; use yaak_plugins::manager::PluginManager; +use yaak_plugins::template_callback::PluginTemplateCallback; pub async fn send_http_request( window: &WebviewWindow, @@ -86,11 +87,15 @@ pub async fn send_http_request( if workspace.setting_validate_certificates { // Use platform-native verifier to validate certificates - client_builder = - client_builder.use_preconfigured_tls(ClientConfig::with_platform_verifier()) + let arc_crypto_provider = Arc::new(ring::default_provider()); + let config = ClientConfig::builder_with_provider(arc_crypto_provider) + .with_safe_default_protocol_versions() + .unwrap() + .with_platform_verifier() + .with_no_client_auth(); + client_builder = client_builder.use_preconfigured_tls(config) } else { - // Use rustls to skip validation because rustls_platform_verifier does not have this - // ability + // Use rustls to skip validation because rustls_platform_verifier does not have this ability client_builder = client_builder .use_rustls_tls() .danger_accept_invalid_hostnames(true) @@ -220,14 +225,14 @@ pub async fn send_http_request( continue; } - let header_name = match HeaderName::from_bytes(h.name.as_bytes()) { + let header_name = match HeaderName::from_str(&h.name) { Ok(n) => n, Err(e) => { error!("Failed to create header name: {}", e); continue; } }; - let header_value = match HeaderValue::from_str(h.value.as_str()) { + let header_value = match HeaderValue::from_str(&h.value) { Ok(n) => n, Err(e) => { error!("Failed to create header value: {}", e); diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 7ab119e0..c31d8689 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -7,7 +7,6 @@ use crate::grpc::metadata_to_map; use crate::http_request::send_http_request; use crate::notifications::YaakNotifier; use crate::render::{render_grpc_request, render_template}; -use crate::template_callback::PluginTemplateCallback; use crate::updates::{UpdateMode, YaakUpdater}; use eventsource_client::{EventParser, SSE}; use log::{debug, error, warn}; @@ -31,29 +30,8 @@ use tokio::sync::Mutex; use tokio::task::block_in_place; use yaak_grpc::manager::{DynamicMessage, GrpcHandle}; use yaak_grpc::{deserialize_message, serialize_message, Code, ServiceDefinition}; -use yaak_models::models::{ - CookieJar, Environment, EnvironmentVariable, Folder, GrpcConnection, GrpcConnectionState, - GrpcEvent, GrpcEventType, GrpcRequest, HttpRequest, HttpResponse, HttpResponseState, KeyValue, - ModelType, Plugin, Settings, Workspace, WorkspaceMeta, -}; -use yaak_models::queries::{ - batch_upsert, cancel_pending_grpc_connections, cancel_pending_responses, - create_default_http_response, delete_all_grpc_connections, - delete_all_grpc_connections_for_workspace, delete_all_http_responses_for_request, - delete_all_http_responses_for_workspace, delete_cookie_jar, delete_environment, delete_folder, - delete_grpc_connection, delete_grpc_request, delete_http_request, delete_http_response, - delete_plugin, delete_workspace, duplicate_folder, duplicate_grpc_request, - duplicate_http_request, ensure_base_environment, generate_model_id, get_base_environment, - 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_or_create_workspace_meta, get_plugin, get_workspace, get_workspace_export_resources, - list_cookie_jars, list_environments, list_folders, list_grpc_connections_for_workspace, - list_grpc_events, list_grpc_requests, list_http_requests, list_http_responses_for_workspace, - list_key_values_raw, list_plugins, 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_plugin, upsert_workspace, - upsert_workspace_meta, BatchUpsertResult, UpdateSource, -}; +use yaak_models::models::{CookieJar, Environment, EnvironmentVariable, Folder, GrpcConnection, GrpcConnectionState, GrpcEvent, GrpcEventType, GrpcRequest, HttpRequest, HttpResponse, HttpResponseState, KeyValue, ModelType, Plugin, Settings, WebsocketRequest, Workspace, WorkspaceMeta}; +use yaak_models::queries::{batch_upsert, cancel_pending_grpc_connections, cancel_pending_responses, create_default_http_response, delete_all_grpc_connections, delete_all_grpc_connections_for_workspace, delete_all_http_responses_for_request, delete_all_http_responses_for_workspace, delete_all_websocket_connections_for_workspace, delete_cookie_jar, delete_environment, delete_folder, delete_grpc_connection, delete_grpc_request, delete_http_request, delete_http_response, delete_plugin, delete_workspace, duplicate_folder, duplicate_grpc_request, duplicate_http_request, ensure_base_environment, generate_model_id, get_base_environment, 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_or_create_workspace_meta, get_plugin, get_workspace, get_workspace_export_resources, list_cookie_jars, list_environments, list_folders, list_grpc_connections_for_workspace, list_grpc_events, list_grpc_requests, list_http_requests, list_http_responses_for_workspace, list_key_values_raw, list_plugins, 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_plugin, upsert_workspace, upsert_workspace_meta, BatchUpsertResult, UpdateSource}; use yaak_plugins::events::{ BootResponse, CallHttpAuthenticationRequest, CallHttpRequestActionRequest, FilterResponse, GetHttpAuthenticationConfigResponse, GetHttpAuthenticationSummaryResponse, @@ -61,6 +39,7 @@ use yaak_plugins::events::{ InternalEventPayload, JsonPrimitive, RenderPurpose, WindowContext, }; use yaak_plugins::manager::PluginManager; +use yaak_plugins::template_callback::PluginTemplateCallback; use yaak_sse::sse::ServerSentEvent; use yaak_templates::format::format_json; use yaak_templates::{Parser, Tokens}; @@ -74,7 +53,6 @@ mod plugin_events; mod render; #[cfg(target_os = "macos")] mod tauri_plugin_mac_window; -mod template_callback; mod updates; mod window; mod window_menu; @@ -920,6 +898,18 @@ async fn cmd_import_data( }) .collect(); + let websocket_requests: Vec = resources + .websocket_requests + .into_iter() + .map(|mut v| { + v.id = maybe_gen_id(v.id.as_str(), ModelType::TypeWebsocketRequest, &mut id_map); + v.workspace_id = + maybe_gen_id(v.workspace_id.as_str(), ModelType::TypeWorkspace, &mut id_map); + v.folder_id = maybe_gen_id_opt(v.folder_id, ModelType::TypeFolder, &mut id_map); + v + }) + .collect(); + let upserted = batch_upsert( &window, workspaces, @@ -927,6 +917,7 @@ async fn cmd_import_data( folders, http_requests, grpc_requests, + websocket_requests, &UpdateSource::Import, ) .await @@ -1611,6 +1602,9 @@ async fn cmd_delete_send_history(workspace_id: &str, window: WebviewWindow) -> R delete_all_grpc_connections_for_workspace(&window, workspace_id, &UpdateSource::Window) .await .map_err(|e| e.to_string())?; + delete_all_websocket_connections_for_workspace(&window, workspace_id, &UpdateSource::Window) + .await + .map_err(|e| e.to_string())?; Ok(()) } @@ -1825,6 +1819,7 @@ pub fn run() { .plugin(yaak_license::init()) .plugin(yaak_models::plugin::Builder::default().build()) .plugin(yaak_plugins::init()) + .plugin(yaak_ws::init()) .plugin(yaak_sync::init()); #[cfg(target_os = "macos")] diff --git a/src-tauri/src/plugin_events.rs b/src-tauri/src/plugin_events.rs index afbeb4bc..2e4ecf2d 100644 --- a/src-tauri/src/plugin_events.rs +++ b/src-tauri/src/plugin_events.rs @@ -1,6 +1,5 @@ use crate::http_request::send_http_request; use crate::render::{render_http_request, render_json_value}; -use crate::template_callback::PluginTemplateCallback; use crate::window::{create_window, CreateWindowConfig}; use crate::{ call_frontend, cookie_jar_from_window, environment_from_window, get_window_from_window_context, @@ -24,6 +23,7 @@ use yaak_plugins::events::{ }; use yaak_plugins::manager::PluginManager; use yaak_plugins::plugin_handle::PluginHandle; +use yaak_plugins::template_callback::PluginTemplateCallback; pub(crate) async fn handle_plugin_event( app_handle: &AppHandle, diff --git a/src-tauri/src/render.rs b/src-tauri/src/render.rs index cce2323c..cd12867a 100644 --- a/src-tauri/src/render.rs +++ b/src-tauri/src/render.rs @@ -1,11 +1,11 @@ -use crate::template_callback::PluginTemplateCallback; -use serde_json::{json, Map, Value}; +use serde_json::Value; use std::collections::{BTreeMap, HashMap}; use yaak_models::models::{ - Environment, EnvironmentVariable, GrpcMetadataEntry, GrpcRequest, HttpRequest, + Environment, GrpcMetadataEntry, GrpcRequest, HttpRequest, HttpRequestHeader, HttpUrlParameter, }; -use yaak_templates::{parse_and_render, TemplateCallback}; +use yaak_models::render::make_vars_hashmap; +use yaak_templates::{parse_and_render, render_json_value_raw, TemplateCallback}; pub async fn render_template( template: &str, @@ -60,11 +60,11 @@ pub async fn render_grpc_request( } } -pub async fn render_http_request( +pub async fn render_http_request( r: &HttpRequest, base_environment: &Environment, environment: Option<&Environment>, - cb: &PluginTemplateCallback, + cb: &T, ) -> HttpRequest { let vars = &make_vars_hashmap(base_environment, environment); @@ -112,20 +112,6 @@ pub async fn render_http_request( apply_path_placeholders(req) } -pub fn make_vars_hashmap( - base_environment: &Environment, - environment: Option<&Environment>, -) -> HashMap { - let mut variables = HashMap::new(); - variables = add_variable_to_map(variables, &base_environment.variables); - - if let Some(e) = environment { - variables = add_variable_to_map(variables, &e.variables); - } - - variables -} - pub async fn render( template: &str, vars: &HashMap, @@ -134,126 +120,6 @@ pub async fn render( parse_and_render(template, vars, cb).await } -fn add_variable_to_map( - m: HashMap, - variables: &Vec, -) -> HashMap { - let mut map = m.clone(); - for variable in variables { - if !variable.enabled || variable.value.is_empty() { - continue; - } - let name = variable.name.as_str(); - let value = variable.value.as_str(); - map.insert(name.into(), value.into()); - } - - map -} - -async fn render_json_value_raw( - v: Value, - vars: &HashMap, - cb: &T, -) -> Value { - match v { - Value::String(s) => json!(render(s.as_str(), vars, cb).await), - Value::Array(a) => { - let mut new_a = Vec::new(); - for v in a { - new_a.push(Box::pin(render_json_value_raw(v, vars, cb)).await) - } - json!(new_a) - } - Value::Object(o) => { - let mut new_o = Map::new(); - for (k, v) in o { - let key = Box::pin(render(k.as_str(), vars, cb)).await; - let value = Box::pin(render_json_value_raw(v, vars, cb)).await; - new_o.insert(key, value); - } - json!(new_o) - } - v => v, - } -} - -#[cfg(test)] -mod render_tests { - use serde_json::json; - use std::collections::HashMap; - use yaak_templates::TemplateCallback; - - struct EmptyCB {} - - impl TemplateCallback for EmptyCB { - async fn run( - &self, - _fn_name: &str, - _args: HashMap, - ) -> Result { - todo!() - } - } - - #[tokio::test] - async fn render_json_value_string() { - let v = json!("${[a]}"); - let mut vars = HashMap::new(); - vars.insert("a".to_string(), "aaa".to_string()); - - let result = super::render_json_value_raw(v, &vars, &EmptyCB {}).await; - assert_eq!(result, json!("aaa")) - } - - #[tokio::test] - async fn render_json_value_array() { - let v = json!(["${[a]}", "${[a]}"]); - let mut vars = HashMap::new(); - vars.insert("a".to_string(), "aaa".to_string()); - - let result = super::render_json_value_raw(v, &vars, &EmptyCB {}).await; - assert_eq!(result, json!(["aaa", "aaa"])) - } - - #[tokio::test] - async fn render_json_value_object() { - let v = json!({"${[a]}": "${[a]}"}); - let mut vars = HashMap::new(); - vars.insert("a".to_string(), "aaa".to_string()); - - let result = super::render_json_value_raw(v, &vars, &EmptyCB {}).await; - assert_eq!(result, json!({"aaa": "aaa"})) - } - - #[tokio::test] - async fn render_json_value_nested() { - let v = json!([ - 123, - {"${[a]}": "${[a]}"}, - null, - "${[a]}", - false, - {"x": ["${[a]}"]} - ]); - let mut vars = HashMap::new(); - vars.insert("a".to_string(), "aaa".to_string()); - - let result = super::render_json_value_raw(v, &vars, &EmptyCB {}).await; - assert_eq!( - result, - json!([ - 123, - {"aaa": "aaa"}, - null, - "aaa", - false, - {"x": ["aaa"]} - ]) - ) - } -} - fn replace_path_placeholder(p: &HttpUrlParameter, url: &str) -> String { if !p.enabled { return url.to_string(); diff --git a/src-tauri/src/tauri_plugin_mac_window.rs b/src-tauri/src/tauri_plugin_mac_window.rs index 8cb70b50..dd70a2b7 100644 --- a/src-tauri/src/tauri_plugin_mac_window.rs +++ b/src-tauri/src/tauri_plugin_mac_window.rs @@ -2,7 +2,8 @@ use crate::MAIN_WINDOW_PREFIX; use hex_color::HexColor; use log::warn; use objc::{msg_send, sel, sel_impl}; -use rand::{distributions::Alphanumeric, Rng}; +use rand::distr::Alphanumeric; +use rand::Rng; use tauri::{ plugin::{Builder, TauriPlugin}, Emitter, Listener, Manager, Runtime, Window, WindowEvent, @@ -420,7 +421,7 @@ pub fn setup_traffic_light_positioner(window: &Window) { }; let app_box = Box::into_raw(Box::new(app_state)) as *mut c_void; let random_str: String = - rand::thread_rng().sample_iter(&Alphanumeric).take(20).map(char::from).collect(); + rand::rng().sample_iter(&Alphanumeric).take(20).map(char::from).collect(); // We need to ensure we have a unique delegate name, otherwise we will panic while trying to create a duplicate // delegate with the same name. diff --git a/src-tauri/yaak-grpc/Cargo.toml b/src-tauri/yaak-grpc/Cargo.toml index 7ac6dedf..1d5fb0df 100644 --- a/src-tauri/yaak-grpc/Cargo.toml +++ b/src-tauri/yaak-grpc/Cargo.toml @@ -9,8 +9,10 @@ anyhow = "1.0.79" async-recursion = "1.1.1" dunce = "1.0.4" hyper = "1.5.2" -hyper-rustls = { version = "0.27.5", default-features = false, features = ["http2", "rustls-platform-verifier"] } -hyper-util = { version = "0.1.10", features = ["client-legacy", "client"] } +hyper-rustls = { version = "0.27.5", default-features = false, features = ["http2"] } +hyper-util = { version = "0.1.10", default-features = false, features = ["client-legacy"] } +rustls = { version = "0.23.21", default-features = false, features = ["custom-provider", "ring"] } +rustls-platform-verifier = "0.5.0" log = "0.4.20" md5 = "0.7.0" prost = "0.13.4" diff --git a/src-tauri/yaak-grpc/src/transport.rs b/src-tauri/yaak-grpc/src/transport.rs index af3dbcf0..de30e06d 100644 --- a/src-tauri/yaak-grpc/src/transport.rs +++ b/src-tauri/yaak-grpc/src/transport.rs @@ -2,17 +2,30 @@ use hyper_rustls::{HttpsConnector, HttpsConnectorBuilder}; use hyper_util::client::legacy::connect::HttpConnector; use hyper_util::client::legacy::Client; use hyper_util::rt::TokioExecutor; +use rustls::crypto::ring; +use rustls::ClientConfig; +use rustls_platform_verifier::BuilderVerifierExt; +use std::sync::Arc; use tonic::body::BoxBody; pub(crate) fn get_transport() -> Client, BoxBody> { - let connector = HttpsConnectorBuilder::new().with_platform_verifier(); - let connector = connector.https_or_http().enable_http2().wrap_connector({ - let mut http_connector = HttpConnector::new(); - http_connector.enforce_http(false); - http_connector - }); - Client::builder(TokioExecutor::new()) + let arc_crypto_provider = Arc::new(ring::default_provider()); + let config = ClientConfig::builder_with_provider(arc_crypto_provider) + .with_safe_default_protocol_versions() + .unwrap() + .with_platform_verifier() + .with_no_client_auth(); + + let mut http = HttpConnector::new(); + http.enforce_http(false); + + let connector = + HttpsConnectorBuilder::new().with_tls_config(config).https_or_http().enable_http2().build(); + + let client = Client::builder(TokioExecutor::new()) .pool_max_idle_per_host(0) .http2_only(true) - .build(connector) + .build(connector); + + client } diff --git a/src-tauri/yaak-license/Cargo.toml b/src-tauri/yaak-license/Cargo.toml index 332a4d5e..b26dd296 100644 --- a/src-tauri/yaak-license/Cargo.toml +++ b/src-tauri/yaak-license/Cargo.toml @@ -17,4 +17,4 @@ log = "0.4.22" serde_json = "1.0.132" [build-dependencies] -tauri-plugin = { version = "2.0.3", features = ["build"] } +tauri-plugin = { workspace = true, features = ["build"] } diff --git a/src-tauri/yaak-models/bindings/gen_models.ts b/src-tauri/yaak-models/bindings/gen_models.ts index dd59a589..bce3d18c 100644 --- a/src-tauri/yaak-models/bindings/gen_models.ts +++ b/src-tauri/yaak-models/bindings/gen_models.ts @@ -1,6 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type AnyModel = CookieJar | Environment | Folder | GrpcConnection | GrpcEvent | GrpcRequest | HttpRequest | HttpResponse | Plugin | Settings | KeyValue | Workspace | WorkspaceMeta; +export type AnyModel = CookieJar | Environment | Folder | GrpcConnection | GrpcEvent | GrpcRequest | HttpRequest | HttpResponse | Plugin | Settings | KeyValue | Workspace | WorkspaceMeta | WebsocketConnection | WebsocketEvent | WebsocketRequest; export type Cookie = { raw_cookie: string, domain: CookieDomain, expires: CookieExpires, path: [string, boolean], }; @@ -48,6 +48,8 @@ export type ModelPayload = { model: AnyModel, windowLabel: string, updateSource: export type Plugin = { model: "plugin", id: string, createdAt: string, updatedAt: string, checkedAt: string | null, directory: string, enabled: boolean, url: string | null, }; +export type PluginKeyValue = { model: "plugin_key_value", createdAt: string, updatedAt: string, pluginName: string, key: string, value: string, }; + export type ProxySetting = { "type": "enabled", http: string, https: string, auth: ProxySettingAuth | null, } | { "type": "disabled" }; export type ProxySettingAuth = { user: string, password: string, }; @@ -60,6 +62,18 @@ export type SyncState = { model: "sync_state", id: string, workspaceId: string, export type UpdateSource = "sync" | "window" | "plugin" | "background" | "import"; +export type WebsocketConnection = { model: "websocket_connection", id: string, createdAt: string, updatedAt: string, workspaceId: string, requestId: string, elapsed: number, error: string | null, headers: Array, state: WebsocketConnectionState, status: number, url: string, }; + +export type WebsocketConnectionState = "initialized" | "connected" | "closed"; + +export type WebsocketEvent = { model: "websocket_event", id: string, createdAt: string, updatedAt: string, workspaceId: string, requestId: string, connectionId: string, isServer: boolean, message: Array, messageType: WebsocketEventType, }; + +export type WebsocketEventType = "binary" | "close" | "frame" | "ping" | "pong" | "text"; + +export type WebsocketMessageType = "text" | "binary"; + +export type WebsocketRequest = { model: "websocket_request", id: string, createdAt: string, updatedAt: string, workspaceId: string, folderId: string | null, authentication: Record, authenticationType: string | null, description: string, headers: Array, message: string, name: string, sortPriority: number, url: string, urlParameters: Array, }; + export type Workspace = { model: "workspace", id: string, createdAt: string, updatedAt: string, name: string, description: string, settingValidateCertificates: boolean, settingFollowRedirects: boolean, settingRequestTimeout: number, }; export type WorkspaceMeta = { model: "workspace_meta", id: string, workspaceId: string, createdAt: string, updatedAt: string, settingSyncDir: string | null, }; diff --git a/src-tauri/yaak-models/src/lib.rs b/src-tauri/yaak-models/src/lib.rs index 2c6f5d79..bcb66425 100644 --- a/src-tauri/yaak-models/src/lib.rs +++ b/src-tauri/yaak-models/src/lib.rs @@ -3,3 +3,4 @@ pub mod models; pub mod queries; pub mod plugin; +pub mod render; diff --git a/src-tauri/yaak-models/src/models.rs b/src-tauri/yaak-models/src/models.rs index 943ea83f..5d7d7d86 100644 --- a/src-tauri/yaak-models/src/models.rs +++ b/src-tauri/yaak-models/src/models.rs @@ -125,7 +125,7 @@ impl<'s> TryFrom<&Row<'s>> for Settings { fn try_from(r: &Row<'s>) -> Result { let proxy: Option = r.get("proxy")?; let editor_keymap: String = r.get("editor_keymap")?; - Ok(Settings { + Ok(Self { id: r.get("id")?, model: r.get("model")?, created_at: r.get("created_at")?, @@ -187,7 +187,7 @@ impl<'s> TryFrom<&Row<'s>> for Workspace { type Error = rusqlite::Error; fn try_from(r: &Row<'s>) -> Result { - Ok(Workspace { + Ok(Self { id: r.get("id")?, model: r.get("model")?, created_at: r.get("created_at")?, @@ -243,7 +243,7 @@ impl<'s> TryFrom<&Row<'s>> for WorkspaceMeta { type Error = rusqlite::Error; fn try_from(r: &Row<'s>) -> Result { - Ok(WorkspaceMeta { + Ok(Self { id: r.get("id")?, workspace_id: r.get("workspace_id")?, model: r.get("model")?, @@ -313,7 +313,7 @@ impl<'s> TryFrom<&Row<'s>> for CookieJar { fn try_from(r: &Row<'s>) -> Result { let cookies: String = r.get("cookies")?; - Ok(CookieJar { + Ok(Self { id: r.get("id")?, model: r.get("model")?, workspace_id: r.get("workspace_id")?, @@ -361,7 +361,7 @@ impl<'s> TryFrom<&Row<'s>> for Environment { fn try_from(r: &Row<'s>) -> Result { let variables: String = r.get("variables")?; - Ok(Environment { + Ok(Self { id: r.get("id")?, model: r.get("model")?, workspace_id: r.get("workspace_id")?, @@ -424,7 +424,7 @@ impl<'s> TryFrom<&Row<'s>> for Folder { type Error = rusqlite::Error; fn try_from(r: &Row<'s>) -> Result { - Ok(Folder { + Ok(Self { id: r.get("id")?, model: r.get("model")?, sort_priority: r.get("sort_priority")?, @@ -484,7 +484,7 @@ pub struct HttpRequest { pub body_type: Option, pub description: String, pub headers: Vec, - #[serde(default = "default_http_request_method")] + #[serde(default = "default_http_method")] pub method: String, pub name: String, pub sort_priority: f32, @@ -524,7 +524,7 @@ impl<'s> TryFrom<&Row<'s>> for HttpRequest { let body: String = r.get("body")?; let authentication: String = r.get("authentication")?; let headers: String = r.get("headers")?; - Ok(HttpRequest { + Ok(Self { id: r.get("id")?, model: r.get("model")?, sort_priority: r.get("sort_priority")?, @@ -546,6 +546,243 @@ impl<'s> TryFrom<&Row<'s>> for HttpRequest { } } +#[derive(Debug, Clone, Serialize, Deserialize, TS)] +#[serde(rename_all = "snake_case")] +#[ts(export, export_to = "gen_models.ts")] +pub enum WebsocketConnectionState { + Initialized, + Connected, + Closed, +} + +impl Default for WebsocketConnectionState { + fn default() -> Self { + Self::Initialized + } +} + +#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)] +#[serde(default, rename_all = "camelCase")] +#[ts(export, export_to = "gen_models.ts")] +pub struct WebsocketConnection { + #[ts(type = "\"websocket_connection\"")] + pub model: String, + pub id: String, + pub created_at: NaiveDateTime, + pub updated_at: NaiveDateTime, + pub workspace_id: String, + pub request_id: String, + + pub elapsed: i32, + pub error: Option, + pub headers: Vec, + pub state: WebsocketConnectionState, + pub status: i32, + pub url: String, +} + +#[derive(Iden)] +pub enum WebsocketConnectionIden { + #[iden = "websocket_connections"] + Table, + Id, + Model, + CreatedAt, + UpdatedAt, + WorkspaceId, + RequestId, + + Elapsed, + Error, + Headers, + State, + Status, + Url, +} + +impl<'s> TryFrom<&Row<'s>> for WebsocketConnection { + type Error = rusqlite::Error; + + fn try_from(r: &Row<'s>) -> Result { + let headers: String = r.get("headers")?; + let state: String = r.get("state")?; + Ok(Self { + id: r.get("id")?, + model: r.get("model")?, + workspace_id: r.get("workspace_id")?, + request_id: r.get("request_id")?, + created_at: r.get("created_at")?, + updated_at: r.get("updated_at")?, + url: r.get("url")?, + headers: serde_json::from_str(headers.as_str()).unwrap_or_default(), + elapsed: r.get("elapsed")?, + error: r.get("error")?, + state: serde_json::from_str(format!(r#""{state}""#).as_str()).unwrap(), + status: r.get("status")?, + }) + } +} + +#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq, TS)] +#[serde(rename_all = "snake_case")] +#[ts(export, export_to = "gen_models.ts")] +pub enum WebsocketMessageType { + Text, + Binary, +} + +impl Default for WebsocketMessageType { + fn default() -> Self { + Self::Text + } +} + +#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)] +#[serde(default, rename_all = "camelCase")] +#[ts(export, export_to = "gen_models.ts")] +pub struct WebsocketRequest { + #[ts(type = "\"websocket_request\"")] + pub model: String, + pub id: String, + pub created_at: NaiveDateTime, + pub updated_at: NaiveDateTime, + pub workspace_id: String, + pub folder_id: Option, + + #[ts(type = "Record")] + pub authentication: BTreeMap, + pub authentication_type: Option, + pub description: String, + pub headers: Vec, + pub message: String, + pub name: String, + pub sort_priority: f32, + pub url: String, + pub url_parameters: Vec, +} + +#[derive(Iden)] +pub enum WebsocketRequestIden { + #[iden = "websocket_requests"] + Table, + Id, + Model, + CreatedAt, + UpdatedAt, + WorkspaceId, + FolderId, + + Authentication, + AuthenticationType, + Message, + Description, + Headers, + Name, + SortPriority, + Url, + UrlParameters, +} + +impl<'s> TryFrom<&Row<'s>> for WebsocketRequest { + type Error = rusqlite::Error; + + fn try_from(r: &Row<'s>) -> Result { + let url_parameters: String = r.get("url_parameters")?; + let authentication: String = r.get("authentication")?; + let headers: String = r.get("headers")?; + Ok(Self { + id: r.get("id")?, + model: r.get("model")?, + sort_priority: r.get("sort_priority")?, + workspace_id: r.get("workspace_id")?, + created_at: r.get("created_at")?, + updated_at: r.get("updated_at")?, + url: r.get("url")?, + url_parameters: serde_json::from_str(url_parameters.as_str()).unwrap_or_default(), + message: r.get("message")?, + description: r.get("description")?, + authentication: serde_json::from_str(authentication.as_str()).unwrap_or_default(), + authentication_type: r.get("authentication_type")?, + headers: serde_json::from_str(headers.as_str()).unwrap_or_default(), + folder_id: r.get("folder_id")?, + name: r.get("name")?, + }) + } +} + +#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq, TS)] +#[serde(rename_all = "snake_case")] +#[ts(export, export_to = "gen_models.ts")] +pub enum WebsocketEventType { + Binary, + Close, + Frame, + Ping, + Pong, + Text, +} + +impl Default for WebsocketEventType { + fn default() -> Self { + Self::Text + } +} + +#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)] +#[serde(default, rename_all = "camelCase")] +#[ts(export, export_to = "gen_models.ts")] +pub struct WebsocketEvent { + #[ts(type = "\"websocket_event\"")] + pub model: String, + pub id: String, + pub created_at: NaiveDateTime, + pub updated_at: NaiveDateTime, + pub workspace_id: String, + pub request_id: String, + pub connection_id: String, + pub is_server: bool, + + pub message: Vec, + pub message_type: WebsocketEventType, +} + +#[derive(Iden)] +pub enum WebsocketEventIden { + #[iden = "websocket_events"] + Table, + Model, + Id, + CreatedAt, + UpdatedAt, + WorkspaceId, + RequestId, + ConnectionId, + IsServer, + + MessageType, + Message, +} + +impl<'s> TryFrom<&Row<'s>> for WebsocketEvent { + type Error = rusqlite::Error; + + fn try_from(r: &Row<'s>) -> Result { + let message_type: String = r.get("message_type")?; + Ok(Self { + id: r.get("id")?, + model: r.get("model")?, + workspace_id: r.get("workspace_id")?, + request_id: r.get("request_id")?, + connection_id: r.get("connection_id")?, + created_at: r.get("created_at")?, + updated_at: r.get("updated_at")?, + message: r.get("message")?, + is_server: r.get("is_server")?, + message_type: serde_json::from_str(message_type.as_str()).unwrap_or_default(), + }) + } +} + #[derive(Debug, Clone, Serialize, Deserialize, Default, TS)] #[serde(default, rename_all = "camelCase")] #[ts(export, export_to = "gen_models.ts")] @@ -626,7 +863,7 @@ impl<'s> TryFrom<&Row<'s>> for HttpResponse { fn try_from(r: &Row<'s>) -> Result { let headers: String = r.get("headers")?; let state: String = r.get("state")?; - Ok(HttpResponse { + Ok(Self { id: r.get("id")?, model: r.get("model")?, workspace_id: r.get("workspace_id")?, @@ -725,7 +962,7 @@ impl<'s> TryFrom<&Row<'s>> for GrpcRequest { fn try_from(r: &Row<'s>) -> Result { let authentication: String = r.get("authentication")?; let metadata: String = r.get("metadata")?; - Ok(GrpcRequest { + Ok(Self { id: r.get("id")?, model: r.get("model")?, workspace_id: r.get("workspace_id")?, @@ -810,7 +1047,7 @@ impl<'s> TryFrom<&Row<'s>> for GrpcConnection { fn try_from(r: &Row<'s>) -> Result { let trailers: String = r.get("trailers")?; let state: String = r.get("state")?; - Ok(GrpcConnection { + Ok(Self { id: r.get("id")?, model: r.get("model")?, workspace_id: r.get("workspace_id")?, @@ -892,7 +1129,7 @@ impl<'s> TryFrom<&Row<'s>> for GrpcEvent { fn try_from(r: &Row<'s>) -> Result { let event_type: String = r.get("event_type")?; let metadata: String = r.get("metadata")?; - Ok(GrpcEvent { + Ok(Self { id: r.get("id")?, model: r.get("model")?, workspace_id: r.get("workspace_id")?, @@ -944,7 +1181,7 @@ impl<'s> TryFrom<&Row<'s>> for Plugin { type Error = rusqlite::Error; fn try_from(r: &Row<'s>) -> Result { - Ok(Plugin { + Ok(Self { id: r.get("id")?, model: r.get("model")?, created_at: r.get("created_at")?, @@ -1012,7 +1249,7 @@ impl<'s> TryFrom<&Row<'s>> for SyncState { type Error = rusqlite::Error; fn try_from(r: &Row<'s>) -> Result { - Ok(SyncState { + Ok(Self { id: r.get("id")?, workspace_id: r.get("workspace_id")?, model: r.get("model")?, @@ -1058,7 +1295,7 @@ impl<'s> TryFrom<&Row<'s>> for KeyValue { type Error = rusqlite::Error; fn try_from(r: &Row<'s>) -> Result { - Ok(KeyValue { + Ok(Self { model: r.get("model")?, created_at: r.get("created_at")?, updated_at: r.get("updated_at")?, @@ -1100,7 +1337,7 @@ impl<'s> TryFrom<&Row<'s>> for PluginKeyValue { type Error = rusqlite::Error; fn try_from(r: &Row<'s>) -> Result { - Ok(PluginKeyValue { + Ok(Self { model: r.get("model")?, created_at: r.get("created_at")?, updated_at: r.get("updated_at")?, @@ -1115,7 +1352,7 @@ fn default_true() -> bool { true } -fn default_http_request_method() -> String { +fn default_http_method() -> String { "GET".to_string() } @@ -1129,9 +1366,12 @@ pub enum ModelType { TypeHttpRequest, TypeHttpResponse, TypePlugin, + TypeSyncState, + TypeWebSocketConnection, + TypeWebSocketEvent, + TypeWebsocketRequest, TypeWorkspace, TypeWorkspaceMeta, - TypeSyncState, } impl ModelType { @@ -1149,6 +1389,9 @@ impl ModelType { ModelType::TypeWorkspace => "wk", ModelType::TypeWorkspaceMeta => "wm", ModelType::TypeSyncState => "ss", + ModelType::TypeWebSocketConnection => "wc", + ModelType::TypeWebSocketEvent => "we", + ModelType::TypeWebsocketRequest => "wr", } .to_string() } @@ -1171,6 +1414,9 @@ pub enum AnyModel { KeyValue(KeyValue), Workspace(Workspace), WorkspaceMeta(WorkspaceMeta), + WebsocketConnection(WebsocketConnection), + WebsocketEvent(WebsocketEvent), + WebsocketRequest(WebsocketRequest), } impl<'de> Deserialize<'de> for AnyModel { diff --git a/src-tauri/yaak-models/src/queries.rs b/src-tauri/yaak-models/src/queries.rs index 3acaab8f..4d7d1012 100644 --- a/src-tauri/yaak-models/src/queries.rs +++ b/src-tauri/yaak-models/src/queries.rs @@ -1,6 +1,15 @@ use crate::error::Error::ModelNotFound; use crate::error::Result; -use crate::models::{AnyModel, CookieJar, CookieJarIden, Environment, EnvironmentIden, Folder, FolderIden, GrpcConnection, GrpcConnectionIden, GrpcConnectionState, GrpcEvent, GrpcEventIden, GrpcRequest, GrpcRequestIden, HttpRequest, HttpRequestIden, HttpResponse, HttpResponseHeader, HttpResponseIden, HttpResponseState, KeyValue, KeyValueIden, ModelType, Plugin, PluginIden, PluginKeyValue, PluginKeyValueIden, Settings, SettingsIden, SyncState, SyncStateIden, Workspace, WorkspaceIden, WorkspaceMeta, WorkspaceMetaIden}; +use crate::models::{ + AnyModel, CookieJar, CookieJarIden, Environment, EnvironmentIden, Folder, FolderIden, + GrpcConnection, GrpcConnectionIden, GrpcConnectionState, GrpcEvent, GrpcEventIden, GrpcRequest, + GrpcRequestIden, HttpRequest, HttpRequestIden, HttpResponse, HttpResponseHeader, + HttpResponseIden, HttpResponseState, KeyValue, KeyValueIden, ModelType, Plugin, PluginIden, + PluginKeyValue, PluginKeyValueIden, Settings, SettingsIden, SyncState, SyncStateIden, + WebsocketConnection, WebsocketConnectionIden, WebsocketEvent, WebsocketEventIden, + WebsocketRequest, WebsocketRequestIden, Workspace, WorkspaceIden, WorkspaceMeta, + WorkspaceMetaIden, +}; use crate::plugin::SqliteConnection; use chrono::{NaiveDateTime, Utc}; use log::{debug, error, info, warn}; @@ -16,8 +25,7 @@ use std::path::Path; use tauri::{AppHandle, Emitter, Listener, Manager, Runtime, WebviewWindow}; use ts_rs::TS; -const MAX_GRPC_CONNECTIONS_PER_REQUEST: usize = 20; -const MAX_HTTP_RESPONSES_PER_REQUEST: usize = MAX_GRPC_CONNECTIONS_PER_REQUEST; +const MAX_HISTORY_ITEMS: usize = 20; pub async fn set_key_value_string( mgr: &WebviewWindow, @@ -659,8 +667,8 @@ pub async fn upsert_grpc_connection( update_source: &UpdateSource, ) -> Result { let connections = - list_http_responses_for_request(window, connection.request_id.as_str(), None).await?; - for c in connections.iter().skip(MAX_GRPC_CONNECTIONS_PER_REQUEST - 1) { + list_grpc_connections_for_request(window, connection.request_id.as_str()).await?; + for c in connections.iter().skip(MAX_HISTORY_ITEMS - 1) { debug!("Deleting old grpc connection {}", c.id); delete_grpc_connection(window, c.id.as_str(), update_source).await?; } @@ -911,6 +919,367 @@ pub async fn list_grpc_events( Ok(items.map(|v| v.unwrap()).collect()) } +pub async fn delete_websocket_request( + window: &WebviewWindow, + id: &str, + update_source: &UpdateSource, +) -> Result { + let request = match get_websocket_request(window, id).await? { + Some(r) => r, + None => { + return Err(ModelNotFound(id.to_string())); + } + }; + + let dbm = &*window.app_handle().state::(); + let db = dbm.0.lock().await.get().unwrap(); + let (sql, params) = Query::delete() + .from_table(WebsocketRequestIden::Table) + .cond_where(Expr::col(WebsocketRequestIden::Id).eq(id)) + .build_rusqlite(SqliteQueryBuilder); + db.execute(sql.as_str(), &*params.as_params())?; + + emit_deleted_model(window, &AnyModel::WebsocketRequest(request.to_owned()), update_source); + Ok(request) +} + +pub async fn delete_websocket_connection( + window: &WebviewWindow, + id: &str, + update_source: &UpdateSource, +) -> Result { + let m = get_websocket_connection(window, id).await?; + + let dbm = &*window.app_handle().state::(); + let db = dbm.0.lock().await.get().unwrap(); + let (sql, params) = Query::delete() + .from_table(WebsocketConnectionIden::Table) + .cond_where(Expr::col(WebsocketConnectionIden::Id).eq(id)) + .build_rusqlite(SqliteQueryBuilder); + db.execute(sql.as_str(), &*params.as_params())?; + + emit_deleted_model(window, &AnyModel::WebsocketConnection(m.to_owned()), update_source); + Ok(m) +} + +pub async fn delete_all_websocket_connections( + window: &WebviewWindow, + request_id: &str, + update_source: &UpdateSource, +) -> Result<()> { + for c in list_websocket_connections_for_request(window, request_id).await? { + delete_websocket_connection(window, &c.id, update_source).await?; + } + Ok(()) +} + +pub async fn delete_all_websocket_connections_for_workspace( + window: &WebviewWindow, + workspace_id: &str, + update_source: &UpdateSource, +) -> Result<()> { + for c in list_websocket_connections_for_workspace(window, workspace_id).await? { + delete_websocket_connection(window, &c.id, update_source).await?; + } + Ok(()) +} + +pub async fn get_websocket_connection( + mgr: &impl Manager, + id: &str, +) -> Result { + let dbm = &*mgr.state::(); + let db = dbm.0.lock().await.get().unwrap(); + let (sql, params) = Query::select() + .from(WebsocketConnectionIden::Table) + .column(Asterisk) + .cond_where(Expr::col(WebsocketConnectionIden::Id).eq(id)) + .build_rusqlite(SqliteQueryBuilder); + let mut stmt = db.prepare(sql.as_str())?; + Ok(stmt.query_row(&*params.as_params(), |row| row.try_into())?) +} + +pub async fn upsert_websocket_event( + window: &WebviewWindow, + event: WebsocketEvent, + update_source: &UpdateSource, +) -> Result { + let id = match event.id.as_str() { + "" => generate_model_id(ModelType::TypeWebSocketEvent), + _ => event.id.to_string(), + }; + + let dbm = &*window.app_handle().state::(); + let db = dbm.0.lock().await.get().unwrap(); + let (sql, params) = Query::insert() + .into_table(WebsocketEventIden::Table) + .columns([ + WebsocketEventIden::Id, + WebsocketEventIden::CreatedAt, + WebsocketEventIden::UpdatedAt, + WebsocketEventIden::WorkspaceId, + WebsocketEventIden::ConnectionId, + WebsocketEventIden::RequestId, + WebsocketEventIden::MessageType, + WebsocketEventIden::IsServer, + WebsocketEventIden::Message, + ]) + .values_panic([ + id.into(), + timestamp_for_upsert(update_source, event.created_at).into(), + timestamp_for_upsert(update_source, event.updated_at).into(), + event.workspace_id.into(), + event.connection_id.into(), + event.request_id.into(), + serde_json::to_string(&event.message_type)?.into(), + event.is_server.into(), + event.message.into(), + ]) + .on_conflict( + OnConflict::column(WebsocketEventIden::Id) + .update_columns([ + WebsocketEventIden::UpdatedAt, + WebsocketEventIden::MessageType, + WebsocketEventIden::IsServer, + WebsocketEventIden::Message, + ]) + .to_owned(), + ) + .returning_all() + .build_rusqlite(SqliteQueryBuilder); + + let mut stmt = db.prepare(sql.as_str())?; + let m: WebsocketEvent = stmt.query_row(&*params.as_params(), |row| row.try_into())?; + emit_upserted_model(window, &AnyModel::WebsocketEvent(m.to_owned()), update_source); + Ok(m) +} + +pub async fn upsert_websocket_request( + window: &WebviewWindow, + request: WebsocketRequest, + update_source: &UpdateSource, +) -> Result { + let id = match request.id.as_str() { + "" => generate_model_id(ModelType::TypeWebsocketRequest), + _ => request.id.to_string(), + }; + let trimmed_name = request.name.trim(); + + let dbm = &*window.app_handle().state::(); + let db = dbm.0.lock().await.get().unwrap(); + let (sql, params) = Query::insert() + .into_table(WebsocketRequestIden::Table) + .columns([ + WebsocketRequestIden::Id, + WebsocketRequestIden::CreatedAt, + WebsocketRequestIden::UpdatedAt, + WebsocketRequestIden::WorkspaceId, + WebsocketRequestIden::FolderId, + WebsocketRequestIden::Authentication, + WebsocketRequestIden::AuthenticationType, + WebsocketRequestIden::Description, + WebsocketRequestIden::Headers, + WebsocketRequestIden::Message, + WebsocketRequestIden::Name, + WebsocketRequestIden::SortPriority, + WebsocketRequestIden::Url, + WebsocketRequestIden::UrlParameters, + ]) + .values_panic([ + id.into(), + timestamp_for_upsert(update_source, request.created_at).into(), + timestamp_for_upsert(update_source, request.updated_at).into(), + request.workspace_id.into(), + request.folder_id.as_ref().map(|s| s.as_str()).into(), + serde_json::to_string(&request.authentication)?.into(), + request.authentication_type.as_ref().map(|s| s.as_str()).into(), + request.description.into(), + serde_json::to_string(&request.headers)?.into(), + request.message.into(), + trimmed_name.into(), + request.sort_priority.into(), + request.url.into(), + serde_json::to_string(&request.url_parameters)?.into(), + ]) + .on_conflict( + OnConflict::column(WebsocketRequestIden::Id) + .update_columns([ + WebsocketRequestIden::UpdatedAt, + WebsocketRequestIden::WorkspaceId, + WebsocketRequestIden::FolderId, + WebsocketRequestIden::Authentication, + WebsocketRequestIden::AuthenticationType, + WebsocketRequestIden::Description, + WebsocketRequestIden::Headers, + WebsocketRequestIden::Message, + WebsocketRequestIden::Name, + WebsocketRequestIden::SortPriority, + WebsocketRequestIden::Url, + WebsocketRequestIden::UrlParameters, + ]) + .to_owned(), + ) + .returning_all() + .build_rusqlite(SqliteQueryBuilder); + + let mut stmt = db.prepare(sql.as_str())?; + let m: WebsocketRequest = stmt.query_row(&*params.as_params(), |row| row.try_into())?; + emit_upserted_model(window, &AnyModel::WebsocketRequest(m.to_owned()), update_source); + Ok(m) +} + +pub async fn list_websocket_connections_for_workspace( + mgr: &impl Manager, + workspace_id: &str, +) -> Result> { + let dbm = &*mgr.state::(); + let db = dbm.0.lock().await.get().unwrap(); + + let (sql, params) = Query::select() + .from(WebsocketConnectionIden::Table) + .cond_where(Expr::col(WebsocketConnectionIden::WorkspaceId).eq(workspace_id)) + .column(Asterisk) + .order_by(WebsocketConnectionIden::CreatedAt, Order::Desc) + .build_rusqlite(SqliteQueryBuilder); + let mut stmt = db.prepare(sql.as_str())?; + let items = stmt.query_map(&*params.as_params(), |row| row.try_into())?; + Ok(items.map(|v| v.unwrap()).collect()) +} + +pub async fn list_websocket_connections_for_request( + mgr: &impl Manager, + request_id: &str, +) -> Result> { + let dbm = &*mgr.state::(); + let db = dbm.0.lock().await.get().unwrap(); + + let (sql, params) = Query::select() + .from(WebsocketConnectionIden::Table) + .cond_where(Expr::col(WebsocketConnectionIden::RequestId).eq(request_id)) + .column(Asterisk) + .order_by(WebsocketConnectionIden::CreatedAt, Order::Desc) + .build_rusqlite(SqliteQueryBuilder); + let mut stmt = db.prepare(sql.as_str())?; + let items = stmt.query_map(&*params.as_params(), |row| row.try_into())?; + Ok(items.map(|v| v.unwrap()).collect()) +} + +pub async fn upsert_websocket_connection( + window: &WebviewWindow, + connection: &WebsocketConnection, + update_source: &UpdateSource, +) -> Result { + let connections = + list_websocket_connections_for_request(window, connection.request_id.as_str()).await?; + for c in connections.iter().skip(MAX_HISTORY_ITEMS - 1) { + debug!("Deleting old websocket connection {}", c.id); + delete_websocket_connection(window, c.id.as_str(), update_source).await?; + } + + let id = match connection.id.as_str() { + "" => generate_model_id(ModelType::TypeWebSocketConnection), + _ => connection.id.to_string(), + }; + let dbm = &*window.app_handle().state::(); + let db = dbm.0.lock().await.get().unwrap(); + let (sql, params) = Query::insert() + .into_table(WebsocketConnectionIden::Table) + .columns([ + WebsocketConnectionIden::Id, + WebsocketConnectionIden::CreatedAt, + WebsocketConnectionIden::UpdatedAt, + WebsocketConnectionIden::WorkspaceId, + WebsocketConnectionIden::RequestId, + WebsocketConnectionIden::Elapsed, + WebsocketConnectionIden::Error, + WebsocketConnectionIden::Headers, + WebsocketConnectionIden::State, + WebsocketConnectionIden::Status, + WebsocketConnectionIden::Url, + ]) + .values_panic([ + id.as_str().into(), + timestamp_for_upsert(update_source, connection.created_at).into(), + timestamp_for_upsert(update_source, connection.updated_at).into(), + connection.workspace_id.as_str().into(), + connection.request_id.as_str().into(), + connection.elapsed.into(), + connection.error.as_ref().map(|s| s.as_str()).into(), + serde_json::to_string(&connection.headers)?.into(), + serde_json::to_value(&connection.state)?.as_str().into(), + connection.status.into(), + connection.url.as_str().into(), + ]) + .on_conflict( + OnConflict::column(WebsocketConnectionIden::Id) + .update_columns([ + WebsocketConnectionIden::UpdatedAt, + WebsocketConnectionIden::Elapsed, + WebsocketConnectionIden::Error, + WebsocketConnectionIden::Headers, + WebsocketConnectionIden::State, + WebsocketConnectionIden::Status, + WebsocketConnectionIden::Url, + ]) + .to_owned(), + ) + .returning_all() + .build_rusqlite(SqliteQueryBuilder); + + let mut stmt = db.prepare(sql.as_str())?; + let m: WebsocketConnection = stmt.query_row(&*params.as_params(), |row| row.try_into())?; + emit_upserted_model(window, &AnyModel::WebsocketConnection(m.to_owned()), update_source); + Ok(m) +} + +pub async fn get_websocket_request( + mgr: &impl Manager, + id: &str, +) -> Result> { + let dbm = &*mgr.state::(); + let db = dbm.0.lock().await.get().unwrap(); + + let (sql, params) = Query::select() + .from(WebsocketRequestIden::Table) + .column(Asterisk) + .cond_where(Expr::col(WebsocketRequestIden::Id).eq(id)) + .build_rusqlite(SqliteQueryBuilder); + let mut stmt = db.prepare(sql.as_str())?; + Ok(stmt.query_row(&*params.as_params(), |row| row.try_into()).optional()?) +} + +pub async fn list_websocket_requests( + mgr: &impl Manager, + workspace_id: &str, +) -> Result> { + let dbm = &*mgr.state::(); + let db = dbm.0.lock().await.get().unwrap(); + let (sql, params) = Query::select() + .from(WebsocketRequestIden::Table) + .cond_where(Expr::col(WebsocketRequestIden::WorkspaceId).eq(workspace_id)) + .column(Asterisk) + .build_rusqlite(SqliteQueryBuilder); + let mut stmt = db.prepare(sql.as_str())?; + let items = stmt.query_map(&*params.as_params(), |row| row.try_into())?; + Ok(items.map(|v| v.unwrap()).collect()) +} + +pub async fn list_websocket_events( + mgr: &impl Manager, + connection_id: &str, +) -> Result> { + let dbm = &*mgr.state::(); + let db = dbm.0.lock().await.get().unwrap(); + let (sql, params) = Query::select() + .from(WebsocketEventIden::Table) + .cond_where(Expr::col(WebsocketEventIden::ConnectionId).eq(connection_id)) + .column(Asterisk) + .build_rusqlite(SqliteQueryBuilder); + let mut stmt = db.prepare(sql.as_str())?; + let items = stmt.query_map(&*params.as_params(), |row| row.try_into())?; + Ok(items.map(|v| v.unwrap()).collect()) +} + pub async fn upsert_cookie_jar( window: &WebviewWindow, cookie_jar: &CookieJar, @@ -1676,7 +2045,7 @@ pub async fn create_http_response( update_source: &UpdateSource, ) -> Result { let responses = list_http_responses_for_request(window, request_id, None).await?; - for response in responses.iter().skip(MAX_HTTP_RESPONSES_PER_REQUEST - 1) { + for response in responses.iter().skip(MAX_HISTORY_ITEMS - 1) { debug!("Deleting old response {}", response.id); delete_http_response(window, response.id.as_str(), update_source).await?; } @@ -2170,6 +2539,7 @@ pub struct BatchUpsertResult { pub folders: Vec, pub http_requests: Vec, pub grpc_requests: Vec, + pub websocket_requests: Vec, } pub async fn batch_upsert( @@ -2179,6 +2549,7 @@ pub async fn batch_upsert( folders: Vec, http_requests: Vec, grpc_requests: Vec, + websocket_requests: Vec, update_source: &UpdateSource, ) -> Result { let mut imported_resources = BatchUpsertResult::default(); @@ -2246,6 +2617,14 @@ pub async fn batch_upsert( info!("Imported {} grpc_requests", imported_resources.grpc_requests.len()); } + if websocket_requests.len() > 0 { + for v in websocket_requests { + let x = upsert_websocket_request(&window, v, update_source).await?; + imported_resources.websocket_requests.push(x.clone()); + } + info!("Imported {} websocket_requests", imported_resources.websocket_requests.len()); + } + Ok(imported_resources) } @@ -2264,6 +2643,7 @@ pub async fn get_workspace_export_resources( folders: Vec::new(), http_requests: Vec::new(), grpc_requests: Vec::new(), + websocket_requests: Vec::new(), }, }; @@ -2273,6 +2653,7 @@ pub async fn get_workspace_export_resources( data.resources.folders.append(&mut list_folders(mgr, workspace_id).await?); data.resources.http_requests.append(&mut list_http_requests(mgr, workspace_id).await?); data.resources.grpc_requests.append(&mut list_grpc_requests(mgr, workspace_id).await?); + data.resources.websocket_requests.append(&mut list_websocket_requests(mgr, workspace_id).await?); } // Nuke environments if we don't want them diff --git a/src-tauri/yaak-models/src/render.rs b/src-tauri/yaak-models/src/render.rs new file mode 100644 index 00000000..4db65912 --- /dev/null +++ b/src-tauri/yaak-models/src/render.rs @@ -0,0 +1,34 @@ +use std::collections::HashMap; +use crate::models::{Environment, EnvironmentVariable}; + +pub fn make_vars_hashmap( + base_environment: &Environment, + environment: Option<&Environment>, +) -> HashMap { + let mut variables = HashMap::new(); + variables = add_variable_to_map(variables, &base_environment.variables); + + if let Some(e) = environment { + variables = add_variable_to_map(variables, &e.variables); + } + + variables +} + +fn add_variable_to_map( + m: HashMap, + variables: &Vec, +) -> HashMap { + let mut map = m.clone(); + for variable in variables { + if !variable.enabled || variable.value.is_empty() { + continue; + } + let name = variable.name.as_str(); + let value = variable.value.as_str(); + map.insert(name.into(), value.into()); + } + + map +} + diff --git a/src-tauri/yaak-plugins/Cargo.toml b/src-tauri/yaak-plugins/Cargo.toml index e82b4e7b..9f5e73fe 100644 --- a/src-tauri/yaak-plugins/Cargo.toml +++ b/src-tauri/yaak-plugins/Cargo.toml @@ -10,7 +10,7 @@ futures-util = "0.3.30" log = "0.4.21" md5 = "0.7.0" path-slash = "0.2.1" -rand = "0.8.5" +rand = "0.9.0" regex = "1.10.6" serde = { version = "1.0.198", features = ["derive"] } serde_json = "1.0.113" @@ -21,3 +21,4 @@ tokio = { version = "1.42.0", features = ["macros", "rt-multi-thread", "process" tokio-tungstenite = "0.26.1" ts-rs = { workspace = true, features = ["import-esm"] } yaak-models = { workspace = true } +yaak-templates = { workspace = true } diff --git a/src-tauri/yaak-plugins/bindings/gen_events.ts b/src-tauri/yaak-plugins/bindings/gen_events.ts index f33ed345..b2b7e0a6 100644 --- a/src-tauri/yaak-plugins/bindings/gen_events.ts +++ b/src-tauri/yaak-plugins/bindings/gen_events.ts @@ -5,6 +5,7 @@ import type { GrpcRequest } from "./gen_models.js"; import type { HttpRequest } from "./gen_models.js"; import type { HttpResponse } from "./gen_models.js"; import type { JsonValue } from "./serde_json/JsonValue.js"; +import type { WebsocketRequest } from "./gen_models.js"; import type { Workspace } from "./gen_models.js"; export type BootRequest = { dir: string, watch: boolean, }; @@ -339,7 +340,7 @@ export type Icon = "alert_triangle" | "check" | "check_circle" | "chevron_down" export type ImportRequest = { content: string, }; -export type ImportResources = { workspaces: Array, environments: Array, folders: Array, httpRequests: Array, grpcRequests: Array, }; +export type ImportResources = { workspaces: Array, environments: Array, folders: Array, httpRequests: Array, grpcRequests: Array, websocketRequests: Array, }; export type ImportResponse = { resources: ImportResources, }; diff --git a/src-tauri/yaak-plugins/bindings/gen_models.ts b/src-tauri/yaak-plugins/bindings/gen_models.ts index 966c2143..13a800c1 100644 --- a/src-tauri/yaak-plugins/bindings/gen_models.ts +++ b/src-tauri/yaak-plugins/bindings/gen_models.ts @@ -22,4 +22,6 @@ export type HttpResponseState = "initialized" | "connected" | "closed"; export type HttpUrlParameter = { enabled?: boolean, name: string, value: string, id?: string, }; +export type WebsocketRequest = { model: "websocket_request", id: string, createdAt: string, updatedAt: string, workspaceId: string, folderId: string | null, authentication: Record, authenticationType: string | null, description: string, headers: Array, message: string, name: string, sortPriority: number, url: string, urlParameters: Array, }; + export type Workspace = { model: "workspace", id: string, createdAt: string, updatedAt: string, name: string, description: string, settingValidateCertificates: boolean, settingFollowRedirects: boolean, settingRequestTimeout: number, }; diff --git a/src-tauri/yaak-plugins/src/error.rs b/src-tauri/yaak-plugins/src/error.rs index e587d072..643d52ad 100644 --- a/src-tauri/yaak-plugins/src/error.rs +++ b/src-tauri/yaak-plugins/src/error.rs @@ -39,10 +39,4 @@ pub enum Error { UnknownEventErr, } -impl Into for Error { - fn into(self) -> String { - todo!() - } -} - pub type Result = std::result::Result; diff --git a/src-tauri/yaak-plugins/src/events.rs b/src-tauri/yaak-plugins/src/events.rs index eb55cf37..3676bbe1 100644 --- a/src-tauri/yaak-plugins/src/events.rs +++ b/src-tauri/yaak-plugins/src/events.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use tauri::{Runtime, WebviewWindow}; use ts_rs::TS; -use yaak_models::models::{Environment, Folder, GrpcRequest, HttpRequest, HttpResponse, Workspace}; +use yaak_models::models::{Environment, Folder, GrpcRequest, HttpRequest, HttpResponse, WebsocketRequest, Workspace}; #[derive(Debug, Clone, Serialize, Deserialize, TS)] #[serde(rename_all = "camelCase")] @@ -873,6 +873,7 @@ pub struct ImportResources { pub folders: Vec, pub http_requests: Vec, pub grpc_requests: Vec, + pub websocket_requests: Vec, } #[derive(Debug, Clone, Default, Serialize, Deserialize, TS)] diff --git a/src-tauri/yaak-plugins/src/lib.rs b/src-tauri/yaak-plugins/src/lib.rs index 659b6b01..d142d438 100644 --- a/src-tauri/yaak-plugins/src/lib.rs +++ b/src-tauri/yaak-plugins/src/lib.rs @@ -7,8 +7,9 @@ use tauri::{Manager, RunEvent, Runtime, State}; pub mod error; pub mod events; pub mod manager; -mod nodejs; pub mod plugin_handle; +pub mod template_callback; +mod nodejs; mod server_ws; mod util; diff --git a/src-tauri/yaak-plugins/src/manager.rs b/src-tauri/yaak-plugins/src/manager.rs index c6924c4e..31aa60fb 100644 --- a/src-tauri/yaak-plugins/src/manager.rs +++ b/src-tauri/yaak-plugins/src/manager.rs @@ -53,8 +53,8 @@ impl PluginManager { PluginRuntimeServerWebsocket::new(events_tx, client_disconnect_tx, client_connect_tx); let plugin_manager = PluginManager { - plugins: Arc::new(Mutex::new(Vec::new())), - subscribers: Arc::new(Mutex::new(HashMap::new())), + plugins: Default::default(), + subscribers: Default::default(), ws_service: Arc::new(ws_service.clone()), kill_tx: kill_server_tx, }; diff --git a/src-tauri/src/template_callback.rs b/src-tauri/yaak-plugins/src/template_callback.rs similarity index 95% rename from src-tauri/src/template_callback.rs rename to src-tauri/yaak-plugins/src/template_callback.rs index 32078f53..2c408f7a 100644 --- a/src-tauri/src/template_callback.rs +++ b/src-tauri/yaak-plugins/src/template_callback.rs @@ -1,7 +1,7 @@ +use crate::events::{FormInput, RenderPurpose, WindowContext}; +use crate::manager::PluginManager; use std::collections::HashMap; use tauri::{AppHandle, Manager, Runtime}; -use yaak_plugins::events::{FormInput, RenderPurpose, WindowContext}; -use yaak_plugins::manager::PluginManager; use yaak_templates::TemplateCallback; #[derive(Clone)] diff --git a/src-tauri/yaak-plugins/src/util.rs b/src-tauri/yaak-plugins/src/util.rs index 6145548a..751ae482 100644 --- a/src-tauri/yaak-plugins/src/util.rs +++ b/src-tauri/yaak-plugins/src/util.rs @@ -1,5 +1,6 @@ -use rand::distributions::{Alphanumeric, DistString}; +use rand::distr::Alphanumeric; +use rand::Rng; pub fn gen_id() -> String { - Alphanumeric.sample_string(&mut rand::thread_rng(), 5) + rand::rng().sample_iter(&Alphanumeric).take(5).map(char::from).collect() } diff --git a/src-tauri/yaak-sync/Cargo.toml b/src-tauri/yaak-sync/Cargo.toml index a039963c..0d9871d2 100644 --- a/src-tauri/yaak-sync/Cargo.toml +++ b/src-tauri/yaak-sync/Cargo.toml @@ -21,4 +21,4 @@ tokio = { version = "1.42.0", features = ["fs", "sync", "macros"] } notify = "7.0.0" [build-dependencies] -tauri-plugin = { version = "2.0.3", features = ["build"] } +tauri-plugin = { workspace = true, features = ["build"] } diff --git a/src-tauri/yaak-sync/bindings/gen_models.ts b/src-tauri/yaak-sync/bindings/gen_models.ts index 0a2c727a..df0aa846 100644 --- a/src-tauri/yaak-sync/bindings/gen_models.ts +++ b/src-tauri/yaak-sync/bindings/gen_models.ts @@ -16,8 +16,10 @@ export type HttpRequestHeader = { enabled?: boolean, name: string, value: string export type HttpUrlParameter = { enabled?: boolean, name: string, value: string, id?: string, }; -export type SyncModel = { "type": "workspace" } & Workspace | { "type": "environment" } & Environment | { "type": "folder" } & Folder | { "type": "http_request" } & HttpRequest | { "type": "grpc_request" } & GrpcRequest; +export type SyncModel = { "type": "workspace" } & Workspace | { "type": "environment" } & Environment | { "type": "folder" } & Folder | { "type": "http_request" } & HttpRequest | { "type": "grpc_request" } & GrpcRequest | { "type": "websocket_request" } & WebsocketRequest; export type SyncState = { model: "sync_state", id: string, workspaceId: string, createdAt: string, updatedAt: string, flushedAt: string, modelId: string, checksum: string, relPath: string, syncDir: string, }; +export type WebsocketRequest = { model: "websocket_request", id: string, createdAt: string, updatedAt: string, workspaceId: string, folderId: string | null, authentication: Record, authenticationType: string | null, description: string, headers: Array, message: string, name: string, sortPriority: number, url: string, urlParameters: Array, }; + export type Workspace = { model: "workspace", id: string, createdAt: string, updatedAt: string, name: string, description: string, settingValidateCertificates: boolean, settingFollowRedirects: boolean, settingRequestTimeout: number, }; diff --git a/src-tauri/yaak-sync/src/models.rs b/src-tauri/yaak-sync/src/models.rs index 43b0feff..54257374 100644 --- a/src-tauri/yaak-sync/src/models.rs +++ b/src-tauri/yaak-sync/src/models.rs @@ -6,7 +6,9 @@ use sha1::{Digest, Sha1}; use std::path::Path; use tokio::fs; use ts_rs::TS; -use yaak_models::models::{AnyModel, Environment, Folder, GrpcRequest, HttpRequest, Workspace}; +use yaak_models::models::{ + AnyModel, Environment, Folder, GrpcRequest, HttpRequest, WebsocketRequest, Workspace, +}; #[derive(Debug, Clone, Serialize, Deserialize, TS)] #[serde(rename_all = "snake_case", tag = "type")] @@ -17,6 +19,7 @@ pub enum SyncModel { Folder(Folder), HttpRequest(HttpRequest), GrpcRequest(GrpcRequest), + WebsocketRequest(WebsocketRequest), } impl SyncModel { @@ -62,6 +65,7 @@ impl SyncModel { SyncModel::Folder(m) => m.id, SyncModel::HttpRequest(m) => m.id, SyncModel::GrpcRequest(m) => m.id, + SyncModel::WebsocketRequest(m) => m.id, } } @@ -72,6 +76,7 @@ impl SyncModel { SyncModel::Folder(m) => m.workspace_id, SyncModel::HttpRequest(m) => m.workspace_id, SyncModel::GrpcRequest(m) => m.workspace_id, + SyncModel::WebsocketRequest(m) => m.workspace_id, } } @@ -82,6 +87,7 @@ impl SyncModel { SyncModel::Folder(m) => m.updated_at, SyncModel::HttpRequest(m) => m.updated_at, SyncModel::GrpcRequest(m) => m.updated_at, + SyncModel::WebsocketRequest(m) => m.updated_at, } } } @@ -95,15 +101,20 @@ impl TryFrom for SyncModel { AnyModel::Folder(m) => SyncModel::Folder(m), AnyModel::GrpcRequest(m) => SyncModel::GrpcRequest(m), AnyModel::HttpRequest(m) => SyncModel::HttpRequest(m), + AnyModel::WebsocketRequest(m) => SyncModel::WebsocketRequest(m), AnyModel::Workspace(m) => SyncModel::Workspace(m), - AnyModel::WorkspaceMeta(m) => return Err(UnknownModel(m.model)), + + // Non-sync models AnyModel::CookieJar(m) => return Err(UnknownModel(m.model)), AnyModel::GrpcConnection(m) => return Err(UnknownModel(m.model)), AnyModel::GrpcEvent(m) => return Err(UnknownModel(m.model)), AnyModel::HttpResponse(m) => return Err(UnknownModel(m.model)), + AnyModel::KeyValue(m) => return Err(UnknownModel(m.model)), AnyModel::Plugin(m) => return Err(UnknownModel(m.model)), AnyModel::Settings(m) => return Err(UnknownModel(m.model)), - AnyModel::KeyValue(m) => return Err(UnknownModel(m.model)), + AnyModel::WebsocketConnection(m) => return Err(UnknownModel(m.model)), + AnyModel::WebsocketEvent(m) => return Err(UnknownModel(m.model)), + AnyModel::WorkspaceMeta(m) => return Err(UnknownModel(m.model)), }; Ok(m) } diff --git a/src-tauri/yaak-sync/src/sync.rs b/src-tauri/yaak-sync/src/sync.rs index 0b21e41b..43e26b9f 100644 --- a/src-tauri/yaak-sync/src/sync.rs +++ b/src-tauri/yaak-sync/src/sync.rs @@ -15,8 +15,9 @@ use ts_rs::TS; use yaak_models::models::{SyncState, WorkspaceMeta}; use yaak_models::queries::{ batch_upsert, delete_environment, delete_folder, delete_grpc_request, delete_http_request, - delete_sync_state, delete_workspace, get_workspace_export_resources, get_workspace_meta, - list_sync_states_for_workspace, upsert_sync_state, upsert_workspace_meta, UpdateSource, + delete_sync_state, delete_websocket_request, delete_workspace, get_workspace_export_resources, + get_workspace_meta, list_sync_states_for_workspace, upsert_sync_state, upsert_workspace_meta, + UpdateSource, }; #[derive(Debug, Clone, Serialize, Deserialize, TS)] @@ -296,6 +297,9 @@ async fn workspace_models( for m in resources.grpc_requests { sync_models.push(SyncModel::GrpcRequest(m)); } + for m in resources.websocket_requests { + sync_models.push(SyncModel::WebsocketRequest(m)); + } Ok(sync_models) } @@ -320,6 +324,7 @@ pub(crate) async fn apply_sync_ops( let mut folders_to_upsert = Vec::new(); let mut http_requests_to_upsert = Vec::new(); let mut grpc_requests_to_upsert = Vec::new(); + let mut websocket_requests_to_upsert = Vec::new(); for op in sync_ops { // Only apply things if workspace ID matches @@ -381,6 +386,7 @@ pub(crate) async fn apply_sync_ops( SyncModel::Folder(m) => folders_to_upsert.push(m), SyncModel::HttpRequest(m) => http_requests_to_upsert.push(m), SyncModel::GrpcRequest(m) => grpc_requests_to_upsert.push(m), + SyncModel::WebsocketRequest(m) => websocket_requests_to_upsert.push(m), }; SyncStateOp::Create { model_id, @@ -397,6 +403,7 @@ pub(crate) async fn apply_sync_ops( SyncModel::Folder(m) => folders_to_upsert.push(m), SyncModel::HttpRequest(m) => http_requests_to_upsert.push(m), SyncModel::GrpcRequest(m) => grpc_requests_to_upsert.push(m), + SyncModel::WebsocketRequest(m) => websocket_requests_to_upsert.push(m), } SyncStateOp::Update { state: state.to_owned(), @@ -420,6 +427,7 @@ pub(crate) async fn apply_sync_ops( folders_to_upsert, http_requests_to_upsert, grpc_requests_to_upsert, + websocket_requests_to_upsert, &UpdateSource::Sync, ) .await?; @@ -543,6 +551,9 @@ async fn delete_model(window: &WebviewWindow, model: &SyncModel) SyncModel::GrpcRequest(m) => { delete_grpc_request(window, m.id.as_str(), &UpdateSource::Sync).await?; } + SyncModel::WebsocketRequest(m) => { + delete_websocket_request(window, m.id.as_str(), &UpdateSource::Sync).await?; + } }; Ok(()) } diff --git a/src-tauri/yaak-templates/Cargo.toml b/src-tauri/yaak-templates/Cargo.toml index d74805fe..5bb0d3bb 100644 --- a/src-tauri/yaak-templates/Cargo.toml +++ b/src-tauri/yaak-templates/Cargo.toml @@ -9,3 +9,4 @@ log = "0.4.22" serde = { version = "1.0.208", features = ["derive"] } ts-rs = { version = "10.0.0" } tokio = { version = "1.39.3", features = ["macros", "rt"] } +serde_json = "1.0.132" diff --git a/src-tauri/yaak-templates/src/format.rs b/src-tauri/yaak-templates/src/format.rs index fa6f9884..f34bdd85 100644 --- a/src-tauri/yaak-templates/src/format.rs +++ b/src-tauri/yaak-templates/src/format.rs @@ -142,7 +142,7 @@ pub fn format_json(text: &str, tab: &str) -> String { } #[cfg(test)] -mod test { +mod tests { use crate::format::format_json; #[test] diff --git a/src-tauri/yaak-templates/src/renderer.rs b/src-tauri/yaak-templates/src/renderer.rs index cb7ffaa2..bf745da1 100644 --- a/src-tauri/yaak-templates/src/renderer.rs +++ b/src-tauri/yaak-templates/src/renderer.rs @@ -1,5 +1,6 @@ use crate::{FnArg, Parser, Token, Tokens, Val}; use log::warn; +use serde_json::json; use std::collections::HashMap; use std::future::Future; @@ -11,6 +12,33 @@ pub trait TemplateCallback { ) -> impl Future> + Send; } +pub async fn render_json_value_raw( + v: serde_json::Value, + vars: &HashMap, + cb: &T, +) -> serde_json::Value { + match v { + serde_json::Value::String(s) => json!(parse_and_render(&s, vars, cb).await), + serde_json::Value::Array(a) => { + let mut new_a = Vec::new(); + for v in a { + new_a.push(Box::pin(render_json_value_raw(v, vars, cb)).await) + } + json!(new_a) + } + serde_json::Value::Object(o) => { + let mut new_o = serde_json::Map::new(); + for (k, v) in o { + let key = Box::pin(parse_and_render(&k, vars, cb)).await; + let value = Box::pin(render_json_value_raw(v, vars, cb)).await; + new_o.insert(key, value); + } + json!(new_o) + } + v => v, + } +} + pub async fn parse_and_render( template: &str, vars: &HashMap, @@ -90,7 +118,7 @@ async fn render_tag( } #[cfg(test)] -mod tests { +mod parse_and_render_tests { use crate::renderer::TemplateCallback; use crate::*; use std::collections::HashMap; @@ -218,3 +246,79 @@ mod tests { assert_eq!(parse_and_render(template, &vars, &CB {}).await, result.to_string()); } } + +#[cfg(test)] +mod render_json_value_raw_tests { + use serde_json::json; + use std::collections::HashMap; + use crate::{render_json_value_raw, TemplateCallback}; + + struct EmptyCB {} + + impl TemplateCallback for EmptyCB { + async fn run( + &self, + _fn_name: &str, + _args: HashMap, + ) -> Result { + todo!() + } + } + + #[tokio::test] + async fn render_json_value_string() { + let v = json!("${[a]}"); + let mut vars = HashMap::new(); + vars.insert("a".to_string(), "aaa".to_string()); + + let result = render_json_value_raw(v, &vars, &EmptyCB {}).await; + assert_eq!(result, json!("aaa")) + } + + #[tokio::test] + async fn render_json_value_array() { + let v = json!(["${[a]}", "${[a]}"]); + let mut vars = HashMap::new(); + vars.insert("a".to_string(), "aaa".to_string()); + + let result = render_json_value_raw(v, &vars, &EmptyCB {}).await; + assert_eq!(result, json!(["aaa", "aaa"])) + } + + #[tokio::test] + async fn render_json_value_object() { + let v = json!({"${[a]}": "${[a]}"}); + let mut vars = HashMap::new(); + vars.insert("a".to_string(), "aaa".to_string()); + + let result = render_json_value_raw(v, &vars, &EmptyCB {}).await; + assert_eq!(result, json!({"aaa": "aaa"})) + } + + #[tokio::test] + async fn render_json_value_nested() { + let v = json!([ + 123, + {"${[a]}": "${[a]}"}, + null, + "${[a]}", + false, + {"x": ["${[a]}"]} + ]); + let mut vars = HashMap::new(); + vars.insert("a".to_string(), "aaa".to_string()); + + let result = render_json_value_raw(v, &vars, &EmptyCB {}).await; + assert_eq!( + result, + json!([ + 123, + {"aaa": "aaa"}, + null, + "aaa", + false, + {"x": ["aaa"]} + ]) + ) + } +} diff --git a/src-tauri/yaak-ws/Cargo.toml b/src-tauri/yaak-ws/Cargo.toml new file mode 100644 index 00000000..47693329 --- /dev/null +++ b/src-tauri/yaak-ws/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "yaak-ws" +links = "yaak-ws" +version = "0.1.0" +edition = "2021" +publish = false + +[dependencies] +futures-util = "0.3.31" +log = "0.4.20" +md5 = "0.7.0" +rustls = { version = "0.23.21", default-features = false, features = ["custom-provider", "ring"] } +rustls-platform-verifier = "0.5.0" +serde = { version = "1.0.217", features = ["derive"] } +tauri = { workspace = true } +thiserror = "2.0.11" +tokio = { version = "1.0", default-features = false, features = ["macros", "time", "test-util"] } +tokio-tungstenite = { version = "0.26.1", default-features = false, features = ["rustls-tls-native-roots", "connect"] } +yaak-models = { workspace = true } +yaak-plugins = { workspace = true } +yaak-templates = { workspace = true } +serde_json = "1.0.132" +chrono = "0.4.38" + +[build-dependencies] +tauri-plugin = { workspace = true, features = ["build"] } diff --git a/src-tauri/yaak-ws/build.rs b/src-tauri/yaak-ws/build.rs new file mode 100644 index 00000000..4f9458e5 --- /dev/null +++ b/src-tauri/yaak-ws/build.rs @@ -0,0 +1,17 @@ +use tauri_plugin; +const COMMANDS: &[&str] = &[ + "close", + "connect", + "delete_connection", + "delete_connections", + "delete_request", + "list_connections", + "list_events", + "list_requests", + "send", + "upsert_request", +]; + +fn main() { + tauri_plugin::Builder::new(COMMANDS).build(); +} diff --git a/src-tauri/yaak-ws/index.ts b/src-tauri/yaak-ws/index.ts new file mode 100644 index 00000000..1d61b0bd --- /dev/null +++ b/src-tauri/yaak-ws/index.ts @@ -0,0 +1,77 @@ +import { invoke } from '@tauri-apps/api/core'; +import { WebsocketConnection, WebsocketEvent, WebsocketRequest } from '@yaakapp-internal/models'; + +export function upsertWebsocketRequest( + request: WebsocketRequest | Partial>, +) { + return invoke('plugin:yaak-ws|upsert_request', { + request, + }) as Promise; +} + +export function deleteWebsocketRequest(requestId: string) { + return invoke('plugin:yaak-ws|delete_request', { + requestId, + }); +} + +export function deleteWebsocketConnection(connectionId: string) { + return invoke('plugin:yaak-ws|delete_connection', { + connectionId, + }); +} + +export function deleteWebsocketConnections(requestId: string) { + return invoke('plugin:yaak-ws|delete_connections', { + requestId, + }); +} + +export function listWebsocketRequests({ workspaceId }: { workspaceId: string }) { + return invoke('plugin:yaak-ws|list_requests', { workspaceId }) as Promise; +} + +export function listWebsocketEvents({ connectionId }: { connectionId: string }) { + return invoke('plugin:yaak-ws|list_events', { connectionId }) as Promise; +} + +export function listWebsocketConnections({ workspaceId }: { workspaceId: string }) { + return invoke('plugin:yaak-ws|list_connections', { workspaceId }) as Promise< + WebsocketConnection[] + >; +} + +export function connectWebsocket({ + requestId, + environmentId, + cookieJarId, +}: { + requestId: string; + environmentId: string | null; + cookieJarId: string | null; +}) { + return invoke('plugin:yaak-ws|connect', { + requestId, + environmentId, + cookieJarId, + }) as Promise; +} + +export function closeWebsocket({ connectionId }: { connectionId: string }) { + return invoke('plugin:yaak-ws|close', { + connectionId, + }); +} + +export function sendWebsocket({ + connectionId, + environmentId, +}: { + connectionId: string; + environmentId: string | null; +}) { + return invoke('plugin:yaak-ws|send', { + connectionId, + environmentId, + }); +} diff --git a/src-tauri/yaak-ws/package.json b/src-tauri/yaak-ws/package.json new file mode 100644 index 00000000..4956fa73 --- /dev/null +++ b/src-tauri/yaak-ws/package.json @@ -0,0 +1,6 @@ +{ + "name": "@yaakapp-internal/ws", + "private": true, + "version": "1.0.0", + "main": "index.ts" +} diff --git a/src-tauri/yaak-ws/permissions/autogenerated/commands/cancel.toml b/src-tauri/yaak-ws/permissions/autogenerated/commands/cancel.toml new file mode 100644 index 00000000..91efeaa0 --- /dev/null +++ b/src-tauri/yaak-ws/permissions/autogenerated/commands/cancel.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-cancel" +description = "Enables the cancel command without any pre-configured scope." +commands.allow = ["cancel"] + +[[permission]] +identifier = "deny-cancel" +description = "Denies the cancel command without any pre-configured scope." +commands.deny = ["cancel"] diff --git a/src-tauri/yaak-ws/permissions/autogenerated/commands/close.toml b/src-tauri/yaak-ws/permissions/autogenerated/commands/close.toml new file mode 100644 index 00000000..fad12d15 --- /dev/null +++ b/src-tauri/yaak-ws/permissions/autogenerated/commands/close.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-close" +description = "Enables the close command without any pre-configured scope." +commands.allow = ["close"] + +[[permission]] +identifier = "deny-close" +description = "Denies the close command without any pre-configured scope." +commands.deny = ["close"] diff --git a/src-tauri/yaak-ws/permissions/autogenerated/commands/connect.toml b/src-tauri/yaak-ws/permissions/autogenerated/commands/connect.toml new file mode 100644 index 00000000..49ce9ad3 --- /dev/null +++ b/src-tauri/yaak-ws/permissions/autogenerated/commands/connect.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-connect" +description = "Enables the connect command without any pre-configured scope." +commands.allow = ["connect"] + +[[permission]] +identifier = "deny-connect" +description = "Denies the connect command without any pre-configured scope." +commands.deny = ["connect"] diff --git a/src-tauri/yaak-ws/permissions/autogenerated/commands/delete_connection.toml b/src-tauri/yaak-ws/permissions/autogenerated/commands/delete_connection.toml new file mode 100644 index 00000000..ad6581e4 --- /dev/null +++ b/src-tauri/yaak-ws/permissions/autogenerated/commands/delete_connection.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-delete-connection" +description = "Enables the delete_connection command without any pre-configured scope." +commands.allow = ["delete_connection"] + +[[permission]] +identifier = "deny-delete-connection" +description = "Denies the delete_connection command without any pre-configured scope." +commands.deny = ["delete_connection"] diff --git a/src-tauri/yaak-ws/permissions/autogenerated/commands/delete_connections.toml b/src-tauri/yaak-ws/permissions/autogenerated/commands/delete_connections.toml new file mode 100644 index 00000000..4459825d --- /dev/null +++ b/src-tauri/yaak-ws/permissions/autogenerated/commands/delete_connections.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-delete-connections" +description = "Enables the delete_connections command without any pre-configured scope." +commands.allow = ["delete_connections"] + +[[permission]] +identifier = "deny-delete-connections" +description = "Denies the delete_connections command without any pre-configured scope." +commands.deny = ["delete_connections"] diff --git a/src-tauri/yaak-ws/permissions/autogenerated/commands/delete_request.toml b/src-tauri/yaak-ws/permissions/autogenerated/commands/delete_request.toml new file mode 100644 index 00000000..b2a3b9ae --- /dev/null +++ b/src-tauri/yaak-ws/permissions/autogenerated/commands/delete_request.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-delete-request" +description = "Enables the delete_request command without any pre-configured scope." +commands.allow = ["delete_request"] + +[[permission]] +identifier = "deny-delete-request" +description = "Denies the delete_request command without any pre-configured scope." +commands.deny = ["delete_request"] diff --git a/src-tauri/yaak-ws/permissions/autogenerated/commands/list_connections.toml b/src-tauri/yaak-ws/permissions/autogenerated/commands/list_connections.toml new file mode 100644 index 00000000..a9809e7c --- /dev/null +++ b/src-tauri/yaak-ws/permissions/autogenerated/commands/list_connections.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-list-connections" +description = "Enables the list_connections command without any pre-configured scope." +commands.allow = ["list_connections"] + +[[permission]] +identifier = "deny-list-connections" +description = "Denies the list_connections command without any pre-configured scope." +commands.deny = ["list_connections"] diff --git a/src-tauri/yaak-ws/permissions/autogenerated/commands/list_events.toml b/src-tauri/yaak-ws/permissions/autogenerated/commands/list_events.toml new file mode 100644 index 00000000..6a7f9b0c --- /dev/null +++ b/src-tauri/yaak-ws/permissions/autogenerated/commands/list_events.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-list-events" +description = "Enables the list_events command without any pre-configured scope." +commands.allow = ["list_events"] + +[[permission]] +identifier = "deny-list-events" +description = "Denies the list_events command without any pre-configured scope." +commands.deny = ["list_events"] diff --git a/src-tauri/yaak-ws/permissions/autogenerated/commands/list_requests.toml b/src-tauri/yaak-ws/permissions/autogenerated/commands/list_requests.toml new file mode 100644 index 00000000..b70ca7c4 --- /dev/null +++ b/src-tauri/yaak-ws/permissions/autogenerated/commands/list_requests.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-list-requests" +description = "Enables the list_requests command without any pre-configured scope." +commands.allow = ["list_requests"] + +[[permission]] +identifier = "deny-list-requests" +description = "Denies the list_requests command without any pre-configured scope." +commands.deny = ["list_requests"] diff --git a/src-tauri/yaak-ws/permissions/autogenerated/commands/list_websocket_connections.toml b/src-tauri/yaak-ws/permissions/autogenerated/commands/list_websocket_connections.toml new file mode 100644 index 00000000..f9f14fd0 --- /dev/null +++ b/src-tauri/yaak-ws/permissions/autogenerated/commands/list_websocket_connections.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-list-websocket-connections" +description = "Enables the list_websocket_connections command without any pre-configured scope." +commands.allow = ["list_websocket_connections"] + +[[permission]] +identifier = "deny-list-websocket-connections" +description = "Denies the list_websocket_connections command without any pre-configured scope." +commands.deny = ["list_websocket_connections"] diff --git a/src-tauri/yaak-ws/permissions/autogenerated/commands/list_websocket_requests.toml b/src-tauri/yaak-ws/permissions/autogenerated/commands/list_websocket_requests.toml new file mode 100644 index 00000000..541c784f --- /dev/null +++ b/src-tauri/yaak-ws/permissions/autogenerated/commands/list_websocket_requests.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-list-websocket-requests" +description = "Enables the list_websocket_requests command without any pre-configured scope." +commands.allow = ["list_websocket_requests"] + +[[permission]] +identifier = "deny-list-websocket-requests" +description = "Denies the list_websocket_requests command without any pre-configured scope." +commands.deny = ["list_websocket_requests"] diff --git a/src-tauri/yaak-ws/permissions/autogenerated/commands/send.toml b/src-tauri/yaak-ws/permissions/autogenerated/commands/send.toml new file mode 100644 index 00000000..a7bac8f5 --- /dev/null +++ b/src-tauri/yaak-ws/permissions/autogenerated/commands/send.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-send" +description = "Enables the send command without any pre-configured scope." +commands.allow = ["send"] + +[[permission]] +identifier = "deny-send" +description = "Denies the send command without any pre-configured scope." +commands.deny = ["send"] diff --git a/src-tauri/yaak-ws/permissions/autogenerated/commands/upsert_request.toml b/src-tauri/yaak-ws/permissions/autogenerated/commands/upsert_request.toml new file mode 100644 index 00000000..1578cb5f --- /dev/null +++ b/src-tauri/yaak-ws/permissions/autogenerated/commands/upsert_request.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-upsert-request" +description = "Enables the upsert_request command without any pre-configured scope." +commands.allow = ["upsert_request"] + +[[permission]] +identifier = "deny-upsert-request" +description = "Denies the upsert_request command without any pre-configured scope." +commands.deny = ["upsert_request"] diff --git a/src-tauri/yaak-ws/permissions/autogenerated/commands/upsert_websocket_request.toml b/src-tauri/yaak-ws/permissions/autogenerated/commands/upsert_websocket_request.toml new file mode 100644 index 00000000..fc7ef896 --- /dev/null +++ b/src-tauri/yaak-ws/permissions/autogenerated/commands/upsert_websocket_request.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-upsert-websocket-request" +description = "Enables the upsert_websocket_request command without any pre-configured scope." +commands.allow = ["upsert_websocket_request"] + +[[permission]] +identifier = "deny-upsert-websocket-request" +description = "Denies the upsert_websocket_request command without any pre-configured scope." +commands.deny = ["upsert_websocket_request"] diff --git a/src-tauri/yaak-ws/permissions/autogenerated/reference.md b/src-tauri/yaak-ws/permissions/autogenerated/reference.md new file mode 100644 index 00000000..673feccc --- /dev/null +++ b/src-tauri/yaak-ws/permissions/autogenerated/reference.md @@ -0,0 +1,388 @@ +## Default Permission + +Default permissions for the plugin + +- `allow-close` +- `allow-connect` +- `allow-delete-connection` +- `allow-delete-connections` +- `allow-delete-request` +- `allow-list-connections` +- `allow-list-events` +- `allow-list-requests` +- `allow-send` +- `allow-upsert-request` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`yaak-ws:allow-cancel` + + + +Enables the cancel command without any pre-configured scope. + +
+ +`yaak-ws:deny-cancel` + + + +Denies the cancel command without any pre-configured scope. + +
+ +`yaak-ws:allow-close` + + + +Enables the close command without any pre-configured scope. + +
+ +`yaak-ws:deny-close` + + + +Denies the close command without any pre-configured scope. + +
+ +`yaak-ws:allow-connect` + + + +Enables the connect command without any pre-configured scope. + +
+ +`yaak-ws:deny-connect` + + + +Denies the connect command without any pre-configured scope. + +
+ +`yaak-ws:allow-delete-connection` + + + +Enables the delete_connection command without any pre-configured scope. + +
+ +`yaak-ws:deny-delete-connection` + + + +Denies the delete_connection command without any pre-configured scope. + +
+ +`yaak-ws:allow-delete-connections` + + + +Enables the delete_connections command without any pre-configured scope. + +
+ +`yaak-ws:deny-delete-connections` + + + +Denies the delete_connections command without any pre-configured scope. + +
+ +`yaak-ws:allow-delete-request` + + + +Enables the delete_request command without any pre-configured scope. + +
+ +`yaak-ws:deny-delete-request` + + + +Denies the delete_request command without any pre-configured scope. + +
+ +`yaak-ws:allow-list-connections` + + + +Enables the list_connections command without any pre-configured scope. + +
+ +`yaak-ws:deny-list-connections` + + + +Denies the list_connections command without any pre-configured scope. + +
+ +`yaak-ws:allow-list-events` + + + +Enables the list_events command without any pre-configured scope. + +
+ +`yaak-ws:deny-list-events` + + + +Denies the list_events command without any pre-configured scope. + +
+ +`yaak-ws:allow-list-requests` + + + +Enables the list_requests command without any pre-configured scope. + +
+ +`yaak-ws:deny-list-requests` + + + +Denies the list_requests command without any pre-configured scope. + +
+ +`yaak-ws:allow-list-websocket-connections` + + + +Enables the list_websocket_connections command without any pre-configured scope. + +
+ +`yaak-ws:deny-list-websocket-connections` + + + +Denies the list_websocket_connections command without any pre-configured scope. + +
+ +`yaak-ws:allow-list-websocket-requests` + + + +Enables the list_websocket_requests command without any pre-configured scope. + +
+ +`yaak-ws:deny-list-websocket-requests` + + + +Denies the list_websocket_requests command without any pre-configured scope. + +
+ +`yaak-ws:allow-send` + + + +Enables the send command without any pre-configured scope. + +
+ +`yaak-ws:deny-send` + + + +Denies the send command without any pre-configured scope. + +
+ +`yaak-ws:allow-upsert-request` + + + +Enables the upsert_request command without any pre-configured scope. + +
+ +`yaak-ws:deny-upsert-request` + + + +Denies the upsert_request command without any pre-configured scope. + +
+ +`yaak-ws:allow-upsert-websocket-request` + + + +Enables the upsert_websocket_request command without any pre-configured scope. + +
+ +`yaak-ws:deny-upsert-websocket-request` + + + +Denies the upsert_websocket_request command without any pre-configured scope. + +
diff --git a/src-tauri/yaak-ws/permissions/default.toml b/src-tauri/yaak-ws/permissions/default.toml new file mode 100644 index 00000000..f815bcda --- /dev/null +++ b/src-tauri/yaak-ws/permissions/default.toml @@ -0,0 +1,14 @@ +[default] +description = "Default permissions for the plugin" +permissions = [ + "allow-close", + "allow-connect", + "allow-delete-connection", + "allow-delete-connections", + "allow-delete-request", + "allow-list-connections", + "allow-list-events", + "allow-list-requests", + "allow-send", + "allow-upsert-request", +] diff --git a/src-tauri/yaak-ws/permissions/schemas/schema.json b/src-tauri/yaak-ws/permissions/schemas/schema.json new file mode 100644 index 00000000..76c495df --- /dev/null +++ b/src-tauri/yaak-ws/permissions/schemas/schema.json @@ -0,0 +1,445 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "set": { + "description": "A list of permissions sets defined", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + } + }, + "definitions": { + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "description": { + "description": "Human-readable description of what the permission does. Tauri convention is to use

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

headings in markdown content for Tauri documentation generation purposes.", + "type": [ + "string", + "null" + ] + }, + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } + } + } + }, + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Scopes": { + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a null JSON value.", + "type": "null" + }, + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "Target": { + "description": "Platform target.", + "oneOf": [ + { + "description": "MacOS.", + "type": "string", + "enum": [ + "macOS" + ] + }, + { + "description": "Windows.", + "type": "string", + "enum": [ + "windows" + ] + }, + { + "description": "Linux.", + "type": "string", + "enum": [ + "linux" + ] + }, + { + "description": "Android.", + "type": "string", + "enum": [ + "android" + ] + }, + { + "description": "iOS.", + "type": "string", + "enum": [ + "iOS" + ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "Enables the cancel command without any pre-configured scope.", + "type": "string", + "const": "allow-cancel" + }, + { + "description": "Denies the cancel command without any pre-configured scope.", + "type": "string", + "const": "deny-cancel" + }, + { + "description": "Enables the close command without any pre-configured scope.", + "type": "string", + "const": "allow-close" + }, + { + "description": "Denies the close command without any pre-configured scope.", + "type": "string", + "const": "deny-close" + }, + { + "description": "Enables the connect command without any pre-configured scope.", + "type": "string", + "const": "allow-connect" + }, + { + "description": "Denies the connect command without any pre-configured scope.", + "type": "string", + "const": "deny-connect" + }, + { + "description": "Enables the delete_connection command without any pre-configured scope.", + "type": "string", + "const": "allow-delete-connection" + }, + { + "description": "Denies the delete_connection command without any pre-configured scope.", + "type": "string", + "const": "deny-delete-connection" + }, + { + "description": "Enables the delete_connections command without any pre-configured scope.", + "type": "string", + "const": "allow-delete-connections" + }, + { + "description": "Denies the delete_connections command without any pre-configured scope.", + "type": "string", + "const": "deny-delete-connections" + }, + { + "description": "Enables the delete_request command without any pre-configured scope.", + "type": "string", + "const": "allow-delete-request" + }, + { + "description": "Denies the delete_request command without any pre-configured scope.", + "type": "string", + "const": "deny-delete-request" + }, + { + "description": "Enables the list_connections command without any pre-configured scope.", + "type": "string", + "const": "allow-list-connections" + }, + { + "description": "Denies the list_connections command without any pre-configured scope.", + "type": "string", + "const": "deny-list-connections" + }, + { + "description": "Enables the list_events command without any pre-configured scope.", + "type": "string", + "const": "allow-list-events" + }, + { + "description": "Denies the list_events command without any pre-configured scope.", + "type": "string", + "const": "deny-list-events" + }, + { + "description": "Enables the list_requests command without any pre-configured scope.", + "type": "string", + "const": "allow-list-requests" + }, + { + "description": "Denies the list_requests command without any pre-configured scope.", + "type": "string", + "const": "deny-list-requests" + }, + { + "description": "Enables the list_websocket_connections command without any pre-configured scope.", + "type": "string", + "const": "allow-list-websocket-connections" + }, + { + "description": "Denies the list_websocket_connections command without any pre-configured scope.", + "type": "string", + "const": "deny-list-websocket-connections" + }, + { + "description": "Enables the list_websocket_requests command without any pre-configured scope.", + "type": "string", + "const": "allow-list-websocket-requests" + }, + { + "description": "Denies the list_websocket_requests command without any pre-configured scope.", + "type": "string", + "const": "deny-list-websocket-requests" + }, + { + "description": "Enables the send command without any pre-configured scope.", + "type": "string", + "const": "allow-send" + }, + { + "description": "Denies the send command without any pre-configured scope.", + "type": "string", + "const": "deny-send" + }, + { + "description": "Enables the upsert_request command without any pre-configured scope.", + "type": "string", + "const": "allow-upsert-request" + }, + { + "description": "Denies the upsert_request command without any pre-configured scope.", + "type": "string", + "const": "deny-upsert-request" + }, + { + "description": "Enables the upsert_websocket_request command without any pre-configured scope.", + "type": "string", + "const": "allow-upsert-websocket-request" + }, + { + "description": "Denies the upsert_websocket_request command without any pre-configured scope.", + "type": "string", + "const": "deny-upsert-websocket-request" + }, + { + "description": "Default permissions for the plugin", + "type": "string", + "const": "default" + } + ] + } + } +} \ No newline at end of file diff --git a/src-tauri/yaak-ws/src/cmd.rs b/src-tauri/yaak-ws/src/cmd.rs new file mode 100644 index 00000000..e3af7870 --- /dev/null +++ b/src-tauri/yaak-ws/src/cmd.rs @@ -0,0 +1,330 @@ +use crate::error::Error::GenericError; +use crate::error::Result; +use crate::manager::WebsocketManager; +use crate::render::render_request; +use chrono::Utc; +use log::info; +use std::str::FromStr; +use tauri::http::{HeaderMap, HeaderName}; +use tauri::{AppHandle, Manager, Runtime, State, WebviewWindow}; +use tokio::sync::{mpsc, Mutex}; +use tokio_tungstenite::tungstenite::http::HeaderValue; +use tokio_tungstenite::tungstenite::Message; +use yaak_models::models::{ + HttpResponseHeader, WebsocketConnection, WebsocketConnectionState, WebsocketEvent, + WebsocketEventType, WebsocketRequest, +}; +use yaak_models::queries; +use yaak_models::queries::{ + get_base_environment, get_cookie_jar, get_environment, get_websocket_connection, + get_websocket_request, upsert_websocket_connection, upsert_websocket_event, UpdateSource, +}; +use yaak_plugins::events::{ + CallHttpAuthenticationRequest, HttpHeader, RenderPurpose, WindowContext, +}; +use yaak_plugins::manager::PluginManager; +use yaak_plugins::template_callback::PluginTemplateCallback; + +#[tauri::command] +pub(crate) async fn upsert_request( + request: WebsocketRequest, + w: WebviewWindow, +) -> Result { + Ok(queries::upsert_websocket_request(&w, request, &UpdateSource::Window).await?) +} + +#[tauri::command] +pub(crate) async fn delete_request( + request_id: &str, + w: WebviewWindow, +) -> Result { + Ok(queries::delete_websocket_request(&w, request_id, &UpdateSource::Window).await?) +} + +#[tauri::command] +pub(crate) async fn delete_connection( + connection_id: &str, + w: WebviewWindow, +) -> Result { + Ok(queries::delete_websocket_connection(&w, connection_id, &UpdateSource::Window).await?) +} + +#[tauri::command] +pub(crate) async fn delete_connections( + request_id: &str, + w: WebviewWindow, +) -> Result<()> { + Ok(queries::delete_all_websocket_connections(&w, request_id, &UpdateSource::Window).await?) +} + +#[tauri::command] +pub(crate) async fn list_events( + connection_id: &str, + app_handle: AppHandle, +) -> Result> { + Ok(queries::list_websocket_events(&app_handle, connection_id).await?) +} + +#[tauri::command] +pub(crate) async fn list_requests( + workspace_id: &str, + app_handle: AppHandle, +) -> Result> { + Ok(queries::list_websocket_requests(&app_handle, workspace_id).await?) +} + +#[tauri::command] +pub(crate) async fn list_connections( + workspace_id: &str, + app_handle: AppHandle, +) -> Result> { + Ok(queries::list_websocket_connections_for_workspace(&app_handle, workspace_id).await?) +} + +#[tauri::command] +pub(crate) async fn send( + connection_id: &str, + environment_id: Option<&str>, + window: WebviewWindow, + ws_manager: State<'_, Mutex>, +) -> Result { + let connection = get_websocket_connection(&window, connection_id).await?; + let unrendered_request = get_websocket_request(&window, &connection.request_id) + .await? + .ok_or(GenericError("WebSocket Request not found".to_string()))?; + let environment = match environment_id { + Some(id) => Some(get_environment(&window, id).await?), + None => None, + }; + let base_environment = get_base_environment(&window, &unrendered_request.workspace_id).await?; + let request = render_request( + &unrendered_request, + &base_environment, + environment.as_ref(), + &PluginTemplateCallback::new( + window.app_handle(), + &WindowContext::from_window(&window), + RenderPurpose::Send, + ), + ) + .await; + + let mut ws_manager = ws_manager.lock().await; + ws_manager.send(&connection.id, Message::Text(request.message.clone().into())).await?; + + upsert_websocket_event( + &window, + WebsocketEvent { + connection_id: connection.id.clone(), + request_id: request.id.clone(), + workspace_id: connection.workspace_id.clone(), + is_server: false, + message_type: WebsocketEventType::Text, + message: request.message.into(), + ..Default::default() + }, + &UpdateSource::Window, + ) + .await + .unwrap(); + + Ok(connection) +} + +#[tauri::command] +pub(crate) async fn close( + connection_id: &str, + window: WebviewWindow, + ws_manager: State<'_, Mutex>, +) -> Result { + let connection = get_websocket_connection(&window, connection_id).await?; + let request = get_websocket_request(&window, &connection.request_id) + .await? + .ok_or(GenericError("WebSocket Request not found".to_string()))?; + + let mut ws_manager = ws_manager.lock().await; + ws_manager.send(&connection.id, Message::Close(None)).await?; + upsert_websocket_event( + &window, + WebsocketEvent { + connection_id: connection.id.clone(), + request_id: request.id.clone(), + workspace_id: request.workspace_id.clone(), + is_server: false, + message_type: WebsocketEventType::Close, + ..Default::default() + }, + &UpdateSource::Window, + ) + .await + .unwrap(); + + let connection = upsert_websocket_connection( + &window, + &WebsocketConnection { + state: WebsocketConnectionState::Closed, + elapsed: Utc::now() + .naive_utc() + .signed_duration_since(connection.created_at) + .num_milliseconds() as i32, + ..connection.clone() + }, + &UpdateSource::Window, + ) + .await?; + + Ok(connection) +} + +#[tauri::command] +pub(crate) async fn connect( + request_id: &str, + environment_id: Option<&str>, + cookie_jar_id: Option<&str>, + window: WebviewWindow, + plugin_manager: State<'_, PluginManager>, + ws_manager: State<'_, Mutex>, +) -> Result { + let unrendered_request = get_websocket_request(&window, request_id) + .await? + .ok_or(GenericError("Failed to find GRPC request".to_string()))?; + let environment = match environment_id { + Some(id) => Some(get_environment(&window, id).await?), + None => None, + }; + let base_environment = get_base_environment(&window, &unrendered_request.workspace_id).await?; + let request = render_request( + &unrendered_request, + &base_environment, + environment.as_ref(), + &PluginTemplateCallback::new( + window.app_handle(), + &WindowContext::from_window(&window), + RenderPurpose::Send, + ), + ) + .await; + + let mut headers = HeaderMap::new(); + if let Some(auth_name) = request.authentication_type.clone() { + let auth = request.authentication.clone(); + let plugin_req = CallHttpAuthenticationRequest { + context_id: format!("{:x}", md5::compute(request_id.to_string())), + values: serde_json::from_value(serde_json::to_value(&auth).unwrap()).unwrap(), + method: "POST".to_string(), + url: request.url.clone(), + headers: request + .headers + .clone() + .into_iter() + .map(|h| HttpHeader { + name: h.name, + value: h.value, + }) + .collect(), + }; + let plugin_result = + plugin_manager.call_http_authentication(&window, &auth_name, plugin_req).await?; + for header in plugin_result.set_headers { + headers.insert( + HeaderName::from_str(&header.name).unwrap(), + HeaderValue::from_str(&header.value).unwrap(), + ); + } + } + + // TODO: Handle cookies + let _cookie_jar = match cookie_jar_id { + Some(id) => Some(get_cookie_jar(&window, id).await?), + None => None, + }; + + let connection = upsert_websocket_connection( + &window, + &WebsocketConnection { + workspace_id: request.workspace_id.clone(), + request_id: request_id.to_string(), + ..Default::default() + }, + &UpdateSource::Window, + ) + .await?; + + let (receive_tx, mut receive_rx) = mpsc::channel::(128); + let mut ws_manager = ws_manager.lock().await; + + { + let connection_id = connection.id.clone(); + let request_id = request.id.to_string(); + let workspace_id = request.workspace_id.clone(); + let window = window.clone(); + tokio::spawn(async move { + while let Some(message) = receive_rx.recv().await { + upsert_websocket_event( + &window, + WebsocketEvent { + connection_id: connection_id.clone(), + request_id: request_id.clone(), + workspace_id: workspace_id.clone(), + is_server: true, + message_type: match message { + Message::Text(_) => WebsocketEventType::Text, + Message::Binary(_) => WebsocketEventType::Binary, + Message::Ping(_) => WebsocketEventType::Ping, + Message::Pong(_) => WebsocketEventType::Pong, + Message::Close(_) => WebsocketEventType::Close, + // Raw frame will never happen during a read + Message::Frame(_) => WebsocketEventType::Frame, + }, + message: message.into_data().into(), + ..Default::default() + }, + &UpdateSource::Window, + ) + .await + .unwrap(); + } + info!("Websocket connection closed"); + }); + } + + let response = match ws_manager.connect(&connection.id, &request.url, headers, receive_tx).await + { + Ok(r) => r, + Err(e) => { + return Ok(upsert_websocket_connection( + &window, + &WebsocketConnection { + error: Some(format!("{e:?}")), + ..connection + }, + &UpdateSource::Window, + ) + .await?); + } + }; + + let response_headers = response + .headers() + .into_iter() + .map(|(name, value)| HttpResponseHeader { + name: name.to_string(), + value: value.to_str().unwrap().to_string(), + }) + .collect::>(); + + let connection = upsert_websocket_connection( + &window, + &WebsocketConnection { + state: WebsocketConnectionState::Connected, + headers: response_headers, + status: response.status().as_u16() as i32, + url: request.url.clone(), + ..connection + }, + &UpdateSource::Window, + ) + .await?; + + Ok(connection) +} diff --git a/src-tauri/yaak-ws/src/connect.rs b/src-tauri/yaak-ws/src/connect.rs new file mode 100644 index 00000000..c10fbdba --- /dev/null +++ b/src-tauri/yaak-ws/src/connect.rs @@ -0,0 +1,80 @@ +use log::info; +use rustls::crypto::ring; +use rustls::ClientConfig; +use rustls_platform_verifier::BuilderVerifierExt; +use std::sync::Arc; +use tauri::http::HeaderMap; +use tokio::net::TcpStream; +use tokio_tungstenite::tungstenite::client::IntoClientRequest; +use tokio_tungstenite::tungstenite::handshake::client::Response; +use tokio_tungstenite::tungstenite::http::HeaderValue; +use tokio_tungstenite::tungstenite::protocol::WebSocketConfig; +use tokio_tungstenite::{ + connect_async_tls_with_config, Connector, MaybeTlsStream, WebSocketStream, +}; + +pub(crate) async fn ws_connect( + url: &str, + headers: HeaderMap, +) -> crate::error::Result<(WebSocketStream>, Response)> { + info!("Connecting to WS {url}"); + let arc_crypto_provider = Arc::new(ring::default_provider()); + let config = ClientConfig::builder_with_provider(arc_crypto_provider) + .with_safe_default_protocol_versions() + .unwrap() + .with_platform_verifier() + .with_no_client_auth(); + + let mut req = url.into_client_request()?; + let req_headers = req.headers_mut(); + for (name, value) in headers { + if let Some(name) = name { + req_headers.insert(name, value); + } + } + + let (stream, response) = connect_async_tls_with_config( + req, + Some(WebSocketConfig::default()), + false, + Some(Connector::Rustls(Arc::new(config))), + ) + .await?; + Ok((stream, response)) +} + +#[cfg(test)] +mod tests { + use crate::connect::ws_connect; + use crate::error::Result; + use futures_util::{SinkExt, StreamExt}; + use std::time::Duration; + use tokio::time::timeout; + use tokio_tungstenite::tungstenite::Message; + + #[tokio::test] + async fn test_connection() -> Result<()> { + let (stream, response) = ws_connect("wss://echo.websocket.org/", Default::default()).await?; + assert_eq!(response.status(), 101); + + let (mut write, mut read) = stream.split(); + + let task = tokio::spawn(async move { + while let Some(Ok(message)) = read.next().await { + if message.is_text() && message.to_text().unwrap() == "Hello" { + return message; + } + } + panic!("Didn't receive text message"); + }); + + write.send(Message::Text("Hello".into())).await?; + + let task = timeout(Duration::from_secs(3), task); + let message = task.await.unwrap().unwrap(); + + assert_eq!(message.into_text().unwrap(), "Hello"); + + Ok(()) + } +} diff --git a/src-tauri/yaak-ws/src/error.rs b/src-tauri/yaak-ws/src/error.rs new file mode 100644 index 00000000..026106af --- /dev/null +++ b/src-tauri/yaak-ws/src/error.rs @@ -0,0 +1,29 @@ +use serde::{Serialize, Serializer}; +use thiserror::Error; +use tokio_tungstenite::tungstenite; + +#[derive(Error, Debug)] +pub enum Error { + #[error("WebSocket error: {0}")] + WebSocketErr(#[from] tungstenite::Error), + + #[error("Model error: {0}")] + ModelError(#[from] yaak_models::error::Error), + + #[error("Plugin error: {0}")] + PluginError(#[from] yaak_plugins::error::Error), + + #[error("WebSocket error: {0}")] + GenericError(String), +} + +impl Serialize for Error { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + serializer.serialize_str(self.to_string().as_ref()) + } +} + +pub type Result = std::result::Result; diff --git a/src-tauri/yaak-ws/src/lib.rs b/src-tauri/yaak-ws/src/lib.rs new file mode 100644 index 00000000..133e14f4 --- /dev/null +++ b/src-tauri/yaak-ws/src/lib.rs @@ -0,0 +1,37 @@ +mod cmd; +mod connect; +mod error; +mod manager; +mod render; + +use crate::cmd::{ + close, connect, delete_connection, delete_connections, delete_request, list_connections, + list_events, list_requests, send, upsert_request, +}; +use crate::manager::WebsocketManager; +use tauri::plugin::{Builder, TauriPlugin}; +use tauri::{generate_handler, Manager, Runtime}; +use tokio::sync::Mutex; + +pub fn init() -> TauriPlugin { + Builder::new("yaak-ws") + .invoke_handler(generate_handler![ + close, + connect, + delete_connection, + delete_connections, + delete_request, + list_connections, + list_events, + list_requests, + send, + upsert_request, + ]) + .setup(|app, _api| { + let manager = WebsocketManager::new(); + app.manage(Mutex::new(manager)); + + Ok(()) + }) + .build() +} diff --git a/src-tauri/yaak-ws/src/manager.rs b/src-tauri/yaak-ws/src/manager.rs new file mode 100644 index 00000000..87e5d1be --- /dev/null +++ b/src-tauri/yaak-ws/src/manager.rs @@ -0,0 +1,62 @@ +use crate::connect::ws_connect; +use crate::error::Result; +use futures_util::stream::SplitSink; +use futures_util::{SinkExt, StreamExt}; +use log::debug; +use std::collections::HashMap; +use std::sync::Arc; +use tokio::net::TcpStream; +use tokio::sync::{mpsc, Mutex}; +use tokio_tungstenite::tungstenite::handshake::client::Response; +use tokio_tungstenite::tungstenite::http::{HeaderMap, HeaderValue}; +use tokio_tungstenite::tungstenite::Message; +use tokio_tungstenite::{MaybeTlsStream, WebSocketStream}; + +#[derive(Clone)] +pub struct WebsocketManager { + connections: + Arc>, Message>>>>, +} + +impl WebsocketManager { + pub fn new() -> Self { + WebsocketManager { + connections: Default::default(), + } + } + + pub async fn connect( + &mut self, + id: &str, + url: &str, + headers: HeaderMap, + receive_tx: mpsc::Sender, + ) -> Result { + let (stream, response) = ws_connect(url, headers).await?; + let (write, mut read) = stream.split(); + self.connections.lock().await.insert(id.to_string(), write); + + let tx = receive_tx.clone(); + tauri::async_runtime::spawn(async move { + while let Some(Ok(message)) = read.next().await { + debug!("Received websocket message {message:?}"); + if message.is_close() { + return; + } + tx.send(message).await.unwrap(); + } + }); + Ok(response) + } + + pub async fn send(&mut self, id: &str, msg: Message) -> Result<()> { + debug!("Send websocket message {msg:?}"); + let mut connections = self.connections.lock().await; + let connection = match connections.get_mut(id) { + None => return Ok(()), + Some(c) => c, + }; + connection.send(msg).await?; + Ok(()) + } +} diff --git a/src-tauri/yaak-ws/src/render.rs b/src-tauri/yaak-ws/src/render.rs new file mode 100644 index 00000000..a04a6d28 --- /dev/null +++ b/src-tauri/yaak-ws/src/render.rs @@ -0,0 +1,40 @@ +use std::collections::BTreeMap; +use yaak_models::models::{Environment, HttpRequestHeader, WebsocketRequest}; +use yaak_models::render::make_vars_hashmap; +use yaak_templates::{parse_and_render, render_json_value_raw, TemplateCallback}; + +pub async fn render_request( + r: &WebsocketRequest, + base_environment: &Environment, + environment: Option<&Environment>, + cb: &T, +) -> WebsocketRequest { + let vars = &make_vars_hashmap(base_environment, environment); + + let mut headers = Vec::new(); + for p in r.headers.clone() { + headers.push(HttpRequestHeader { + enabled: p.enabled, + name: parse_and_render(&p.name, vars, cb).await, + value: parse_and_render(&p.value, vars, cb).await, + id: p.id, + }) + } + + let mut authentication = BTreeMap::new(); + for (k, v) in r.authentication.clone() { + authentication.insert(k, render_json_value_raw(v, vars, cb).await); + } + + let url = parse_and_render(r.url.as_str(), vars, cb).await; + + let message = parse_and_render(&r.message.clone(), vars, cb).await; + + WebsocketRequest { + url, + headers, + authentication, + message, + ..r.to_owned() + } +} diff --git a/src-web/commands/deleteWebsocketConnection.ts b/src-web/commands/deleteWebsocketConnection.ts new file mode 100644 index 00000000..59f002f6 --- /dev/null +++ b/src-web/commands/deleteWebsocketConnection.ts @@ -0,0 +1,14 @@ +import type { WebsocketConnection } from '@yaakapp-internal/models'; +import { deleteWebsocketConnection as cmdDeleteWebsocketConnection } from '@yaakapp-internal/ws'; +import { createFastMutation } from '../hooks/useFastMutation'; +import { trackEvent } from '../lib/analytics'; + +export const deleteWebsocketConnection = createFastMutation({ + mutationKey: ['delete_websocket_connection'], + mutationFn: async function (connection: WebsocketConnection) { + return cmdDeleteWebsocketConnection(connection.id); + }, + onSuccess: async () => { + trackEvent('websocket_connection', 'delete'); + }, +}); diff --git a/src-web/commands/deleteWebsocketConnections.ts b/src-web/commands/deleteWebsocketConnections.ts new file mode 100644 index 00000000..2560be22 --- /dev/null +++ b/src-web/commands/deleteWebsocketConnections.ts @@ -0,0 +1,14 @@ +import type { WebsocketRequest } from '@yaakapp-internal/models'; +import { deleteWebsocketConnections as cmdDeleteWebsocketConnections } from '@yaakapp-internal/ws'; +import { createFastMutation } from '../hooks/useFastMutation'; +import { trackEvent } from '../lib/analytics'; + +export const deleteWebsocketConnections = createFastMutation({ + mutationKey: ['delete_websocket_connections'], + mutationFn: async function (request: WebsocketRequest) { + return cmdDeleteWebsocketConnections(request.id); + }, + onSuccess: async () => { + trackEvent('websocket_connection', 'delete_many'); + }, +}); diff --git a/src-web/commands/deleteWebsocketRequest.tsx b/src-web/commands/deleteWebsocketRequest.tsx new file mode 100644 index 00000000..8e4b63c2 --- /dev/null +++ b/src-web/commands/deleteWebsocketRequest.tsx @@ -0,0 +1,31 @@ +import type {WebsocketRequest} from "@yaakapp-internal/models"; +import { deleteWebsocketRequest as cmdDeleteWebsocketRequest } from '@yaakapp-internal/ws'; +import { InlineCode } from '../components/core/InlineCode'; +import { createFastMutation } from '../hooks/useFastMutation'; +import { trackEvent } from '../lib/analytics'; +import { showConfirm } from '../lib/confirm'; +import { fallbackRequestName } from '../lib/fallbackRequestName'; + +export const deleteWebsocketRequest = createFastMutation({ + mutationKey: ['delete_websocket_request'], + mutationFn: async (request: WebsocketRequest) => { + const confirmed = await showConfirm({ + id: 'delete-websocket-request', + title: 'Delete WebSocket Request', + variant: 'delete', + description: ( + <> + Permanently delete {fallbackRequestName(request)}? + + ), + }); + if (!confirmed) { + return null; + } + + return cmdDeleteWebsocketRequest(request.id); + }, + onSuccess: async () => { + trackEvent('websocket_request', 'delete'); + }, +}); diff --git a/src-web/commands/upsertWebsocketRequest.ts b/src-web/commands/upsertWebsocketRequest.ts new file mode 100644 index 00000000..65858f1c --- /dev/null +++ b/src-web/commands/upsertWebsocketRequest.ts @@ -0,0 +1,27 @@ +import type { WebsocketRequest } from '@yaakapp-internal/models'; +import { upsertWebsocketRequest as cmdUpsertWebsocketRequest } from '@yaakapp-internal/ws'; +import { differenceInMilliseconds } from 'date-fns'; +import { createFastMutation } from '../hooks/useFastMutation'; +import { trackEvent } from '../lib/analytics'; +import { router } from '../lib/router'; + +export const upsertWebsocketRequest = createFastMutation< + WebsocketRequest, + void, + Parameters[0] +>({ + mutationKey: ['upsert_websocket_request'], + mutationFn: (request) => cmdUpsertWebsocketRequest(request), + onSuccess: async (request) => { + const isNew = differenceInMilliseconds(new Date(), request.createdAt + 'Z') < 100; + + if (isNew) { + trackEvent('websocket_request', 'create'); + await router.navigate({ + to: '/workspaces/$workspaceId', + params: { workspaceId: request.workspaceId }, + search: (prev) => ({ ...prev, request_id: request.id }), + }); + } else trackEvent('websocket_request', 'update'); + }, +}); diff --git a/src-web/commands/upsertWorkspace.ts b/src-web/commands/upsertWorkspace.ts index 7132b70b..882475eb 100644 --- a/src-web/commands/upsertWorkspace.ts +++ b/src-web/commands/upsertWorkspace.ts @@ -1,4 +1,5 @@ import type { Workspace } from '@yaakapp-internal/models'; +import { differenceInMilliseconds } from 'date-fns'; import { createFastMutation } from '../hooks/useFastMutation'; import { trackEvent } from '../lib/analytics'; import { invokeCmd } from '../lib/tauri'; @@ -11,7 +12,7 @@ export const upsertWorkspace = createFastMutation< mutationKey: ['upsert_workspace'], mutationFn: (workspace) => invokeCmd('cmd_update_workspace', { workspace }), onSuccess: async (workspace) => { - const isNew = workspace.createdAt == workspace.updatedAt; + const isNew = differenceInMilliseconds(new Date(), workspace.createdAt + 'Z') < 100; if (isNew) trackEvent('workspace', 'create'); else trackEvent('workspace', 'update'); diff --git a/src-web/components/GrpcConnectionMessagesPane.tsx b/src-web/components/GrpcConnectionMessagesPane.tsx index ef9c81b7..6e757f20 100644 --- a/src-web/components/GrpcConnectionMessagesPane.tsx +++ b/src-web/components/GrpcConnectionMessagesPane.tsx @@ -3,19 +3,21 @@ import classNames from 'classnames'; import { format } from 'date-fns'; import type { CSSProperties } from 'react'; import React, { useEffect, useMemo, useState } from 'react'; +import { useCopy } from '../hooks/useCopy'; import { useGrpcEvents } from '../hooks/useGrpcEvents'; import { usePinnedGrpcConnection } from '../hooks/usePinnedGrpcConnection'; import { useStateWithDeps } from '../hooks/useStateWithDeps'; import { Banner } from './core/Banner'; import { Button } from './core/Button'; import { Icon } from './core/Icon'; +import { IconButton } from './core/IconButton'; import { JsonAttributeTree } from './core/JsonAttributeTree'; import { KeyValueRow, KeyValueRows } from './core/KeyValueRow'; import { Separator } from './core/Separator'; import { SplitLayout } from './core/SplitLayout'; import { HStack, VStack } from './core/Stacks'; import { EmptyStateText } from './EmptyStateText'; -import { RecentConnectionsDropdown } from './RecentConnectionsDropdown'; +import { RecentGrpcConnectionsDropdown } from './RecentGrpcConnectionsDropdown'; interface Props { style?: CSSProperties; @@ -37,6 +39,7 @@ export function GrpcConnectionMessagesPane({ style, methodType, activeRequest }: const { activeConnection, connections, setPinnedConnectionId } = usePinnedGrpcConnection(activeRequest); const events = useGrpcEvents(activeConnection?.id ?? null); + const copy = useCopy(); const activeEvent = useMemo( () => events.find((m) => m.id === activeEventId) ?? null, @@ -69,11 +72,13 @@ export function GrpcConnectionMessagesPane({ style, methodType, activeRequest }: )} - +
+ +
{activeConnection.error && ( @@ -107,8 +112,16 @@ export function GrpcConnectionMessagesPane({ style, methodType, activeRequest }: {activeEvent.eventType === 'client_message' || activeEvent.eventType === 'server_message' ? ( <> -
- Message {activeEvent.eventType === 'client_message' ? 'Sent' : 'Received'} +
+
+ Message {activeEvent.eventType === 'client_message' ? 'Sent' : 'Received'} +
+ copy(activeEvent.content)} + />
{!showLarge && activeEvent.content.length > 1000 * 1000 ? ( diff --git a/src-web/components/GrpcConnectionSetupPane.tsx b/src-web/components/GrpcConnectionSetupPane.tsx index a489fcff..600f14ba 100644 --- a/src-web/components/GrpcConnectionSetupPane.tsx +++ b/src-web/components/GrpcConnectionSetupPane.tsx @@ -312,6 +312,7 @@ export function GrpcConnectionSetupPane({ & { +type Props = Pick & { services: ReflectResponseService[] | null; reflectionError?: string; reflectionLoading?: boolean; diff --git a/src-web/components/HeadersEditor.tsx b/src-web/components/HeadersEditor.tsx index 1f56a99c..a4cb4469 100644 --- a/src-web/components/HeadersEditor.tsx +++ b/src-web/components/HeadersEditor.tsx @@ -1,4 +1,4 @@ -import type { HttpRequest } from '@yaakapp-internal/models'; +import type { HttpRequestHeader } from '@yaakapp-internal/models'; import type { GenericCompletionOption } from '@yaakapp-internal/plugins'; import { charsets } from '../lib/data/charsets'; import { connections } from '../lib/data/connections'; @@ -11,18 +11,19 @@ import { PairOrBulkEditor } from './core/PairOrBulkEditor'; type Props = { forceUpdateKey: string; - request: HttpRequest; - onChange: (headers: HttpRequest['headers']) => void; + headers: HttpRequestHeader[]; + stateKey: string; + onChange: (headers: HttpRequestHeader[]) => void; }; -export function HeadersEditor({ request, onChange, forceUpdateKey }: Props) { +export function HeadersEditor({ stateKey, headers, onChange, forceUpdateKey }: Props) { return ( ({ ...r, authentication }), }); + } else if (request.model === 'websocket_request') { + upsertWebsocketRequest.mutate({ ...request, authentication }); } else { updateGrpcRequest.mutate({ id: request.id, @@ -39,7 +42,7 @@ export function HttpAuthenticationEditor({ request }: Props) { }); } }, - [request.id, request.model, updateGrpcRequest, updateHttpRequest], + [request, updateGrpcRequest, updateHttpRequest], ); if (authConfig.data == null) { diff --git a/src-web/components/HttpRequestLayout.tsx b/src-web/components/HttpRequestLayout.tsx index 4c786444..44367715 100644 --- a/src-web/components/HttpRequestLayout.tsx +++ b/src-web/components/HttpRequestLayout.tsx @@ -2,8 +2,8 @@ import type { CSSProperties } from 'react'; import React from 'react'; import type { HttpRequest } from '@yaakapp-internal/models'; import { SplitLayout } from './core/SplitLayout'; -import { RequestPane } from './RequestPane'; -import { ResponsePane } from './ResponsePane'; +import { HttpRequestPane } from './HttpRequestPane'; +import { HttpResponsePane } from './HttpResponsePane'; interface Props { activeRequest: HttpRequest; @@ -17,13 +17,13 @@ export function HttpRequestLayout({ activeRequest, style }: Props) { className="p-3 gap-1.5" style={style} firstSlot={({ orientation, style }) => ( - )} - secondSlot={({ style }) => } + secondSlot={({ style }) => } /> ); } diff --git a/src-web/components/RequestPane.tsx b/src-web/components/HttpRequestPane.tsx similarity index 98% rename from src-web/components/RequestPane.tsx rename to src-web/components/HttpRequestPane.tsx index 3f3ac97c..c6eebe49 100644 --- a/src-web/components/RequestPane.tsx +++ b/src-web/components/HttpRequestPane.tsx @@ -4,7 +4,7 @@ import classNames from 'classnames'; import { atom, useAtom, useAtomValue } from 'jotai'; import { atomWithStorage } from 'jotai/utils'; import type { CSSProperties } from 'react'; -import React, { memo, useCallback, useMemo, useState } from 'react'; +import React, { useCallback, useMemo, useState } from 'react'; import { activeRequestIdAtom } from '../hooks/useActiveRequestId'; import { useCancelHttpResponse } from '../hooks/useCancelHttpResponse'; import { useContentTypeFromHeaders } from '../hooks/useContentTypeFromHeaders'; @@ -77,12 +77,7 @@ const nonActiveRequestUrlsAtom = atom((get) => { const memoNotActiveRequestUrlsAtom = deepEqualAtom(nonActiveRequestUrlsAtom); -export const RequestPane = memo(function RequestPane({ - style, - fullHeight, - className, - activeRequest, -}: Props) { +export function HttpRequestPane({ style, fullHeight, className, activeRequest }: Props) { const activeRequestId = activeRequest.id; const { mutateAsync: updateRequestAsync, mutate: updateRequest } = useUpdateAnyHttpRequest(); const [activeTabs, setActiveTabs] = useAtom(tabsAtom); @@ -94,7 +89,7 @@ export const RequestPane = memo(function RequestPane({ const handleContentTypeChange = useCallback( async (contentType: string | null) => { - if (activeRequest == null || activeRequest.model !== 'http_request') { + if (activeRequest == null) { console.error('Failed to get active request to update', activeRequest); return; } @@ -381,7 +376,8 @@ export const RequestPane = memo(function RequestPane({ updateRequest({ id: activeRequestId, update: { headers } })} /> @@ -492,4 +488,4 @@ export const RequestPane = memo(function RequestPane({ )}
); -}); +} diff --git a/src-web/components/ResponsePane.tsx b/src-web/components/HttpResponsePane.tsx similarity index 96% rename from src-web/components/ResponsePane.tsx rename to src-web/components/HttpResponsePane.tsx index 8d78bc75..eef1fb58 100644 --- a/src-web/components/ResponsePane.tsx +++ b/src-web/components/HttpResponsePane.tsx @@ -1,7 +1,7 @@ import type { HttpResponse } from '@yaakapp-internal/models'; import classNames from 'classnames'; import type { CSSProperties, ReactNode } from 'react'; -import React, { memo, useCallback, useMemo } from 'react'; +import React, { useCallback, useMemo } from 'react'; import { useLocalStorage } from 'react-use'; import { useContentTypeFromHeaders } from '../hooks/useContentTypeFromHeaders'; import { usePinnedHttpResponse } from '../hooks/usePinnedHttpResponse'; @@ -18,7 +18,7 @@ import { StatusTag } from './core/StatusTag'; import type { TabItem } from './core/Tabs/Tabs'; import { TabContent, Tabs } from './core/Tabs/Tabs'; import { EmptyStateText } from './EmptyStateText'; -import { RecentResponsesDropdown } from './RecentResponsesDropdown'; +import { RecentHttpResponsesDropdown } from './RecentHttpResponsesDropdown'; import { ResponseHeaders } from './ResponseHeaders'; import { ResponseInfo } from './ResponseInfo'; import { AudioViewer } from './responseViewers/AudioViewer'; @@ -40,11 +40,7 @@ const TAB_BODY = 'body'; const TAB_HEADERS = 'headers'; const TAB_INFO = 'info'; -export const ResponsePane = memo(function ResponsePane({ - style, - className, - activeRequestId, -}: Props) { +export function HttpResponsePane({ style, className, activeRequestId }: Props) { const { activeResponse, setPinnedResponseId, responses } = usePinnedHttpResponse(activeRequestId); const [viewMode, setViewMode] = useResponseViewMode(activeResponse?.requestId); const [activeTabs, setActiveTabs] = useLocalStorage>( @@ -135,7 +131,7 @@ export const ResponsePane = memo(function ResponsePane({
- ); -}); +} function EnsureCompleteResponse({ response, diff --git a/src-web/components/LicenseBadge.tsx b/src-web/components/LicenseBadge.tsx index f8e274ae..48e91329 100644 --- a/src-web/components/LicenseBadge.tsx +++ b/src-web/components/LicenseBadge.tsx @@ -47,7 +47,7 @@ export function LicenseBadge() { className="!rounded-full mx-1" onClick={async () => { if (checkType === 'beta') { - await openUrl('https://feedback.yaak.app/p/yaak-20-feedback'); + await openUrl('https://feedback.yaak.app'); } else { openSettings.mutate(); } diff --git a/src-web/components/MoveToWorkspaceDialog.tsx b/src-web/components/MoveToWorkspaceDialog.tsx index e08c364b..f45f210a 100644 --- a/src-web/components/MoveToWorkspaceDialog.tsx +++ b/src-web/components/MoveToWorkspaceDialog.tsx @@ -1,5 +1,6 @@ -import type { GrpcRequest, HttpRequest } from '@yaakapp-internal/models'; +import type { GrpcRequest, HttpRequest, WebsocketRequest } from '@yaakapp-internal/models'; import React, { useState } from 'react'; +import { upsertWebsocketRequest } from '../commands/upsertWebsocketRequest'; import { useUpdateAnyGrpcRequest } from '../hooks/useUpdateAnyGrpcRequest'; import { useUpdateAnyHttpRequest } from '../hooks/useUpdateAnyHttpRequest'; import { useWorkspaces } from '../hooks/useWorkspaces'; @@ -13,7 +14,7 @@ import { VStack } from './core/Stacks'; interface Props { activeWorkspaceId: string; - request: HttpRequest | GrpcRequest; + request: HttpRequest | GrpcRequest | WebsocketRequest; onDone: () => void; } @@ -39,15 +40,17 @@ export function MoveToWorkspaceDialog({ onDone, request, activeWorkspaceId }: Pr color="primary" disabled={selectedWorkspaceId === activeWorkspaceId} onClick={async () => { - const args = { - id: request.id, - update: { workspaceId: selectedWorkspaceId, folderId: null }, + const update = { + workspaceId: selectedWorkspaceId, + folderId: null, }; if (request.model === 'http_request') { - await updateHttpRequest.mutateAsync(args); + await updateHttpRequest.mutateAsync({ id: request.id, update }); } else if (request.model === 'grpc_request') { - await updateGrpcRequest.mutateAsync(args); + await updateGrpcRequest.mutateAsync({ id: request.id, update }); + } else if (request.model === 'websocket_request') { + await upsertWebsocketRequest.mutateAsync({ ...request, ...update }); } // Hide after a moment, to give time for request to disappear diff --git a/src-web/components/RecentConnectionsDropdown.tsx b/src-web/components/RecentGrpcConnectionsDropdown.tsx similarity index 94% rename from src-web/components/RecentConnectionsDropdown.tsx rename to src-web/components/RecentGrpcConnectionsDropdown.tsx index 81efd53f..63f7ac24 100644 --- a/src-web/components/RecentConnectionsDropdown.tsx +++ b/src-web/components/RecentGrpcConnectionsDropdown.tsx @@ -14,7 +14,7 @@ interface Props { onPinnedConnectionId: (id: string) => void; } -export function RecentConnectionsDropdown({ +export function RecentGrpcConnectionsDropdown({ activeConnection, connections, onPinnedConnectionId, @@ -38,7 +38,7 @@ export function RecentConnectionsDropdown({ disabled: connections.length === 0, }, { type: 'separator', label: 'History' }, - ...connections.slice(0, 20).map((c) => ({ + ...connections.map((c) => ({ label: ( {formatDistanceToNowStrict(c.createdAt + 'Z')} ago •{' '} @@ -53,7 +53,7 @@ export function RecentConnectionsDropdown({ diff --git a/src-web/components/RecentResponsesDropdown.tsx b/src-web/components/RecentHttpResponsesDropdown.tsx similarity index 96% rename from src-web/components/RecentResponsesDropdown.tsx rename to src-web/components/RecentHttpResponsesDropdown.tsx index 5d70c55d..04ff3a04 100644 --- a/src-web/components/RecentResponsesDropdown.tsx +++ b/src-web/components/RecentHttpResponsesDropdown.tsx @@ -17,7 +17,7 @@ interface Props { className?: string; } -export const RecentResponsesDropdown = function ResponsePane({ +export const RecentHttpResponsesDropdown = function ResponsePane({ activeResponse, responses, onPinnedResponseId, @@ -65,7 +65,7 @@ export const RecentResponsesDropdown = function ResponsePane({ disabled: responses.length === 0, }, { type: 'separator' }, - ...responses.slice(0, 20).map((r: HttpResponse) => ({ + ...responses.map((r: HttpResponse) => ({ label: ( diff --git a/src-web/components/RecentRequestsDropdown.tsx b/src-web/components/RecentRequestsDropdown.tsx index 5d10a0ce..6b725810 100644 --- a/src-web/components/RecentRequestsDropdown.tsx +++ b/src-web/components/RecentRequestsDropdown.tsx @@ -2,11 +2,10 @@ import classNames from 'classnames'; import { useMemo, useRef } from 'react'; import { useActiveRequest } from '../hooks/useActiveRequest'; import { getActiveWorkspaceId } from '../hooks/useActiveWorkspace'; -import { grpcRequestsAtom } from '../hooks/useGrpcRequests'; import { useHotKey } from '../hooks/useHotKey'; -import { httpRequestsAtom } from '../hooks/useHttpRequests'; import { useKeyboardEvent } from '../hooks/useKeyboardEvent'; import { useRecentRequests } from '../hooks/useRecentRequests'; +import { requestsAtom } from '../hooks/useRequests'; import { fallbackRequestName } from '../lib/fallbackRequestName'; import { jotaiStore } from '../lib/jotai'; import { router } from '../lib/router'; @@ -51,7 +50,7 @@ export function RecentRequestsDropdown({ className }: Props) { const activeWorkspaceId = getActiveWorkspaceId(); if (activeWorkspaceId === null) return []; - const requests = [...jotaiStore.get(httpRequestsAtom), ...jotaiStore.get(grpcRequestsAtom)]; + const requests = jotaiStore.get(requestsAtom); const recentRequestItems: DropdownItem[] = []; for (const id of recentRequestIds) { const request = requests.find((r) => r.id === id); diff --git a/src-web/components/RecentWebsocketConnectionsDropdown.tsx b/src-web/components/RecentWebsocketConnectionsDropdown.tsx new file mode 100644 index 00000000..fee1b93e --- /dev/null +++ b/src-web/components/RecentWebsocketConnectionsDropdown.tsx @@ -0,0 +1,69 @@ +import type { WebsocketConnection } from '@yaakapp-internal/models'; +import { formatDistanceToNowStrict } from 'date-fns'; +import { deleteWebsocketConnection } from '../commands/deleteWebsocketConnection'; +import { deleteWebsocketConnections } from '../commands/deleteWebsocketConnections'; +import { websocketRequestsAtom } from '../hooks/useWebsocketRequests'; +import { jotaiStore } from '../lib/jotai'; +import { pluralizeCount } from '../lib/pluralize'; +import { Dropdown } from './core/Dropdown'; +import { Icon } from './core/Icon'; +import { IconButton } from './core/IconButton'; +import { HStack } from './core/Stacks'; + +interface Props { + connections: WebsocketConnection[]; + activeConnection: WebsocketConnection; + onPinnedConnectionId: (id: string) => void; +} + +export function RecentWebsocketConnectionsDropdown({ + activeConnection, + connections, + onPinnedConnectionId, +}: Props) { + const latestConnectionId = connections[0]?.id ?? 'n/a'; + + return ( + deleteWebsocketConnection.mutate(activeConnection), + disabled: connections.length === 0, + }, + { + label: `Clear ${pluralizeCount('Connection', connections.length)}`, + onSelect: () => { + const request = jotaiStore + .get(websocketRequestsAtom) + .find((r) => r.id === activeConnection.requestId); + if (request != null) { + deleteWebsocketConnections.mutate(request); + } + }, + hidden: connections.length <= 1, + disabled: connections.length === 0, + }, + { type: 'separator', label: 'History' }, + ...connections.map((c) => ({ + label: ( + + {formatDistanceToNowStrict(c.createdAt + 'Z')} ago •{' '} + {c.elapsed}ms + + ), + leftSlot: activeConnection?.id === c.id ? : , + onSelect: () => onPinnedConnectionId(c.id), + })), + ]} + > + + + ); +} diff --git a/src-web/components/UrlBar.tsx b/src-web/components/UrlBar.tsx index 127e5ace..da465d15 100644 --- a/src-web/components/UrlBar.tsx +++ b/src-web/components/UrlBar.tsx @@ -8,6 +8,7 @@ import type { IconProps } from './core/Icon'; import { IconButton } from './core/IconButton'; import type { InputProps } from './core/Input'; import { Input } from './core/Input'; +import {HStack} from "./core/Stacks"; import { RequestMethodDropdown } from './RequestMethodDropdown'; type Props = Pick & { @@ -69,7 +70,7 @@ export const UrlBar = memo(function UrlBar({ ref={inputRef} autocompleteVariables stateKey={stateKey} - size="md" + size="sm" wrapLines={isFocused} hideLabel useTemplating @@ -99,10 +100,10 @@ export const UrlBar = memo(function UrlBar({ ) } rightSlot={ - <> - {rightSlot} + + {rightSlot &&
{rightSlot}
} {submitIcon !== null && ( -
+
)} - + } /> diff --git a/src-web/components/WebsocketRequestLayout.tsx b/src-web/components/WebsocketRequestLayout.tsx new file mode 100644 index 00000000..3356e359 --- /dev/null +++ b/src-web/components/WebsocketRequestLayout.tsx @@ -0,0 +1,42 @@ +import type { WebsocketRequest } from '@yaakapp-internal/models'; +import classNames from 'classnames'; +import type { CSSProperties } from 'react'; +import React from 'react'; +import { SplitLayout } from './core/SplitLayout'; +import { WebsocketRequestPane } from './WebsocketRequestPane'; +import { WebsocketResponsePane } from './WebsocketResponsePane'; + +interface Props { + activeRequest: WebsocketRequest; + style: CSSProperties; +} + +export function WebsocketRequestLayout({ activeRequest, style }: Props) { + return ( + ( + + )} + secondSlot={({ style }) => ( +
+ +
+ )} + /> + ); +} diff --git a/src-web/components/WebsocketRequestPane.tsx b/src-web/components/WebsocketRequestPane.tsx new file mode 100644 index 00000000..96f4aa86 --- /dev/null +++ b/src-web/components/WebsocketRequestPane.tsx @@ -0,0 +1,325 @@ +import type { HttpRequest, WebsocketRequest } from '@yaakapp-internal/models'; +import type { GenericCompletionOption } from '@yaakapp-internal/plugins'; +import { closeWebsocket, connectWebsocket, sendWebsocket } from '@yaakapp-internal/ws'; +import classNames from 'classnames'; +import { atom, useAtom, useAtomValue } from 'jotai'; +import { atomWithStorage } from 'jotai/utils'; +import type { CSSProperties } from 'react'; +import React, { useCallback, useMemo } from 'react'; +import { upsertWebsocketRequest } from '../commands/upsertWebsocketRequest'; +import { getActiveCookieJar } from '../hooks/useActiveCookieJar'; +import { getActiveEnvironment } from '../hooks/useActiveEnvironment'; +import { activeRequestIdAtom } from '../hooks/useActiveRequestId'; +import { useCancelHttpResponse } from '../hooks/useCancelHttpResponse'; +import { useHttpAuthenticationSummaries } from '../hooks/useHttpAuthentication'; +import { useImportQuerystring } from '../hooks/useImportQuerystring'; +import { usePinnedHttpResponse } from '../hooks/usePinnedHttpResponse'; +import { useRequestEditor, useRequestEditorEvent } from '../hooks/useRequestEditor'; +import { requestsAtom } from '../hooks/useRequests'; +import { useRequestUpdateKey } from '../hooks/useRequestUpdateKey'; +import { useLatestWebsocketConnection } from '../hooks/useWebsocketConnections'; +import { trackEvent } from '../lib/analytics'; +import { deepEqualAtom } from '../lib/atoms'; +import { languageFromContentType } from '../lib/contentType'; +import { fallbackRequestName } from '../lib/fallbackRequestName'; +import { generateId } from '../lib/generateId'; +import { CountBadge } from './core/CountBadge'; +import { Editor } from './core/Editor/Editor'; +import type { GenericCompletionConfig } from './core/Editor/genericCompletion'; +import { IconButton } from './core/IconButton'; +import type { Pair } from './core/PairEditor'; +import { PlainInput } from './core/PlainInput'; +import type { TabItem } from './core/Tabs/Tabs'; +import { TabContent, Tabs } from './core/Tabs/Tabs'; +import { HeadersEditor } from './HeadersEditor'; +import { HttpAuthenticationEditor } from './HttpAuthenticationEditor'; +import { MarkdownEditor } from './MarkdownEditor'; +import { UrlBar } from './UrlBar'; +import { UrlParametersEditor } from './UrlParameterEditor'; + +interface Props { + style: CSSProperties; + fullHeight: boolean; + className?: string; + activeRequest: WebsocketRequest; +} + +const TAB_MESSAGE = 'message'; +const TAB_PARAMS = 'params'; +const TAB_HEADERS = 'headers'; +const TAB_AUTH = 'auth'; +const TAB_DESCRIPTION = 'description'; + +const tabsAtom = atomWithStorage>('requestPaneActiveTabs', {}); + +const nonActiveRequestUrlsAtom = atom((get) => { + const activeRequestId = get(activeRequestIdAtom); + const requests = get(requestsAtom); + return requests + .filter((r) => r.id !== activeRequestId) + .map((r): GenericCompletionOption => ({ type: 'constant', label: r.url })); +}); + +const memoNotActiveRequestUrlsAtom = deepEqualAtom(nonActiveRequestUrlsAtom); + +export function WebsocketRequestPane({ style, fullHeight, className, activeRequest }: Props) { + const activeRequestId = activeRequest.id; + const [activeTabs, setActiveTabs] = useAtom(tabsAtom); + const { updateKey: forceUpdateKey } = useRequestUpdateKey(activeRequest.id ?? null); + const [{ urlKey }] = useRequestEditor(); + const authentication = useHttpAuthenticationSummaries(); + + const { urlParameterPairs, urlParametersKey } = useMemo(() => { + const placeholderNames = Array.from(activeRequest.url.matchAll(/\/(:[^/]+)/g)).map( + (m) => m[1] ?? '', + ); + const nonEmptyParameters = activeRequest.urlParameters.filter((p) => p.name || p.value); + const items: Pair[] = [...nonEmptyParameters]; + for (const name of placeholderNames) { + const index = items.findIndex((p) => p.name === name); + if (index >= 0) { + items[index]!.readOnlyName = true; + } else { + items.push({ name, value: '', enabled: true, readOnlyName: true, id: generateId() }); + } + } + return { urlParameterPairs: items, urlParametersKey: placeholderNames.join(',') }; + }, [activeRequest.url, activeRequest.urlParameters]); + + const tabs = useMemo(() => { + // const options: Omit, 'children'> = { + // value: activeRequest.messageType ?? 'text', + // items: [ + // { label: 'Text', value: 'text' }, + // { label: 'Binary', value: 'binary' }, + // ], + // onChange: async (messageType) => { + // if (messageType === activeRequest.messageType) return; + // upsertWebsocketRequest.mutate({ ...activeRequest, messageType }); + // }, + // }; + return [ + { + value: TAB_MESSAGE, + label: 'Message', + } as TabItem, + { + value: TAB_PARAMS, + rightSlot: , + label: 'Params', + }, + { + value: TAB_HEADERS, + label: 'Headers', + rightSlot: h.name).length} />, + }, + { + value: TAB_AUTH, + label: 'Auth', + options: { + value: activeRequest.authenticationType, + items: [ + ...authentication.map((a) => ({ + label: a.label || 'UNKNOWN', + shortLabel: a.shortLabel, + value: a.name, + })), + { type: 'separator' }, + { label: 'No Authentication', shortLabel: 'Auth', value: null }, + ], + onChange: async (authenticationType) => { + let authentication: HttpRequest['authentication'] = activeRequest.authentication; + if (activeRequest.authenticationType !== authenticationType) { + authentication = { + // Reset auth if changing types + }; + } + upsertWebsocketRequest.mutate({ + ...activeRequest, + authenticationType, + authentication, + }); + }, + }, + }, + { + value: TAB_DESCRIPTION, + label: 'Info', + }, + ]; + }, [activeRequest, authentication, urlParameterPairs.length]); + + const { activeResponse } = usePinnedHttpResponse(activeRequestId); + const { mutate: cancelResponse } = useCancelHttpResponse(activeResponse?.id ?? null); + const { updateKey } = useRequestUpdateKey(activeRequestId); + const { mutate: importQuerystring } = useImportQuerystring(activeRequestId); + const connection = useLatestWebsocketConnection(activeRequestId); + + const activeTab = activeTabs?.[activeRequestId]; + const setActiveTab = useCallback( + (tab: string) => { + setActiveTabs((r) => ({ ...r, [activeRequest.id]: tab })); + }, + [activeRequest.id, setActiveTabs], + ); + + useRequestEditorEvent('request_pane.focus_tab', () => { + setActiveTab(TAB_PARAMS); + }); + + const autocompleteUrls = useAtomValue(memoNotActiveRequestUrlsAtom); + + const autocomplete: GenericCompletionConfig = useMemo( + () => ({ + minMatch: 3, + options: + autocompleteUrls.length > 0 + ? autocompleteUrls + : [ + { label: 'http://', type: 'constant' }, + { label: 'https://', type: 'constant' }, + ], + }), + [autocompleteUrls], + ); + + const handleConnect = useCallback(async () => { + await connectWebsocket({ + requestId: activeRequest.id, + environmentId: getActiveEnvironment()?.id ?? null, + cookieJarId: getActiveCookieJar()?.id ?? null, + }); + trackEvent('websocket_request', 'send'); + }, [activeRequest.id]); + + const handleSend = useCallback(async () => { + if (connection == null) return; + await sendWebsocket({ + connectionId: connection?.id, + environmentId: getActiveEnvironment()?.id ?? null, + }); + trackEvent('websocket_connection', 'send'); + }, [connection]); + + const handleCancel = useCallback(async () => { + if (connection == null) return; + await closeWebsocket({ connectionId: connection?.id }); + trackEvent('websocket_connection', 'cancel'); + }, [connection]); + + const handleUrlChange = useCallback( + (url: string) => upsertWebsocketRequest.mutate({ ...activeRequest, url }), + [activeRequest], + ); + + const messageLanguage = languageFromContentType(null, activeRequest.message); + + const isLoading = connection !== null && connection.state !== 'closed'; + + return ( +
+ {activeRequest && ( + <> +
+ + ) + } + placeholder="wss://example.com" + onPasteOverwrite={importQuerystring} + autocomplete={autocomplete} + onSend={isLoading ? handleSend : handleConnect} + onCancel={cancelResponse} + onUrlChange={handleUrlChange} + forceUpdateKey={updateKey} + isLoading={activeResponse != null && activeResponse.state !== 'closed'} + method={null} + /> +
+ + + + + + upsertWebsocketRequest.mutate({ ...activeRequest, headers })} + /> + + + + upsertWebsocketRequest.mutate({ ...activeRequest, urlParameters }) + } + /> + + + upsertWebsocketRequest.mutate({ ...activeRequest, message })} + stateKey={`json.${activeRequest.id}`} + /> + + +
+ upsertWebsocketRequest.mutate({ ...activeRequest, name })} + /> + + upsertWebsocketRequest.mutate({ ...activeRequest, description }) + } + /> +
+
+
+ + )} +
+ ); +} diff --git a/src-web/components/WebsocketResponsePane.tsx b/src-web/components/WebsocketResponsePane.tsx new file mode 100644 index 00000000..966101b7 --- /dev/null +++ b/src-web/components/WebsocketResponsePane.tsx @@ -0,0 +1,229 @@ +import type { WebsocketEvent, WebsocketRequest } from '@yaakapp-internal/models'; +import classNames from 'classnames'; +import { format } from 'date-fns'; +import { hexy } from 'hexy'; +import React, { useMemo, useState } from 'react'; +import { useCopy } from '../hooks/useCopy'; +import { useFormatText } from '../hooks/useFormatText'; +import { usePinnedWebsocketConnection } from '../hooks/usePinnedWebsocketConnection'; +import { useStateWithDeps } from '../hooks/useStateWithDeps'; +import { useWebsocketEvents } from '../hooks/useWebsocketEvents'; +import { languageFromContentType } from '../lib/contentType'; +import { Banner } from './core/Banner'; +import { Button } from './core/Button'; +import { Editor } from './core/Editor/Editor'; +import { Icon } from './core/Icon'; +import { IconButton } from './core/IconButton'; +import { Separator } from './core/Separator'; +import { SplitLayout } from './core/SplitLayout'; +import { HStack, VStack } from './core/Stacks'; +import { StatusTag } from './core/StatusTag'; +import { EmptyStateText } from './EmptyStateText'; +import { RecentWebsocketConnectionsDropdown } from './RecentWebsocketConnectionsDropdown'; + +interface Props { + activeRequest: WebsocketRequest; +} + +export function WebsocketResponsePane({ activeRequest }: Props) { + const [activeEventId, setActiveEventId] = useState(null); + const [showLarge, setShowLarge] = useStateWithDeps(false, [activeRequest.id]); + const [showingLarge, setShowingLarge] = useState(false); + const [hexDumps, setHexDumps] = useState>({}); + + const { activeConnection, connections, setPinnedConnectionId } = + usePinnedWebsocketConnection(activeRequest); + + // const isLoading = activeConnection !== null && activeConnection.state !== 'closed'; + const events = useWebsocketEvents(activeConnection?.id ?? null); + + const activeEvent = useMemo( + () => events.find((m) => m.id === activeEventId) ?? null, + [activeEventId, events], + ); + + const hexDump = hexDumps[activeEventId ?? 'n/a'] ?? activeEvent?.messageType === 'binary'; + + const message = useMemo(() => { + if (hexDump) { + return activeEvent?.message ? hexy(activeEvent?.message) : ''; + } + const text = activeEvent?.message + ? new TextDecoder('utf-8').decode(Uint8Array.from(activeEvent.message)) + : ''; + return text; + }, [activeEvent?.message, hexDump]); + + const language = languageFromContentType(null, message); + const formattedContent = useFormatText({ language, text: message, pretty: true }); + const copy = useCopy(); + + return ( + + activeConnection && ( +
+ + + {activeConnection.state !== 'closed' && ( + + )} + + + {events.length} Messages + +
+ +
+
+
+ {activeConnection.error && ( + + {activeConnection.error} + + )} + {...events.map((e) => ( + { + if (e.id === activeEventId) setActiveEventId(null); + else setActiveEventId(e.id); + }} + /> + ))} +
+
+ ) + } + secondSlot={ + activeEvent && + (() => ( +
+
+ +
+
+
+
+ {activeEvent.messageType === 'close' + ? 'Connection Closed' + : `Message ${activeEvent.isServer ? 'Received' : 'Sent'}`} +
+ + + copy(message)} + /> + +
+ {!showLarge && activeEvent.message.length > 1000 * 1000 ? ( + + Message previews larger than 1MB are hidden +
+ +
+
+ ) : activeEvent.message.length === 0 ? ( + No Content + ) : ( + + )} +
+
+ )) + } + /> + ); +} + +function EventRow({ + onClick, + isActive, + event, +}: { + onClick?: () => void; + isActive?: boolean; + event: WebsocketEvent; +}) { + const { createdAt, message: messageBytes, isServer, messageType } = event; + const message = messageBytes + ? new TextDecoder('utf-8').decode(Uint8Array.from(messageBytes)) + : ''; + return ( +
+ +
+ ); +} diff --git a/src-web/components/Workspace.tsx b/src-web/components/Workspace.tsx index 6d28174d..adbe7b8c 100644 --- a/src-web/components/Workspace.tsx +++ b/src-web/components/Workspace.tsx @@ -2,25 +2,28 @@ import classNames from 'classnames'; import { motion } from 'framer-motion'; import type { CSSProperties, MouseEvent as ReactMouseEvent } from 'react'; import { useCallback, useMemo, useRef, useState } from 'react'; -import {useEnsureActiveCookieJar, useSubscribeActiveCookieJarId} from "../hooks/useActiveCookieJar"; -import {useSubscribeActiveEnvironmentId} from "../hooks/useActiveEnvironment"; -import {getActiveRequest, useActiveRequest} from '../hooks/useActiveRequest'; -import {useSubscribeActiveRequestId} from "../hooks/useActiveRequestId"; +import { + useEnsureActiveCookieJar, + useSubscribeActiveCookieJarId, +} from '../hooks/useActiveCookieJar'; +import { useSubscribeActiveEnvironmentId } from '../hooks/useActiveEnvironment'; +import { getActiveRequest, useActiveRequest } from '../hooks/useActiveRequest'; +import { useSubscribeActiveRequestId } from '../hooks/useActiveRequestId'; import { useActiveWorkspace } from '../hooks/useActiveWorkspace'; -import {useDuplicateGrpcRequest} from "../hooks/useDuplicateGrpcRequest"; -import {useDuplicateHttpRequest} from "../hooks/useDuplicateHttpRequest"; +import { useDuplicateGrpcRequest } from '../hooks/useDuplicateGrpcRequest'; +import { useDuplicateHttpRequest } from '../hooks/useDuplicateHttpRequest'; import { useFloatingSidebarHidden } from '../hooks/useFloatingSidebarHidden'; -import {useHotKey} from "../hooks/useHotKey"; +import { useHotKey } from '../hooks/useHotKey'; import { useImportData } from '../hooks/useImportData'; -import {useSubscribeRecentCookieJars} from "../hooks/useRecentCookieJars"; -import {useSubscribeRecentEnvironments} from "../hooks/useRecentEnvironments"; -import {useSubscribeRecentRequests} from "../hooks/useRecentRequests"; -import {useSubscribeRecentWorkspaces} from "../hooks/useRecentWorkspaces"; +import { useSubscribeRecentCookieJars } from '../hooks/useRecentCookieJars'; +import { useSubscribeRecentEnvironments } from '../hooks/useRecentEnvironments'; +import { useSubscribeRecentRequests } from '../hooks/useRecentRequests'; +import { useSubscribeRecentWorkspaces } from '../hooks/useRecentWorkspaces'; import { useShouldFloatSidebar } from '../hooks/useShouldFloatSidebar'; import { useSidebarHidden } from '../hooks/useSidebarHidden'; import { useSidebarWidth } from '../hooks/useSidebarWidth'; -import {useSyncWorkspaceRequestTitle} from "../hooks/useSyncWorkspaceRequestTitle"; -import {useToggleCommandPalette} from "../hooks/useToggleCommandPalette"; +import { useSyncWorkspaceRequestTitle } from '../hooks/useSyncWorkspaceRequestTitle'; +import { useToggleCommandPalette } from '../hooks/useToggleCommandPalette'; import { useWorkspaces } from '../hooks/useWorkspaces'; import { Banner } from './core/Banner'; import { Button } from './core/Button'; @@ -33,8 +36,9 @@ import { HeaderSize } from './HeaderSize'; import { HttpRequestLayout } from './HttpRequestLayout'; import { Overlay } from './Overlay'; import { ResizeHandle } from './ResizeHandle'; -import { Sidebar } from './Sidebar'; -import { SidebarActions } from './SidebarActions'; +import { Sidebar } from './sidebar/Sidebar'; +import { SidebarActions } from './sidebar/SidebarActions'; +import { WebsocketRequestLayout } from './WebsocketRequestLayout'; import { WorkspaceHeader } from './WorkspaceHeader'; const side = { gridArea: 'side' }; @@ -213,9 +217,11 @@ function WorkspaceBody() { if (activeRequest.model === 'grpc_request') { return ; + } else if (activeRequest.model === 'websocket_request') { + return ; + } else { + return ; } - - return ; } function useGlobalWorkspaceHooks() { diff --git a/src-web/components/WorkspaceHeader.tsx b/src-web/components/WorkspaceHeader.tsx index cab1f4f9..995ba113 100644 --- a/src-web/components/WorkspaceHeader.tsx +++ b/src-web/components/WorkspaceHeader.tsx @@ -10,7 +10,7 @@ import { ImportCurlButton } from './ImportCurlButton'; import { LicenseBadge } from './LicenseBadge'; import { RecentRequestsDropdown } from './RecentRequestsDropdown'; import { SettingsDropdown } from './SettingsDropdown'; -import { SidebarActions } from './SidebarActions'; +import { SidebarActions } from './sidebar/SidebarActions'; import { WorkspaceActionsDropdown } from './WorkspaceActionsDropdown'; interface Props { diff --git a/src-web/components/core/HttpMethodTag.tsx b/src-web/components/core/HttpMethodTag.tsx index 55a24f5e..f2f5bb21 100644 --- a/src-web/components/core/HttpMethodTag.tsx +++ b/src-web/components/core/HttpMethodTag.tsx @@ -1,15 +1,15 @@ -import type { GrpcRequest, HttpRequest } from '@yaakapp-internal/models'; +import type { GrpcRequest, HttpRequest, WebsocketRequest } from '@yaakapp-internal/models'; import classNames from 'classnames'; interface Props { - request: HttpRequest | GrpcRequest; + request: HttpRequest | GrpcRequest | WebsocketRequest; className?: string; shortNames?: boolean; } const methodNames: Record = { - get: ' GET', - put: ' PUT', + get: 'GET', + put: 'PUT', post: 'POST', patch: 'PTCH', delete: 'DELE', @@ -24,7 +24,11 @@ export function HttpMethodTag({ request, className }: Props) { ? 'GQL' : request.model === 'grpc_request' ? 'GRPC' - : request.method; + : request.model === 'websocket_request' + ? 'WS' + : (methodNames[request.method.toLowerCase()] ?? request.method.slice(0, 4)); + + const paddedMethod = method.padStart(4, ' ').toUpperCase(); return ( - {(methodNames[method.toLowerCase()] ?? method.slice(0, 4)).toUpperCase()} + {paddedMethod} ); } diff --git a/src-web/components/core/StatusTag.tsx b/src-web/components/core/StatusTag.tsx index 96b1056c..a6fd2ff0 100644 --- a/src-web/components/core/StatusTag.tsx +++ b/src-web/components/core/StatusTag.tsx @@ -1,8 +1,8 @@ -import type { HttpResponse } from '@yaakapp-internal/models'; +import type {HttpResponse, WebsocketConnection} from '@yaakapp-internal/models'; import classNames from 'classnames'; interface Props { - response: HttpResponse; + response: HttpResponse | WebsocketConnection; className?: string; showReason?: boolean; } @@ -28,7 +28,7 @@ export function StatusTag({ response, className, showReason }: Props) { )} > {isInitializing ? 'CONNECTING' : label}{' '} - {showReason && response.statusReason && response.statusReason} + {showReason && 'statusReason' in response ? response.statusReason : null} ); } diff --git a/src-web/components/Sidebar.tsx b/src-web/components/sidebar/Sidebar.tsx similarity index 85% rename from src-web/components/Sidebar.tsx rename to src-web/components/sidebar/Sidebar.tsx index 1c75a121..51658d8b 100644 --- a/src-web/components/Sidebar.tsx +++ b/src-web/components/sidebar/Sidebar.tsx @@ -1,23 +1,31 @@ -import type { Folder, GrpcRequest, HttpRequest, Workspace } from '@yaakapp-internal/models'; +import type { + Folder, + GrpcRequest, + HttpRequest, + WebsocketRequest, + Workspace, +} from '@yaakapp-internal/models'; import classNames from 'classnames'; import { useAtom, useAtomValue } from 'jotai'; import React, { useCallback, useRef, useState } from 'react'; import { useKey, useKeyPressEvent } from 'react-use'; -import { getActiveRequest } from '../hooks/useActiveRequest'; -import { useActiveWorkspace } from '../hooks/useActiveWorkspace'; -import { useCreateDropdownItems } from '../hooks/useCreateDropdownItems'; -import { useDeleteAnyRequest } from '../hooks/useDeleteAnyRequest'; -import { useGrpcConnections } from '../hooks/useGrpcConnections'; -import { useHotKey } from '../hooks/useHotKey'; -import { useHttpResponses } from '../hooks/useHttpResponses'; -import { useSidebarHidden } from '../hooks/useSidebarHidden'; -import { getSidebarCollapsedMap } from '../hooks/useSidebarItemCollapsed'; -import { useUpdateAnyFolder } from '../hooks/useUpdateAnyFolder'; -import { useUpdateAnyGrpcRequest } from '../hooks/useUpdateAnyGrpcRequest'; -import { useUpdateAnyHttpRequest } from '../hooks/useUpdateAnyHttpRequest'; -import { router } from '../lib/router'; -import { setWorkspaceSearchParams } from '../lib/setWorkspaceSearchParams'; -import { ContextMenu } from './core/Dropdown'; +import { upsertWebsocketRequest } from '../../commands/upsertWebsocketRequest'; +import { getActiveRequest } from '../../hooks/useActiveRequest'; +import { useActiveWorkspace } from '../../hooks/useActiveWorkspace'; +import { useCreateDropdownItems } from '../../hooks/useCreateDropdownItems'; +import { useDeleteAnyRequest } from '../../hooks/useDeleteAnyRequest'; +import { useGrpcConnections } from '../../hooks/useGrpcConnections'; +import { useHotKey } from '../../hooks/useHotKey'; +import { useHttpResponses } from '../../hooks/useHttpResponses'; +import { useSidebarHidden } from '../../hooks/useSidebarHidden'; +import { getSidebarCollapsedMap } from '../../hooks/useSidebarItemCollapsed'; +import { useUpdateAnyFolder } from '../../hooks/useUpdateAnyFolder'; +import { useUpdateAnyGrpcRequest } from '../../hooks/useUpdateAnyGrpcRequest'; +import { useUpdateAnyHttpRequest } from '../../hooks/useUpdateAnyHttpRequest'; +import { getWebsocketRequest } from '../../hooks/useWebsocketRequests'; +import { router } from '../../lib/router'; +import { setWorkspaceSearchParams } from '../../lib/setWorkspaceSearchParams'; +import { ContextMenu } from '../core/Dropdown'; import { sidebarSelectedIdAtom, sidebarTreeAtom } from './SidebarAtoms'; import type { SidebarItemProps } from './SidebarItem'; import { SidebarItems } from './SidebarItems'; @@ -26,7 +34,7 @@ interface Props { className?: string; } -export type SidebarModel = Folder | GrpcRequest | HttpRequest | Workspace; +export type SidebarModel = Folder | GrpcRequest | HttpRequest | WebsocketRequest | Workspace; export interface SidebarTreeNode { id: string; @@ -97,7 +105,7 @@ export function Sidebar({ className }: Props) { } // NOTE: I'm not sure why, but TS thinks workspaceId is (string | undefined) here - if ((node.model === 'http_request' || node.model === 'grpc_request') && node.workspaceId) { + if (node.model !== 'folder' && node.workspaceId) { const workspaceId = node.workspaceId; await router.navigate({ to: '/workspaces/$workspaceId', @@ -281,6 +289,11 @@ export function Sidebar({ className }: Props) { } else if (child.model === 'http_request') { const updateRequest = (r: HttpRequest) => ({ ...r, sortPriority, folderId }); return updateAnyHttpRequest({ id: child.id, update: updateRequest }); + } else if (child.model === 'websocket_request') { + const request = getWebsocketRequest(child.id); + return upsertWebsocketRequest.mutateAsync({ ...request, sortPriority, folderId }); + } else { + throw new Error('Invalid model to update: ' + child.model); } }), ); @@ -295,6 +308,11 @@ export function Sidebar({ className }: Props) { } else if (child.model === 'http_request') { const updateRequest = (r: HttpRequest) => ({ ...r, sortPriority, folderId }); await updateAnyHttpRequest({ id: child.id, update: updateRequest }); + } else if (child.model === 'websocket_request') { + const request = getWebsocketRequest(child.id); + return upsertWebsocketRequest.mutateAsync({ ...request, sortPriority, folderId }); + } else { + throw new Error('Invalid model to update: ' + child.model); } } setDraggingId(null); diff --git a/src-web/components/SidebarActions.tsx b/src-web/components/sidebar/SidebarActions.tsx similarity index 73% rename from src-web/components/SidebarActions.tsx rename to src-web/components/sidebar/SidebarActions.tsx index f5f86067..76db9035 100644 --- a/src-web/components/SidebarActions.tsx +++ b/src-web/components/sidebar/SidebarActions.tsx @@ -1,11 +1,11 @@ import { useMemo } from 'react'; -import { useFloatingSidebarHidden } from '../hooks/useFloatingSidebarHidden'; -import { useShouldFloatSidebar } from '../hooks/useShouldFloatSidebar'; -import { useSidebarHidden } from '../hooks/useSidebarHidden'; -import { trackEvent } from '../lib/analytics'; -import { IconButton } from './core/IconButton'; -import { HStack } from './core/Stacks'; -import { CreateDropdown } from './CreateDropdown'; +import { useFloatingSidebarHidden } from '../../hooks/useFloatingSidebarHidden'; +import { useShouldFloatSidebar } from '../../hooks/useShouldFloatSidebar'; +import { useSidebarHidden } from '../../hooks/useSidebarHidden'; +import { trackEvent } from '../../lib/analytics'; +import { IconButton } from '../core/IconButton'; +import { HStack } from '../core/Stacks'; +import { CreateDropdown } from '../CreateDropdown'; export function SidebarActions() { const floating = useShouldFloatSidebar(); diff --git a/src-web/components/SidebarAtoms.ts b/src-web/components/sidebar/SidebarAtoms.ts similarity index 81% rename from src-web/components/SidebarAtoms.ts rename to src-web/components/sidebar/SidebarAtoms.ts index d706576c..ea3390b0 100644 --- a/src-web/components/SidebarAtoms.ts +++ b/src-web/components/sidebar/SidebarAtoms.ts @@ -1,22 +1,20 @@ -import type { Folder, GrpcRequest, HttpRequest } from '@yaakapp-internal/models'; +import type { Folder, GrpcRequest, HttpRequest, WebsocketRequest } from '@yaakapp-internal/models'; // This is an atom so we can use it in the child items to avoid re-rendering the entire list import { atom } from 'jotai'; -import { activeWorkspaceAtom } from '../hooks/useActiveWorkspace'; -import { foldersAtom } from '../hooks/useFolders'; -import { grpcRequestsAtom } from '../hooks/useGrpcRequests'; -import { httpRequestsAtom } from '../hooks/useHttpRequests'; -import { deepEqualAtom } from '../lib/atoms'; -import { fallbackRequestName } from '../lib/fallbackRequestName'; +import { activeWorkspaceAtom } from '../../hooks/useActiveWorkspace'; +import { foldersAtom } from '../../hooks/useFolders'; +import { requestsAtom } from '../../hooks/useRequests'; +import { deepEqualAtom } from '../../lib/atoms'; +import { fallbackRequestName } from '../../lib/fallbackRequestName'; import type { SidebarTreeNode } from './Sidebar'; export const sidebarSelectedIdAtom = atom(null); const allPotentialChildrenAtom = atom((get) => { - const httpRequests = get(httpRequestsAtom); - const grpcRequests = get(grpcRequestsAtom); + const requests = get(requestsAtom); const folders = get(foldersAtom); - return [...httpRequests, ...folders, ...grpcRequests].map((v) => ({ + return [...requests, ...folders].map((v) => ({ id: v.id, model: v.model, folderId: v.folderId, @@ -62,7 +60,7 @@ export const sidebarTreeAtom = atom<{ return { tree: null, treeParentMap, selectableRequests }; } - const selectedRequest: HttpRequest | GrpcRequest | null = null; + const selectedRequest: HttpRequest | GrpcRequest | WebsocketRequest | null = null; let selectableRequestIndex = 0; // Put requests and folders into a tree structure @@ -102,7 +100,7 @@ export const sidebarTreeAtom = atom<{ function itemFromModel( item: Pick< - Folder | HttpRequest | GrpcRequest, + Folder | HttpRequest | GrpcRequest | WebsocketRequest, 'folderId' | 'model' | 'workspaceId' | 'id' | 'name' | 'sortPriority' >, depth = 0, diff --git a/src-web/components/SidebarItem.tsx b/src-web/components/sidebar/SidebarItem.tsx similarity index 86% rename from src-web/components/SidebarItem.tsx rename to src-web/components/sidebar/SidebarItem.tsx index 4823d9a4..44fe1d2d 100644 --- a/src-web/components/SidebarItem.tsx +++ b/src-web/components/sidebar/SidebarItem.tsx @@ -5,18 +5,19 @@ import type { ReactElement } from 'react'; import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import type { XYCoord } from 'react-dnd'; import { useDrag, useDrop } from 'react-dnd'; -import { activeRequestAtom } from '../hooks/useActiveRequest'; -import { foldersAtom } from '../hooks/useFolders'; -import { grpcRequestsAtom } from '../hooks/useGrpcRequests'; -import { httpRequestsAtom } from '../hooks/useHttpRequests'; -import { useScrollIntoView } from '../hooks/useScrollIntoView'; -import { useSidebarItemCollapsed } from '../hooks/useSidebarItemCollapsed'; -import { useUpdateAnyGrpcRequest } from '../hooks/useUpdateAnyGrpcRequest'; -import { useUpdateAnyHttpRequest } from '../hooks/useUpdateAnyHttpRequest'; -import { jotaiStore } from '../lib/jotai'; -import { HttpMethodTag } from './core/HttpMethodTag'; -import { Icon } from './core/Icon'; -import { StatusTag } from './core/StatusTag'; +import { upsertWebsocketRequest } from '../../commands/upsertWebsocketRequest'; +import { activeRequestAtom } from '../../hooks/useActiveRequest'; +import { foldersAtom } from '../../hooks/useFolders'; +import { requestsAtom } from '../../hooks/useRequests'; +import { useScrollIntoView } from '../../hooks/useScrollIntoView'; +import { useSidebarItemCollapsed } from '../../hooks/useSidebarItemCollapsed'; +import { useUpdateAnyGrpcRequest } from '../../hooks/useUpdateAnyGrpcRequest'; +import { useUpdateAnyHttpRequest } from '../../hooks/useUpdateAnyHttpRequest'; +import { getWebsocketRequest } from '../../hooks/useWebsocketRequests'; +import { jotaiStore } from '../../lib/jotai'; +import { HttpMethodTag } from '../core/HttpMethodTag'; +import { Icon } from '../core/Icon'; +import { StatusTag } from '../core/StatusTag'; import type { SidebarTreeNode } from './Sidebar'; import { sidebarSelectedIdAtom } from './SidebarAtoms'; import { SidebarItemContextMenu } from './SidebarItemContextMenu'; @@ -138,6 +139,10 @@ export const SidebarItem = memo(function SidebarItem({ id: itemId, update: (r) => ({ ...r, name: el.value }), }); + } else if (itemModel === 'websocket_request') { + const request = getWebsocketRequest(itemId); + if (request == null) return; + await upsertWebsocketRequest.mutateAsync({ ...request, name: el.value }); } setEditing(false); }, @@ -167,7 +172,12 @@ export const SidebarItem = memo(function SidebarItem({ ); const handleStartEditing = useCallback(() => { - if (itemModel !== 'http_request' && itemModel !== 'grpc_request') return; + if ( + itemModel !== 'http_request' && + itemModel !== 'grpc_request' && + itemModel !== 'websocket_request' + ) + return; setEditing(true); }, [setEditing, itemModel]); @@ -197,14 +207,10 @@ export const SidebarItem = memo(function SidebarItem({ const itemAtom = useMemo(() => { return atom((get) => { - if (itemModel === 'http_request') { - return get(httpRequestsAtom).find((v) => v.id === itemId); - } else if (itemModel === 'grpc_request') { - return get(grpcRequestsAtom).find((v) => v.id === itemId); - } else if (itemModel === 'folder') { + if (itemModel === 'folder') { return get(foldersAtom).find((v) => v.id === itemId); } else { - return null; + return get(requestsAtom).find((v) => v.id === itemId); } }); }, [itemId, itemModel]); @@ -215,7 +221,7 @@ export const SidebarItem = memo(function SidebarItem({ return null; } - const itemPrefix = (item.model === 'http_request' || item.model === 'grpc_request') && ( + const itemPrefix = item.model !== 'folder' && ( ((get) => { +export const activeRequestAtom = atom((get) => { const activeRequestId = get(activeRequestIdAtom); - const requests = [...get(httpRequestsAtom), ...get(grpcRequestsAtom)]; + const requests = get(requestsAtom); return requests.find((r) => r.id === activeRequestId) ?? null; }); diff --git a/src-web/hooks/useCopy.ts b/src-web/hooks/useCopy.ts index dc2aa8e1..e648a5bf 100644 --- a/src-web/hooks/useCopy.ts +++ b/src-web/hooks/useCopy.ts @@ -13,7 +13,7 @@ export function useCopy({ disableToast }: { disableToast?: boolean } = {}) { if (text != '' && !disableToast) { showToast({ id: 'copied', - color: 'secondary', + color: 'success', icon: 'copy', message: 'Copied to clipboard', }); diff --git a/src-web/hooks/useCreateDropdownItems.tsx b/src-web/hooks/useCreateDropdownItems.tsx index e2ed4bb2..9f4d6e50 100644 --- a/src-web/hooks/useCreateDropdownItems.tsx +++ b/src-web/hooks/useCreateDropdownItems.tsx @@ -1,10 +1,12 @@ import { useMemo } from 'react'; import { createFolder } from '../commands/commands'; +import { upsertWebsocketRequest } from '../commands/upsertWebsocketRequest'; import type { DropdownItem } from '../components/core/Dropdown'; import { Icon } from '../components/core/Icon'; import { generateId } from '../lib/generateId'; import { BODY_TYPE_GRAPHQL } from '../lib/model_util'; import { getActiveRequest } from './useActiveRequest'; +import { getActiveWorkspace } from './useActiveWorkspace'; import { useCreateGrpcRequest } from './useCreateGrpcRequest'; import { useCreateHttpRequest } from './useCreateHttpRequest'; @@ -19,21 +21,24 @@ export function useCreateDropdownItems({ } = {}): DropdownItem[] { const { mutate: createHttpRequest } = useCreateHttpRequest(); const { mutate: createGrpcRequest } = useCreateGrpcRequest(); + const activeWorkspace = getActiveWorkspace(); - return useMemo((): DropdownItem[] => { + const items = useMemo((): DropdownItem[] => { + const activeRequest = getActiveRequest(); const folderId = - folderIdOption === 'active-folder' ? getActiveRequest()?.folderId : folderIdOption; + (folderIdOption === 'active-folder' ? activeRequest?.folderId : folderIdOption) ?? null; + if (activeWorkspace == null) return []; return [ { - label: 'HTTP Request', + label: 'HTTP', leftSlot: hideIcons ? undefined : , onSelect: () => { createHttpRequest({ folderId }); }, }, { - label: 'GraphQL Query', + label: 'GraphQL', leftSlot: hideIcons ? undefined : , onSelect: () => createHttpRequest({ @@ -44,10 +49,16 @@ export function useCreateDropdownItems({ }), }, { - label: 'gRPC Call', + label: 'gRPC', leftSlot: hideIcons ? undefined : , onSelect: () => createGrpcRequest({ folderId }), }, + { + label: 'WebSocket', + leftSlot: hideIcons ? undefined : , + onSelect: () => + upsertWebsocketRequest.mutate({ folderId, workspaceId: activeWorkspace.id }), + }, ...((hideFolder ? [] : [ @@ -59,5 +70,14 @@ export function useCreateDropdownItems({ }, ]) as DropdownItem[]), ]; - }, [createGrpcRequest, createHttpRequest, folderIdOption, hideFolder, hideIcons]); + }, [ + activeWorkspace, + createGrpcRequest, + createHttpRequest, + folderIdOption, + hideFolder, + hideIcons, + ]); + + return items; } diff --git a/src-web/hooks/useDeleteAnyGrpcRequest.tsx b/src-web/hooks/useDeleteAnyGrpcRequest.tsx index e5e09261..21012e2f 100644 --- a/src-web/hooks/useDeleteAnyGrpcRequest.tsx +++ b/src-web/hooks/useDeleteAnyGrpcRequest.tsx @@ -5,15 +5,11 @@ import { showConfirm } from '../lib/confirm'; import { fallbackRequestName } from '../lib/fallbackRequestName'; import { invokeCmd } from '../lib/tauri'; import { useFastMutation } from './useFastMutation'; -import { getGrpcRequest } from './useGrpcRequests'; export function useDeleteAnyGrpcRequest() { - return useFastMutation({ + return useFastMutation({ mutationKey: ['delete_any_grpc_request'], - mutationFn: async (id) => { - const request = getGrpcRequest(id); - if (request == null) return null; - + mutationFn: async (request) => { const confirmed = await showConfirm({ id: 'delete-grpc-request', title: 'Delete Request', @@ -24,9 +20,11 @@ export function useDeleteAnyGrpcRequest() { ), }); - if (!confirmed) return null; - return invokeCmd('cmd_delete_grpc_request', { requestId: id }); + if (!confirmed) { + return null; + } + return invokeCmd('cmd_delete_grpc_request', { requestId: request.id }); }, - onSettled: () => trackEvent('grpc_request', 'delete'), + onSuccess: () => trackEvent('grpc_request', 'delete'), }); } diff --git a/src-web/hooks/useDeleteAnyHttpRequest.tsx b/src-web/hooks/useDeleteAnyHttpRequest.tsx index 061e8679..4888549e 100644 --- a/src-web/hooks/useDeleteAnyHttpRequest.tsx +++ b/src-web/hooks/useDeleteAnyHttpRequest.tsx @@ -5,15 +5,11 @@ import { showConfirm } from '../lib/confirm'; import { fallbackRequestName } from '../lib/fallbackRequestName'; import { invokeCmd } from '../lib/tauri'; import { useFastMutation } from './useFastMutation'; -import { getHttpRequest } from './useHttpRequests'; export function useDeleteAnyHttpRequest() { - return useFastMutation({ + return useFastMutation({ mutationKey: ['delete_any_http_request'], - mutationFn: async (id) => { - const request = getHttpRequest(id); - if (request == null) return null; - + mutationFn: async (request) => { const confirmed = await showConfirm({ id: 'delete-request', title: 'Delete Request', @@ -24,9 +20,11 @@ export function useDeleteAnyHttpRequest() { ), }); - if (!confirmed) return null; - return invokeCmd('cmd_delete_http_request', { requestId: id }); + if (!confirmed) { + return null; + } + return invokeCmd('cmd_delete_http_request', { requestId: request.id }); }, - onSettled: () => trackEvent('http_request', 'delete'), + onSuccess: () => trackEvent('http_request', 'delete'), }); } diff --git a/src-web/hooks/useDeleteAnyRequest.tsx b/src-web/hooks/useDeleteAnyRequest.tsx index faa61ad2..4d9a533d 100644 --- a/src-web/hooks/useDeleteAnyRequest.tsx +++ b/src-web/hooks/useDeleteAnyRequest.tsx @@ -1,6 +1,9 @@ +import { deleteWebsocketRequest } from '../commands/deleteWebsocketRequest'; +import { jotaiStore } from '../lib/jotai'; import { useDeleteAnyGrpcRequest } from './useDeleteAnyGrpcRequest'; import { useDeleteAnyHttpRequest } from './useDeleteAnyHttpRequest'; import { useFastMutation } from './useFastMutation'; +import { requestsAtom } from './useRequests'; export function useDeleteAnyRequest() { const deleteAnyHttpRequest = useDeleteAnyHttpRequest(); @@ -10,9 +13,17 @@ export function useDeleteAnyRequest() { mutationKey: ['delete_request'], mutationFn: async (id) => { if (id == null) return; - // We don't know what type it is based on the ID, so just try deleting both - deleteAnyHttpRequest.mutate(id); - deleteAnyGrpcRequest.mutate(id); + const request = jotaiStore.get(requestsAtom).find((r) => r.id === id); + + if (request?.model === 'websocket_request') { + deleteWebsocketRequest.mutate(request); + } else if (request?.model === 'http_request') { + deleteAnyHttpRequest.mutate(request); + } else if (request?.model === 'grpc_request') { + deleteAnyGrpcRequest.mutate(request); + } else { + console.log('Failed to delete request', id, request); + } }, }); } diff --git a/src-web/hooks/useDeleteSendHistory.tsx b/src-web/hooks/useDeleteSendHistory.tsx index aa7a7ebf..bc9f9b9b 100644 --- a/src-web/hooks/useDeleteSendHistory.tsx +++ b/src-web/hooks/useDeleteSendHistory.tsx @@ -7,24 +7,29 @@ import { getActiveWorkspaceId } from './useActiveWorkspace'; import { useFastMutation } from './useFastMutation'; import { useGrpcConnections } from './useGrpcConnections'; import { httpResponsesAtom, useHttpResponses } from './useHttpResponses'; +import { useWebsocketConnections } from './useWebsocketConnections'; export function useDeleteSendHistory() { const setHttpResponses = useSetAtom(httpResponsesAtom); const httpResponses = useHttpResponses(); const grpcConnections = useGrpcConnections(); + const websocketConnections = useWebsocketConnections(); const labels = [ httpResponses.length > 0 ? pluralizeCount('Http Response', httpResponses.length) : null, grpcConnections.length > 0 ? pluralizeCount('Grpc Connection', grpcConnections.length) : null, + websocketConnections.length > 0 + ? pluralizeCount('WebSocket Connection', websocketConnections.length) + : null, ].filter((l) => l != null); return useFastMutation({ - mutationKey: ['delete_send_history'], + mutationKey: ['delete_send_history', labels], mutationFn: async () => { if (labels.length === 0) { showAlert({ id: 'no-responses', title: 'Nothing to Delete', - body: 'There are no Http Response or Grpc Connections to delete', + body: 'There is no Http, Grpc, or Websocket history', }); return; } diff --git a/src-web/hooks/useHotKey.ts b/src-web/hooks/useHotKey.ts index 08d073e5..6080a8f3 100644 --- a/src-web/hooks/useHotKey.ts +++ b/src-web/hooks/useHotKey.ts @@ -116,6 +116,16 @@ export function useHotKey( if (e.shiftKey) currentKeysWithModifiers.add('Shift'); for (const [hkAction, hkKeys] of Object.entries(hotkeys) as [HotkeyAction, string[]][]) { + if ( + (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) && + currentKeysWithModifiers.size === 1 && + currentKeysWithModifiers.has('Backspace') + ) { + // Don't support Backspace-only modifiers within input fields. This is fairly brittle, so maybe there's a + // better way to do stuff like this in the future. + continue; + } + for (const hkKey of hkKeys) { if (hkAction !== action) { continue; diff --git a/src-web/hooks/useHttpAuthenticationConfig.ts b/src-web/hooks/useHttpAuthenticationConfig.ts index 0d0a8833..4225c831 100644 --- a/src-web/hooks/useHttpAuthenticationConfig.ts +++ b/src-web/hooks/useHttpAuthenticationConfig.ts @@ -1,5 +1,5 @@ import { useQuery } from '@tanstack/react-query'; -import type { GrpcRequest, HttpRequest } from '@yaakapp-internal/models'; +import type { GrpcRequest, HttpRequest, WebsocketRequest } from '@yaakapp-internal/models'; import type { GetHttpAuthenticationConfigResponse, JsonPrimitive } from '@yaakapp-internal/plugins'; import { md5 } from 'js-md5'; import { useState } from 'react'; @@ -48,7 +48,7 @@ export function useHttpAuthenticationConfig( ...config, actions: config.actions?.map((a, i) => ({ ...a, - call: async ({ id: requestId }: HttpRequest | GrpcRequest) => { + call: async ({ id: requestId }: HttpRequest | GrpcRequest | WebsocketRequest) => { await invokeCmd('cmd_call_http_authentication_action', { pluginRefId: config.pluginRefId, actionIndex: i, diff --git a/src-web/hooks/useMoveToWorkspace.tsx b/src-web/hooks/useMoveToWorkspace.tsx index f61ff847..25357efa 100644 --- a/src-web/hooks/useMoveToWorkspace.tsx +++ b/src-web/hooks/useMoveToWorkspace.tsx @@ -1,9 +1,10 @@ import React from 'react'; import { MoveToWorkspaceDialog } from '../components/MoveToWorkspaceDialog'; import { showDialog } from '../lib/dialog'; +import { jotaiStore } from '../lib/jotai'; import { getActiveWorkspaceId } from './useActiveWorkspace'; import { useFastMutation } from './useFastMutation'; -import { getRequests } from './useRequests'; +import { requestsAtom } from './useRequests'; export function useMoveToWorkspace(id: string) { return useFastMutation({ @@ -12,7 +13,7 @@ export function useMoveToWorkspace(id: string) { const activeWorkspaceId = getActiveWorkspaceId(); if (activeWorkspaceId == null) return; - const request = getRequests().find((r) => r.id === id); + const request = jotaiStore.get(requestsAtom).find((r) => r.id === id); if (request == null) return; showDialog({ diff --git a/src-web/hooks/usePinnedWebsocketConnection.ts b/src-web/hooks/usePinnedWebsocketConnection.ts new file mode 100644 index 00000000..402d442e --- /dev/null +++ b/src-web/hooks/usePinnedWebsocketConnection.ts @@ -0,0 +1,18 @@ +import type { WebsocketConnection, WebsocketRequest } from '@yaakapp-internal/models'; +import { useKeyValue } from './useKeyValue'; +import { useLatestWebsocketConnection, useWebsocketConnections } from './useWebsocketConnections'; + +export function usePinnedWebsocketConnection(activeRequest: WebsocketRequest) { + const latestConnection = useLatestWebsocketConnection(activeRequest.id); + const { set: setPinnedConnectionId, value: pinnedConnectionId } = useKeyValue({ + // Key on latest connection instead of activeRequest because connections change out of band of active request + key: ['pinned_websocket_connection_id', latestConnection?.id ?? 'n/a'], + fallback: null, + namespace: 'global', + }); + const connections = useWebsocketConnections().filter((c) => c.requestId === activeRequest.id); + const activeConnection: WebsocketConnection | null = + connections.find((r) => r.id === pinnedConnectionId) ?? latestConnection; + + return { activeConnection, setPinnedConnectionId, pinnedConnectionId, connections } as const; +} diff --git a/src-web/hooks/useRequestUpdateKey.ts b/src-web/hooks/useRequestUpdateKey.ts index d828e623..8d10cff4 100644 --- a/src-web/hooks/useRequestUpdateKey.ts +++ b/src-web/hooks/useRequestUpdateKey.ts @@ -1,15 +1,16 @@ -import { createGlobalState } from 'react-use'; +import { atom, useAtomValue } from 'jotai'; import { generateId } from '../lib/generateId'; +import { jotaiStore } from '../lib/jotai'; -const useGlobalState = createGlobalState>({}); +const keyAtom = atom>({}); export function useRequestUpdateKey(requestId: string | null) { - const [keys, setKeys] = useGlobalState(); + const keys = useAtomValue(keyAtom); const key = keys[requestId ?? 'n/a']; return { updateKey: `${requestId}::${key ?? 'default'}`, wasUpdatedExternally: (changedRequestId: string) => { - setKeys((m) => ({ ...m, [changedRequestId]: generateId() })); + jotaiStore.set(keyAtom, (m) => ({ ...m, [changedRequestId]: generateId() })); }, }; } diff --git a/src-web/hooks/useRequests.ts b/src-web/hooks/useRequests.ts index 4f2e201f..ddad9c1e 100644 --- a/src-web/hooks/useRequests.ts +++ b/src-web/hooks/useRequests.ts @@ -1,14 +1,14 @@ import { atom, useAtomValue } from 'jotai'; -import {jotaiStore} from "../lib/jotai"; import { grpcRequestsAtom } from './useGrpcRequests'; import { httpRequestsAtom } from './useHttpRequests'; +import { websocketRequestsAtom } from './useWebsocketRequests'; -const requestsAtom = atom((get) => [...get(httpRequestsAtom), ...get(grpcRequestsAtom)]); +export const requestsAtom = atom((get) => [ + ...get(httpRequestsAtom), + ...get(grpcRequestsAtom), + ...get(websocketRequestsAtom), +]); export function useRequests() { return useAtomValue(requestsAtom); } - -export function getRequests() { - return jotaiStore.get(requestsAtom); -} diff --git a/src-web/hooks/useSyncModelStores.ts b/src-web/hooks/useSyncModelStores.ts index 87f185d6..ed677a1b 100644 --- a/src-web/hooks/useSyncModelStores.ts +++ b/src-web/hooks/useSyncModelStores.ts @@ -19,6 +19,9 @@ import { useListenToTauriEvent } from './useListenToTauriEvent'; import { pluginsAtom } from './usePlugins'; import { useRequestUpdateKey } from './useRequestUpdateKey'; import { settingsAtom } from './useSettings'; +import { websocketConnectionsAtom } from './useWebsocketConnections'; +import { websocketEventsQueryKey } from './useWebsocketEvents'; +import { websocketRequestsAtom } from './useWebsocketRequests'; import { workspaceMetaAtom } from './useWorkspaceMeta'; import { workspacesAtom } from './useWorkspaces'; @@ -31,13 +34,17 @@ export function useSyncModelStores() { const queryKey = payload.model.model === 'grpc_event' ? grpcEventsQueryKey(payload.model) - : payload.model.model === 'key_value' - ? keyValueQueryKey(payload.model) - : null; + : payload.model.model === 'websocket_event' + ? websocketEventsQueryKey(payload.model) + : payload.model.model === 'key_value' + ? keyValueQueryKey(payload.model) + : null; // TODO: Move this logic to useRequestEditor() hook if ( - payload.model.model === 'http_request' && + (payload.model.model === 'http_request' || + payload.model.model === 'grpc_request' || + payload.model.model === 'websocket_request') && (payload.windowLabel !== getCurrentWebviewWindow().label || payload.updateSource !== 'window') ) { wasUpdatedExternally(payload.model.id); @@ -64,6 +71,10 @@ export function useSyncModelStores() { jotaiStore.set(httpResponsesAtom, updateModelList(payload.model)); } else if (payload.model.model === 'grpc_request') { jotaiStore.set(grpcRequestsAtom, updateModelList(payload.model)); + } else if (payload.model.model === 'websocket_request') { + jotaiStore.set(websocketRequestsAtom, updateModelList(payload.model)); + } else if (payload.model.model === 'websocket_connection') { + jotaiStore.set(websocketConnectionsAtom, updateModelList(payload.model)); } else if (payload.model.model === 'grpc_connection') { jotaiStore.set(grpcConnectionsAtom, updateModelList(payload.model)); } else if (payload.model.model === 'environment') { @@ -103,6 +114,15 @@ export function useSyncModelStores() { jotaiStore.set(environmentsAtom, removeModelById(payload.model)); } else if (payload.model.model === 'grpc_request') { jotaiStore.set(grpcRequestsAtom, removeModelById(payload.model)); + } else if (payload.model.model === 'websocket_request') { + jotaiStore.set(websocketRequestsAtom, removeModelById(payload.model)); + } else if (payload.model.model === 'websocket_connection') { + jotaiStore.set(websocketConnectionsAtom, removeModelById(payload.model)); + } else if (payload.model.model === 'websocket_event') { + queryClient.setQueryData( + websocketEventsQueryKey(payload.model), + removeModelById(payload.model), + ); } else if (payload.model.model === 'grpc_connection') { jotaiStore.set(grpcConnectionsAtom, removeModelById(payload.model)); } else if (payload.model.model === 'grpc_event') { @@ -117,7 +137,10 @@ export function useSyncModelStores() { export function updateModelList(model: T) { // Mark these models as DESC instead of ASC - const pushToFront = model.model === 'http_response' || model.model === 'grpc_connection'; + const pushToFront = + model.model === 'http_response' || + model.model === 'grpc_connection' || + model.model === 'websocket_connection'; return (current: T[] | undefined | null): T[] => { const index = current?.findIndex((v) => modelsEq(v, model)) ?? -1; diff --git a/src-web/hooks/useSyncWorkspaceChildModels.ts b/src-web/hooks/useSyncWorkspaceChildModels.ts index f84f8b4d..1cbf2fff 100644 --- a/src-web/hooks/useSyncWorkspaceChildModels.ts +++ b/src-web/hooks/useSyncWorkspaceChildModels.ts @@ -1,3 +1,4 @@ +import {listWebsocketConnections, listWebsocketRequests} from '@yaakapp-internal/ws'; import { useEffect } from 'react'; import { jotaiStore } from '../lib/jotai'; import { invokeCmd } from '../lib/tauri'; @@ -10,6 +11,8 @@ import { grpcRequestsAtom } from './useGrpcRequests'; import { httpRequestsAtom } from './useHttpRequests'; import { httpResponsesAtom } from './useHttpResponses'; import { keyValuesAtom } from './useKeyValue'; +import {websocketConnectionsAtom} from "./useWebsocketConnections"; +import { websocketRequestsAtom } from './useWebsocketRequests'; import { workspaceMetaAtom } from './useWorkspaceMeta'; export function useSyncWorkspaceChildModels() { @@ -33,11 +36,13 @@ async function sync() { jotaiStore.set(httpRequestsAtom, await invokeCmd('cmd_list_http_requests', args)); jotaiStore.set(grpcRequestsAtom, await invokeCmd('cmd_list_grpc_requests', args)); jotaiStore.set(foldersAtom, await invokeCmd('cmd_list_folders', args)); + jotaiStore.set(websocketRequestsAtom, await listWebsocketRequests(args)); // Then, set the rest jotaiStore.set(cookieJarsAtom, await invokeCmd('cmd_list_cookie_jars', args)); jotaiStore.set(httpResponsesAtom, await invokeCmd('cmd_list_http_responses', args)); jotaiStore.set(grpcConnectionsAtom, await invokeCmd('cmd_list_grpc_connections', args)); + jotaiStore.set(websocketConnectionsAtom, await listWebsocketConnections(args)); jotaiStore.set(environmentsAtom, await invokeCmd('cmd_list_environments', args)); // Single models diff --git a/src-web/hooks/useWebsocketConnections.ts b/src-web/hooks/useWebsocketConnections.ts new file mode 100644 index 00000000..545320fb --- /dev/null +++ b/src-web/hooks/useWebsocketConnections.ts @@ -0,0 +1,17 @@ +import type { WebsocketConnection } from '@yaakapp-internal/models'; +import { atom, useAtomValue } from 'jotai'; +import { jotaiStore } from '../lib/jotai'; + +export const websocketConnectionsAtom = atom([]); + +export function useWebsocketConnections() { + return useAtomValue(websocketConnectionsAtom); +} + +export function useLatestWebsocketConnection(requestId: string | null): WebsocketConnection | null { + return useWebsocketConnections().find((r) => r.requestId === requestId) ?? null; +} + +export function getWebsocketConnection(id: string) { + return jotaiStore.get(websocketConnectionsAtom).find((r) => r.id === id) ?? null; +} diff --git a/src-web/hooks/useWebsocketEvents.ts b/src-web/hooks/useWebsocketEvents.ts new file mode 100644 index 00000000..cd2cdb70 --- /dev/null +++ b/src-web/hooks/useWebsocketEvents.ts @@ -0,0 +1,21 @@ +import { useQuery } from '@tanstack/react-query'; +import type { WebsocketEvent } from '@yaakapp-internal/models'; +import { listWebsocketEvents } from '@yaakapp-internal/ws'; + +export function websocketEventsQueryKey({ connectionId }: { connectionId: string }) { + return ['websocket_events', { connectionId }]; +} + +export function useWebsocketEvents(connectionId: string | null) { + return ( + useQuery({ + enabled: connectionId !== null, + initialData: [], + queryKey: websocketEventsQueryKey({ connectionId: connectionId ?? 'n/a' }), + queryFn: () => { + if (connectionId == null) return [] as WebsocketEvent[]; + return listWebsocketEvents({ connectionId }); + }, + }).data ?? [] + ); +} diff --git a/src-web/hooks/useWebsocketRequests.ts b/src-web/hooks/useWebsocketRequests.ts new file mode 100644 index 00000000..3603655b --- /dev/null +++ b/src-web/hooks/useWebsocketRequests.ts @@ -0,0 +1,13 @@ +import type { WebsocketRequest } from '@yaakapp-internal/models'; +import { atom, useAtomValue } from 'jotai'; +import { jotaiStore } from '../lib/jotai'; + +export const websocketRequestsAtom = atom([]); + +export function useWebsocketRequests() { + return useAtomValue(websocketRequestsAtom); +} + +export function getWebsocketRequest(id: string) { + return jotaiStore.get(websocketRequestsAtom).find((r) => r.id === id) ?? null; +} diff --git a/src-web/lib/contentType.ts b/src-web/lib/contentType.ts index 2122d265..608362e2 100644 --- a/src-web/lib/contentType.ts +++ b/src-web/lib/contentType.ts @@ -32,6 +32,8 @@ function detectFromContent( content.toLowerCase().startsWith('