I'm looking to develop a solution which shows all files that has been shared by the user or with the user in Office 365 (through OneDrive, Teams, SharePoint). How do I fetch this info? It should be something like the Audit report of OneDrive but also with files from other sources. The idea is to create a page/ app that shows all these files to the user.
Microsoft 365 auditing log has the records of all sharing events containing the target user and the acting user. For more information, you may have a check on this official doc. It could be a useful data for you to fetch.