export type DeleteApiProfilesGuidCookiesArgs = {guid: string}; export type DeleteApiProfilesGuidCookiesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes all the cookies stored in the profile, which will likely log the profile out of all websites. * * DELETE /profiles/{guid}/cookies */ export const deleteApiProfilesGuidCookies = async (args: DeleteApiProfilesGuidCookiesArgs, options?: DeleteApiProfilesGuidCookiesOptions) => { const {baseUrl = "http://localhost:5050", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/profiles/${encodeURIComponent(String(args.guid))}/cookies${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 };