export type DeleteApiConfigCorsCorsUrlArgs = {cors_url: string}; export type DeleteApiConfigCorsCorsUrlOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a BFD session * * DELETE /config/cors/{cors_url} */ export const deleteApiConfigCorsCorsUrl = async (args: DeleteApiConfigCorsCorsUrlArgs, options?: DeleteApiConfigCorsCorsUrlOptions) => { const {baseUrl = "http://0.0.0.0:11111/netlox/v1", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerAuth !== undefined) headers.set("Authorization", BearerAuth) const url = `${baseUrl.replace(/\/+$/, '')}/config/cors/${encodeURIComponent(String(args.cors_url))}${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 };