INNER CODE UNIT · TypeScript

recordFooter

rowboatlabs/rowboat · apps/harbor/packages/server/src/connectors/attio/index.ts:59

function recordFooter(record: { id: { record_id: string }; web_url?: string }): string[] {
  const lines = [`Record ID: \`${record.id.record_id}\``];
  if (record.web_url) {
    try {
      const url = new URL(record.web_url);
      if (url.origin === 'https://app.attio.com' && !url.username && !url.password && url.href.length <= 2048) {
        const href = url.href.replace(/[<>\[\]`\\]/g, (char) => `%${char.charCodeAt(0).toString(16)}`);
        lines.push(`[Open in Attio](<${href}>)`);
      }
    } catch { /* A missing or invalid external link does not hide the record (spec §8 Attio, 2026-10-12). */ }
  }
  return lines;
}

function lookupReply<T>(records: T[], noun: string, query: string, format: (record: T) => string): string {
  const subject = plainText(query, 254);
  if (!records.length) return `No ${noun} found for **${subject}**.`;
  const heading = records.length === 1 ? '' : records.length > LOOKUP_LIMIT

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…