when we create a site we create it according to a model. - how can I recover a model and see these elements (js)? - how can I know the model in which the site is created via (js)? - I deleted some files in my site and the objective is to make the comparison with the source model and copy from the model the missing files.
When a site is created, it is the result of a duplication of a xx model. In my opinion, we should compare with the source model and copy the missing files from the model. what I thought of as a solution and I don't know if it's possible to do it !!
But according to your answer I think of recovering them from the trash but how to do it in JS please?
I am not sure what is the real benefit implement a js to retrieve the deleted files. it would be simple for the user to simply go to their trashcan and restore the deleted file as needed. But it may be a particular use case for you which is fine.
You need to also understand the lifecycle of a node/file/folder etc.
If you still want to use your custom js to restore files, you would have make a lot of customizations to list of files which are deleted and then restore them based on their nodeIds. You might have to implement some sort of UI as well.
Have a look at these rest apis which can be a reference for your customization in order to list deleted files and retrieve them:
"When a site is created, it is the result of a duplication of a xx model. In my opinion, we should compare with the source model and copy the missing files from the model" ----> Seems you are confusing between site and content model with this statement you mentioned above. It is not correct. Content model is created/deployed at repository level. You create/configure, types, aspects, constraints, associations etc. in your content model and when you create sites, you could utilize your custom types aspects etc. to create content/metadata/associations.
I would recommend to go through these docs and understand the site and content model: