export type GetApiTombaV1PeopleFindArgs = {email: string}; export type GetApiTombaV1PeopleFindOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get person information from an email address. * * GET /tomba/v1/people/find */ export const getApiTombaV1PeopleFind = async (args: GetApiTombaV1PeopleFindArgs, options?: GetApiTombaV1PeopleFindOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.email != null) query.append("email", String(args.email)) const url = `${baseUrl.replace(/\/+$/, '')}/tomba/v1/people/find${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 };