diff --git a/plugins/stronghold/CHANGELOG.md b/plugins/stronghold/CHANGELOG.md index 5d7ea2d1..342c046f 100644 --- a/plugins/stronghold/CHANGELOG.md +++ b/plugins/stronghold/CHANGELOG.md @@ -22,7 +22,7 @@ ## \[2.0.0-beta.8] -- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version. +- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the _minimum_ `@tauri-apps/api` version instead of a single exact version. - [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25. ## \[2.0.0-beta.7] diff --git a/plugins/stronghold/api-iife.js b/plugins/stronghold/api-iife.js index aabe9ed2..b6aedcd2 100644 --- a/plugins/stronghold/api-iife.js +++ b/plugins/stronghold/api-iife.js @@ -1 +1,180 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_STRONGHOLD__=function(t){"use strict";async function e(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}"function"==typeof SuppressedError&&SuppressedError;class r{constructor(t,e){this.type=t,this.payload=e}static generic(t,e){return new r("Generic",{vault:t,record:e})}static counter(t,e){return new r("Counter",{vault:t,counter:e})}}class n{constructor(t){this.procedureArgs=t}async generateSLIP10Seed(t,r){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"SLIP10Generate",payload:{output:t,sizeBytes:r}}}).then((t=>Uint8Array.from(t)))}async deriveSLIP10(t,r,n,a){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"SLIP10Derive",payload:{chain:t,input:{type:r,payload:n},output:a}}}).then((t=>Uint8Array.from(t)))}async recoverBIP39(t,r,n){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"BIP39Recover",payload:{mnemonic:t,passphrase:n,output:r}}}).then((t=>Uint8Array.from(t)))}async generateBIP39(t,r){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"BIP39Generate",payload:{output:t,passphrase:r}}}).then((t=>Uint8Array.from(t)))}async getEd25519PublicKey(t){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"PublicKey",payload:{type:"Ed25519",privateKey:t}}}).then((t=>Uint8Array.from(t)))}async signEd25519(t,r){return await e("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"Ed25519Sign",payload:{privateKey:t,msg:r}}}).then((t=>Uint8Array.from(t)))}}class a{constructor(t,e){this.path=t,this.name=e}getVault(t){return new o(this.path,this.name,t)}getStore(){return new s(this.path,this.name)}}class s{constructor(t,e){this.path=t,this.client=e}async get(t){return await e("plugin:stronghold|get_store_record",{snapshotPath:this.path,client:this.client,key:t}).then((t=>t&&Uint8Array.from(t)))}async insert(t,r,n){await e("plugin:stronghold|save_store_record",{snapshotPath:this.path,client:this.client,key:t,value:r,lifetime:n})}async remove(t){return await e("plugin:stronghold|remove_store_record",{snapshotPath:this.path,client:this.client,key:t}).then((t=>t&&Uint8Array.from(t)))}}class o extends n{constructor(t,e,r){super({snapshotPath:t,client:e,vault:r}),this.path=t,this.client=e,this.name=r}async insert(t,r){await e("plugin:stronghold|save_secret",{snapshotPath:this.path,client:this.client,vault:this.name,recordPath:t,secret:r})}async remove(t){await e("plugin:stronghold|remove_secret",{snapshotPath:this.path,client:this.client,vault:this.name,recordPath:t.payload.record})}}class i{constructor(t){this.path=t}static async load(t,r){return await e("plugin:stronghold|initialize",{snapshotPath:t,password:r}).then((()=>new i(t)))}async unload(){await e("plugin:stronghold|destroy",{snapshotPath:this.path})}async loadClient(t){return await e("plugin:stronghold|load_client",{snapshotPath:this.path,client:t}).then((()=>new a(this.path,t)))}async createClient(t){return await e("plugin:stronghold|create_client",{snapshotPath:this.path,client:t}).then((()=>new a(this.path,t)))}async save(){await e("plugin:stronghold|save",{snapshotPath:this.path})}}return t.Client=a,t.Location=r,t.Store=s,t.Stronghold=i,t.Vault=o,t}({});Object.defineProperty(window.__TAURI__,"stronghold",{value:__TAURI_PLUGIN_STRONGHOLD__})} +if ('__TAURI__' in window) { + var __TAURI_PLUGIN_STRONGHOLD__ = (function (t) { + 'use strict' + async function e(t, e = {}, r) { + return window.__TAURI_INTERNALS__.invoke(t, e, r) + } + 'function' == typeof SuppressedError && SuppressedError + class r { + constructor(t, e) { + ;(this.type = t), (this.payload = e) + } + static generic(t, e) { + return new r('Generic', { vault: t, record: e }) + } + static counter(t, e) { + return new r('Counter', { vault: t, counter: e }) + } + } + class n { + constructor(t) { + this.procedureArgs = t + } + async generateSLIP10Seed(t, r) { + return await e('plugin:stronghold|execute_procedure', { + ...this.procedureArgs, + procedure: { + type: 'SLIP10Generate', + payload: { output: t, sizeBytes: r } + } + }).then((t) => Uint8Array.from(t)) + } + async deriveSLIP10(t, r, n, a) { + return await e('plugin:stronghold|execute_procedure', { + ...this.procedureArgs, + procedure: { + type: 'SLIP10Derive', + payload: { chain: t, input: { type: r, payload: n }, output: a } + } + }).then((t) => Uint8Array.from(t)) + } + async recoverBIP39(t, r, n) { + return await e('plugin:stronghold|execute_procedure', { + ...this.procedureArgs, + procedure: { + type: 'BIP39Recover', + payload: { mnemonic: t, passphrase: n, output: r } + } + }).then((t) => Uint8Array.from(t)) + } + async generateBIP39(t, r) { + return await e('plugin:stronghold|execute_procedure', { + ...this.procedureArgs, + procedure: { + type: 'BIP39Generate', + payload: { output: t, passphrase: r } + } + }).then((t) => Uint8Array.from(t)) + } + async getEd25519PublicKey(t) { + return await e('plugin:stronghold|execute_procedure', { + ...this.procedureArgs, + procedure: { + type: 'PublicKey', + payload: { type: 'Ed25519', privateKey: t } + } + }).then((t) => Uint8Array.from(t)) + } + async signEd25519(t, r) { + return await e('plugin:stronghold|execute_procedure', { + ...this.procedureArgs, + procedure: { type: 'Ed25519Sign', payload: { privateKey: t, msg: r } } + }).then((t) => Uint8Array.from(t)) + } + } + class a { + constructor(t, e) { + ;(this.path = t), (this.name = e) + } + getVault(t) { + return new o(this.path, this.name, t) + } + getStore() { + return new s(this.path, this.name) + } + } + class s { + constructor(t, e) { + ;(this.path = t), (this.client = e) + } + async get(t) { + return await e('plugin:stronghold|get_store_record', { + snapshotPath: this.path, + client: this.client, + key: t + }).then((t) => t && Uint8Array.from(t)) + } + async insert(t, r, n) { + await e('plugin:stronghold|save_store_record', { + snapshotPath: this.path, + client: this.client, + key: t, + value: r, + lifetime: n + }) + } + async remove(t) { + return await e('plugin:stronghold|remove_store_record', { + snapshotPath: this.path, + client: this.client, + key: t + }).then((t) => t && Uint8Array.from(t)) + } + } + class o extends n { + constructor(t, e, r) { + super({ snapshotPath: t, client: e, vault: r }), + (this.path = t), + (this.client = e), + (this.name = r) + } + async insert(t, r) { + await e('plugin:stronghold|save_secret', { + snapshotPath: this.path, + client: this.client, + vault: this.name, + recordPath: t, + secret: r + }) + } + async remove(t) { + await e('plugin:stronghold|remove_secret', { + snapshotPath: this.path, + client: this.client, + vault: this.name, + recordPath: t.payload.record + }) + } + } + class i { + constructor(t) { + this.path = t + } + static async load(t, r) { + return await e('plugin:stronghold|initialize', { + snapshotPath: t, + password: r + }).then(() => new i(t)) + } + async unload() { + await e('plugin:stronghold|destroy', { snapshotPath: this.path }) + } + async loadClient(t) { + return await e('plugin:stronghold|load_client', { + snapshotPath: this.path, + client: t + }).then(() => new a(this.path, t)) + } + async createClient(t) { + return await e('plugin:stronghold|create_client', { + snapshotPath: this.path, + client: t + }).then(() => new a(this.path, t)) + } + async save() { + await e('plugin:stronghold|save', { snapshotPath: this.path }) + } + } + return ( + (t.Client = a), + (t.Location = r), + (t.Store = s), + (t.Stronghold = i), + (t.Vault = o), + t + ) + })({}) + Object.defineProperty(window.__TAURI__, 'stronghold', { + value: __TAURI_PLUGIN_STRONGHOLD__ + }) +} diff --git a/plugins/stronghold/guest-js/index.ts b/plugins/stronghold/guest-js/index.ts index 09b1e758..e2d9cd70 100644 --- a/plugins/stronghold/guest-js/index.ts +++ b/plugins/stronghold/guest-js/index.ts @@ -264,7 +264,9 @@ class ProcedureExecutor { * * @since 2.1.0 */ - async getSecp256k1EcdsaPublicKey(privateKeyLocation: Location): Promise { + async getSecp256k1EcdsaPublicKey( + privateKeyLocation: Location + ): Promise { return await invoke('plugin:stronghold|execute_procedure', { ...this.procedureArgs, procedure: { @@ -284,7 +286,9 @@ class ProcedureExecutor { * * @since 2.1.0 */ - async getSecp256k1EcdsaEvmAddress(privateKeyLocation: Location): Promise { + async getSecp256k1EcdsaEvmAddress( + privateKeyLocation: Location + ): Promise { return await invoke('plugin:stronghold|execute_procedure', { ...this.procedureArgs, procedure: { @@ -306,7 +310,7 @@ class ProcedureExecutor { * @since 2.1.0 */ async signSecp256k1Ecdsa( - flavor: 'Keccak256' | 'Sha256', + flavor: 'Keccak256' | 'Sha256', privateKeyLocation: Location, msg: string ): Promise { diff --git a/plugins/stronghold/permissions/autogenerated/reference.md b/plugins/stronghold/permissions/autogenerated/reference.md index c00e56c3..39170d04 100644 --- a/plugins/stronghold/permissions/autogenerated/reference.md +++ b/plugins/stronghold/permissions/autogenerated/reference.md @@ -7,8 +7,6 @@ operations are available from the stronghold plugin. All non-destructive operations are enabled by default. - - #### This default permission set includes the following: - `allow-create-client` @@ -28,7 +26,6 @@ All non-destructive operations are enabled by default. Description - diff --git a/plugins/stronghold/permissions/schemas/schema.json b/plugins/stronghold/permissions/schemas/schema.json index 6af87c6a..96c67e5b 100644 --- a/plugins/stronghold/permissions/schemas/schema.json +++ b/plugins/stronghold/permissions/schemas/schema.json @@ -35,25 +35,17 @@ "DefaultPermission": { "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", "type": "object", - "required": [ - "permissions" - ], + "required": ["permissions"], "properties": { "version": { "description": "The version of the permission.", - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "uint64", "minimum": 1.0 }, "description": { "description": "Human-readable description of what the permission does. Tauri convention is to use `

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

` headings in markdown content for Tauri documentation generation purposes.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "commands": { "description": "Allowed or denied commands when using this permission.", @@ -139,10 +119,7 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/definitions/Target" } @@ -177,20 +154,14 @@ "properties": { "allow": { "description": "Data that defines what is allowed by the scope.", - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/definitions/Value" } }, "deny": { "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/definitions/Value" } @@ -257,37 +228,27 @@ { "description": "MacOS.", "type": "string", - "enum": [ - "macOS" - ] + "enum": ["macOS"] }, { "description": "Windows.", "type": "string", - "enum": [ - "windows" - ] + "enum": ["windows"] }, { "description": "Linux.", "type": "string", - "enum": [ - "linux" - ] + "enum": ["linux"] }, { "description": "Android.", "type": "string", - "enum": [ - "android" - ] + "enum": ["android"] }, { "description": "iOS.", "type": "string", - "enum": [ - "iOS" - ] + "enum": ["iOS"] } ] }, @@ -435,4 +396,4 @@ ] } } -} \ No newline at end of file +}