* Produces a fully-hydrated document from a single `items_page` element. The list * query already selects the complete item payload (`column_values` + `updates`), * so content is built inline here — avoiding a redundant per-item `getDocument` * round-trip. `contentHash` derives solely from id + `
(
item: MondayItem,
fallbackBoard?: { id: string; name: string | null }
)
| 238 | * identical whether produced here or via `getDocument`. |
| 239 | */ |
| 240 | function itemToDocument( |
| 241 | item: MondayItem, |
| 242 | fallbackBoard?: { id: string; name: string | null } |
| 243 | ): ExternalDocument { |
| 244 | const board = resolveBoard(item, fallbackBoard) |
| 245 | return { |
| 246 | externalId: item.id, |
| 247 | title: item.name?.trim() || 'Untitled Item', |
| 248 | content: formatItemContent(item, board), |
| 249 | contentDeferred: false, |
| 250 | mimeType: 'text/plain', |
| 251 | sourceUrl: buildSourceUrl(item), |
| 252 | contentHash: buildContentHash(item.id, item.updated_at), |
| 253 | metadata: itemMetadata(item, board), |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | /** |
| 258 | * Formats an item's column values and updates into a plain-text document. The |
no test coverage detected