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.
- package/index.js +12 -4
- 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
|
-
|
|
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
|
|
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
|
}
|