export type DeleteApiApiV1DotauthHeadlessOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Clear the system-level headless token-exchange configuration * * DELETE /api/v1/dotauth/headless */ export const deleteApiApiV1DotauthHeadless = async (options: DeleteApiApiV1DotauthHeadlessOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/dotauth/headless${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 };