export type GetApiApiV1LivescanScannersOptions = {baseUrl?: string | undefined, apikeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Live Scanners * * GET /api/v1/livescan/scanners/ */ export const getApiApiV1LivescanScanners = async (options?: GetApiApiV1LivescanScannersOptions) => { 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/scanners/${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 };