@deinossrl/dgp-agent 1.4.46 → 1.4.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/index.mjs +45 -44
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog - DGP Agent
|
|
2
2
|
|
|
3
|
+
## [1.4.48] - 2026-01-12
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- Copia TODAS las DLLs de PostgreSQL (no solo algunas específicas)
|
|
7
|
+
- Resuelve error 0xC0000135 "DLL not found" al ejecutar pg_dump
|
|
8
|
+
- Instalación más robusta con todas las dependencias
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Simplificado proceso de copia de DLLs (copy *.dll en lugar de lista fija)
|
|
12
|
+
- Eliminada carpeta pgsql después de copiar para ahorrar espacio
|
|
13
|
+
|
|
14
|
+
## [1.4.47] - 2026-01-12
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- Usa spawnSync directamente para ejecutar pg_dump (evita escapado de comillas)
|
|
18
|
+
- Elimina problemas con rutas que contienen espacios en Windows
|
|
19
|
+
- Solución definitiva para "comando no reconocido" con usernames que tienen espacios
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- Reemplazado shellAsync por spawnSync con argumentos separados
|
|
23
|
+
- Mejor manejo de errores y output de pg_dump
|
|
24
|
+
|
|
3
25
|
## [1.4.46] - 2026-01-12
|
|
4
26
|
|
|
5
27
|
### Fixed
|
package/index.mjs
CHANGED
|
@@ -1519,32 +1519,25 @@ async function findOrInstallPgDump() {
|
|
|
1519
1519
|
const extractedPgDump = join(BIN_DIR, 'pgsql', 'bin', 'pg_dump.exe');
|
|
1520
1520
|
|
|
1521
1521
|
if (existsSync(extractedPgDump)) {
|
|
1522
|
-
// Copiar pg_dump.exe y DLLs
|
|
1522
|
+
// Copiar pg_dump.exe y TODAS las DLLs al BIN_DIR raíz
|
|
1523
1523
|
const binSrcDir = join(BIN_DIR, 'pgsql', 'bin');
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
'libcrypto-3-x64.dll',
|
|
1531
|
-
'zlib1.dll',
|
|
1532
|
-
];
|
|
1533
|
-
|
|
1534
|
-
for (const file of essentialFiles) {
|
|
1535
|
-
const src = join(binSrcDir, file);
|
|
1536
|
-
const dest = join(BIN_DIR, file);
|
|
1537
|
-
if (existsSync(src)) {
|
|
1538
|
-
execSync(`copy "${src}" "${dest}"`, { shell: 'cmd.exe' });
|
|
1539
|
-
}
|
|
1540
|
-
}
|
|
1524
|
+
|
|
1525
|
+
// Copiar pg_dump.exe
|
|
1526
|
+
execSync(`copy "${extractedPgDump}" "${localPgDump}"`, { shell: 'cmd.exe' });
|
|
1527
|
+
|
|
1528
|
+
// Copiar TODAS las DLLs (no solo algunas específicas)
|
|
1529
|
+
execSync(`copy "${binSrcDir}\\*.dll" "${BIN_DIR}\\"`, { shell: 'cmd.exe' });
|
|
1541
1530
|
|
|
1542
1531
|
// Limpiar archivos temporales
|
|
1543
1532
|
unlinkSync(zipPath);
|
|
1544
|
-
//
|
|
1545
|
-
|
|
1533
|
+
// Eliminar carpeta pgsql para ahorrar espacio
|
|
1534
|
+
try {
|
|
1535
|
+
execSync(`rmdir /s /q "${join(BIN_DIR, 'pgsql')}"`, { shell: 'cmd.exe' });
|
|
1536
|
+
} catch (e) {
|
|
1537
|
+
// Ignorar si falla el borrado
|
|
1538
|
+
}
|
|
1546
1539
|
|
|
1547
|
-
logSuccess('pg_dump instalado correctamente');
|
|
1540
|
+
logSuccess('pg_dump instalado correctamente con todas las dependencias');
|
|
1548
1541
|
resolve(localPgDump);
|
|
1549
1542
|
} else {
|
|
1550
1543
|
reject(new Error('No se pudo extraer pg_dump del archivo'));
|
|
@@ -1571,27 +1564,23 @@ async function findOrInstallPgDump() {
|
|
|
1571
1564
|
|
|
1572
1565
|
if (existsSync(extractedPgDump)) {
|
|
1573
1566
|
const binSrcDir = join(BIN_DIR, 'pgsql', 'bin');
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
'libcrypto-3-x64.dll',
|
|
1581
|
-
'zlib1.dll',
|
|
1582
|
-
];
|
|
1583
|
-
|
|
1584
|
-
for (const file of essentialFiles) {
|
|
1585
|
-
const src = join(binSrcDir, file);
|
|
1586
|
-
const dest = join(BIN_DIR, file);
|
|
1587
|
-
if (existsSync(src)) {
|
|
1588
|
-
execSync(`copy "${src}" "${dest}"`, { shell: 'cmd.exe' });
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1567
|
+
|
|
1568
|
+
// Copiar pg_dump.exe
|
|
1569
|
+
execSync(`copy "${extractedPgDump}" "${localPgDump}"`, { shell: 'cmd.exe' });
|
|
1570
|
+
|
|
1571
|
+
// Copiar TODAS las DLLs
|
|
1572
|
+
execSync(`copy "${binSrcDir}\\*.dll" "${BIN_DIR}\\"`, { shell: 'cmd.exe' });
|
|
1591
1573
|
|
|
1592
1574
|
unlinkSync(zipPath);
|
|
1593
1575
|
|
|
1594
|
-
|
|
1576
|
+
// Eliminar carpeta pgsql
|
|
1577
|
+
try {
|
|
1578
|
+
execSync(`rmdir /s /q "${join(BIN_DIR, 'pgsql')}"`, { shell: 'cmd.exe' });
|
|
1579
|
+
} catch (e) {
|
|
1580
|
+
// Ignorar
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
logSuccess('pg_dump instalado correctamente con todas las dependencias');
|
|
1595
1584
|
resolve(localPgDump);
|
|
1596
1585
|
} else {
|
|
1597
1586
|
reject(new Error('No se pudo extraer pg_dump del archivo'));
|
|
@@ -1738,15 +1727,27 @@ async function executePgDump(command) {
|
|
|
1738
1727
|
});
|
|
1739
1728
|
}
|
|
1740
1729
|
|
|
1741
|
-
// Archivo de salida
|
|
1742
|
-
pgDumpArgs.push(`--file
|
|
1730
|
+
// Archivo de salida
|
|
1731
|
+
pgDumpArgs.push(`--file=${localFilePath}`);
|
|
1743
1732
|
|
|
1744
|
-
// Ejecutar pg_dump (
|
|
1745
|
-
const fullCommand = `"${pgDumpCmd}" ${pgDumpArgs.join(' ')}`;
|
|
1733
|
+
// Ejecutar pg_dump usando spawnSync directamente (evita problemas con espacios en rutas)
|
|
1746
1734
|
logCommand(`Ejecutando: pg_dump [conexión oculta]`);
|
|
1747
1735
|
await addCommandLog('command', 'Ejecutando pg_dump...');
|
|
1748
1736
|
|
|
1749
|
-
|
|
1737
|
+
const result = spawnSync(pgDumpCmd, pgDumpArgs, {
|
|
1738
|
+
env: process.env,
|
|
1739
|
+
encoding: 'utf-8',
|
|
1740
|
+
stdio: 'pipe',
|
|
1741
|
+
});
|
|
1742
|
+
|
|
1743
|
+
if (result.error) {
|
|
1744
|
+
throw new Error(`Error ejecutando pg_dump: ${result.error.message}`);
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
if (result.status !== 0) {
|
|
1748
|
+
const errorMsg = result.stderr || result.stdout || 'Unknown error';
|
|
1749
|
+
throw new Error(`pg_dump failed with code ${result.status}: ${errorMsg}`);
|
|
1750
|
+
}
|
|
1750
1751
|
|
|
1751
1752
|
// Verificar que el archivo se creó
|
|
1752
1753
|
if (!existsSync(localFilePath)) {
|