bot-functions 1.5.0 → 1.5.2

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.
Files changed (2) hide show
  1. package/index.js +12 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -505,6 +505,16 @@ const insertEvidence4 = async (rutaFile, rutaImg, db, idgfc, periodo, fecha, tip
505
505
  })
506
506
  }
507
507
 
508
+ // inserEvidence original, para que las evidencias se inserten por ejecucion
509
+ const insertEvidenceCore = async (rutaFile, rutaImg, db, idgfc, periodo, fecha, tipo) => {
510
+ return new Promise(async function (resolve) {
511
+ const strFile = (rutaFile != "") ? "rutaArchivo" : "rutaCaptura";
512
+ const fileInsert = (rutaFile != "") ? rutaFile : rutaImg;
513
+ await axios.post(process.env.INSERT_EVIDENCE_CORE, { db, strFile, tipo, fileInsert, idgfc, periodo, fecha });
514
+ resolve(true);
515
+ });
516
+ }
517
+
508
518
  const insertLog = async (params, codigo) => {
509
519
  return new Promise(async function (resolve) {
510
520
  try {
@@ -1147,13 +1157,11 @@ const sendFile4 = async (pathDownloads, params) => {
1147
1157
  periodo = process.env.PERIODO
1148
1158
  fecha = params.reporte.prefix;
1149
1159
  //CARGA DE EVIDENCIAS DE BOTS SEMANALES Y MENSUALES
1150
- const gfcSemanal = [82,398,49495,49845,50119,39369,50045,50124,50114,50140,50137,50141,50157,50160,50159,50169,50170,50172,50182,50191,50192,50193,50187,50203];
1151
- if(gfcSemanal.includes(params.robot.idgfc)){
1160
+ if(params.robot.base_portal == 'wm'){
1152
1161
  periodo = 0;
1153
1162
  fecha = params.reporte.interval[params.reporte.interval.length - 1];
1154
1163
  }
1155
- await insertEvidence4(uploadFileResponse.data.data, '', params.robot.baseHyperCube, params.robot.idgfc, periodo,
1156
- fecha, params.reporte.type)
1164
+ await insertEvidenceCore(uploadFileResponse.data.data, '', params.robot.baseHyperCube, params.robot.idgfc, periodo, fecha, params.reporte.type)
1157
1165
  await insertLog2(params, 305);
1158
1166
  resolve();
1159
1167
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bot-functions",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "Bot functions",
5
5
  "main": "index.js",
6
6
  "scripts": {