export type GetApiFundableCompanyDealsArgs = {id?: string | undefined, domain?: string | undefined, linkedin?: string | undefined, crunchbase?: string | undefined, page?: number | undefined, page_size?: number | undefined}; export type GetApiFundableCompanyDealsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get entire funding history for a company Pagination: page is 0-based (0, 1, 2, ...). Every page is a separate billable request priced on the results it returns. page_size (1-500) sets the maximum cost of a call. * * GET /fundable/company/deals */ export const getApiFundableCompanyDeals = async (args: GetApiFundableCompanyDealsArgs, options?: GetApiFundableCompanyDealsOptions) => { 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)) if (args.page != null) query.append("page", String(args.page)) if (args.page_size != null) query.append("page_size", String(args.page_size)) const url = `${baseUrl.replace(/\/+$/, '')}/fundable/company/deals${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 };