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

Function apiListNotebooks

apps/sim/connectors/evernote/evernote.ts:153–184  ·  view source on GitHub ↗
(
  token: string,
  retryOptions?: Parameters<typeof fetchWithRetry>[2]
)

Source from the content-addressed store, hash-verified

151}
152
153async function apiListNotebooks(
154 token: string,
155 retryOptions?: Parameters<typeof fetchWithRetry>[2]
156): Promise<Notebook[]> {
157 const w = new ThriftWriter()
158 w.writeMessageBegin('listNotebooks', 0)
159 w.writeStringField(1, token)
160 w.writeFieldStop()
161
162 const r = await callNoteStore(token, w, retryOptions)
163 const notebooks: Notebook[] = []
164
165 r.readStruct((r2, fid, ftype) => {
166 if (fid === 0 && ftype === TYPE_LIST) {
167 const { size } = r2.readListBegin()
168 for (let i = 0; i < size; i++) {
169 let guid = ''
170 let name = ''
171 r2.readStruct((r3, fid3, ftype3) => {
172 if (fid3 === 1 && ftype3 === TYPE_STRING) guid = r3.readString()
173 else if (fid3 === 2 && ftype3 === TYPE_STRING) name = r3.readString()
174 else r3.skip(ftype3)
175 })
176 notebooks.push({ guid, name })
177 }
178 } else if (!checkException(r2, fid, ftype)) {
179 r2.skip(ftype)
180 }
181 })
182
183 return notebooks
184}
185
186async function apiListTags(
187 token: string,

Callers 1

evernote.tsFile · 0.85

Calls 10

writeMessageBeginMethod · 0.95
writeStringFieldMethod · 0.95
writeFieldStopMethod · 0.95
checkExceptionFunction · 0.85
readStructMethod · 0.80
readListBeginMethod · 0.80
readStringMethod · 0.80
skipMethod · 0.80
callNoteStoreFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected