Skip to content

Commit 4bbe1aa

Browse files
committed
fix: fix prettier warning
1 parent c1ed5e9 commit 4bbe1aa

File tree

5 files changed

+204
-63
lines changed

5 files changed

+204
-63
lines changed

plugins/stronghold/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
## \[2.0.0-beta.8]
2424

25-
- [`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.
25+
- [`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.
2626
- [`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.
2727

2828
## \[2.0.0-beta.7]

plugins/stronghold/api-iife.js

Lines changed: 180 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,180 @@
1-
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__})}
1+
if ('__TAURI__' in window) {
2+
var __TAURI_PLUGIN_STRONGHOLD__ = (function (t) {
3+
'use strict'
4+
async function e(t, e = {}, r) {
5+
return window.__TAURI_INTERNALS__.invoke(t, e, r)
6+
}
7+
'function' == typeof SuppressedError && SuppressedError
8+
class r {
9+
constructor(t, e) {
10+
;(this.type = t), (this.payload = e)
11+
}
12+
static generic(t, e) {
13+
return new r('Generic', { vault: t, record: e })
14+
}
15+
static counter(t, e) {
16+
return new r('Counter', { vault: t, counter: e })
17+
}
18+
}
19+
class n {
20+
constructor(t) {
21+
this.procedureArgs = t
22+
}
23+
async generateSLIP10Seed(t, r) {
24+
return await e('plugin:stronghold|execute_procedure', {
25+
...this.procedureArgs,
26+
procedure: {
27+
type: 'SLIP10Generate',
28+
payload: { output: t, sizeBytes: r }
29+
}
30+
}).then((t) => Uint8Array.from(t))
31+
}
32+
async deriveSLIP10(t, r, n, a) {
33+
return await e('plugin:stronghold|execute_procedure', {
34+
...this.procedureArgs,
35+
procedure: {
36+
type: 'SLIP10Derive',
37+
payload: { chain: t, input: { type: r, payload: n }, output: a }
38+
}
39+
}).then((t) => Uint8Array.from(t))
40+
}
41+
async recoverBIP39(t, r, n) {
42+
return await e('plugin:stronghold|execute_procedure', {
43+
...this.procedureArgs,
44+
procedure: {
45+
type: 'BIP39Recover',
46+
payload: { mnemonic: t, passphrase: n, output: r }
47+
}
48+
}).then((t) => Uint8Array.from(t))
49+
}
50+
async generateBIP39(t, r) {
51+
return await e('plugin:stronghold|execute_procedure', {
52+
...this.procedureArgs,
53+
procedure: {
54+
type: 'BIP39Generate',
55+
payload: { output: t, passphrase: r }
56+
}
57+
}).then((t) => Uint8Array.from(t))
58+
}
59+
async getEd25519PublicKey(t) {
60+
return await e('plugin:stronghold|execute_procedure', {
61+
...this.procedureArgs,
62+
procedure: {
63+
type: 'PublicKey',
64+
payload: { type: 'Ed25519', privateKey: t }
65+
}
66+
}).then((t) => Uint8Array.from(t))
67+
}
68+
async signEd25519(t, r) {
69+
return await e('plugin:stronghold|execute_procedure', {
70+
...this.procedureArgs,
71+
procedure: { type: 'Ed25519Sign', payload: { privateKey: t, msg: r } }
72+
}).then((t) => Uint8Array.from(t))
73+
}
74+
}
75+
class a {
76+
constructor(t, e) {
77+
;(this.path = t), (this.name = e)
78+
}
79+
getVault(t) {
80+
return new o(this.path, this.name, t)
81+
}
82+
getStore() {
83+
return new s(this.path, this.name)
84+
}
85+
}
86+
class s {
87+
constructor(t, e) {
88+
;(this.path = t), (this.client = e)
89+
}
90+
async get(t) {
91+
return await e('plugin:stronghold|get_store_record', {
92+
snapshotPath: this.path,
93+
client: this.client,
94+
key: t
95+
}).then((t) => t && Uint8Array.from(t))
96+
}
97+
async insert(t, r, n) {
98+
await e('plugin:stronghold|save_store_record', {
99+
snapshotPath: this.path,
100+
client: this.client,
101+
key: t,
102+
value: r,
103+
lifetime: n
104+
})
105+
}
106+
async remove(t) {
107+
return await e('plugin:stronghold|remove_store_record', {
108+
snapshotPath: this.path,
109+
client: this.client,
110+
key: t
111+
}).then((t) => t && Uint8Array.from(t))
112+
}
113+
}
114+
class o extends n {
115+
constructor(t, e, r) {
116+
super({ snapshotPath: t, client: e, vault: r }),
117+
(this.path = t),
118+
(this.client = e),
119+
(this.name = r)
120+
}
121+
async insert(t, r) {
122+
await e('plugin:stronghold|save_secret', {
123+
snapshotPath: this.path,
124+
client: this.client,
125+
vault: this.name,
126+
recordPath: t,
127+
secret: r
128+
})
129+
}
130+
async remove(t) {
131+
await e('plugin:stronghold|remove_secret', {
132+
snapshotPath: this.path,
133+
client: this.client,
134+
vault: this.name,
135+
recordPath: t.payload.record
136+
})
137+
}
138+
}
139+
class i {
140+
constructor(t) {
141+
this.path = t
142+
}
143+
static async load(t, r) {
144+
return await e('plugin:stronghold|initialize', {
145+
snapshotPath: t,
146+
password: r
147+
}).then(() => new i(t))
148+
}
149+
async unload() {
150+
await e('plugin:stronghold|destroy', { snapshotPath: this.path })
151+
}
152+
async loadClient(t) {
153+
return await e('plugin:stronghold|load_client', {
154+
snapshotPath: this.path,
155+
client: t
156+
}).then(() => new a(this.path, t))
157+
}
158+
async createClient(t) {
159+
return await e('plugin:stronghold|create_client', {
160+
snapshotPath: this.path,
161+
client: t
162+
}).then(() => new a(this.path, t))
163+
}
164+
async save() {
165+
await e('plugin:stronghold|save', { snapshotPath: this.path })
166+
}
167+
}
168+
return (
169+
(t.Client = a),
170+
(t.Location = r),
171+
(t.Store = s),
172+
(t.Stronghold = i),
173+
(t.Vault = o),
174+
t
175+
)
176+
})({})
177+
Object.defineProperty(window.__TAURI__, 'stronghold', {
178+
value: __TAURI_PLUGIN_STRONGHOLD__
179+
})
180+
}

plugins/stronghold/guest-js/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ class ProcedureExecutor {
264264
*
265265
* @since 2.1.0
266266
*/
267-
async getSecp256k1EcdsaPublicKey(privateKeyLocation: Location): Promise<Uint8Array> {
267+
async getSecp256k1EcdsaPublicKey(
268+
privateKeyLocation: Location
269+
): Promise<Uint8Array> {
268270
return await invoke<number[]>('plugin:stronghold|execute_procedure', {
269271
...this.procedureArgs,
270272
procedure: {
@@ -284,7 +286,9 @@ class ProcedureExecutor {
284286
*
285287
* @since 2.1.0
286288
*/
287-
async getSecp256k1EcdsaEvmAddress(privateKeyLocation: Location): Promise<Uint8Array> {
289+
async getSecp256k1EcdsaEvmAddress(
290+
privateKeyLocation: Location
291+
): Promise<Uint8Array> {
288292
return await invoke<number[]>('plugin:stronghold|execute_procedure', {
289293
...this.procedureArgs,
290294
procedure: {
@@ -306,7 +310,7 @@ class ProcedureExecutor {
306310
* @since 2.1.0
307311
*/
308312
async signSecp256k1Ecdsa(
309-
flavor: 'Keccak256' | 'Sha256',
313+
flavor: 'Keccak256' | 'Sha256',
310314
privateKeyLocation: Location,
311315
msg: string
312316
): Promise<Uint8Array> {

plugins/stronghold/permissions/autogenerated/reference.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ operations are available from the stronghold plugin.
77

88
All non-destructive operations are enabled by default.
99

10-
11-
1210
#### This default permission set includes the following:
1311

1412
- `allow-create-client`
@@ -28,7 +26,6 @@ All non-destructive operations are enabled by default.
2826
<th>Description</th>
2927
</tr>
3028

31-
3229
<tr>
3330
<td>
3431

plugins/stronghold/permissions/schemas/schema.json

Lines changed: 16 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,17 @@
3535
"DefaultPermission": {
3636
"description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
3737
"type": "object",
38-
"required": [
39-
"permissions"
40-
],
38+
"required": ["permissions"],
4139
"properties": {
4240
"version": {
4341
"description": "The version of the permission.",
44-
"type": [
45-
"integer",
46-
"null"
47-
],
42+
"type": ["integer", "null"],
4843
"format": "uint64",
4944
"minimum": 1.0
5045
},
5146
"description": {
5247
"description": "Human-readable description of what the permission does. Tauri convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.",
53-
"type": [
54-
"string",
55-
"null"
56-
]
48+
"type": ["string", "null"]
5749
},
5850
"permissions": {
5951
"description": "All permissions this set contains.",
@@ -67,11 +59,7 @@
6759
"PermissionSet": {
6860
"description": "A set of direct permissions grouped together under a new name.",
6961
"type": "object",
70-
"required": [
71-
"description",
72-
"identifier",
73-
"permissions"
74-
],
62+
"required": ["description", "identifier", "permissions"],
7563
"properties": {
7664
"identifier": {
7765
"description": "A unique identifier for the permission.",
@@ -93,16 +81,11 @@
9381
"Permission": {
9482
"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.",
9583
"type": "object",
96-
"required": [
97-
"identifier"
98-
],
84+
"required": ["identifier"],
9985
"properties": {
10086
"version": {
10187
"description": "The version of the permission.",
102-
"type": [
103-
"integer",
104-
"null"
105-
],
88+
"type": ["integer", "null"],
10689
"format": "uint64",
10790
"minimum": 1.0
10891
},
@@ -112,10 +95,7 @@
11295
},
11396
"description": {
11497
"description": "Human-readable description of what the permission does. Tauri internal convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.",
115-
"type": [
116-
"string",
117-
"null"
118-
]
98+
"type": ["string", "null"]
11999
},
120100
"commands": {
121101
"description": "Allowed or denied commands when using this permission.",
@@ -139,10 +119,7 @@
139119
},
140120
"platforms": {
141121
"description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
142-
"type": [
143-
"array",
144-
"null"
145-
],
122+
"type": ["array", "null"],
146123
"items": {
147124
"$ref": "#/definitions/Target"
148125
}
@@ -177,20 +154,14 @@
177154
"properties": {
178155
"allow": {
179156
"description": "Data that defines what is allowed by the scope.",
180-
"type": [
181-
"array",
182-
"null"
183-
],
157+
"type": ["array", "null"],
184158
"items": {
185159
"$ref": "#/definitions/Value"
186160
}
187161
},
188162
"deny": {
189163
"description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.",
190-
"type": [
191-
"array",
192-
"null"
193-
],
164+
"type": ["array", "null"],
194165
"items": {
195166
"$ref": "#/definitions/Value"
196167
}
@@ -257,37 +228,27 @@
257228
{
258229
"description": "MacOS.",
259230
"type": "string",
260-
"enum": [
261-
"macOS"
262-
]
231+
"enum": ["macOS"]
263232
},
264233
{
265234
"description": "Windows.",
266235
"type": "string",
267-
"enum": [
268-
"windows"
269-
]
236+
"enum": ["windows"]
270237
},
271238
{
272239
"description": "Linux.",
273240
"type": "string",
274-
"enum": [
275-
"linux"
276-
]
241+
"enum": ["linux"]
277242
},
278243
{
279244
"description": "Android.",
280245
"type": "string",
281-
"enum": [
282-
"android"
283-
]
246+
"enum": ["android"]
284247
},
285248
{
286249
"description": "iOS.",
287250
"type": "string",
288-
"enum": [
289-
"iOS"
290-
]
251+
"enum": ["iOS"]
291252
}
292253
]
293254
},
@@ -435,4 +396,4 @@
435396
]
436397
}
437398
}
438-
}
399+
}

0 commit comments

Comments
 (0)