export type GetApiTombaV1DomainSearchArgs = {domain?: string | undefined, company?: string | undefined, page?: string | undefined, limit?: string | undefined, country?: string | undefined, department?: string | undefined}; export type GetApiTombaV1DomainSearchOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Search emails based on a website domain. Returns all email addresses found on the internet for a given domain, with organization info and employee details. * * GET /tomba/v1/domain-search */ export const getApiTombaV1DomainSearch = async (args: GetApiTombaV1DomainSearchArgs, options?: GetApiTombaV1DomainSearchOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.domain != null) query.append("domain", String(args.domain)) if (args.company != null) query.append("company", String(args.company)) if (args.page != null) query.append("page", String(args.page)) if (args.limit != null) query.append("limit", String(args.limit)) if (args.country != null) query.append("country", String(args.country)) if (args.department != null) query.append("department", String(args.department)) const url = `${baseUrl.replace(/\/+$/, '')}/tomba/v1/domain-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 };