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

Function copyNote

apps/sim/app/api/tools/evernote/lib/client.ts:769–799  ·  view source on GitHub ↗
(
  token: string,
  noteGuid: string,
  toNotebookGuid: string
)

Source from the content-addressed store, hash-verified

767}
768
769export async function copyNote(
770 token: string,
771 noteGuid: string,
772 toNotebookGuid: string
773): Promise<EvernoteNote> {
774 const writer = new ThriftWriter()
775 writer.writeMessageBegin('copyNote', 0)
776 writer.writeStringField(1, token)
777 writer.writeStringField(2, noteGuid)
778 writer.writeStringField(3, toNotebookGuid)
779 writer.writeFieldStop()
780
781 const reader = await callNoteStore(token, writer)
782 let note: EvernoteNote | null = null
783
784 reader.readStruct((r, fieldId, fieldType) => {
785 if (fieldId === 0 && fieldType === TYPE_STRUCT) {
786 note = readNote(r)
787 } else {
788 if (!checkEvernoteException(r, fieldId, fieldType)) {
789 r.skip(fieldType)
790 }
791 }
792 })
793
794 if (!note) {
795 throw new Error('No note returned from Evernote API')
796 }
797
798 return note
799}

Callers 1

route.tsFile · 0.90

Calls 8

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

Tested by

no test coverage detected