export type GetApiApiPublicWhatsappContactContactsArgs = {days: number, 'x-api-key': string}; export type GetApiApiPublicWhatsappContactContactsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get contacts * * GET /api/public/whatsapp/contact/contacts */ export const getApiApiPublicWhatsappContactContacts = async (args: GetApiApiPublicWhatsappContactContactsArgs, options?: GetApiApiPublicWhatsappContactContactsOptions) => { const {baseUrl = "https://api.vambe.me", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.days != null) query.append("days", String(args.days)) if (args['x-api-key'] != null) headers.set("x-api-key", String(args['x-api-key'])) const url = `${baseUrl.replace(/\/+$/, '')}/api/public/whatsapp/contact/contacts${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 };