Delete definitively file(s) or folder(s)
The secrecyClient.cloud.deleteNodeCloudTrash method permanently deletes files or folders from the cloud trash. It takes an ids array of node ids — pass a single element array to delete only one node — and returns a boolean telling whether the deletion succeeded.
cloud.ts
const deleteDefinitivelyFileOrFolder = async (
nodeIds: string[]
): Promise<boolean> => {
// First we need to check if the secrecyClient is available
if (!secrecyClient) {
return false;
}
try {
const isDeleted = await secrecyClient.cloud.deleteNodeCloudTrash({
ids: nodeIds,
});
return isDeleted;
} catch (error) {
console.error(error);
return false;
}
};The nodes must already be in the trash — see move files and folders to trash. To clear the whole trash at once, use delete all files and folders from the trash instead.