export type DeleteApiV1TokensSessionsRevokeOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Revoke an existing access token * * DELETE /v1/tokens/sessions/revoke */ export const deleteApiV1TokensSessionsRevoke = async (options?: DeleteApiV1TokensSessionsRevokeOptions) => { const {baseUrl = "https://api.zenoti.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/plain") const url = `${baseUrl.replace(/\/+$/, '')}/v1/tokens/sessions/revoke${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 res.text() };