export type UUID4 = unknown; export type DeleteApiWebauthnCredentialsIdArgs = {id: UUID4}; export type DeleteApiWebauthnCredentialsIdOptions = {baseUrl?: string | undefined, CookieAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes a WebAuthn credential * * DELETE /webauthn/credentials/{id} * * Also accepts auth: BearerTokenAuth */ export const deleteApiWebauthnCredentialsId = async (args: DeleteApiWebauthnCredentialsIdArgs, options?: DeleteApiWebauthnCredentialsIdOptions) => { const {baseUrl = "https://.hanko.io/admin", fetch: fetchFn = fetch, CookieAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (CookieAuth !== undefined) cookies.push("hanko=" + encodeURIComponent(CookieAuth)) const url = `${baseUrl.replace(/\/+$/, '')}/webauthn/credentials/${encodeURIComponent(String(args.id))}${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 };