export type UploadCodexScreenshotDto = Record; export type CreateApiV1CodexAutomationRunsRunIdScreenshotsArgs = {runId: string, body: UploadCodexScreenshotDto}; export type CreateApiV1CodexAutomationRunsRunIdScreenshotsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /v1/codex-automation/runs/{runId}/screenshots */ export const createApiV1CodexAutomationRunsRunIdScreenshots = async (args: CreateApiV1CodexAutomationRunsRunIdScreenshotsArgs, options?: CreateApiV1CodexAutomationRunsRunIdScreenshotsOptions) => { const {baseUrl = "https://api.betayum.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/codex-automation/runs/${encodeURIComponent(String(args.runId))}/screenshots${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 };