bot-functions 1.5.0 → 1.5.1
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/index.js +13 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -14,6 +14,7 @@ const _ = require('lodash');
|
|
|
14
14
|
const { simpleParser } = require('mailparser');
|
|
15
15
|
const xpath = require('xpath');
|
|
16
16
|
const { JSDOM } = require('jsdom');
|
|
17
|
+
const { param } = require('../retail-analyzer-models/src/routes');
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
async function obtenerCorreos(email, password, subject) {
|
|
@@ -505,6 +506,16 @@ const insertEvidence4 = async (rutaFile, rutaImg, db, idgfc, periodo, fecha, tip
|
|
|
505
506
|
})
|
|
506
507
|
}
|
|
507
508
|
|
|
509
|
+
// inserEvidence original, para que las evidencias se inserten por ejecucion
|
|
510
|
+
const insertEvidenceCore = async (rutaFile, rutaImg, db, idgfc, periodo, fecha, tipo) => {
|
|
511
|
+
return new Promise(async function (resolve) {
|
|
512
|
+
const strFile = (rutaFile != "") ? "rutaArchivo" : "rutaCaptura";
|
|
513
|
+
const fileInsert = (rutaFile != "") ? rutaFile : rutaImg;
|
|
514
|
+
await axios.post(process.env.INSERT_EVIDENCE_CORE, { db, strFile, tipo, fileInsert, idgfc, periodo, fecha });
|
|
515
|
+
resolve(true);
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
|
|
508
519
|
const insertLog = async (params, codigo) => {
|
|
509
520
|
return new Promise(async function (resolve) {
|
|
510
521
|
try {
|
|
@@ -1147,13 +1158,11 @@ const sendFile4 = async (pathDownloads, params) => {
|
|
|
1147
1158
|
periodo = process.env.PERIODO
|
|
1148
1159
|
fecha = params.reporte.prefix;
|
|
1149
1160
|
//CARGA DE EVIDENCIAS DE BOTS SEMANALES Y MENSUALES
|
|
1150
|
-
|
|
1151
|
-
if(gfcSemanal.includes(params.robot.idgfc)){
|
|
1161
|
+
if(params.robot.base_portal == 'wm'){
|
|
1152
1162
|
periodo = 0;
|
|
1153
1163
|
fecha = params.reporte.interval[params.reporte.interval.length - 1];
|
|
1154
1164
|
}
|
|
1155
|
-
await
|
|
1156
|
-
fecha, params.reporte.type)
|
|
1165
|
+
await insertEvidenceCore(uploadFileResponse.data.data, '', params.robot.baseHyperCube, params.robot.idgfc, periodo, fecha, params.reporte.type)
|
|
1157
1166
|
await insertLog2(params, 305);
|
|
1158
1167
|
resolve();
|
|
1159
1168
|
}
|