export type GetApiV1JobsJobIdDocumentContentArtifactRefArgs = {artifact_ref: string, job_id: string}; export type GetApiV1JobsJobIdDocumentContentArtifactRefOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * get_document_content * * GET /v1/jobs/{job_id}/document-content/{artifact_ref} */ export const getApiV1JobsJobIdDocumentContentArtifactRef = async (args: GetApiV1JobsJobIdDocumentContentArtifactRefArgs, options?: GetApiV1JobsJobIdDocumentContentArtifactRefOptions) => { const {baseUrl = "https://ndi-api.nace.ai", fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (APIKeyHeader !== undefined) headers.set("X-API-Key", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/v1/jobs/${encodeURIComponent(String(args.job_id))}/document-content/${encodeURIComponent(String(args.artifact_ref))}${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 };