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

Function readNote

apps/sim/app/api/tools/evernote/lib/client.ts:200–279  ·  view source on GitHub ↗
(reader: ThriftReader)

Source from the content-addressed store, hash-verified

198}
199
200function readNote(reader: ThriftReader): EvernoteNote {
201 const note: EvernoteNote = {
202 guid: '',
203 title: '',
204 content: null,
205 contentLength: null,
206 created: null,
207 updated: null,
208 deleted: null,
209 active: true,
210 notebookGuid: null,
211 tagGuids: [],
212 tagNames: [],
213 }
214
215 reader.readStruct((r, fieldId, fieldType) => {
216 switch (fieldId) {
217 case 1:
218 if (fieldType === TYPE_STRING) note.guid = r.readString()
219 else r.skip(fieldType)
220 break
221 case 2:
222 if (fieldType === TYPE_STRING) note.title = r.readString()
223 else r.skip(fieldType)
224 break
225 case 3:
226 if (fieldType === TYPE_STRING) note.content = r.readString()
227 else r.skip(fieldType)
228 break
229 case 5:
230 if (fieldType === TYPE_I32) note.contentLength = r.readI32()
231 else r.skip(fieldType)
232 break
233 case 6:
234 if (fieldType === TYPE_I64) note.created = Number(r.readI64())
235 else r.skip(fieldType)
236 break
237 case 7:
238 if (fieldType === TYPE_I64) note.updated = Number(r.readI64())
239 else r.skip(fieldType)
240 break
241 case 8:
242 if (fieldType === TYPE_I64) note.deleted = Number(r.readI64())
243 else r.skip(fieldType)
244 break
245 case 9:
246 if (fieldType === TYPE_BOOL) note.active = r.readBool()
247 else r.skip(fieldType)
248 break
249 case 11:
250 if (fieldType === TYPE_STRING) note.notebookGuid = r.readString()
251 else r.skip(fieldType)
252 break
253 case 12:
254 if (fieldType === TYPE_LIST) {
255 const { size } = r.readListBegin()
256 for (let i = 0; i < size; i++) {
257 note.tagGuids.push(r.readString())

Callers 4

getNoteFunction · 0.85
createNoteFunction · 0.85
updateNoteFunction · 0.85
copyNoteFunction · 0.85

Calls 8

readStructMethod · 0.80
readStringMethod · 0.80
skipMethod · 0.80
readI32Method · 0.80
readI64Method · 0.80
readBoolMethod · 0.80
readListBeginMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected