feat: Enhance CSV cleaning service with new endpoints for CSV analysis and preview functionality. Introduce support for job management linked to extraction batches, and update the cleaning rules structure. Add new utility functions for handling CSV data and improve documentation for clarity on usage and available endpoints.

This commit is contained in:
erik
2026-07-11 00:27:05 -05:00
parent cf0ebc72ba
commit b770761832
73 changed files with 7614 additions and 2671 deletions
+37
View File
@@ -2,10 +2,15 @@ const { app, BrowserWindow, dialog, ipcMain } = require("electron");
const fs = require("node:fs/promises");
const path = require("node:path");
const { indexFolder } = require("./folderIndex.cjs");
const autoUpdate = require("./autoUpdate.cjs");
const { version: appVersion } = require("../package.json");
const DOCUMENT_EXTENSIONS = new Set([".pdf", ".tif", ".tiff", ".png", ".jpg", ".jpeg"]);
const APP_ICON = path.join(__dirname, "icon.png");
/** @type {BrowserWindow | null} */
let mainWindow = null;
function createWindow() {
const win = new BrowserWindow({
@@ -14,6 +19,7 @@ function createWindow() {
minWidth: 1080,
minHeight: 720,
title: `IPSExtractor Desktop v${appVersion}`,
icon: APP_ICON,
backgroundColor: "#f6f7f9",
webPreferences: {
preload: path.join(__dirname, "preload.cjs"),
@@ -21,6 +27,10 @@ function createWindow() {
nodeIntegration: false,
},
});
mainWindow = win;
win.on("closed", () => {
if (mainWindow === win) mainWindow = null;
});
if (!app.isPackaged) {
win.loadURL("http://127.0.0.1:5173");
@@ -30,7 +40,34 @@ function createWindow() {
}
}
function sendUpdateProgress(payload) {
if (mainWindow && !mainWindow.isDestroyed()) {
mainWindow.webContents.send("updater:progress", payload);
}
}
ipcMain.handle("updater:check", async () => {
if (!app.isPackaged) {
return {
updateAvailable: false,
currentVersion: appVersion,
error: "Auto-update desactivado en desarrollo",
};
}
return autoUpdate.checkForUpdates();
});
ipcMain.handle("updater:install", async (_event, manifest) => {
if (!app.isPackaged) {
throw new Error("Auto-update solo disponible en la app instalada");
}
return autoUpdate.downloadAndInstall(manifest, sendUpdateProgress);
});
app.whenReady().then(() => {
if (process.platform === "win32") {
app.setAppUserModelId("com.ipsextractor.desktop");
}
createWindow();
app.on("activate", () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow();