I can recursively run
ipfs ls but wonder if there is a ready-to-use API for it?
Another way I can think of is to list all hashes first with
ipfs refs -r and filter out directories later. However refs command only lists cids, no file type. I tried to figure out how to tell if a hash is file or directory but didn’t find any easy ways. There is a post here Way to identify if a hash is a directory or a file but the solution looks too hacky and I’m not sure if it’s still working or not.