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

Function fetchFileContent

apps/sim/connectors/onedrive/onedrive.ts:95–108  ·  view source on GitHub ↗

* Fetches file content, converting HTML to plain text when applicable.

(
  accessToken: string,
  fileId: string,
  fileName: string
)

Source from the content-addressed store, hash-verified

93 * Fetches file content, converting HTML to plain text when applicable.
94 */
95async function fetchFileContent(
96 accessToken: string,
97 fileId: string,
98 fileName: string
99): Promise<string> {
100 const ext = fileName.slice(fileName.lastIndexOf('.')).toLowerCase()
101 const raw = await downloadFileContent(accessToken, fileId)
102
103 if (ext === '.html' || ext === '.htm') {
104 return htmlToPlainText(raw)
105 }
106
107 return raw
108}
109
110/**
111 * Converts a OneDrive item to a lightweight metadata stub (no content).

Callers 1

onedrive.tsFile · 0.70

Calls 2

htmlToPlainTextFunction · 0.90
downloadFileContentFunction · 0.70

Tested by

no test coverage detected