MCPcopy Index your code
hub / github.com/simstudioai/sim / fetchFileContent

Function fetchFileContent

apps/sim/connectors/sharepoint/sharepoint.ts:160–171  ·  view source on GitHub ↗

* Fetches file content, applying HTML-to-text conversion for .html files.

(
  accessToken: string,
  siteId: string,
  itemId: string,
  fileName: string
)

Source from the content-addressed store, hash-verified

158 * Fetches file content, applying HTML-to-text conversion for .html files.
159 */
160async function fetchFileContent(
161 accessToken: string,
162 siteId: string,
163 itemId: string,
164 fileName: string
165): Promise<string> {
166 const raw = await downloadFileContent(accessToken, siteId, itemId, fileName)
167 if (fileName.toLowerCase().endsWith('.html') || fileName.toLowerCase().endsWith('.htm')) {
168 return htmlToPlainText(raw)
169 }
170 return raw
171}
172
173/**
174 * Converts a DriveItem to a lightweight metadata stub (no content download).

Callers 1

sharepoint.tsFile · 0.70

Calls 2

htmlToPlainTextFunction · 0.90
downloadFileContentFunction · 0.70

Tested by

no test coverage detected