export type GetApiCaptaindataPeopleFindArgs = {full_name: string, company_name?: string | undefined}; export type GetApiCaptaindataPeopleFindOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Find people by name and optionally company name. Returns matching profiles. * * GET /captaindata/people/find */ export const getApiCaptaindataPeopleFind = async (args: GetApiCaptaindataPeopleFindArgs, options?: GetApiCaptaindataPeopleFindOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.full_name != null) query.append("full_name", String(args.full_name)) if (args.company_name != null) query.append("company_name", String(args.company_name)) const url = `${baseUrl.replace(/\/+$/, '')}/captaindata/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 };