2024-07-18 21:35:17 +03:00
|
|
|
import anonymizationService from "./services/anonymization.js";
|
|
|
|
import sqlInit from "./services/sql_init.js";
|
2024-07-18 23:24:36 +03:00
|
|
|
await import("./becca/entity_constructor");
|
2018-10-25 18:03:28 +02:00
|
|
|
|
2020-06-07 10:45:41 +02:00
|
|
|
sqlInit.dbReady.then(async () => {
|
|
|
|
try {
|
|
|
|
console.log("Starting anonymization...");
|
|
|
|
|
2023-01-15 21:04:17 +01:00
|
|
|
const resp = await anonymizationService.createAnonymizedCopy('full');
|
2020-06-07 10:45:41 +02:00
|
|
|
|
|
|
|
if (resp.success) {
|
2022-12-21 15:19:05 +01:00
|
|
|
console.log(`Anonymized file has been saved to: ${resp.anonymizedFilePath}`);
|
2020-06-07 10:45:41 +02:00
|
|
|
|
|
|
|
process.exit(0);
|
|
|
|
} else {
|
|
|
|
console.log("Anonymization failed.");
|
|
|
|
}
|
2020-06-02 23:13:55 +02:00
|
|
|
}
|
2024-04-03 22:51:07 +03:00
|
|
|
catch (e: any) {
|
2020-06-07 10:45:41 +02:00
|
|
|
console.error(e.message, e.stack);
|
2020-06-02 23:13:55 +02:00
|
|
|
}
|
2018-10-25 18:03:28 +02:00
|
|
|
|
2020-06-07 10:45:41 +02:00
|
|
|
process.exit(1);
|
2020-06-02 23:13:55 +02:00
|
|
|
});
|