Эх сурвалжийг харах

refactor(core): delete the command module (#8716)

Lucas Fernandes Nogueira 1 жил өмнө
parent
commit
aa758a850f

+ 5 - 0
.changes/move-command-module.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch:breaking
+---
+
+Moved the `command` module items to the `ipc` module so its import name does not clash with the `command` macro.

+ 3 - 3
core/tauri-macros/src/command/wrapper.rs

@@ -264,7 +264,7 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream {
         // double braces because the item is expected to be a block expression
         ($path:path, $invoke:ident) => {{
           #[allow(unused_imports)]
-          use #root::command::private::*;
+          use #root::ipc::private::*;
           // prevent warnings when the body is a `compile_error!` or if the command has no arguments
           #[allow(unused_variables)]
           let #root::ipc::Invoke { message: #message, resolver: #resolver, acl: #acl } = $invoke;
@@ -442,8 +442,8 @@ fn parse_arg(
 
   let root = &attributes.root;
 
-  Ok(quote!(#root::command::CommandArg::from_command(
-    #root::command::CommandItem {
+  Ok(quote!(#root::ipc::CommandArg::from_command(
+    #root::ipc::CommandItem {
       plugin: #plugin_name,
       name: stringify!(#command),
       key: #key,

+ 156 - 156
core/tauri/permissions/app/schemas/schema.json

@@ -15,49 +15,39 @@
         }
       ]
     },
-    "set": {
-      "description": "A list of permissions sets defined",
+    "permission": {
+      "description": "A list of inlined permissions",
       "default": [],
       "type": "array",
       "items": {
-        "$ref": "#/definitions/PermissionSet"
+        "$ref": "#/definitions/Permission"
       }
     },
-    "permission": {
-      "description": "A list of inlined permissions",
+    "set": {
+      "description": "A list of permissions sets defined",
       "default": [],
       "type": "array",
       "items": {
-        "$ref": "#/definitions/Permission"
+        "$ref": "#/definitions/PermissionSet"
       }
     }
   },
   "definitions": {
-    "DefaultPermission": {
-      "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
+    "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",
-      "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.",
-          "type": [
-            "string",
-            "null"
-          ]
+        "allow": {
+          "description": "Allowed command.",
+          "default": [],
+          "type": "array",
+          "items": {
+            "type": "string"
+          }
         },
-        "permissions": {
-          "description": "All permissions this set contains.",
+        "deny": {
+          "description": "Denied command, which takes priority.",
+          "default": [],
           "type": "array",
           "items": {
             "type": "string"
@@ -65,32 +55,53 @@
         }
       }
     },
-    "PermissionSet": {
-      "description": "A set of direct permissions grouped together under a new name.",
+    "DefaultPermission": {
+      "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
       "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"
+          "type": [
+            "string",
+            "null"
+          ]
         },
         "permissions": {
           "description": "All permissions this set contains.",
           "type": "array",
           "items": {
-            "$ref": "#/definitions/PermissionKind"
+            "type": "string"
           }
+        },
+        "version": {
+          "description": "The version of the permission.",
+          "type": [
+            "integer",
+            "null"
+          ],
+          "format": "uint64",
+          "minimum": 1.0
         }
       }
     },
+    "Number": {
+      "description": "A valid ACL number.",
+      "anyOf": [
+        {
+          "description": "Represents an [`i64`].",
+          "type": "integer",
+          "format": "int64"
+        },
+        {
+          "description": "Represents a [`f64`].",
+          "type": "number",
+          "format": "double"
+        }
+      ]
+    },
     "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",
@@ -98,26 +109,6 @@
         "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.",
-          "type": [
-            "string",
-            "null"
-          ]
-        },
         "commands": {
           "description": "Allowed or denied commands when using this permission.",
           "default": {
@@ -130,6 +121,17 @@
             }
           ]
         },
+        "description": {
+          "description": "Human-readable description of what the permission does.",
+          "type": [
+            "string",
+            "null"
+          ]
+        },
+        "identifier": {
+          "description": "A unique identifier for the permission.",
+          "type": "string"
+        },
         "scope": {
           "description": "Allowed or denied scoped when using this permission.",
           "default": {},
@@ -138,111 +140,18 @@
               "$ref": "#/definitions/Scopes"
             }
           ]
-        }
-      }
-    },
-    "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": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.",
-      "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.",
+        "version": {
+          "description": "The version of the permission.",
           "type": [
-            "array",
+            "integer",
             "null"
           ],
-          "items": {
-            "$ref": "#/definitions/Value"
-          }
+          "format": "uint64",
+          "minimum": 1.0
         }
       }
     },
-    "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"
-        }
-      ]
-    },
     "PermissionKind": {
       "type": "string",
       "oneOf": [
@@ -324,6 +233,97 @@
           ]
         }
       ]
+    },
+    "PermissionSet": {
+      "description": "A set of direct permissions grouped together under a new name.",
+      "type": "object",
+      "required": [
+        "description",
+        "identifier",
+        "permissions"
+      ],
+      "properties": {
+        "description": {
+          "description": "Human-readable description of what the permission does.",
+          "type": "string"
+        },
+        "identifier": {
+          "description": "A unique identifier for the permission.",
+          "type": "string"
+        },
+        "permissions": {
+          "description": "All permissions this set contains.",
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/PermissionKind"
+          }
+        }
+      }
+    },
+    "Scopes": {
+      "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.",
+      "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.",
+          "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"
+          }
+        }
+      ]
     }
   }
 }

+ 140 - 140
core/tauri/permissions/event/schemas/schema.json

@@ -15,49 +15,39 @@
         }
       ]
     },
-    "set": {
-      "description": "A list of permissions sets defined",
+    "permission": {
+      "description": "A list of inlined permissions",
       "default": [],
       "type": "array",
       "items": {
-        "$ref": "#/definitions/PermissionSet"
+        "$ref": "#/definitions/Permission"
       }
     },
-    "permission": {
-      "description": "A list of inlined permissions",
+    "set": {
+      "description": "A list of permissions sets defined",
       "default": [],
       "type": "array",
       "items": {
-        "$ref": "#/definitions/Permission"
+        "$ref": "#/definitions/PermissionSet"
       }
     }
   },
   "definitions": {
-    "DefaultPermission": {
-      "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
+    "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",
-      "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.",
-          "type": [
-            "string",
-            "null"
-          ]
+        "allow": {
+          "description": "Allowed command.",
+          "default": [],
+          "type": "array",
+          "items": {
+            "type": "string"
+          }
         },
-        "permissions": {
-          "description": "All permissions this set contains.",
+        "deny": {
+          "description": "Denied command, which takes priority.",
+          "default": [],
           "type": "array",
           "items": {
             "type": "string"
@@ -65,32 +55,53 @@
         }
       }
     },
-    "PermissionSet": {
-      "description": "A set of direct permissions grouped together under a new name.",
+    "DefaultPermission": {
+      "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
       "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"
+          "type": [
+            "string",
+            "null"
+          ]
         },
         "permissions": {
           "description": "All permissions this set contains.",
           "type": "array",
           "items": {
-            "$ref": "#/definitions/PermissionKind"
+            "type": "string"
           }
+        },
+        "version": {
+          "description": "The version of the permission.",
+          "type": [
+            "integer",
+            "null"
+          ],
+          "format": "uint64",
+          "minimum": 1.0
         }
       }
     },
+    "Number": {
+      "description": "A valid ACL number.",
+      "anyOf": [
+        {
+          "description": "Represents an [`i64`].",
+          "type": "integer",
+          "format": "int64"
+        },
+        {
+          "description": "Represents a [`f64`].",
+          "type": "number",
+          "format": "double"
+        }
+      ]
+    },
     "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",
@@ -98,26 +109,6 @@
         "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.",
-          "type": [
-            "string",
-            "null"
-          ]
-        },
         "commands": {
           "description": "Allowed or denied commands when using this permission.",
           "default": {
@@ -130,6 +121,17 @@
             }
           ]
         },
+        "description": {
+          "description": "Human-readable description of what the permission does.",
+          "type": [
+            "string",
+            "null"
+          ]
+        },
+        "identifier": {
+          "description": "A unique identifier for the permission.",
+          "type": "string"
+        },
         "scope": {
           "description": "Allowed or denied scoped when using this permission.",
           "default": {},
@@ -138,27 +140,94 @@
               "$ref": "#/definitions/Scopes"
             }
           ]
+        },
+        "version": {
+          "description": "The version of the permission.",
+          "type": [
+            "integer",
+            "null"
+          ],
+          "format": "uint64",
+          "minimum": 1.0
         }
       }
     },
-    "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.",
+    "PermissionKind": {
+      "type": "string",
+      "oneOf": [
+        {
+          "description": "allow-emit -> Enables the emit command without any pre-configured scope.",
+          "type": "string",
+          "enum": [
+            "allow-emit"
+          ]
+        },
+        {
+          "description": "deny-emit -> Denies the emit command without any pre-configured scope.",
+          "type": "string",
+          "enum": [
+            "deny-emit"
+          ]
+        },
+        {
+          "description": "allow-listen -> Enables the listen command without any pre-configured scope.",
+          "type": "string",
+          "enum": [
+            "allow-listen"
+          ]
+        },
+        {
+          "description": "deny-listen -> Denies the listen command without any pre-configured scope.",
+          "type": "string",
+          "enum": [
+            "deny-listen"
+          ]
+        },
+        {
+          "description": "allow-unlisten -> Enables the unlisten command without any pre-configured scope.",
+          "type": "string",
+          "enum": [
+            "allow-unlisten"
+          ]
+        },
+        {
+          "description": "deny-unlisten -> Denies the unlisten command without any pre-configured scope.",
+          "type": "string",
+          "enum": [
+            "deny-unlisten"
+          ]
+        },
+        {
+          "description": "default -> Default permissions for the plugin.",
+          "type": "string",
+          "enum": [
+            "default"
+          ]
+        }
+      ]
+    },
+    "PermissionSet": {
+      "description": "A set of direct permissions grouped together under a new name.",
       "type": "object",
+      "required": [
+        "description",
+        "identifier",
+        "permissions"
+      ],
       "properties": {
-        "allow": {
-          "description": "Allowed command.",
-          "default": [],
-          "type": "array",
-          "items": {
-            "type": "string"
-          }
+        "description": {
+          "description": "Human-readable description of what the permission does.",
+          "type": "string"
         },
-        "deny": {
-          "description": "Denied command, which takes priority.",
-          "default": [],
+        "identifier": {
+          "description": "A unique identifier for the permission.",
+          "type": "string"
+        },
+        "permissions": {
+          "description": "All permissions this set contains.",
           "type": "array",
           "items": {
-            "type": "string"
+            "$ref": "#/definitions/PermissionKind"
           }
         }
       }
@@ -227,75 +296,6 @@
           }
         }
       ]
-    },
-    "Number": {
-      "description": "A valid ACL number.",
-      "anyOf": [
-        {
-          "description": "Represents an [`i64`].",
-          "type": "integer",
-          "format": "int64"
-        },
-        {
-          "description": "Represents a [`f64`].",
-          "type": "number",
-          "format": "double"
-        }
-      ]
-    },
-    "PermissionKind": {
-      "type": "string",
-      "oneOf": [
-        {
-          "description": "allow-emit -> Enables the emit command without any pre-configured scope.",
-          "type": "string",
-          "enum": [
-            "allow-emit"
-          ]
-        },
-        {
-          "description": "deny-emit -> Denies the emit command without any pre-configured scope.",
-          "type": "string",
-          "enum": [
-            "deny-emit"
-          ]
-        },
-        {
-          "description": "allow-listen -> Enables the listen command without any pre-configured scope.",
-          "type": "string",
-          "enum": [
-            "allow-listen"
-          ]
-        },
-        {
-          "description": "deny-listen -> Denies the listen command without any pre-configured scope.",
-          "type": "string",
-          "enum": [
-            "deny-listen"
-          ]
-        },
-        {
-          "description": "allow-unlisten -> Enables the unlisten command without any pre-configured scope.",
-          "type": "string",
-          "enum": [
-            "allow-unlisten"
-          ]
-        },
-        {
-          "description": "deny-unlisten -> Denies the unlisten command without any pre-configured scope.",
-          "type": "string",
-          "enum": [
-            "deny-unlisten"
-          ]
-        },
-        {
-          "description": "default -> Default permissions for the plugin.",
-          "type": "string",
-          "enum": [
-            "default"
-          ]
-        }
-      ]
     }
   }
 }

+ 156 - 156
core/tauri/permissions/menu/schemas/schema.json

@@ -15,49 +15,39 @@
         }
       ]
     },
-    "set": {
-      "description": "A list of permissions sets defined",
+    "permission": {
+      "description": "A list of inlined permissions",
       "default": [],
       "type": "array",
       "items": {
-        "$ref": "#/definitions/PermissionSet"
+        "$ref": "#/definitions/Permission"
       }
     },
-    "permission": {
-      "description": "A list of inlined permissions",
+    "set": {
+      "description": "A list of permissions sets defined",
       "default": [],
       "type": "array",
       "items": {
-        "$ref": "#/definitions/Permission"
+        "$ref": "#/definitions/PermissionSet"
       }
     }
   },
   "definitions": {
-    "DefaultPermission": {
-      "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
+    "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",
-      "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.",
-          "type": [
-            "string",
-            "null"
-          ]
+        "allow": {
+          "description": "Allowed command.",
+          "default": [],
+          "type": "array",
+          "items": {
+            "type": "string"
+          }
         },
-        "permissions": {
-          "description": "All permissions this set contains.",
+        "deny": {
+          "description": "Denied command, which takes priority.",
+          "default": [],
           "type": "array",
           "items": {
             "type": "string"
@@ -65,32 +55,53 @@
         }
       }
     },
-    "PermissionSet": {
-      "description": "A set of direct permissions grouped together under a new name.",
+    "DefaultPermission": {
+      "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
       "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"
+          "type": [
+            "string",
+            "null"
+          ]
         },
         "permissions": {
           "description": "All permissions this set contains.",
           "type": "array",
           "items": {
-            "$ref": "#/definitions/PermissionKind"
+            "type": "string"
           }
+        },
+        "version": {
+          "description": "The version of the permission.",
+          "type": [
+            "integer",
+            "null"
+          ],
+          "format": "uint64",
+          "minimum": 1.0
         }
       }
     },
+    "Number": {
+      "description": "A valid ACL number.",
+      "anyOf": [
+        {
+          "description": "Represents an [`i64`].",
+          "type": "integer",
+          "format": "int64"
+        },
+        {
+          "description": "Represents a [`f64`].",
+          "type": "number",
+          "format": "double"
+        }
+      ]
+    },
     "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",
@@ -98,26 +109,6 @@
         "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.",
-          "type": [
-            "string",
-            "null"
-          ]
-        },
         "commands": {
           "description": "Allowed or denied commands when using this permission.",
           "default": {
@@ -130,6 +121,17 @@
             }
           ]
         },
+        "description": {
+          "description": "Human-readable description of what the permission does.",
+          "type": [
+            "string",
+            "null"
+          ]
+        },
+        "identifier": {
+          "description": "A unique identifier for the permission.",
+          "type": "string"
+        },
         "scope": {
           "description": "Allowed or denied scoped when using this permission.",
           "default": {},
@@ -138,111 +140,18 @@
               "$ref": "#/definitions/Scopes"
             }
           ]
-        }
-      }
-    },
-    "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": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.",
-      "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.",
+        "version": {
+          "description": "The version of the permission.",
           "type": [
-            "array",
+            "integer",
             "null"
           ],
-          "items": {
-            "$ref": "#/definitions/Value"
-          }
+          "format": "uint64",
+          "minimum": 1.0
         }
       }
     },
-    "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"
-        }
-      ]
-    },
     "PermissionKind": {
       "type": "string",
       "oneOf": [
@@ -562,6 +471,97 @@
           ]
         }
       ]
+    },
+    "PermissionSet": {
+      "description": "A set of direct permissions grouped together under a new name.",
+      "type": "object",
+      "required": [
+        "description",
+        "identifier",
+        "permissions"
+      ],
+      "properties": {
+        "description": {
+          "description": "Human-readable description of what the permission does.",
+          "type": "string"
+        },
+        "identifier": {
+          "description": "A unique identifier for the permission.",
+          "type": "string"
+        },
+        "permissions": {
+          "description": "All permissions this set contains.",
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/PermissionKind"
+          }
+        }
+      }
+    },
+    "Scopes": {
+      "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.",
+      "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.",
+          "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"
+          }
+        }
+      ]
     }
   }
 }

+ 156 - 156
core/tauri/permissions/path/schemas/schema.json

@@ -15,49 +15,39 @@
         }
       ]
     },
-    "set": {
-      "description": "A list of permissions sets defined",
+    "permission": {
+      "description": "A list of inlined permissions",
       "default": [],
       "type": "array",
       "items": {
-        "$ref": "#/definitions/PermissionSet"
+        "$ref": "#/definitions/Permission"
       }
     },
-    "permission": {
-      "description": "A list of inlined permissions",
+    "set": {
+      "description": "A list of permissions sets defined",
       "default": [],
       "type": "array",
       "items": {
-        "$ref": "#/definitions/Permission"
+        "$ref": "#/definitions/PermissionSet"
       }
     }
   },
   "definitions": {
-    "DefaultPermission": {
-      "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
+    "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",
-      "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.",
-          "type": [
-            "string",
-            "null"
-          ]
+        "allow": {
+          "description": "Allowed command.",
+          "default": [],
+          "type": "array",
+          "items": {
+            "type": "string"
+          }
         },
-        "permissions": {
-          "description": "All permissions this set contains.",
+        "deny": {
+          "description": "Denied command, which takes priority.",
+          "default": [],
           "type": "array",
           "items": {
             "type": "string"
@@ -65,32 +55,53 @@
         }
       }
     },
-    "PermissionSet": {
-      "description": "A set of direct permissions grouped together under a new name.",
+    "DefaultPermission": {
+      "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
       "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"
+          "type": [
+            "string",
+            "null"
+          ]
         },
         "permissions": {
           "description": "All permissions this set contains.",
           "type": "array",
           "items": {
-            "$ref": "#/definitions/PermissionKind"
+            "type": "string"
           }
+        },
+        "version": {
+          "description": "The version of the permission.",
+          "type": [
+            "integer",
+            "null"
+          ],
+          "format": "uint64",
+          "minimum": 1.0
         }
       }
     },
+    "Number": {
+      "description": "A valid ACL number.",
+      "anyOf": [
+        {
+          "description": "Represents an [`i64`].",
+          "type": "integer",
+          "format": "int64"
+        },
+        {
+          "description": "Represents a [`f64`].",
+          "type": "number",
+          "format": "double"
+        }
+      ]
+    },
     "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",
@@ -98,26 +109,6 @@
         "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.",
-          "type": [
-            "string",
-            "null"
-          ]
-        },
         "commands": {
           "description": "Allowed or denied commands when using this permission.",
           "default": {
@@ -130,6 +121,17 @@
             }
           ]
         },
+        "description": {
+          "description": "Human-readable description of what the permission does.",
+          "type": [
+            "string",
+            "null"
+          ]
+        },
+        "identifier": {
+          "description": "A unique identifier for the permission.",
+          "type": "string"
+        },
         "scope": {
           "description": "Allowed or denied scoped when using this permission.",
           "default": {},
@@ -138,111 +140,18 @@
               "$ref": "#/definitions/Scopes"
             }
           ]
-        }
-      }
-    },
-    "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": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.",
-      "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.",
+        "version": {
+          "description": "The version of the permission.",
           "type": [
-            "array",
+            "integer",
             "null"
           ],
-          "items": {
-            "$ref": "#/definitions/Value"
-          }
+          "format": "uint64",
+          "minimum": 1.0
         }
       }
     },
-    "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"
-        }
-      ]
-    },
     "PermissionKind": {
       "type": "string",
       "oneOf": [
@@ -366,6 +275,97 @@
           ]
         }
       ]
+    },
+    "PermissionSet": {
+      "description": "A set of direct permissions grouped together under a new name.",
+      "type": "object",
+      "required": [
+        "description",
+        "identifier",
+        "permissions"
+      ],
+      "properties": {
+        "description": {
+          "description": "Human-readable description of what the permission does.",
+          "type": "string"
+        },
+        "identifier": {
+          "description": "A unique identifier for the permission.",
+          "type": "string"
+        },
+        "permissions": {
+          "description": "All permissions this set contains.",
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/PermissionKind"
+          }
+        }
+      }
+    },
+    "Scopes": {
+      "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.",
+      "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.",
+          "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"
+          }
+        }
+      ]
     }
   }
 }

+ 112 - 112
core/tauri/permissions/resources/schemas/schema.json

@@ -15,49 +15,39 @@
         }
       ]
     },
-    "set": {
-      "description": "A list of permissions sets defined",
+    "permission": {
+      "description": "A list of inlined permissions",
       "default": [],
       "type": "array",
       "items": {
-        "$ref": "#/definitions/PermissionSet"
+        "$ref": "#/definitions/Permission"
       }
     },
-    "permission": {
-      "description": "A list of inlined permissions",
+    "set": {
+      "description": "A list of permissions sets defined",
       "default": [],
       "type": "array",
       "items": {
-        "$ref": "#/definitions/Permission"
+        "$ref": "#/definitions/PermissionSet"
       }
     }
   },
   "definitions": {
-    "DefaultPermission": {
-      "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
+    "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",
-      "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.",
-          "type": [
-            "string",
-            "null"
-          ]
+        "allow": {
+          "description": "Allowed command.",
+          "default": [],
+          "type": "array",
+          "items": {
+            "type": "string"
+          }
         },
-        "permissions": {
-          "description": "All permissions this set contains.",
+        "deny": {
+          "description": "Denied command, which takes priority.",
+          "default": [],
           "type": "array",
           "items": {
             "type": "string"
@@ -65,32 +55,53 @@
         }
       }
     },
-    "PermissionSet": {
-      "description": "A set of direct permissions grouped together under a new name.",
+    "DefaultPermission": {
+      "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
       "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"
+          "type": [
+            "string",
+            "null"
+          ]
         },
         "permissions": {
           "description": "All permissions this set contains.",
           "type": "array",
           "items": {
-            "$ref": "#/definitions/PermissionKind"
+            "type": "string"
           }
+        },
+        "version": {
+          "description": "The version of the permission.",
+          "type": [
+            "integer",
+            "null"
+          ],
+          "format": "uint64",
+          "minimum": 1.0
         }
       }
     },
+    "Number": {
+      "description": "A valid ACL number.",
+      "anyOf": [
+        {
+          "description": "Represents an [`i64`].",
+          "type": "integer",
+          "format": "int64"
+        },
+        {
+          "description": "Represents a [`f64`].",
+          "type": "number",
+          "format": "double"
+        }
+      ]
+    },
     "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",
@@ -98,26 +109,6 @@
         "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.",
-          "type": [
-            "string",
-            "null"
-          ]
-        },
         "commands": {
           "description": "Allowed or denied commands when using this permission.",
           "default": {
@@ -130,6 +121,17 @@
             }
           ]
         },
+        "description": {
+          "description": "Human-readable description of what the permission does.",
+          "type": [
+            "string",
+            "null"
+          ]
+        },
+        "identifier": {
+          "description": "A unique identifier for the permission.",
+          "type": "string"
+        },
         "scope": {
           "description": "Allowed or denied scoped when using this permission.",
           "default": {},
@@ -138,27 +140,66 @@
               "$ref": "#/definitions/Scopes"
             }
           ]
+        },
+        "version": {
+          "description": "The version of the permission.",
+          "type": [
+            "integer",
+            "null"
+          ],
+          "format": "uint64",
+          "minimum": 1.0
         }
       }
     },
-    "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.",
+    "PermissionKind": {
+      "type": "string",
+      "oneOf": [
+        {
+          "description": "allow-close -> Enables the close command without any pre-configured scope.",
+          "type": "string",
+          "enum": [
+            "allow-close"
+          ]
+        },
+        {
+          "description": "deny-close -> Denies the close command without any pre-configured scope.",
+          "type": "string",
+          "enum": [
+            "deny-close"
+          ]
+        },
+        {
+          "description": "default -> Default permissions for the plugin.",
+          "type": "string",
+          "enum": [
+            "default"
+          ]
+        }
+      ]
+    },
+    "PermissionSet": {
+      "description": "A set of direct permissions grouped together under a new name.",
       "type": "object",
+      "required": [
+        "description",
+        "identifier",
+        "permissions"
+      ],
       "properties": {
-        "allow": {
-          "description": "Allowed command.",
-          "default": [],
-          "type": "array",
-          "items": {
-            "type": "string"
-          }
+        "description": {
+          "description": "Human-readable description of what the permission does.",
+          "type": "string"
         },
-        "deny": {
-          "description": "Denied command, which takes priority.",
-          "default": [],
+        "identifier": {
+          "description": "A unique identifier for the permission.",
+          "type": "string"
+        },
+        "permissions": {
+          "description": "All permissions this set contains.",
           "type": "array",
           "items": {
-            "type": "string"
+            "$ref": "#/definitions/PermissionKind"
           }
         }
       }
@@ -227,47 +268,6 @@
           }
         }
       ]
-    },
-    "Number": {
-      "description": "A valid ACL number.",
-      "anyOf": [
-        {
-          "description": "Represents an [`i64`].",
-          "type": "integer",
-          "format": "int64"
-        },
-        {
-          "description": "Represents a [`f64`].",
-          "type": "number",
-          "format": "double"
-        }
-      ]
-    },
-    "PermissionKind": {
-      "type": "string",
-      "oneOf": [
-        {
-          "description": "allow-close -> Enables the close command without any pre-configured scope.",
-          "type": "string",
-          "enum": [
-            "allow-close"
-          ]
-        },
-        {
-          "description": "deny-close -> Denies the close command without any pre-configured scope.",
-          "type": "string",
-          "enum": [
-            "deny-close"
-          ]
-        },
-        {
-          "description": "default -> Default permissions for the plugin.",
-          "type": "string",
-          "enum": [
-            "default"
-          ]
-        }
-      ]
     }
   }
 }

+ 156 - 156
core/tauri/permissions/tray/schemas/schema.json

@@ -15,49 +15,39 @@
         }
       ]
     },
-    "set": {
-      "description": "A list of permissions sets defined",
+    "permission": {
+      "description": "A list of inlined permissions",
       "default": [],
       "type": "array",
       "items": {
-        "$ref": "#/definitions/PermissionSet"
+        "$ref": "#/definitions/Permission"
       }
     },
-    "permission": {
-      "description": "A list of inlined permissions",
+    "set": {
+      "description": "A list of permissions sets defined",
       "default": [],
       "type": "array",
       "items": {
-        "$ref": "#/definitions/Permission"
+        "$ref": "#/definitions/PermissionSet"
       }
     }
   },
   "definitions": {
-    "DefaultPermission": {
-      "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
+    "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",
-      "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.",
-          "type": [
-            "string",
-            "null"
-          ]
+        "allow": {
+          "description": "Allowed command.",
+          "default": [],
+          "type": "array",
+          "items": {
+            "type": "string"
+          }
         },
-        "permissions": {
-          "description": "All permissions this set contains.",
+        "deny": {
+          "description": "Denied command, which takes priority.",
+          "default": [],
           "type": "array",
           "items": {
             "type": "string"
@@ -65,32 +55,53 @@
         }
       }
     },
-    "PermissionSet": {
-      "description": "A set of direct permissions grouped together under a new name.",
+    "DefaultPermission": {
+      "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
       "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"
+          "type": [
+            "string",
+            "null"
+          ]
         },
         "permissions": {
           "description": "All permissions this set contains.",
           "type": "array",
           "items": {
-            "$ref": "#/definitions/PermissionKind"
+            "type": "string"
           }
+        },
+        "version": {
+          "description": "The version of the permission.",
+          "type": [
+            "integer",
+            "null"
+          ],
+          "format": "uint64",
+          "minimum": 1.0
         }
       }
     },
+    "Number": {
+      "description": "A valid ACL number.",
+      "anyOf": [
+        {
+          "description": "Represents an [`i64`].",
+          "type": "integer",
+          "format": "int64"
+        },
+        {
+          "description": "Represents a [`f64`].",
+          "type": "number",
+          "format": "double"
+        }
+      ]
+    },
     "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",
@@ -98,26 +109,6 @@
         "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.",
-          "type": [
-            "string",
-            "null"
-          ]
-        },
         "commands": {
           "description": "Allowed or denied commands when using this permission.",
           "default": {
@@ -130,6 +121,17 @@
             }
           ]
         },
+        "description": {
+          "description": "Human-readable description of what the permission does.",
+          "type": [
+            "string",
+            "null"
+          ]
+        },
+        "identifier": {
+          "description": "A unique identifier for the permission.",
+          "type": "string"
+        },
         "scope": {
           "description": "Allowed or denied scoped when using this permission.",
           "default": {},
@@ -138,111 +140,18 @@
               "$ref": "#/definitions/Scopes"
             }
           ]
-        }
-      }
-    },
-    "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": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.",
-      "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.",
+        "version": {
+          "description": "The version of the permission.",
           "type": [
-            "array",
+            "integer",
             "null"
           ],
-          "items": {
-            "$ref": "#/definitions/Value"
-          }
+          "format": "uint64",
+          "minimum": 1.0
         }
       }
     },
-    "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"
-        }
-      ]
-    },
     "PermissionKind": {
       "type": "string",
       "oneOf": [
@@ -380,6 +289,97 @@
           ]
         }
       ]
+    },
+    "PermissionSet": {
+      "description": "A set of direct permissions grouped together under a new name.",
+      "type": "object",
+      "required": [
+        "description",
+        "identifier",
+        "permissions"
+      ],
+      "properties": {
+        "description": {
+          "description": "Human-readable description of what the permission does.",
+          "type": "string"
+        },
+        "identifier": {
+          "description": "A unique identifier for the permission.",
+          "type": "string"
+        },
+        "permissions": {
+          "description": "All permissions this set contains.",
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/PermissionKind"
+          }
+        }
+      }
+    },
+    "Scopes": {
+      "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.",
+      "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.",
+          "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"
+          }
+        }
+      ]
     }
   }
 }

+ 156 - 156
core/tauri/permissions/webview/schemas/schema.json

@@ -15,49 +15,39 @@
         }
       ]
     },
-    "set": {
-      "description": "A list of permissions sets defined",
+    "permission": {
+      "description": "A list of inlined permissions",
       "default": [],
       "type": "array",
       "items": {
-        "$ref": "#/definitions/PermissionSet"
+        "$ref": "#/definitions/Permission"
       }
     },
-    "permission": {
-      "description": "A list of inlined permissions",
+    "set": {
+      "description": "A list of permissions sets defined",
       "default": [],
       "type": "array",
       "items": {
-        "$ref": "#/definitions/Permission"
+        "$ref": "#/definitions/PermissionSet"
       }
     }
   },
   "definitions": {
-    "DefaultPermission": {
-      "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
+    "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",
-      "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.",
-          "type": [
-            "string",
-            "null"
-          ]
+        "allow": {
+          "description": "Allowed command.",
+          "default": [],
+          "type": "array",
+          "items": {
+            "type": "string"
+          }
         },
-        "permissions": {
-          "description": "All permissions this set contains.",
+        "deny": {
+          "description": "Denied command, which takes priority.",
+          "default": [],
           "type": "array",
           "items": {
             "type": "string"
@@ -65,32 +55,53 @@
         }
       }
     },
-    "PermissionSet": {
-      "description": "A set of direct permissions grouped together under a new name.",
+    "DefaultPermission": {
+      "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
       "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"
+          "type": [
+            "string",
+            "null"
+          ]
         },
         "permissions": {
           "description": "All permissions this set contains.",
           "type": "array",
           "items": {
-            "$ref": "#/definitions/PermissionKind"
+            "type": "string"
           }
+        },
+        "version": {
+          "description": "The version of the permission.",
+          "type": [
+            "integer",
+            "null"
+          ],
+          "format": "uint64",
+          "minimum": 1.0
         }
       }
     },
+    "Number": {
+      "description": "A valid ACL number.",
+      "anyOf": [
+        {
+          "description": "Represents an [`i64`].",
+          "type": "integer",
+          "format": "int64"
+        },
+        {
+          "description": "Represents a [`f64`].",
+          "type": "number",
+          "format": "double"
+        }
+      ]
+    },
     "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",
@@ -98,26 +109,6 @@
         "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.",
-          "type": [
-            "string",
-            "null"
-          ]
-        },
         "commands": {
           "description": "Allowed or denied commands when using this permission.",
           "default": {
@@ -130,6 +121,17 @@
             }
           ]
         },
+        "description": {
+          "description": "Human-readable description of what the permission does.",
+          "type": [
+            "string",
+            "null"
+          ]
+        },
+        "identifier": {
+          "description": "A unique identifier for the permission.",
+          "type": "string"
+        },
         "scope": {
           "description": "Allowed or denied scoped when using this permission.",
           "default": {},
@@ -138,111 +140,18 @@
               "$ref": "#/definitions/Scopes"
             }
           ]
-        }
-      }
-    },
-    "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": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.",
-      "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.",
+        "version": {
+          "description": "The version of the permission.",
           "type": [
-            "array",
+            "integer",
             "null"
           ],
-          "items": {
-            "$ref": "#/definitions/Value"
-          }
+          "format": "uint64",
+          "minimum": 1.0
         }
       }
     },
-    "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"
-        }
-      ]
-    },
     "PermissionKind": {
       "type": "string",
       "oneOf": [
@@ -394,6 +303,97 @@
           ]
         }
       ]
+    },
+    "PermissionSet": {
+      "description": "A set of direct permissions grouped together under a new name.",
+      "type": "object",
+      "required": [
+        "description",
+        "identifier",
+        "permissions"
+      ],
+      "properties": {
+        "description": {
+          "description": "Human-readable description of what the permission does.",
+          "type": "string"
+        },
+        "identifier": {
+          "description": "A unique identifier for the permission.",
+          "type": "string"
+        },
+        "permissions": {
+          "description": "All permissions this set contains.",
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/PermissionKind"
+          }
+        }
+      }
+    },
+    "Scopes": {
+      "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.",
+      "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.",
+          "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"
+          }
+        }
+      ]
     }
   }
 }

+ 156 - 156
core/tauri/permissions/window/schemas/schema.json

@@ -15,49 +15,39 @@
         }
       ]
     },
-    "set": {
-      "description": "A list of permissions sets defined",
+    "permission": {
+      "description": "A list of inlined permissions",
       "default": [],
       "type": "array",
       "items": {
-        "$ref": "#/definitions/PermissionSet"
+        "$ref": "#/definitions/Permission"
       }
     },
-    "permission": {
-      "description": "A list of inlined permissions",
+    "set": {
+      "description": "A list of permissions sets defined",
       "default": [],
       "type": "array",
       "items": {
-        "$ref": "#/definitions/Permission"
+        "$ref": "#/definitions/PermissionSet"
       }
     }
   },
   "definitions": {
-    "DefaultPermission": {
-      "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
+    "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",
-      "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.",
-          "type": [
-            "string",
-            "null"
-          ]
+        "allow": {
+          "description": "Allowed command.",
+          "default": [],
+          "type": "array",
+          "items": {
+            "type": "string"
+          }
         },
-        "permissions": {
-          "description": "All permissions this set contains.",
+        "deny": {
+          "description": "Denied command, which takes priority.",
+          "default": [],
           "type": "array",
           "items": {
             "type": "string"
@@ -65,32 +55,53 @@
         }
       }
     },
-    "PermissionSet": {
-      "description": "A set of direct permissions grouped together under a new name.",
+    "DefaultPermission": {
+      "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
       "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"
+          "type": [
+            "string",
+            "null"
+          ]
         },
         "permissions": {
           "description": "All permissions this set contains.",
           "type": "array",
           "items": {
-            "$ref": "#/definitions/PermissionKind"
+            "type": "string"
           }
+        },
+        "version": {
+          "description": "The version of the permission.",
+          "type": [
+            "integer",
+            "null"
+          ],
+          "format": "uint64",
+          "minimum": 1.0
         }
       }
     },
+    "Number": {
+      "description": "A valid ACL number.",
+      "anyOf": [
+        {
+          "description": "Represents an [`i64`].",
+          "type": "integer",
+          "format": "int64"
+        },
+        {
+          "description": "Represents a [`f64`].",
+          "type": "number",
+          "format": "double"
+        }
+      ]
+    },
     "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",
@@ -98,26 +109,6 @@
         "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.",
-          "type": [
-            "string",
-            "null"
-          ]
-        },
         "commands": {
           "description": "Allowed or denied commands when using this permission.",
           "default": {
@@ -130,6 +121,17 @@
             }
           ]
         },
+        "description": {
+          "description": "Human-readable description of what the permission does.",
+          "type": [
+            "string",
+            "null"
+          ]
+        },
+        "identifier": {
+          "description": "A unique identifier for the permission.",
+          "type": "string"
+        },
         "scope": {
           "description": "Allowed or denied scoped when using this permission.",
           "default": {},
@@ -138,111 +140,18 @@
               "$ref": "#/definitions/Scopes"
             }
           ]
-        }
-      }
-    },
-    "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": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.",
-      "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.",
+        "version": {
+          "description": "The version of the permission.",
           "type": [
-            "array",
+            "integer",
             "null"
           ],
-          "items": {
-            "$ref": "#/definitions/Value"
-          }
+          "format": "uint64",
+          "minimum": 1.0
         }
       }
     },
-    "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"
-        }
-      ]
-    },
     "PermissionKind": {
       "type": "string",
       "oneOf": [
@@ -1108,6 +1017,97 @@
           ]
         }
       ]
+    },
+    "PermissionSet": {
+      "description": "A set of direct permissions grouped together under a new name.",
+      "type": "object",
+      "required": [
+        "description",
+        "identifier",
+        "permissions"
+      ],
+      "properties": {
+        "description": {
+          "description": "Human-readable description of what the permission does.",
+          "type": "string"
+        },
+        "identifier": {
+          "description": "A unique identifier for the permission.",
+          "type": "string"
+        },
+        "permissions": {
+          "description": "All permissions this set contains.",
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/PermissionKind"
+          }
+        }
+      }
+    },
+    "Scopes": {
+      "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.",
+      "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.",
+          "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"
+          }
+        }
+      ]
     }
   }
 }

+ 2 - 3
core/tauri/src/app.rs

@@ -3,10 +3,9 @@
 // SPDX-License-Identifier: MIT
 
 use crate::{
-  command::{CommandArg, CommandItem},
   ipc::{
-    channel::ChannelDataIpcQueue, CallbackFn, Invoke, InvokeError, InvokeHandler, InvokeResponder,
-    InvokeResponse,
+    channel::ChannelDataIpcQueue, CallbackFn, CommandArg, CommandItem, Invoke, InvokeError,
+    InvokeHandler, InvokeResponder, InvokeResponse,
   },
   manager::{
     webview::{UriSchemeProtocol, WebviewLabelDef},

+ 1 - 1
core/tauri/src/command/authority.rs → core/tauri/src/ipc/authority.rs

@@ -456,7 +456,7 @@ mod tests {
     ExecutionContext,
   };
 
-  use crate::command::Origin;
+  use crate::ipc::Origin;
 
   use super::RuntimeAuthority;
 

+ 1 - 1
core/tauri/src/ipc/channel.rs

@@ -15,7 +15,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};
 
 use crate::{
   command,
-  command::{CommandArg, CommandItem},
+  ipc::{CommandArg, CommandItem},
   plugin::{Builder as PluginBuilder, TauriPlugin},
   Manager, Runtime, State, Webview,
 };

+ 0 - 3
core/tauri/src/command/mod.rs → core/tauri/src/ipc/command.rs

@@ -16,9 +16,6 @@ use serde::{
   Deserialize, Deserializer,
 };
 
-mod authority;
-
-pub use authority::{CommandScope, GlobalScope, Origin, RuntimeAuthority, ScopeObject, ScopeValue};
 use tauri_utils::acl::resolved::ResolvedCommand;
 
 /// Represents a custom command.

+ 5 - 5
core/tauri/src/ipc/mod.rs

@@ -16,18 +16,18 @@ pub use serialize_to_javascript::Options as SerializeOptions;
 use tauri_macros::default_runtime;
 use tauri_utils::acl::resolved::ResolvedCommand;
 
-use crate::{
-  command::{CommandArg, CommandItem},
-  webview::Webview,
-  Runtime, StateManager,
-};
+use crate::{webview::Webview, Runtime, StateManager};
 
+mod authority;
 pub(crate) mod channel;
+mod command;
 #[cfg(any(target_os = "macos", target_os = "ios", not(ipc_custom_protocol)))]
 pub(crate) mod format_callback;
 pub(crate) mod protocol;
 
+pub use authority::{CommandScope, GlobalScope, Origin, RuntimeAuthority, ScopeObject, ScopeValue};
 pub use channel::{Channel, JavaScriptChannelId};
+pub use command::{private, CommandArg, CommandItem};
 
 /// A closure that is run every time Tauri receives a message it doesn't explicitly handle.
 pub type InvokeHandler<R> = dyn Fn(Invoke<R>) -> bool + Send + Sync + 'static;

+ 0 - 1
core/tauri/src/lib.rs

@@ -78,7 +78,6 @@ pub use tauri_macros::{command, generate_handler};
 
 pub(crate) mod app;
 pub mod async_runtime;
-pub mod command;
 mod error;
 mod event;
 pub mod ipc;

+ 1 - 2
core/tauri/src/manager/mod.rs

@@ -22,9 +22,8 @@ use tauri_utils::{
 
 use crate::{
   app::{AppHandle, GlobalWindowEventListener, OnPageLoad},
-  command::RuntimeAuthority,
   event::{assert_event_name_is_valid, Event, EventId, EventSource, Listeners},
-  ipc::{Invoke, InvokeHandler, InvokeResponder},
+  ipc::{Invoke, InvokeHandler, InvokeResponder, RuntimeAuthority},
   plugin::PluginStore,
   utils::{
     assets::Assets,

+ 1 - 2
core/tauri/src/plugin.rs

@@ -6,8 +6,7 @@
 
 use crate::{
   app::UriSchemeResponder,
-  command::{ScopeObject, ScopeValue},
-  ipc::{Invoke, InvokeHandler},
+  ipc::{Invoke, InvokeHandler, ScopeObject, ScopeValue},
   manager::webview::UriSchemeProtocol,
   utils::config::PluginConfig,
   webview::PageLoadPayload,

+ 1 - 2
core/tauri/src/state.rs

@@ -3,8 +3,7 @@
 // SPDX-License-Identifier: MIT
 
 use crate::{
-  command::{CommandArg, CommandItem},
-  ipc::InvokeError,
+  ipc::{CommandArg, CommandItem, InvokeError},
   Runtime,
 };
 use state::TypeMap;

+ 2 - 3
core/tauri/src/webview/mod.rs

@@ -27,11 +27,10 @@ pub use url::Url;
 
 use crate::{
   app::UriSchemeResponder,
-  command::{CommandArg, CommandItem, Origin},
   event::{EmitArgs, EventSource},
   ipc::{
-    CallbackFn, Invoke, InvokeBody, InvokeError, InvokeMessage, InvokeResolver,
-    OwnedInvokeResponder,
+    CallbackFn, CommandArg, CommandItem, Invoke, InvokeBody, InvokeError, InvokeMessage,
+    InvokeResolver, Origin, OwnedInvokeResponder,
   },
   manager::{webview::WebviewLabelDef, AppManager},
   sealed::{ManagerBase, RuntimeOrDispatch},

+ 1 - 2
core/tauri/src/webview/webview_window.rs

@@ -27,8 +27,7 @@ use tauri_utils::config::{WebviewUrl, WindowConfig};
 use url::Url;
 
 use crate::{
-  command::{CommandArg, CommandItem},
-  ipc::{InvokeError, OwnedInvokeResponder},
+  ipc::{CommandArg, CommandItem, InvokeError, OwnedInvokeResponder},
   manager::{webview::WebviewLabelDef, AppManager},
   sealed::{ManagerBase, RuntimeOrDispatch},
   webview::PageLoadPayload,

+ 1 - 2
core/tauri/src/window/mod.rs

@@ -14,9 +14,8 @@ pub use tauri_utils::{config::Color, WindowEffect as Effect, WindowEffectState a
 
 use crate::{
   app::AppHandle,
-  command::{CommandArg, CommandItem},
   event::{Event, EventId, EventSource},
-  ipc::InvokeError,
+  ipc::{CommandArg, CommandItem, InvokeError},
   manager::{webview::WebviewLabelDef, AppManager},
   runtime::{
     monitor::Monitor as RuntimeMonitor,

+ 2 - 2
examples/api/src-tauri/tauri-plugin-sample/src/lib.rs

@@ -53,8 +53,8 @@ struct SampleScope {
 fn ping<R: tauri::Runtime>(
   app: tauri::AppHandle<R>,
   value: Option<String>,
-  scope: tauri::command::CommandScope<PingScope>,
-  global_scope: tauri::command::GlobalScope<SampleScope>,
+  scope: tauri::ipc::CommandScope<PingScope>,
+  global_scope: tauri::ipc::GlobalScope<SampleScope>,
 ) -> std::result::Result<PingResponse, String> {
   println!("local scope {:?}", scope);
   println!("global scope {:?}", global_scope);