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

Function getNotebook

apps/sim/app/api/tools/evernote/lib/client.ts:641–666  ·  view source on GitHub ↗
(token: string, guid: string)

Source from the content-addressed store, hash-verified

639}
640
641export async function getNotebook(token: string, guid: string): Promise<EvernoteNotebook> {
642 const writer = new ThriftWriter()
643 writer.writeMessageBegin('getNotebook', 0)
644 writer.writeStringField(1, token)
645 writer.writeStringField(2, guid)
646 writer.writeFieldStop()
647
648 const reader = await callNoteStore(token, writer)
649 let notebook: EvernoteNotebook | null = null
650
651 reader.readStruct((r, fieldId, fieldType) => {
652 if (fieldId === 0 && fieldType === TYPE_STRUCT) {
653 notebook = readNotebook(r)
654 } else {
655 if (!checkEvernoteException(r, fieldId, fieldType)) {
656 r.skip(fieldType)
657 }
658 }
659 })
660
661 if (!notebook) {
662 throw new Error('No notebook returned from Evernote API')
663 }
664
665 return notebook
666}
667
668export async function createNotebook(
669 token: string,

Callers 1

route.tsFile · 0.90

Calls 8

writeMessageBeginMethod · 0.95
writeStringFieldMethod · 0.95
writeFieldStopMethod · 0.95
readNotebookFunction · 0.85
checkEvernoteExceptionFunction · 0.85
readStructMethod · 0.80
skipMethod · 0.80
callNoteStoreFunction · 0.70

Tested by

no test coverage detected