export type CreateApiNynePersonSearchArgs = {body: {query: string, limit?: number | undefined, offset?: number | undefined, cursor?: string | undefined, request_id?: string | undefined, force_new?: boolean | undefined, type?: string | undefined, show_emails?: boolean | undefined, show_phone_numbers?: boolean | undefined, require_emails?: boolean | undefined, require_phone_numbers?: boolean | undefined, require_phones_or_emails?: boolean | undefined, insights?: boolean | undefined, high_freshness?: boolean | undefined, profile_scoring?: boolean | undefined, callback_url?: string | undefined, custom_filters?: Record | undefined}}; export type CreateApiNynePersonSearchOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Start async person search by company name, role, geography, and person name. Returns requestId for polling. Pagination billing: call the first page normally and save billing.requestId from the Orthogonal /v1/run response. For later offset or cursor pages of the same search, pass parentRequestId with unchanged search parameters. Valid continuation pages still get their own request IDs and quoted price, but are charged 0. Changing filters starts a new billable search. * * POST /nyne/person/search */ export const createApiNynePersonSearch = async (args: CreateApiNynePersonSearchArgs, options?: CreateApiNynePersonSearchOptions) => { 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(/\/+$/, '')}/nyne/person/search${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 };