export type CreateApiUsersUsernameResetPasswordArgs = {username: string}; export type CreateApiUsersUsernameResetPasswordOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reset the password of an existing user * * POST /users/{username}/resetPassword */ export const createApiUsersUsernameResetPassword = async (args: CreateApiUsersUsernameResetPasswordArgs, options?: CreateApiUsersUsernameResetPasswordOptions) => { const {baseUrl = "https://api.quivo.co", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/users/${encodeURIComponent(String(args.username))}/resetPassword${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };