export type GetApiApiPublicRunLogsArgs = {'x-api-key': string, ai_contact_id: string, page?: number | undefined, page_size?: number | undefined}; export type GetApiApiPublicRunLogsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve run logs by AI contact * * GET /api/public/run-logs */ export const getApiApiPublicRunLogs = async (args: GetApiApiPublicRunLogsArgs, options?: GetApiApiPublicRunLogsOptions) => { const {baseUrl = "https://api.vambe.me", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['x-api-key'] != null) headers.set("x-api-key", String(args['x-api-key'])) if (args.ai_contact_id != null) query.append("ai_contact_id", String(args.ai_contact_id)) if (args.page != null) query.append("page", String(args.page)) if (args.page_size != null) query.append("page_size", String(args.page_size)) const url = `${baseUrl.replace(/\/+$/, '')}/api/public/run-logs${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 };