* 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)
| 200 | * fetched later via `getDocument` only for new/changed notes. |
| 201 | */ |
| 202 | function 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 | |
| 221 | export const granolaConnector: ConnectorConfig = { |
| 222 | ...granolaConnectorMeta, |
no test coverage detected