MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / listDatabases

Function listDatabases

apps/web/src/bridge/http-bridge.ts:901–911  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

899}
900
901async function listDatabases(): Promise<DatabaseSummary[]> {
902 const [folders, atRoot] = await Promise.all([listFolders(), primaryNotesAtRoot()])
903 const out: DatabaseSummary[] = []
904 for (const f of folders) {
905 if (!isFormDirName(f.subpath)) continue
906 // The folder subpath is folder-relative; reconstruct the vault-relative path.
907 const csv = csvPathForFormDir(vaultRelDir(f.folder, f.subpath, atRoot))
908 out.push({ path: csv, title: dbTitleFromPath(csv) })
909 }
910 return out.sort((a, b) => a.title.localeCompare(b.title))
911}
912
913// --------------------------------------------------------------------
914// Demo tour

Callers

nothing calls this directly

Calls 6

isFormDirNameFunction · 0.90
csvPathForFormDirFunction · 0.90
primaryNotesAtRootFunction · 0.85
vaultRelDirFunction · 0.85
dbTitleFromPathFunction · 0.85
listFoldersFunction · 0.70

Tested by

no test coverage detected