export type GetApiAviatoPersonSimpleSearchArgs = {page: number, perPage: number, enrich?: boolean | undefined, fullName?: string | undefined}; export type GetApiAviatoPersonSimpleSearchOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Simplified person search with pre-defined query parameters. Pagination billing: call the first page normally and save billing.requestId from the Orthogonal /v1/run response. For later page, offset, or cursor calls on the same logical search, pass parentRequestId with unchanged non-pagination parameters. Valid continuation calls still get their own request IDs and quoted price, but are charged 0. Changing filters starts a new billable request. * * GET /aviato/person/simple/search */ export const getApiAviatoPersonSimpleSearch = async (args: GetApiAviatoPersonSimpleSearchArgs, options?: GetApiAviatoPersonSimpleSearchOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.page != null) query.append("page", String(args.page)) if (args.perPage != null) query.append("perPage", String(args.perPage)) if (args.enrich != null) query.append("enrich", String(args.enrich)) if (args.fullName != null) query.append("fullName", String(args.fullName)) const url = `${baseUrl.replace(/\/+$/, '')}/aviato/person/simple/search${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 };