export type GetApiFundableInvestorArgs = {id?: string | undefined, domain?: string | undefined, linkedin?: string | undefined, crunchbase?: string | undefined}; export type GetApiFundableInvestorOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get investor by id * * GET /fundable/investor */ export const getApiFundableInvestor = async (args: GetApiFundableInvestorArgs, options?: GetApiFundableInvestorOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.id != null) query.append("id", String(args.id)) if (args.domain != null) query.append("domain", String(args.domain)) if (args.linkedin != null) query.append("linkedin", String(args.linkedin)) if (args.crunchbase != null) query.append("crunchbase", String(args.crunchbase)) const url = `${baseUrl.replace(/\/+$/, '')}/fundable/investor${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 };