export type GetApiNynePersonInteractionsArgs = {request_id: string}; export type GetApiNynePersonInteractionsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Poll for interactions results using requestId. * * GET /nyne/person/interactions */ export const getApiNynePersonInteractions = async (args: GetApiNynePersonInteractionsArgs, options?: GetApiNynePersonInteractionsOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.request_id != null) query.append("request_id", String(args.request_id)) const url = `${baseUrl.replace(/\/+$/, '')}/nyne/person/interactions${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 };