MCPcopy Create free account
hub / github.com/simstudioai/sim / itemToDocument

Function itemToDocument

apps/sim/connectors/monday/monday.ts:240–255  ·  view source on GitHub ↗

* 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 }
)

Source from the content-addressed store, hash-verified

238 * identical whether produced here or via `getDocument`.
239 */
240function 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

Callers 1

monday.tsFile · 0.70

Calls 5

resolveBoardFunction · 0.85
formatItemContentFunction · 0.85
itemMetadataFunction · 0.85
buildSourceUrlFunction · 0.70
buildContentHashFunction · 0.70

Tested by

no test coverage detected