feat: finish api package

This commit is contained in:
Adrian Castro
2024-04-18 17:34:40 +02:00
parent 4f833bee46
commit 3fb2567ae1
12 changed files with 615 additions and 82 deletions

View File

@@ -1,10 +1,10 @@
import { ofetch } from "ofetch";
import type { SessionResponse } from "./auth";
export interface ChallengeTokenResponse {
challenge: string;
}
import type {
ChallengeTokenResponse,
LoginInput,
LoginResponse,
} from "./types";
export async function getLoginChallengeToken(
url: string,
@@ -19,20 +19,6 @@ export async function getLoginChallengeToken(
});
}
export interface LoginResponse {
session: SessionResponse;
token: string;
}
export interface LoginInput {
publicKey: string;
challenge: {
code: string;
signature: string;
};
device: string;
}
export async function loginAccount(
url: string,
data: LoginInput,