mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-05-07 12:26:41 +02:00
chore: adjust prettier config, .gitignore and use taplo to format toml files (#1728)
* chore: adjust prettier config, .gitignore and use taplo to format toml files This brings the plugins-workspace repository to the same code style of the main tauri repo * format toml * ignore examples gen dir * add .vscode/extensions.json * remove packageManager field * fmt * fix audit * taplo ignore permissions autogenerated files * remove create dummy dist * fix prettier workflow * install fmt in prettier workflow --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
@@ -1 +0,0 @@
|
||||
/.tauri
|
||||
@@ -9,12 +9,12 @@ repository = { workspace = true }
|
||||
links = "tauri-plugin-biometric"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
targets = [ "x86_64-linux-android" ]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
targets = ["x86_64-linux-android"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = [ "build" ] }
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true }
|
||||
|
||||
@@ -62,8 +62,8 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { authenticate } from "@tauri-apps/plugin-biometric";
|
||||
await authenticate('Open your wallet');
|
||||
import { authenticate } from '@tauri-apps/plugin-biometric'
|
||||
await authenticate('Open your wallet')
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
@@ -20,4 +20,4 @@ We prefer to receive reports in English.
|
||||
|
||||
Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new).
|
||||
|
||||
Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app).
|
||||
Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { invoke } from '@tauri-apps/api/core'
|
||||
|
||||
export enum BiometryType {
|
||||
None = 0,
|
||||
@@ -11,39 +11,39 @@ export enum BiometryType {
|
||||
// Apple FaceID or Android face authentication
|
||||
FaceID = 2,
|
||||
// Android iris authentication
|
||||
Iris = 3,
|
||||
Iris = 3
|
||||
}
|
||||
|
||||
export interface Status {
|
||||
isAvailable: boolean;
|
||||
biometryType: BiometryType;
|
||||
error?: string;
|
||||
isAvailable: boolean
|
||||
biometryType: BiometryType
|
||||
error?: string
|
||||
errorCode?:
|
||||
| "appCancel"
|
||||
| "authenticationFailed"
|
||||
| "invalidContext"
|
||||
| "notInteractive"
|
||||
| "passcodeNotSet"
|
||||
| "systemCancel"
|
||||
| "userCancel"
|
||||
| "userFallback"
|
||||
| "biometryLockout"
|
||||
| "biometryNotAvailable"
|
||||
| "biometryNotEnrolled";
|
||||
| 'appCancel'
|
||||
| 'authenticationFailed'
|
||||
| 'invalidContext'
|
||||
| 'notInteractive'
|
||||
| 'passcodeNotSet'
|
||||
| 'systemCancel'
|
||||
| 'userCancel'
|
||||
| 'userFallback'
|
||||
| 'biometryLockout'
|
||||
| 'biometryNotAvailable'
|
||||
| 'biometryNotEnrolled'
|
||||
}
|
||||
|
||||
export interface AuthOptions {
|
||||
allowDeviceCredential?: boolean;
|
||||
cancelTitle?: string;
|
||||
allowDeviceCredential?: boolean
|
||||
cancelTitle?: string
|
||||
|
||||
// iOS options
|
||||
fallbackTitle?: string;
|
||||
fallbackTitle?: string
|
||||
|
||||
// android options
|
||||
title?: string;
|
||||
subtitle?: string;
|
||||
confirmationRequired?: boolean;
|
||||
maxAttemps?: number;
|
||||
title?: string
|
||||
subtitle?: string
|
||||
confirmationRequired?: boolean
|
||||
maxAttemps?: number
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -51,7 +51,7 @@ export interface AuthOptions {
|
||||
* @returns a promise resolving to an object containing all the information about the status of the biometry.
|
||||
*/
|
||||
export async function checkStatus(): Promise<Status> {
|
||||
return await invoke("plugin:biometric|status");
|
||||
return await invoke('plugin:biometric|status')
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,10 +68,10 @@ export async function checkStatus(): Promise<Status> {
|
||||
*/
|
||||
export async function authenticate(
|
||||
reason: string,
|
||||
options?: AuthOptions,
|
||||
options?: AuthOptions
|
||||
): Promise<void> {
|
||||
await invoke("plugin:biometric|authenticate", {
|
||||
await invoke('plugin:biometric|authenticate', {
|
||||
reason,
|
||||
...options,
|
||||
});
|
||||
...options
|
||||
})
|
||||
}
|
||||
|
||||
@@ -10,7 +10,4 @@ It allows acccess to all biometric commands.
|
||||
|
||||
"""
|
||||
|
||||
permissions = [
|
||||
"allow-authenticate",
|
||||
"allow-status",
|
||||
]
|
||||
permissions = ["allow-authenticate", "allow-status"]
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { createConfig } from "../../shared/rollup.config.js";
|
||||
import { createConfig } from '../../shared/rollup.config.js'
|
||||
|
||||
export default createConfig();
|
||||
export default createConfig()
|
||||
|
||||
Reference in New Issue
Block a user