export type GetApiV2JobJobIdInputArgs = {jobId: string}; export type GetApiV2JobJobIdInputOptions = {baseUrl?: string | undefined, XAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Job Input * * GET /v2/job/{jobId}/input */ export const getApiV2JobJobIdInput = async (args: GetApiV2JobJobIdInputArgs, options?: GetApiV2JobJobIdInputOptions) => { const {baseUrl = "https://api.alianza.com", fetch: fetchFn = fetch, XAuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/octet-stream") if (XAuthToken !== undefined) headers.set("X-AUTH-TOKEN", XAuthToken) const url = `${baseUrl.replace(/\/+$/, '')}/v2/job/${encodeURIComponent(String(args.jobId))}/input${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() };