mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-21 11:26:15 +02:00
set readme banners to absolute url
Signed-off-by: Lorenzo Lewis <lorenzo_lewis@icloud.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
This plugin provides APIs to read application metadata and macOS app visibility functions.
|
||||
|
||||
@@ -60,7 +60,7 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { getVersion, hide } from "@tauri-apps/plugin-app";
|
||||
import { getVersion, hide } from '@tauri-apps/plugin-app';
|
||||
const appVersion = await getVersion();
|
||||
await hide();
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Use hardware security-keys in your Tauri App.
|
||||
|
||||
@@ -70,7 +70,7 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { Authenticator } from "@tauri-apps/plugin-authenticator";
|
||||
import { Authenticator } from '@tauri-apps/plugin-authenticator';
|
||||
|
||||
const auth = new Authenticator();
|
||||
auth.init(); // initialize transports
|
||||
@@ -80,9 +80,9 @@ const arr = new Uint32Array(32);
|
||||
window.crypto.getRandomValues(arr);
|
||||
const b64 = btoa(String.fromCharCode.apply(null, arr));
|
||||
// web-safe base64
|
||||
const challenge = b64.replace(/\+/g, "-").replace(/\//g, "_");
|
||||
const challenge = b64.replace(/\+/g, '-').replace(/\//g, '_');
|
||||
|
||||
const domain = "https://tauri.app";
|
||||
const domain = 'https://tauri.app';
|
||||
|
||||
// attempt to register with the security key
|
||||
const json = await auth.register(challenge, domain);
|
||||
@@ -93,7 +93,7 @@ const r2 = await auth.verifyRegistration(
|
||||
challenge,
|
||||
app,
|
||||
registerResult.registerData,
|
||||
registerResult.clientData,
|
||||
registerResult.clientData
|
||||
);
|
||||
const j2 = JSON.parse(r2);
|
||||
|
||||
@@ -108,11 +108,11 @@ const counter = await auth.verifySignature(
|
||||
signData.signData,
|
||||
clientData,
|
||||
keyHandle,
|
||||
pubkey,
|
||||
pubkey
|
||||
);
|
||||
|
||||
if (counter && counter > 0) {
|
||||
console.log("SUCCESS!");
|
||||
console.log('SUCCESS!');
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Automatically launch your application at startup. Supports Windows, Mac (via AppleScript or Launch Agent), and Linux.
|
||||
|
||||
@@ -62,7 +62,7 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { enable, isEnabled, disable } from "@tauri-apps/plugin-autostart";
|
||||
import { enable, isEnabled, disable } from '@tauri-apps/plugin-autostart';
|
||||
|
||||
await enable();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Parse arguments from your Command Line Interface.
|
||||
|
||||
@@ -67,12 +67,12 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { getMatches } from "@tauri-apps/plugin-cli";
|
||||
import { getMatches } from '@tauri-apps/plugin-cli';
|
||||
const matches = await getMatches();
|
||||
if (matches.subcommand?.name === "run") {
|
||||
if (matches.subcommand?.name === 'run') {
|
||||
// `./your-app run $ARGS` was executed
|
||||
const args = matches.subcommand?.matches.args;
|
||||
if ("debug" in args) {
|
||||
if ('debug' in args) {
|
||||
// `./your-app run --debug` was executed
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Read and write to the system clipboard.
|
||||
|
||||
@@ -60,9 +60,9 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { writeText, readText } from "@tauri-apps/plugin-clipboard-manager";
|
||||
await writeText("Tauri is awesome!");
|
||||
assert(await readText(), "Tauri is awesome!");
|
||||
import { writeText, readText } from '@tauri-apps/plugin-clipboard-manager';
|
||||
await writeText('Tauri is awesome!');
|
||||
assert(await readText(), 'Tauri is awesome!');
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Native system dialogs for opening and saving files along with message dialogs.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Access the file system.
|
||||
|
||||
@@ -60,9 +60,9 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { metadata } from "@tauri-apps/plugin-fs";
|
||||
import { metadata } from '@tauri-apps/plugin-fs';
|
||||
|
||||
await metadata("/path/to/file");
|
||||
await metadata('/path/to/file');
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Register global shortcuts.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Access the HTTP client written in Rust.
|
||||
|
||||
@@ -60,9 +60,9 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { fetch } from "@tauri-apps/plugin-http";
|
||||
const response = await fetch("http://localhost:3003/users/2", {
|
||||
method: "GET",
|
||||
import { fetch } from '@tauri-apps/plugin-http';
|
||||
const response = await fetch('http://localhost:3003/users/2', {
|
||||
method: 'GET',
|
||||
timeout: 30,
|
||||
});
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Expose your apps assets through a localhost server instead of the default custom protocol.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Configurable logging for your Tauri app.
|
||||
|
||||
@@ -66,14 +66,14 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { trace, info, error, attachConsole } from "@tauri-apps/plugin-log";
|
||||
import { trace, info, error, attachConsole } from '@tauri-apps/plugin-log';
|
||||
|
||||
// with LogTarget::Webview enabled this function will print logs to the browser console
|
||||
const detach = await attachConsole();
|
||||
|
||||
trace("Trace");
|
||||
info("Info");
|
||||
error("Error");
|
||||
trace('Trace');
|
||||
info('Info');
|
||||
error('Error');
|
||||
|
||||
// detach the browser console from the log stream
|
||||
detach();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Send message notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Read information about the operating system.
|
||||
|
||||
@@ -60,7 +60,7 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { version } from "@tauri-apps/plugin-os";
|
||||
import { version } from '@tauri-apps/plugin-os';
|
||||
const osVersion = await version();
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Save filesystem and asset scopes and restore them when the app is reopened.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Position your windows at well-known locations.
|
||||
|
||||
@@ -66,7 +66,7 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { move_window, Position } from "@tauri-apps/plugin-positioner";
|
||||
import { move_window, Position } from '@tauri-apps/plugin-positioner';
|
||||
|
||||
move_window(Position.TopRight);
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
This plugin provides APIs to access the current process. To spawn child processes, see the [`shell`](https://github.com/tauri-apps/tauri-plugin-shell) plugin.
|
||||
|
||||
@@ -60,7 +60,7 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { exit, relaunch } from "@tauri-apps/plugin-process";
|
||||
import { exit, relaunch } from '@tauri-apps/plugin-process';
|
||||
// exit the app with the given status code
|
||||
await exit(0);
|
||||
// restart the app
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application.
|
||||
|
||||
@@ -60,8 +60,8 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { Command } from "@tauri-apps/plugin-shell";
|
||||
Command.create("git", ["commit", "-m", "the commit message"]);
|
||||
import { Command } from '@tauri-apps/plugin-shell';
|
||||
Command.create('git', ['commit', '-m', 'the commit message']);
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Ensure a single instance of your tauri app is running.
|
||||
|
||||
|
||||
+14
-14
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Interface with SQL databases through [sqlx](https://github.com/launchbadge/sqlx). It supports the `sqlite`, `mysql` and `postgres` drivers, enabled by a Cargo feature.
|
||||
|
||||
@@ -62,16 +62,16 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import Database from "@tauri-apps/plugin-sql";
|
||||
import Database from '@tauri-apps/plugin-sql';
|
||||
|
||||
// sqlite. The path is relative to `tauri::api::path::BaseDirectory::App`.
|
||||
const db = await Database.load("sqlite:test.db");
|
||||
const db = await Database.load('sqlite:test.db');
|
||||
// mysql
|
||||
const db = await Database.load("mysql://user:pass@host/database");
|
||||
const db = await Database.load('mysql://user:pass@host/database');
|
||||
// postgres
|
||||
const db = await Database.load("postgres://postgres:password@localhost/test");
|
||||
const db = await Database.load('postgres://postgres:password@localhost/test');
|
||||
|
||||
await db.execute("INSERT INTO ...");
|
||||
await db.execute('INSERT INTO ...');
|
||||
```
|
||||
|
||||
## Syntax
|
||||
@@ -84,24 +84,24 @@ We use sqlx as our underlying library, adopting their query syntax:
|
||||
```javascript
|
||||
// INSERT and UPDATE examples for sqlite and postgres
|
||||
const result = await db.execute(
|
||||
"INSERT into todos (id, title, status) VALUES ($1, $2, $3)",
|
||||
[todos.id, todos.title, todos.status],
|
||||
'INSERT into todos (id, title, status) VALUES ($1, $2, $3)',
|
||||
[todos.id, todos.title, todos.status]
|
||||
);
|
||||
|
||||
const result = await db.execute(
|
||||
"UPDATE todos SET title = $1, completed = $2 WHERE id = $3",
|
||||
[todos.title, todos.status, todos.id],
|
||||
'UPDATE todos SET title = $1, completed = $2 WHERE id = $3',
|
||||
[todos.title, todos.status, todos.id]
|
||||
);
|
||||
|
||||
// INSERT and UPDATE examples for mysql
|
||||
const result = await db.execute(
|
||||
"INSERT into todos (id, title, status) VALUES (?, ?, ?)",
|
||||
[todos.id, todos.title, todos.status],
|
||||
'INSERT into todos (id, title, status) VALUES (?, ?, ?)',
|
||||
[todos.id, todos.title, todos.status]
|
||||
);
|
||||
|
||||
const result = await db.execute(
|
||||
"UPDATE todos SET title = ?, completed = ? WHERE id = ?",
|
||||
[todos.title, todos.status, todos.id],
|
||||
'UPDATE todos SET title = ?, completed = ? WHERE id = ?',
|
||||
[todos.title, todos.status, todos.id]
|
||||
);
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Simple, persistent key-value store.
|
||||
|
||||
@@ -60,13 +60,13 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { Store } from "@tauri-apps/plugin-store";
|
||||
import { Store } from '@tauri-apps/plugin-store';
|
||||
|
||||
const store = new Store(".settings.dat");
|
||||
const store = new Store('.settings.dat');
|
||||
|
||||
await store.set("some-key", { value: 5 });
|
||||
await store.set('some-key', { value: 5 });
|
||||
|
||||
const val = await store.get("some-key");
|
||||
const val = await store.get('some-key');
|
||||
assert(val, { value: 5 });
|
||||
|
||||
await store.save(); // this manually saves the store, otherwise the store is only saved when your app is closed
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Store secrets and keys using the [IOTA Stronghold](https://github.com/iotaledger/stronghold.rs) encrypted database and secure runtime.
|
||||
|
||||
@@ -64,7 +64,7 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { Stronghold, Location } from "@tauri-apps/plugin-stronghold";
|
||||
import { Stronghold, Location } from '@tauri-apps/plugin-stronghold';
|
||||
|
||||
// TODO
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
In-app updates for Tauri applications.
|
||||
|
||||
@@ -67,8 +67,8 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { check } from "@tauri-apps/plugin-updater";
|
||||
import { relaunch } from "@tauri-apps/plugin-process";
|
||||
import { check } from '@tauri-apps/plugin-updater';
|
||||
import { relaunch } from '@tauri-apps/plugin-process';
|
||||
const update = await check();
|
||||
if (update.response.available) {
|
||||
await update.downloadAndInstall();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Upload files from disk to a remote server over HTTP.
|
||||
Download files from a remote HTTP server to disk.
|
||||
@@ -61,24 +61,24 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { upload } from "@tauri-apps/plugin-upload";
|
||||
import { upload } from '@tauri-apps/plugin-upload';
|
||||
|
||||
upload(
|
||||
"https://example.com/file-upload",
|
||||
"./path/to/my/file.txt",
|
||||
'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
|
||||
);
|
||||
```
|
||||
|
||||
```javascript
|
||||
import { download } from "tauri-plugin-upload-api";
|
||||
import { download } from 'tauri-plugin-upload-api';
|
||||
|
||||
download(
|
||||
"https://example.com/file-download-link",
|
||||
"./path/to/save/my/file.txt",
|
||||
'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
|
||||
);
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Expose a WebSocket server to your Tauri frontend.
|
||||
|
||||
@@ -60,11 +60,11 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import WebSocket from "@tauri-apps/plugin-websocket";
|
||||
import WebSocket from '@tauri-apps/plugin-websocket';
|
||||
|
||||
const ws = await WebSocket.connect("wss://example.com");
|
||||
const ws = await WebSocket.connect('wss://example.com');
|
||||
|
||||
await ws.send("Hello World");
|
||||
await ws.send('Hello World');
|
||||
|
||||
await ws.disconnect();
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Save window positions and sizes and restore them when the app is reopened.
|
||||
|
||||
@@ -71,7 +71,7 @@ app.save_window_state(StateFlags::all()); // will save the state of all open win
|
||||
or through Javascript
|
||||
|
||||
```javascript
|
||||
import { saveWindowState, StateFlags } from "@tauri-apps/plugin-window-state";
|
||||
import { saveWindowState, StateFlags } from '@tauri-apps/plugin-window-state';
|
||||
|
||||
saveWindowState(StateFlags.ALL);
|
||||
```
|
||||
@@ -91,7 +91,7 @@ or through Javascript
|
||||
import {
|
||||
restoreStateCurrent,
|
||||
StateFlags,
|
||||
} from "@tauri-apps/plugin-window-state";
|
||||
} from '@tauri-apps/plugin-window-state';
|
||||
|
||||
restoreStateCurrent(StateFlags.ALL);
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Interact with the Tauri window.
|
||||
|
||||
@@ -60,19 +60,19 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { appWindow, WebviewWindow } from "@tauri-apps/plugin-window";
|
||||
import { appWindow, WebviewWindow } from '@tauri-apps/plugin-window';
|
||||
|
||||
// manipulating this window
|
||||
await appWindow.setResizable(false);
|
||||
|
||||
// Creating new windows:
|
||||
// loading embedded asset:
|
||||
const webview = new WebviewWindow("theUniqueLabel", {
|
||||
url: "path/to/page.html",
|
||||
const webview = new WebviewWindow('theUniqueLabel', {
|
||||
url: 'path/to/page.html',
|
||||
});
|
||||
// alternatively, load a remote URL:
|
||||
const webview = new WebviewWindow("theUniqueLabel", {
|
||||
url: "https://github.com/tauri-apps/tauri",
|
||||
const webview = new WebviewWindow('theUniqueLabel', {
|
||||
url: 'https://github.com/tauri-apps/tauri',
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user