export type DeleteApiApiV1LivescanScannerIdScanIdArgs = {scannerId: string, scanId: string}; export type DeleteApiApiV1LivescanScannerIdScanIdOptions = {baseUrl?: string | undefined, apikeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Purge Live Scan Result * * DELETE /api/v1/livescan/{scannerId}/{scanId}/ */ export const deleteApiApiV1LivescanScannerIdScanId = async (args: DeleteApiApiV1LivescanScannerIdScanIdArgs, options?: DeleteApiApiV1LivescanScannerIdScanIdOptions) => { const {baseUrl = "https://urlscan.io", fetch: fetchFn = fetch, apikeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apikeyAuth !== undefined) headers.set("api-key", apikeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/livescan/${encodeURIComponent(String(args.scannerId))}/${encodeURIComponent(String(args.scanId))}/${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 };