export type DeleteApiUsersIdPasswordArgs = {id: string}; export type DeleteApiUsersIdPasswordOptions = {baseUrl?: string | undefined, BearerApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete the password of a user * * DELETE /users/{id}/password */ export const deleteApiUsersIdPassword = async (args: DeleteApiUsersIdPasswordArgs, options?: DeleteApiUsersIdPasswordOptions) => { const {baseUrl = "https://.hanko.io/admin", fetch: fetchFn = fetch, BearerApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerApiKeyAuth !== undefined) headers.set('authorization', `Bearer ${BearerApiKeyAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/users/${encodeURIComponent(String(args.id))}/password${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };