export type CreateApiV1AnnouncementsSeenArgs = {body: {ids: Array}}; export type CreateApiV1AnnouncementsSeenOptions = {baseUrl?: string | undefined, AccountSessionAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Mark visible announcement cards seen and acknowledged for this account * * POST /v1/announcements/seen */ export const createApiV1AnnouncementsSeen = async (args: CreateApiV1AnnouncementsSeenArgs, options?: CreateApiV1AnnouncementsSeenOptions) => { 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/seen${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 };