export type CreateApiNotteSessionsStartArgs = {body: {headless?: boolean | undefined, browser_type?: string | undefined, proxies?: boolean | undefined, solve_captchas?: boolean | undefined, idle_timeout_minutes?: number | undefined, max_duration_minutes?: number | undefined, viewport_width?: number | undefined, viewport_height?: number | undefined, user_agent?: string | undefined}}; export type CreateApiNotteSessionsStartOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Start a new browser session. Configure browser type, proxies, viewport, and session timeout. * * POST /notte/sessions/start */ export const createApiNotteSessionsStart = async (args: CreateApiNotteSessionsStartArgs, options?: CreateApiNotteSessionsStartOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/notte/sessions/start${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };