export type DeleteApiV1ScheduledScansScheduleIdArgs = {scheduleId: string}; export type DeleteApiV1ScheduledScansScheduleIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a schedule without deleting its run receipts. * * DELETE /v1/scheduled-scans/{scheduleId} */ export const deleteApiV1ScheduledScansScheduleId = async (args: DeleteApiV1ScheduledScansScheduleIdArgs, options?: DeleteApiV1ScheduledScansScheduleIdOptions) => { const {baseUrl = "https://api.on-page.ai", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set('authorization', `Bearer ${apiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/scheduled-scans/${encodeURIComponent(String(args.scheduleId))}${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 };