fleetmap-reports 2.0.8 → 2.0.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "2.0.8",
3
+ "version": "2.0.12",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -14,14 +14,14 @@
14
14
  "@turf/distance": "^6.5.0",
15
15
  "@turf/helpers": "^6.5.0",
16
16
  "@turf/point-to-line-distance": "^6.5.0",
17
- "axios": "1.6.7",
17
+ "axios": "1.6.6",
18
18
  "country-reverse-geocoding": "^0.2.2",
19
19
  "docx": "^7.3.0",
20
20
  "file-saver": "^2.0.5",
21
21
  "fleetmap-partners": "^1.0.160",
22
22
  "json-as-xlsx": "2.5.6",
23
23
  "jspdf": "^2.5.1",
24
- "jspdf-autotable": "3.6.0",
24
+ "jspdf-autotable": "3.8.1",
25
25
  "moment": "2.30.1",
26
26
  "traccar-api": "^1.0.5",
27
27
  "wkt": "^0.1.1"
@@ -16,7 +16,6 @@ const { isInsideTimetable, isPartialInsideTimetable, calculateTrip, getDataByDay
16
16
  const { devicesToProcess } = require('./util/device')
17
17
  const { getDriverData } = require('./util/driver')
18
18
  const { calculateConsumption } = require('./util/fuel')
19
- const axios = require('axios')
20
19
  const { getSummaryByDay } = require('./util/traccar')
21
20
 
22
21
  const fileName = 'ActivityReport'
@@ -76,7 +75,7 @@ async function createActivityReportByGroup (from, to, userData, traccarInstance)
76
75
  return reportData
77
76
  }
78
77
 
79
- async function executeServerSide (allData, sliced, from, to, userData, totalDevices) {
78
+ async function executeServerSide (allData, sliced, from, to, userData, totalDevices, {axios}) {
80
79
  let deviceCount = 0
81
80
  for (const devices of sliced) {
82
81
  const url = `https://${process.env.SERVER_HOST}/reports/activity-report`
@@ -100,7 +99,7 @@ async function createActivityReportByDevice (from, to, userData, traccarInstance
100
99
 
101
100
  if (isClientSide() && allDevices.length > 20) {
102
101
  const sliced = automaticReports.sliceArray(allDevices, 10)
103
- await executeServerSide(allData, sliced, from, to, userData, allDevices.length)
102
+ await executeServerSide(allData, sliced, from, to, userData, allDevices.length, traccarInstance)
104
103
  } else {
105
104
  let summaryByDay = []
106
105
  if (userData.allWeek && userData.groupByDay) {