Files added in Uppy after adding restrictions

Hello, everyone
Hope you are doing good,

I have been using uppy with basic drag and drop funtionality in my react project. Now, I want to add some restriction of maximum number of files user can add and maximum size of file can be of 3GB.

Till now the process was that first I was hitting my API of media creation in onBeforeFileUpload ( Media creation api is for adding some details in file meta and then take that file to server, create a encrypted media id and then add the details in the DB accordingly).

Now, If some files fails due to restriction they show me in my media list. I tried to remove the media in my restriction-failed event but I am unable to get file.meta.mediaId as the process is async.

I tried using uppy event restriction-passed which I found on some website. I am not sure if that event is included or not as It is neither present in uppy’s documentation nor working when I tried to use it. Also, in OnBeforeFileAdded when I try to get files object which it the parameter passed in onBeforeFIleAdded all I get are the files that pass through the restrictions.

What should I do? Is there any way to get all the files that are just selected and added and have not gone through all other processes?