Cloud
Delete definitively files and folders

Delete definitively file(s) or folder(s)

The secrecyClient.cloud.deleteNodeCloudTrash permanently deletes one or more files or folders from the cloud trash. It accepts a parameter, nodeIds, which can be either a single nodeId or an array of nodeIds.

cloud.ts
const deleteDefinitivelyFileOrFolder = async (
  nodeIds: string | string[]
): Promise<boolean> => {
  // First we need to check if the secrecyClient is available
  if (!secrecyClient) {
    return false;
  }
 
  // Convert nodeId to an array if it's not already
  nodeIds = Array.isArray(nodeId) ? nodeId : [nodeId];
 
  try {
    const isDeleted = await secrecyClient.cloud.deleteNodeCloudTrash({
      ids: nodeIds,
    });
 
    return isDeleted;
  } catch (error) {
    console.error(error);
    return false;
  }
};