export type UpdateApiApiV1LoggerArgs = {body: BodyInit}; export type UpdateApiApiV1LoggerOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * PUT /api/v1/logger */ export const updateApiApiV1Logger = async (args: UpdateApiApiV1LoggerArgs, options: UpdateApiApiV1LoggerOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "*/*") headers.set('accept', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/logger${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return (await res.json()) as unknown };