export type GetApiPipelinesCustomIdLogsArgs = {task_index?: number | undefined, num_lines?: number | undefined, follow?: boolean | undefined}; export type GetApiPipelinesCustomIdLogsOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve logs for a custom pipeline * * GET /pipelines/custom/{id}/logs */ export const getApiPipelinesCustomIdLogs = async (args: GetApiPipelinesCustomIdLogsArgs, options?: GetApiPipelinesCustomIdLogsOptions) => { const {baseUrl = "https://replace-with-account.api.data.decodable.co/v1alpha2", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/plain") if (args.task_index != null) query.append("task_index", String(args.task_index)) if (args.num_lines != null) query.append("num_lines", String(args.num_lines)) if (args.follow != null) query.append("follow", String(args.follow)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/pipelines/custom/${encodeURIComponent(String(args.id))}/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 res.text() };