export type GetApiSiteIdAccountEmailVerifyArgs = {site_id: string, token: string}; export type GetApiSiteIdAccountEmailVerifyOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Verify User Email * * GET /{site_id}/account/email_verify */ export const getApiSiteIdAccountEmailVerify = async (args: GetApiSiteIdAccountEmailVerifyArgs, options?: GetApiSiteIdAccountEmailVerifyOptions) => { const {baseUrl = "https://api.viafoura.co/v2", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.token != null) query.append("token", String(args.token)) const url = `${baseUrl.replace(/\/+$/, '')}/${encodeURIComponent(String(args.site_id))}/account/email_verify${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 };