1import { getReqKnex } from '../serverF/dbF/dbCtxF.mts'3export type MfsRootCidEntry = {label: string, cid: string}5export const collectMfsRootCids = async (): Promise<MfsRootCidEntry[]> => {6 const db = getReqKnex()7 try {8 const rows = await db('generic_kvs').where('key', 'like', 'ipfs_mfsroot_%').select('key', 'value')9 return rows.filter((r: any) => r.value).map((r: any) => ({label: r.key, cid: r.value}))10 } catch (err: any) {11 if (err.code === '42P01') return []12 throw err13 }14}