export type GetApiApiDatasyncOptions = {baseUrl: string, AuthenticationToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * QuantumSync API Legacy Route. Use /api/quantumsync instead. * * GET /api/datasync * * Also accepts auth: DEPRECATED - API Key, API Key, Basic Auth */ export const getApiApiDatasync = async (options: GetApiApiDatasyncOptions) => { const {baseUrl, fetch: fetchFn = fetch, AuthenticationToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (AuthenticationToken !== undefined) headers.set("X-PL-AUTH", AuthenticationToken) const url = `${baseUrl.replace(/\/+$/, '')}/api/datasync${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 };