export type CreateApiFundableCompaniesArgs = {body: {identifiers?: Record | undefined, company?: Record | undefined, latest_deal?: Record | undefined, investors?: Record | undefined, page?: number | undefined, page_size?: number | undefined, sort_by?: string | undefined}}; export type CreateApiFundableCompaniesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Search for companies using filters, includes latest funding round 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. * * POST /fundable/companies */ export const createApiFundableCompanies = async (args: CreateApiFundableCompaniesArgs, options?: CreateApiFundableCompaniesOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/fundable/companies${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };