feat: update to tauri beta, add permissions (#862)

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Lucas Nogueira <lucas@crabnebula.dev>
This commit is contained in:
Tillmann
2024-02-04 03:14:41 +09:00
committed by GitHub
parent 506ce4835b
commit d198c01486
387 changed files with 21883 additions and 943 deletions
+6 -2
View File
@@ -6,10 +6,14 @@ authors = { workspace = true }
license = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }
links = "tauri-plugin-store"
[package.metadata.docs.rs]
rustc-args = [ "--cfg", "docsrs" ]
rustdoc-args = [ "--cfg", "docsrs" ]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
[build-dependencies]
tauri-plugin = { workspace = true, features = ["build"] }
[dependencies]
serde = { workspace = true }
+12
View File
@@ -0,0 +1,12 @@
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
const COMMANDS: &[&str] = &[
"set", "get", "has", "delete", "clear", "reset", "keys", "values", "length", "entries", "load",
"save",
];
fn main() {
tauri_plugin::Builder::new(COMMANDS).build();
}
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.13"
"@tauri-apps/api": "2.0.0-beta.0"
}
}
+1
View File
@@ -0,0 +1 @@
schemas/
+1
View File
@@ -0,0 +1 @@
schemas/
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-clear"
description = "Enables the clear command without any pre-configured scope."
commands.allow = ["clear"]
[[permission]]
identifier = "deny-clear"
description = "Denies the clear command without any pre-configured scope."
commands.deny = ["clear"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-delete"
description = "Enables the delete command without any pre-configured scope."
commands.allow = ["delete"]
[[permission]]
identifier = "deny-delete"
description = "Denies the delete command without any pre-configured scope."
commands.deny = ["delete"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-entries"
description = "Enables the entries command without any pre-configured scope."
commands.allow = ["entries"]
[[permission]]
identifier = "deny-entries"
description = "Denies the entries command without any pre-configured scope."
commands.deny = ["entries"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-get"
description = "Enables the get command without any pre-configured scope."
commands.allow = ["get"]
[[permission]]
identifier = "deny-get"
description = "Denies the get command without any pre-configured scope."
commands.deny = ["get"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-has"
description = "Enables the has command without any pre-configured scope."
commands.allow = ["has"]
[[permission]]
identifier = "deny-has"
description = "Denies the has command without any pre-configured scope."
commands.deny = ["has"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-keys"
description = "Enables the keys command without any pre-configured scope."
commands.allow = ["keys"]
[[permission]]
identifier = "deny-keys"
description = "Denies the keys command without any pre-configured scope."
commands.deny = ["keys"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-length"
description = "Enables the length command without any pre-configured scope."
commands.allow = ["length"]
[[permission]]
identifier = "deny-length"
description = "Denies the length command without any pre-configured scope."
commands.deny = ["length"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-load"
description = "Enables the load command without any pre-configured scope."
commands.allow = ["load"]
[[permission]]
identifier = "deny-load"
description = "Denies the load command without any pre-configured scope."
commands.deny = ["load"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-reset"
description = "Enables the reset command without any pre-configured scope."
commands.allow = ["reset"]
[[permission]]
identifier = "deny-reset"
description = "Denies the reset command without any pre-configured scope."
commands.deny = ["reset"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-save"
description = "Enables the save command without any pre-configured scope."
commands.allow = ["save"]
[[permission]]
identifier = "deny-save"
description = "Denies the save command without any pre-configured scope."
commands.deny = ["save"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-set"
description = "Enables the set command without any pre-configured scope."
commands.allow = ["set"]
[[permission]]
identifier = "deny-set"
description = "Denies the set command without any pre-configured scope."
commands.deny = ["set"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-values"
description = "Enables the values command without any pre-configured scope."
commands.allow = ["values"]
[[permission]]
identifier = "deny-values"
description = "Denies the values command without any pre-configured scope."
commands.deny = ["values"]
@@ -0,0 +1,98 @@
# Permissions
## allow-clear
Enables the clear command without any pre-configured scope.
## deny-clear
Denies the clear command without any pre-configured scope.
## allow-delete
Enables the delete command without any pre-configured scope.
## deny-delete
Denies the delete command without any pre-configured scope.
## allow-entries
Enables the entries command without any pre-configured scope.
## deny-entries
Denies the entries command without any pre-configured scope.
## allow-get
Enables the get command without any pre-configured scope.
## deny-get
Denies the get command without any pre-configured scope.
## allow-has
Enables the has command without any pre-configured scope.
## deny-has
Denies the has command without any pre-configured scope.
## allow-keys
Enables the keys command without any pre-configured scope.
## deny-keys
Denies the keys command without any pre-configured scope.
## allow-length
Enables the length command without any pre-configured scope.
## deny-length
Denies the length command without any pre-configured scope.
## allow-load
Enables the load command without any pre-configured scope.
## deny-load
Denies the load command without any pre-configured scope.
## allow-reset
Enables the reset command without any pre-configured scope.
## deny-reset
Denies the reset command without any pre-configured scope.
## allow-save
Enables the save command without any pre-configured scope.
## deny-save
Denies the save command without any pre-configured scope.
## allow-set
Enables the set command without any pre-configured scope.
## deny-set
Denies the set command without any pre-configured scope.
## allow-values
Enables the values command without any pre-configured scope.
## deny-values
Denies the values command without any pre-configured scope.
+1 -1
View File
@@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_STORE__=function(t){"use strict";function a(t,a=!1){return window.__TAURI_INTERNALS__.transformCallback(t,a)}async function e(t,a={},e){return window.__TAURI_INTERNALS__.invoke(t,a,e)}var n;async function r(t,n,r){return e("plugin:event|listen",{event:t,windowLabel:r?.target,handler:a(n)}).then((a=>async()=>async function(t,a){await e("plugin:event|unlisten",{event:t,eventId:a})}(t,a)))}"function"==typeof SuppressedError&&SuppressedError,function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_CREATED="tauri://window-created",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_FILE_DROP="tauri://file-drop",t.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",t.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled"}(n||(n={}));return t.Store=class{constructor(t){this.path=t}async set(t,a){return await e("plugin:store|set",{path:this.path,key:t,value:a})}async get(t){return await e("plugin:store|get",{path:this.path,key:t})}async has(t){return await e("plugin:store|has",{path:this.path,key:t})}async delete(t){return await e("plugin:store|delete",{path:this.path,key:t})}async clear(){return await e("plugin:store|clear",{path:this.path})}async reset(){return await e("plugin:store|reset",{path:this.path})}async keys(){return await e("plugin:store|keys",{path:this.path})}async values(){return await e("plugin:store|values",{path:this.path})}async entries(){return await e("plugin:store|entries",{path:this.path})}async length(){return await e("plugin:store|length",{path:this.path})}async load(){return await e("plugin:store|load",{path:this.path})}async save(){return await e("plugin:store|save",{path:this.path})}async onKeyChange(t,a){return await r("store://change",(e=>{e.payload.path===this.path&&e.payload.key===t&&a(e.payload.value)}))}async onChange(t){return await r("store://change",(a=>{a.payload.path===this.path&&t(a.payload.key,a.payload.value)}))}},t}({});Object.defineProperty(window.__TAURI__,"store",{value:__TAURI_PLUGIN_STORE__})}
if("__TAURI__"in window){var __TAURI_PLUGIN_STORE__=function(t){"use strict";function a(t,a=!1){return window.__TAURI_INTERNALS__.transformCallback(t,a)}async function e(t,a={},e){return window.__TAURI_INTERNALS__.invoke(t,a,e)}var n;async function r(t,n,r){const i="string"==typeof r?.target?{kind:"AnyLabel",label:r.target}:r?.target??{kind:"Any"};return e("plugin:event|listen",{event:t,target:i,handler:a(n)}).then((a=>async()=>async function(t,a){await e("plugin:event|unlisten",{event:t,eventId:a})}(t,a)))}"function"==typeof SuppressedError&&SuppressedError,function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WEBVIEW_CREATED="tauri://webview-created",t.WEBVIEW_FILE_DROP="tauri://file-drop",t.WEBVIEW_FILE_DROP_HOVER="tauri://file-drop-hover",t.WEBVIEW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled"}(n||(n={}));return t.Store=class{constructor(t){this.path=t}async set(t,a){return await e("plugin:store|set",{path:this.path,key:t,value:a})}async get(t){return await e("plugin:store|get",{path:this.path,key:t})}async has(t){return await e("plugin:store|has",{path:this.path,key:t})}async delete(t){return await e("plugin:store|delete",{path:this.path,key:t})}async clear(){return await e("plugin:store|clear",{path:this.path})}async reset(){return await e("plugin:store|reset",{path:this.path})}async keys(){return await e("plugin:store|keys",{path:this.path})}async values(){return await e("plugin:store|values",{path:this.path})}async entries(){return await e("plugin:store|entries",{path:this.path})}async length(){return await e("plugin:store|length",{path:this.path})}async load(){return await e("plugin:store|load",{path:this.path})}async save(){return await e("plugin:store|save",{path:this.path})}async onKeyChange(t,a){return await r("store://change",(e=>{e.payload.path===this.path&&e.payload.key===t&&a(e.payload.value)}))}async onChange(t){return await r("store://change",(a=>{a.payload.path===this.path&&t(a.payload.key,a.payload.value)}))}},t}({});Object.defineProperty(window.__TAURI__,"store",{value:__TAURI_PLUGIN_STORE__})}