aboutsummaryrefslogtreecommitdiffstats
path: root/ui/src/state/client.ts
blob: 5ec0d8a7e4b542c0650ed40c3a4f15b20033d05e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// At some point, I'd like to replace some of the Atuin calls
// with separate state handling here

import { invoke } from "@tauri-apps/api/core";
import { Settings } from "@/state/models";

export async function sessionToken(): Promise<String> {
  return await invoke("session");
}

export async function settings(): Promise<Settings> {
  return await invoke("config");
}

export async function login(
  username: string,
  password: string,
  key: string,
): Promise<string> {
  return await invoke("login", { username, password, key });
}

export async function register(
  username: string,
  email: string,
  password: string,
): Promise<string> {
  return await invoke("register", { username, email, password });
}