export type CreateApiV1AnnouncementsAcknowledgeArgs = {body: {ids: Array}}; export type CreateApiV1AnnouncementsAcknowledgeOptions = {baseUrl?: string | undefined, AccountSessionAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Acknowledge a displayed digest's pending backlog for this account * * POST /v1/announcements/acknowledge */ export const createApiV1AnnouncementsAcknowledge = async (args: CreateApiV1AnnouncementsAcknowledgeArgs, options?: CreateApiV1AnnouncementsAcknowledgeOptions) => { const {baseUrl = "https://api.lunary.ai", fetch: fetchFn = fetch, AccountSessionAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (AccountSessionAuth !== undefined) headers.set('authorization', `Bearer ${AccountSessionAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/announcements/acknowledge${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 undefined };