export type GetApiApiV5UsersResetPasswordArgs = {token: string}; export type GetApiApiV5UsersResetPasswordOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reset password page * * GET /api/v5/users/reset-password */ export const getApiApiV5UsersResetPassword = async (args: GetApiApiV5UsersResetPasswordArgs, options?: GetApiApiV5UsersResetPasswordOptions) => { const {baseUrl = "https://api.pavlok.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/html") if (args.token != null) query.append("token", String(args.token)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v5/users/reset-password${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.text() };