export type AuthRegisterRequest = {email: string, first_name: string, last_name: string}; export type CreateApiApiV1UsersRegisterArgs = {body: AuthRegisterRequest}; export type CreateApiApiV1UsersRegisterOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Register a new user account * * POST /api/v1/users/register */ export const createApiApiV1UsersRegister = async (args: CreateApiApiV1UsersRegisterArgs, options?: CreateApiApiV1UsersRegisterOptions) => { const {baseUrl = "https://core.quidkey.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/users/register${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };