export type GetApiAccountsAccountIdFeedArgs = {account_id: number, before?: string | undefined, after?: string | undefined, limit?: number | undefined, types?: (Array<'email' | 'message' | 'meeting-live' | 'meeting-phone' | 'forward' | 'webpage' | 'user_added' | 'user_removed' | 'account_created'>) | undefined, contacts?: Array | undefined}; export type GetApiAccountsAccountIdFeedOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get an account's feed * * GET /accounts/{account_id}/feed */ export const getApiAccountsAccountIdFeed = async (args: GetApiAccountsAccountIdFeedArgs, options?: GetApiAccountsAccountIdFeedOptions) => { const {baseUrl = "https://api.salesflare.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.before != null) query.append("before", String(args.before)) if (args.after != null) query.append("after", String(args.after)) if (args.limit != null) query.append("limit", String(args.limit)) for (const item of args.types ?? []) query.append("types", String(item)) for (const item of args.contacts ?? []) query.append("contacts", String(item)) const url = `${baseUrl.replace(/\/+$/, '')}/accounts/${encodeURIComponent(String(args.account_id))}/feed${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 res.blob() };