export type CreateApiApiProjectsPidSpidersSidJobsJidDataDeleteArgs = {type: string}; export type CreateApiApiProjectsPidSpidersSidJobsJidDataDeleteOptions = {baseUrl?: string | undefined, Basic?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * POST /api/projects/{pid}/spiders/{sid}/jobs/{jid}/data/delete */ export const createApiApiProjectsPidSpidersSidJobsJidDataDelete = async (args: CreateApiApiProjectsPidSpidersSidJobsJidDataDeleteArgs, options?: CreateApiApiProjectsPidSpidersSidJobsJidDataDeleteOptions) => { const {baseUrl = "http://127.0.0.1:8000", fetch: fetchFn = fetch, Basic} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.type != null) query.append("type", String(args.type)) if (Basic !== undefined) headers.set('authorization', `Basic ${btoa(`${Basic.username}:${Basic.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/projects/${encodeURIComponent(String(args.pid))}/spiders/${encodeURIComponent(String(args.sid))}/jobs/${encodeURIComponent(String(args.jid))}/data/delete${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };