export type GetApiV1AnnouncementsOptions = {baseUrl?: string | undefined, AccountSessionAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * List the signed-in account's available product updates * * GET /v1/announcements */ export const getApiV1Announcements = async (options?: GetApiV1AnnouncementsOptions) => { const {baseUrl = "https://api.lunary.ai", fetch: fetchFn = fetch, AccountSessionAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (AccountSessionAuth !== undefined) headers.set('authorization', `Bearer ${AccountSessionAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/announcements${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };