export type UpdateApiSettingsAiArgs = {body: {company?: ({name?: string | undefined, summary?: string | undefined, generated?: boolean | undefined}) | undefined, user?: ({name?: string | undefined, summary?: string | undefined}) | undefined}}; export type UpdateApiSettingsAiOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update AI Settings * * PUT /settings/ai */ export const updateApiSettingsAi = async (args: UpdateApiSettingsAiArgs, options?: UpdateApiSettingsAiOptions) => { const {baseUrl = "https://api.salesflare.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/settings/ai${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };