export type GetApiNotteSessionsSessionIdCookiesArgs = {session_id: string}; export type GetApiNotteSessionsSessionIdCookiesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get all cookies from the browser session. * * GET /notte/sessions/{session_id}/cookies */ export const getApiNotteSessionsSessionIdCookies = async (args: GetApiNotteSessionsSessionIdCookiesArgs, options?: GetApiNotteSessionsSessionIdCookiesOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.session_id != null) query.append("session_id", String(args.session_id)) const url = `${baseUrl.replace(/\/+$/, '')}/notte/sessions/${encodeURIComponent(String(args.session_id))}/cookies${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };