export type DeleteApiBatchBatchIdMultipartUploadIdOptions = {baseUrl?: string | undefined, DVIDS?: string | undefined, fetch?: typeof fetch | undefined}; /** * Abort a batch multipart upload and delete its incomplete parts * * DELETE /batch/{batch_id}/multipart-upload/{id} */ export const deleteApiBatchBatchIdMultipartUploadId = async (options?: DeleteApiBatchBatchIdMultipartUploadIdOptions) => { const {baseUrl = "https://submitapi.dvidshub.net", fetch: fetchFn = fetch, DVIDS} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (DVIDS !== undefined) headers.set('authorization', `Bearer ${DVIDS}`) const url = `${baseUrl.replace(/\/+$/, '')}/batch/${encodeURIComponent(String(args.batch_id))}/multipart-upload/${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 };