export type GetApiApiPublicContactAiContactIdInfoArgs = {'x-api-key': string, aiContactId: string, isoDates?: boolean | undefined}; export type GetApiApiPublicContactAiContactIdInfoOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get info of an AI contact * * GET /api/public/contact/{aiContactId}/info */ export const getApiApiPublicContactAiContactIdInfo = async (args: GetApiApiPublicContactAiContactIdInfoArgs, options?: GetApiApiPublicContactAiContactIdInfoOptions) => { const {baseUrl = "https://api.vambe.me", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['x-api-key'] != null) headers.set("x-api-key", String(args['x-api-key'])) if (args.isoDates != null) query.append("isoDates", String(args.isoDates)) const url = `${baseUrl.replace(/\/+$/, '')}/api/public/contact/${encodeURIComponent(String(args.aiContactId))}/info${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 };