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

Function fetchRecording

apps/sim/connectors/grain/grain.ts:284–297  ·  view source on GitHub ↗

* Fetches a single recording's metadata from the v2 recordings endpoint. * Returns null on 404 (recording deleted/inaccessible).

(accessToken: string, id: string)

Source from the content-addressed store, hash-verified

282 * Returns null on 404 (recording deleted/inaccessible).
283 */
284async function fetchRecording(accessToken: string, id: string): Promise<GrainRecording | null> {
285 const response = await fetchWithRetry(`${GRAIN_API_BASE}/recordings/${id}`, {
286 method: 'POST',
287 headers: grainHeaders(accessToken),
288 body: JSON.stringify({ include: RECORDING_INCLUDE }),
289 })
290
291 if (!response.ok) {
292 if (response.status === 404) return null
293 throw new Error(`Failed to fetch Grain recording: ${response.status}`)
294 }
295
296 return (await response.json()) as GrainRecording
297}
298
299/**
300 * Fetches the speaker-attributed transcript segments for a recording.

Callers 1

grain.tsFile · 0.85

Calls 2

fetchWithRetryFunction · 0.90
grainHeadersFunction · 0.85

Tested by

no test coverage detected