export type DeleteApiV1DocumentsJobsIdArgs = {id: string}; export type DeleteApiV1DocumentsJobsIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Cancel or delete a job * * DELETE /v1/documents/jobs/{id} */ export const deleteApiV1DocumentsJobsId = async (args: DeleteApiV1DocumentsJobsIdArgs, options?: DeleteApiV1DocumentsJobsIdOptions) => { const {baseUrl = "https://console.nace.ai", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/documents/jobs/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };