export type GetApiV3ConnectMobileArgs = {userId?: number | undefined}; export type GetApiV3ConnectMobileOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Mobile connect page * * GET /v3/connect/mobile */ export const getApiV3ConnectMobile = async (args: GetApiV3ConnectMobileArgs, options?: GetApiV3ConnectMobileOptions) => { const {baseUrl = "https://app.quantimo.do/api", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.userId != null) query.append("userId", String(args.userId)) const url = `${baseUrl.replace(/\/+$/, '')}/v3/connect/mobile${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 };