mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 21:19:01 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			656 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			656 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import anonymizationService from "./services/anonymization.js";
 | 
						|
import sqlInit from "./services/sql_init.js";
 | 
						|
await import("./becca/entity_constructor.js");
 | 
						|
 | 
						|
sqlInit.dbReady.then(async () => {
 | 
						|
    try {
 | 
						|
        console.log("Starting anonymization...");
 | 
						|
 | 
						|
        const resp = await anonymizationService.createAnonymizedCopy("full");
 | 
						|
 | 
						|
        if (resp.success) {
 | 
						|
            console.log(`Anonymized file has been saved to: ${resp.anonymizedFilePath}`);
 | 
						|
 | 
						|
            process.exit(0);
 | 
						|
        } else {
 | 
						|
            console.log("Anonymization failed.");
 | 
						|
        }
 | 
						|
    } catch (e: any) {
 | 
						|
        console.error(e.message, e.stack);
 | 
						|
    }
 | 
						|
 | 
						|
    process.exit(1);
 | 
						|
});
 |