INNER CODE UNIT · TypeScript
companySummary
rowboatlabs/rowboat · apps/harbor/packages/server/src/connectors/attio/index.ts:38
function companySummary(company: AttioCompany): string {
const name = current(company.values.name)[0]?.value || 'Unnamed company';
const description = current(company.values.description)[0]?.value;
const domains = current(company.values.domains).slice(0, 5).map((value) => plainText(value.domain, 253));
const lines = [`**${plainText(name, 160)}**`];
if (domains.length) lines.push(`Domains: ${domains.join(', ')}`);
if (description) lines.push(plainText(description, 500));
return [...lines, ...recordFooter(company)].join('\n\n');
}
function personSummary(person: AttioPerson): string {
const name = current(person.values.name)[0];
const displayName = name?.full_name?.trim() || [name?.first_name, name?.last_name].filter(Boolean).join(' ').trim() || 'Unnamed person';
const emails = current(person.values.email_addresses).slice(0, 5).map((value) => plainText(value.email_address, 254));
const title = current(person.values.job_title)[0]?.value;
const lines = [`**${plainText(displayName, 160)}**`];
if (emails.length) lines.push(`Email: ${emails.join(', ')}`);
if (title) lines.push(`Job title: ${plainText(title, 200)}`);