export type GetApiSelfHostedTerraformPlansKeyOutputArgs = {key: string}; export type GetApiSelfHostedTerraformPlansKeyOutputOptions = {baseUrl?: string | undefined, RunnerPoolAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get Terraform plan output (self-hosted) * * GET /self-hosted/terraform/plans/{key}/output */ export const getApiSelfHostedTerraformPlansKeyOutput = async (args: GetApiSelfHostedTerraformPlansKeyOutputArgs, options?: GetApiSelfHostedTerraformPlansKeyOutputOptions) => { const {baseUrl = "https://api.firefly.ai/v2", fetch: fetchFn = fetch, RunnerPoolAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/octet-stream") if (RunnerPoolAuth !== undefined) headers.set('authorization', `Bearer ${RunnerPoolAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/self-hosted/terraform/plans/${encodeURIComponent(String(args.key))}/output${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.blob() };