export type DeleteApiUsersIdWebauthnCredentialsCredentialIdArgs = {id: string, credential_id: string}; export type DeleteApiUsersIdWebauthnCredentialsCredentialIdOptions = {baseUrl?: string | undefined, BearerApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a WebAuthn credential from a user * * DELETE /users/{id}/webauthn_credentials/{credential_id} */ export const deleteApiUsersIdWebauthnCredentialsCredentialId = async (args: DeleteApiUsersIdWebauthnCredentialsCredentialIdArgs, options?: DeleteApiUsersIdWebauthnCredentialsCredentialIdOptions) => { 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))}/webauthn_credentials/${encodeURIComponent(String(args.credential_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 };