herramientaenvioestupendo 1.0.46 → 1.0.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/README.md CHANGED
@@ -14,7 +14,7 @@ Para instalar el aplicativo CLI, deben realizar el siguiente procedimiento :
14
14
  ```npm i -g herramientaenvioestupendo```
15
15
 
16
16
  - Luego de esto deben validar la version de la herramienta :
17
- ```estupendo --version```, si esta indica que es la 1.0.46 es la correcta.
17
+ ```estupendo --version```, si esta indica que es la 1.0.48 es la correcta.
18
18
 
19
19
  - Para conocer que opciones tienen de comandos solo deben ingresar en su CMD :
20
20
  ```estupendo --help```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "herramientaenvioestupendo",
3
- "version": "1.0.46",
3
+ "version": "1.0.48",
4
4
  "private": false,
5
5
  "description": "Proyecto para envio documentos masivos",
6
6
  "keywords": [],
package/src/index.js CHANGED
@@ -3,7 +3,7 @@ import { program } from "commander"
3
3
  import { sendTxt, sendXml, sendAttached, sendJson, requestDocumentRace } from "./services.js"
4
4
 
5
5
 
6
- program.name("estupendo").version("1.0.46")
6
+ program.name("estupendo").version("1.0.48")
7
7
 
8
8
  program.command("send_xml")
9
9
  .requiredOption("-d, --directory <char>", "Directorio donde se encuentran los documentos XML")
package/src/services.js CHANGED
@@ -341,23 +341,22 @@ const requestDocumentRace = async (options) => {
341
341
  console.log(token)
342
342
  try {
343
343
  const data = await requestGet(urlApiConsulta, {
344
- fechaIni:fechaAnterior,
345
- fechaFin:fechaAnterior,
344
+ fechaIni:"2025-07-01",
345
+ fechaFin:"2025-07-10",
346
346
  nit: identificacion
347
347
  }, token)
348
348
  console.log(data)
349
349
 
350
350
  if (Array.isArray(data)) {
351
351
  for (const item of data) {
352
- const { xml, pdf } = item;
352
+ const { xml, pdf, proveedorNit, numeral } = item;
353
353
 
354
354
  // Obtener nombre base de cada archivo
355
- const xmlName = xml ? path.basename(xml) : null;
356
- const pdfName = pdf ? path.basename(pdf) : null;
355
+ const baseName = `${proveedorNit}_${numeral}`;
357
356
 
358
357
  // Descargar y guardar XML
359
358
  if (xml) {
360
- const xmlPath = path.join(xmlDir, xmlName);
359
+ const xmlPath = path.join(xmlDir, `${baseName}.xml`);
361
360
  try {
362
361
  const response = await axios.get(xml, { responseType: 'arraybuffer' });
363
362
  fs.writeFileSync(xmlPath, response.data);
@@ -369,7 +368,7 @@ const requestDocumentRace = async (options) => {
369
368
 
370
369
  // Descargar y guardar PDF
371
370
  if (pdf) {
372
- const pdfPath = path.join(pdfDir, pdfName);
371
+ const pdfPath = path.join(pdfDir, `${baseName}.pdf`);
373
372
  try {
374
373
  const response = await axios.get(pdf, { responseType: 'arraybuffer' });
375
374
  fs.writeFileSync(pdfPath, response.data);