export type DeleteApiV2UserAccessOptions = {baseUrl?: string | undefined, OAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Revoke the access token granted by the user. If the associated OAuth client is configured to receive webhooks, it will no longer receive them for this user. * * DELETE /v2/user/access */ export const deleteApiV2UserAccess = async (options?: DeleteApiV2UserAccessOptions) => { const {baseUrl = "https://api.prod.whoop.com/developer", fetch: fetchFn = fetch, OAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth !== undefined) headers.set('authorization', `Bearer ${OAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/user/access${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 };