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

Function noteSummaryToStub

apps/sim/connectors/granola/granola.ts:202–219  ·  view source on GitHub ↗

* Builds the deferred stub for a note from list metadata. Content is empty and * fetched later via `getDocument` only for new/changed notes.

(note: GranolaNoteSummary)

Source from the content-addressed store, hash-verified

200 * fetched later via `getDocument` only for new/changed notes.
201 */
202function noteSummaryToStub(note: GranolaNoteSummary): ExternalDocument {
203 return {
204 externalId: note.id,
205 title: note.title?.trim() || 'Untitled Note',
206 content: '',
207 contentDeferred: true,
208 mimeType: 'text/markdown',
209 contentHash: buildContentHash(note.id, note.updated_at),
210 metadata: {
211 title: note.title?.trim() || undefined,
212 owner: ownerDisplay(note.owner),
213 ownerName: note.owner?.name ?? undefined,
214 ownerEmail: note.owner?.email ?? undefined,
215 noteDate: note.created_at,
216 updatedAt: note.updated_at,
217 },
218 }
219}
220
221export const granolaConnector: ConnectorConfig = {
222 ...granolaConnectorMeta,

Callers 1

granola.tsFile · 0.85

Calls 2

ownerDisplayFunction · 0.85
buildContentHashFunction · 0.70

Tested by

no test coverage detected