export type EnrichContactRequest = {email?: string | undefined, socialURL?: string | undefined, firstName?: string | undefined, lastName?: string | undefined, domain?: string | undefined}; export type CreateApiContactEnrichV1HoldArgs = {version?: string | undefined, body: EnrichContactRequest}; export type CreateApiContactEnrichV1HoldOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Enrich a contact * * POST /contact/enrich/v1-hold */ export const createApiContactEnrichV1Hold = async (args: CreateApiContactEnrichV1HoldArgs, options?: CreateApiContactEnrichV1HoldOptions) => { const {baseUrl = "http://localhost:8080/api", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.version != null) query.append("version", String(args.version)) const url = `${baseUrl.replace(/\/+$/, '')}/contact/enrich/v1-hold${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };