pull/467/head
FabianLars 2 years ago
parent ed099e1722
commit e82ce50dd5
No known key found for this signature in database
GPG Key ID: 3B12BC1DEBF61125

@ -48,7 +48,7 @@ https.get(url, options, (response) => {
console.log(versions.length ? versions[0].num : "0.0.0");
} else if (kind === "npm") {
const versions = Object.keys(data.versions).filter((v) =>
v.startsWith(target)
v.startsWith(target),
);
console.log(versions[versions.length - 1] || "0.0.0");
}

@ -76,7 +76,7 @@ const r2 = await auth.verifyRegistration(
challenge,
app,
registerResult.registerData,
registerResult.clientData
registerResult.clientData,
);
const j2 = JSON.parse(r2);
@ -91,7 +91,7 @@ const counter = await auth.verifySignature(
signData.signData,
clientData,
keyHandle,
pubkey
pubkey,
);
if (counter && counter > 0) {

@ -17,7 +17,7 @@ export class Authenticator {
challenge: string,
application: string,
registerData: string,
clientData: string
clientData: string,
): Promise<string> {
return await invoke("plugin:authenticator|verify_registration", {
challenge,
@ -30,7 +30,7 @@ export class Authenticator {
async sign(
challenge: string,
application: string,
keyHandle: string
keyHandle: string,
): Promise<string> {
return await invoke("plugin:authenticator|sign", {
timeout: 10000,
@ -46,7 +46,7 @@ export class Authenticator {
signData: string,
clientData: string,
keyHandle: string,
pubkey: string
pubkey: string,
): Promise<number> {
return await invoke("plugin:authenticator|verify_signature", {
challenge,

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({
input: "guest-js/index.ts",
pkg: JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf8")
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
),
external: [/^@tauri-apps\/api/],
});

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({
input: "guest-js/index.ts",
pkg: JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf8")
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
),
external: [/^@tauri-apps\/api/],
});

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({
input: "guest-js/index.ts",
pkg: JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf8")
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
),
external: [/^@tauri-apps\/api/],
});

@ -59,7 +59,7 @@ const stopWatching = await watch(
(event) => {
const { kind, path } = event;
},
{ recursive: true }
{ recursive: true },
);
const stopRawWatcher = await watchImmediate(
@ -67,7 +67,7 @@ const stopRawWatcher = await watchImmediate(
(event) => {
const { type, paths, attrs } = event;
},
{}
{},
);
```

@ -45,7 +45,7 @@ async function unwatch(id: number): Promise<void> {
export async function watch(
paths: string | string[],
cb: (event: DebouncedEvent) => void,
options: DebouncedWatchOptions = {}
options: DebouncedWatchOptions = {},
): Promise<UnlistenFn> {
const opts = {
recursive: false,
@ -71,7 +71,7 @@ export async function watch(
`watcher://debounced-event/${id}`,
(event) => {
cb(event.payload);
}
},
);
return () => {
@ -83,7 +83,7 @@ export async function watch(
export async function watchImmediate(
paths: string | string[],
cb: (event: RawEvent) => void,
options: WatchOptions = {}
options: WatchOptions = {},
): Promise<UnlistenFn> {
const opts = {
recursive: false,
@ -109,7 +109,7 @@ export async function watchImmediate(
`watcher://raw-event/${id}`,
(event) => {
cb(event.payload);
}
},
);
return () => {

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({
input: "guest-js/index.ts",
pkg: JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf8")
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
),
external: [/^@tauri-apps\/api/],
});

@ -43,7 +43,7 @@ enum LogLevel {
async function log(
level: LogLevel,
message: string,
options?: LogOptions
options?: LogOptions,
): Promise<void> {
const traces = new Error().stack?.split("\n").map((line) => line.split("@"));
@ -86,7 +86,7 @@ async function log(
*/
export async function error(
message: string,
options?: LogOptions
options?: LogOptions,
): Promise<void> {
await log(LogLevel.Error, message, options);
}
@ -108,7 +108,7 @@ export async function error(
*/
export async function warn(
message: string,
options?: LogOptions
options?: LogOptions,
): Promise<void> {
await log(LogLevel.Warn, message, options);
}
@ -130,7 +130,7 @@ export async function warn(
*/
export async function info(
message: string,
options?: LogOptions
options?: LogOptions,
): Promise<void> {
await log(LogLevel.Info, message, options);
}
@ -152,7 +152,7 @@ export async function info(
*/
export async function debug(
message: string,
options?: LogOptions
options?: LogOptions,
): Promise<void> {
await log(LogLevel.Debug, message, options);
}
@ -174,7 +174,7 @@ export async function debug(
*/
export async function trace(
message: string,
options?: LogOptions
options?: LogOptions,
): Promise<void> {
await log(LogLevel.Trace, message, options);
}
@ -193,7 +193,7 @@ export async function attachConsole(): Promise<UnlistenFn> {
// TODO: Investigate security/detect-unsafe-regex
// eslint-disable-next-line no-control-regex, security/detect-unsafe-regex
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,
""
"",
);
switch (payload.level) {

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({
input: "guest-js/index.ts",
pkg: JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf8")
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
),
external: [/^@tauri-apps\/api/],
});

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({
input: "guest-js/index.ts",
pkg: JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf8")
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
),
external: [/^@tauri-apps\/api/],
});

@ -89,7 +89,7 @@ export default class Database {
db: this.path,
query,
values: bindValues ?? [],
}
},
);
return {

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({
input: "guest-js/index.ts",
pkg: JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf8")
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
),
external: [/^@tauri-apps\/api/],
});

@ -177,7 +177,7 @@ export class Store {
*/
async onKeyChange<T>(
key: string,
cb: (value: T | null) => void
cb: (value: T | null) => void,
): Promise<UnlistenFn> {
return await listen<ChangePayload<T>>("store://change", (event) => {
if (event.payload.path === this.path && event.payload.key === key) {
@ -192,7 +192,7 @@ export class Store {
* @returns A promise resolving to a function to unlisten to the event.
*/
async onChange<T>(
cb: (key: string, value: T | null) => void
cb: (key: string, value: T | null) => void,
): Promise<UnlistenFn> {
return await listen<ChangePayload<T>>("store://change", (event) => {
if (event.payload.path === this.path) {

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({
input: "guest-js/index.ts",
pkg: JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf8")
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
),
external: [/^@tauri-apps\/api/],
});

@ -23,7 +23,7 @@ export type StoreKey =
| ArrayBuffer;
function toBytesDto(
v: ClientPath | VaultPath | RecordPath | StoreKey
v: ClientPath | VaultPath | RecordPath | StoreKey,
): string | number[] {
if (typeof v === "string") {
return v;
@ -125,7 +125,7 @@ class ProcedureExecutor {
*/
async generateSLIP10Seed(
outputLocation: Location,
sizeBytes?: number
sizeBytes?: number,
): Promise<Uint8Array> {
return await invoke<number[]>("plugin:stronghold|execute_procedure", {
...this.procedureArgs,
@ -152,7 +152,7 @@ class ProcedureExecutor {
chain: number[],
source: "Seed" | "Key",
sourceLocation: Location,
outputLocation: Location
outputLocation: Location,
): Promise<Uint8Array> {
return await invoke<number[]>("plugin:stronghold|execute_procedure", {
...this.procedureArgs,
@ -181,7 +181,7 @@ class ProcedureExecutor {
async recoverBIP39(
mnemonic: string,
outputLocation: Location,
passphrase?: string
passphrase?: string,
): Promise<Uint8Array> {
return await invoke<number[]>("plugin:stronghold|execute_procedure", {
...this.procedureArgs,
@ -205,7 +205,7 @@ class ProcedureExecutor {
*/
async generateBIP39(
outputLocation: Location,
passphrase?: string
passphrase?: string,
): Promise<Uint8Array> {
return await invoke<number[]>("plugin:stronghold|execute_procedure", {
...this.procedureArgs,
@ -245,7 +245,7 @@ class ProcedureExecutor {
*/
async signEd25519(
privateKeyLocation: Location,
msg: string
msg: string,
): Promise<Uint8Array> {
return await invoke<number[]>("plugin:stronghold|execute_procedure", {
...this.procedureArgs,
@ -310,7 +310,7 @@ export class Store {
async insert(
key: StoreKey,
value: number[],
lifetime?: Duration
lifetime?: Duration,
): Promise<void> {
return await invoke("plugin:stronghold|save_store_record", {
snapshotPath: this.path,
@ -328,7 +328,7 @@ export class Store {
snapshotPath: this.path,
client: this.client,
key: toBytesDto(key),
}
},
).then((v) => (v != null ? Uint8Array.from(v) : null));
}
}

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({
input: "guest-js/index.ts",
pkg: JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf8")
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
),
external: [/^@tauri-apps\/api/],
});

@ -58,7 +58,7 @@ upload(
"https://example.com/file-upload",
"./path/to/my/file.txt",
(progress, total) => console.log(`Uploaded ${progress} of ${total} bytes`), // a callback that will be called with the upload progress
{ "Content-Type": "text/plain" } // optional headers to send with the request
{ "Content-Type": "text/plain" }, // optional headers to send with the request
);
```
@ -69,7 +69,7 @@ download(
"https://example.com/file-download-link",
"./path/to/save/my/file.txt",
(progress, total) => console.log(`Downloaded ${progress} of ${total} bytes`), // a callback that will be called with the download progress
{ "Content-Type": "text/plain" } // optional headers to send with the request
{ "Content-Type": "text/plain" }, // optional headers to send with the request
);
```

@ -31,7 +31,7 @@ async function upload(
url: string,
filePath: string,
progressHandler?: ProgressHandler,
headers?: Map<string, string>
headers?: Map<string, string>,
): Promise<void> {
const ids = new Uint32Array(1);
window.crypto.getRandomValues(ids);
@ -59,7 +59,7 @@ async function download(
url: string,
filePath: string,
progressHandler?: ProgressHandler,
headers?: Map<string, string>
headers?: Map<string, string>,
): Promise<void> {
const ids = new Uint32Array(1);
window.crypto.getRandomValues(ids);

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({
input: "guest-js/index.ts",
pkg: JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf8")
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
),
external: [/^@tauri-apps\/api/],
});

@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />

@ -53,7 +53,7 @@ export default class WebSocket {
m = { type: "Binary", data: message };
} else {
throw new Error(
"invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array"
"invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array",
);
}
return await invoke("plugin:websocket|send", {

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({
input: "guest-js/index.ts",
pkg: JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf8")
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
),
external: [/^@tauri-apps\/api/],
});

@ -23,7 +23,7 @@ async function saveWindowState(flags: StateFlags): Promise<void> {
*/
async function restoreState(
label: WindowLabel,
flags: StateFlags
flags: StateFlags,
): Promise<void> {
return invoke("plugin:window-state|restore_state", { label, flags });
}

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({
input: "guest-js/index.ts",
pkg: JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf8")
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
),
external: [/^@tauri-apps\/api/],
});

@ -1,4 +1,4 @@
lockfileVersion: '6.0'
lockfileVersion: '6.1'
settings:
autoInstallPeers: true
@ -31,13 +31,13 @@ importers:
version: 8.8.0(eslint@8.38.0)
eslint-config-standard-with-typescript:
specifier: ^36.0.0
version: 36.0.0(@typescript-eslint/eslint-plugin@5.58.0)(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.0)(eslint-plugin-promise@6.1.1)(eslint@8.38.0)(typescript@5.0.4)
version: 36.0.0(@typescript-eslint/eslint-plugin@5.58.0)(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.1)(eslint-plugin-promise@6.1.1)(eslint@8.38.0)(typescript@5.0.4)
eslint-plugin-import:
specifier: ^2.27.5
version: 2.27.5(@typescript-eslint/parser@5.58.0)(eslint@8.38.0)
eslint-plugin-n:
specifier: ^16.0.0
version: 16.0.0(eslint@8.38.0)
version: 16.0.1(eslint@8.38.0)
eslint-plugin-promise:
specifier: ^6.1.1
version: 6.1.1(eslint@8.38.0)
@ -1071,7 +1071,7 @@ packages:
/builtins@5.0.1:
resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==}
dependencies:
semver: 7.5.1
semver: 7.5.3
dev: true
/busboy@1.6.0:
@ -1354,7 +1354,7 @@ packages:
eslint: 8.38.0
dev: true
/eslint-config-standard-with-typescript@36.0.0(@typescript-eslint/eslint-plugin@5.58.0)(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.0)(eslint-plugin-promise@6.1.1)(eslint@8.38.0)(typescript@5.0.4):
/eslint-config-standard-with-typescript@36.0.0(@typescript-eslint/eslint-plugin@5.58.0)(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.1)(eslint-plugin-promise@6.1.1)(eslint@8.38.0)(typescript@5.0.4):
resolution: {integrity: sha512-8ZSEskfrDAkUF2lTQLMT0CBzgRNlx1uIM7l2I7L683dKAXUdHuEL2x+GxuGAsdsoWbx7W7Zv0xF67VCEZXIk0Q==}
peerDependencies:
'@typescript-eslint/eslint-plugin': ^5.50.0
@ -1367,16 +1367,16 @@ packages:
'@typescript-eslint/eslint-plugin': 5.58.0(@typescript-eslint/parser@5.58.0)(eslint@8.38.0)(typescript@5.0.4)
'@typescript-eslint/parser': 5.58.0(eslint@8.38.0)(typescript@5.0.4)
eslint: 8.38.0
eslint-config-standard: 17.0.0(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.0)(eslint-plugin-promise@6.1.1)(eslint@8.38.0)
eslint-config-standard: 17.0.0(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.1)(eslint-plugin-promise@6.1.1)(eslint@8.38.0)
eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.58.0)(eslint@8.38.0)
eslint-plugin-n: 16.0.0(eslint@8.38.0)
eslint-plugin-n: 16.0.1(eslint@8.38.0)
eslint-plugin-promise: 6.1.1(eslint@8.38.0)
typescript: 5.0.4
transitivePeerDependencies:
- supports-color
dev: true
/eslint-config-standard@17.0.0(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.0)(eslint-plugin-promise@6.1.1)(eslint@8.38.0):
/eslint-config-standard@17.0.0(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.1)(eslint-plugin-promise@6.1.1)(eslint@8.38.0):
resolution: {integrity: sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg==}
peerDependencies:
eslint: ^8.0.1
@ -1386,7 +1386,7 @@ packages:
dependencies:
eslint: 8.38.0
eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.58.0)(eslint@8.38.0)
eslint-plugin-n: 16.0.0(eslint@8.38.0)
eslint-plugin-n: 16.0.1(eslint@8.38.0)
eslint-plugin-promise: 6.1.1(eslint@8.38.0)
dev: true
@ -1429,8 +1429,8 @@ packages:
- supports-color
dev: true
/eslint-plugin-es-x@6.1.0(eslint@8.38.0):
resolution: {integrity: sha512-f6dHOuVDDYHOCu3w+EledZnUkDdCa71GGHxZ0DMNfalM/2Upl0t/ks0+d5W5YDQJEQmvthE3WYv7RI/9Fl+csQ==}
/eslint-plugin-es-x@7.1.0(eslint@8.38.0):
resolution: {integrity: sha512-AhiaF31syh4CCQ+C5ccJA0VG6+kJK8+5mXKKE7Qs1xcPRg02CDPOj3mWlQxuWS/AYtg7kxrDNgW9YW3vc0Q+Mw==}
engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies:
eslint: '>=8'
@ -1473,8 +1473,8 @@ packages:
- supports-color
dev: true
/eslint-plugin-n@16.0.0(eslint@8.38.0):
resolution: {integrity: sha512-akkZTE3hsHBrq6CwmGuYCzQREbVUrA855kzcHqe6i0FLBkeY7Y/6tThCVkjUnjhvRBAlc+8lILcSe5QvvDpeZQ==}
/eslint-plugin-n@16.0.1(eslint@8.38.0):
resolution: {integrity: sha512-CDmHegJN0OF3L5cz5tATH84RPQm9kG+Yx39wIqIwPR2C0uhBGMWfbbOtetR83PQjjidA5aXMu+LEFw1jaSwvTA==}
engines: {node: '>=16.0.0'}
peerDependencies:
eslint: '>=7.0.0'
@ -1482,12 +1482,12 @@ packages:
'@eslint-community/eslint-utils': 4.4.0(eslint@8.38.0)
builtins: 5.0.1
eslint: 8.38.0
eslint-plugin-es-x: 6.1.0(eslint@8.38.0)
eslint-plugin-es-x: 7.1.0(eslint@8.38.0)
ignore: 5.2.4
is-core-module: 2.12.0
is-core-module: 2.12.1
minimatch: 3.1.2
resolve: 1.22.2
semver: 7.5.1
semver: 7.5.3
dev: true
/eslint-plugin-promise@6.1.1(eslint@8.38.0):
@ -1943,6 +1943,12 @@ packages:
has: 1.0.3
dev: true
/is-core-module@2.12.1:
resolution: {integrity: sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==}
dependencies:
has: 1.0.3
dev: true
/is-date-object@1.0.5:
resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==}
engines: {node: '>= 0.4'}
@ -2466,6 +2472,14 @@ packages:
lru-cache: 6.0.0
dev: true
/semver@7.5.3:
resolution: {integrity: sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==}
engines: {node: '>=10'}
hasBin: true
dependencies:
lru-cache: 6.0.0
dev: true
/serialize-javascript@6.0.1:
resolution: {integrity: sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==}
dependencies:

@ -5,7 +5,7 @@ import { createConfig } from "../rollup.config.mjs";
export default createConfig({
input: "guest-js/index.ts",
pkg: JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf8")
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
),
external: [/^@tauri-apps\/api/],
});

Loading…
Cancel
Save