export type DeleteApiPublicDebugV1LoggersLoggerNameArgs = {loggerName: string}; export type DeleteApiPublicDebugV1LoggersLoggerNameOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a persisted logger level * * DELETE /public/debug/v1/loggers/{loggerName} */ export const deleteApiPublicDebugV1LoggersLoggerName = async (args: DeleteApiPublicDebugV1LoggersLoggerNameArgs, options: DeleteApiPublicDebugV1LoggersLoggerNameOptions) => { const {baseUrl, fetch: fetchFn = fetch, httpAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (httpAuth !== undefined) headers.set('authorization', `Bearer ${httpAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/public/debug/v1/loggers/${encodeURIComponent(String(args.loggerName))}${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 };