export type GetApiHealthLiveOptions = {baseUrl?: string | undefined, customHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Liveness check * * GET /health/live */ export const getApiHealthLive = async (options?: GetApiHealthLiveOptions) => { const {baseUrl = "https://integrators.prod.api.tabsplatform.com", fetch: fetchFn = fetch, customHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (customHeader !== undefined) headers.set("Authorization", customHeader) const url = `${baseUrl.replace(/\/+$/, '')}/health/live${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 };