fleetmap-reports 1.0.858 → 1.0.862

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": "1.0.858",
3
+ "version": "1.0.862",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -374,6 +374,7 @@ function exportLocationReportToExcel (userData, reportData) {
374
374
 
375
375
  if (userData.includeTemperature) {
376
376
  headers.push({ label: translations.report.temperature, value: 'temperature' })
377
+ headers.push({ label: translations.report.temperature2, value: 'temperature2' })
377
378
  }
378
379
 
379
380
  headers.push({ label: 'Latitude', value: 'latitude' })
@@ -299,7 +299,7 @@ async function getCustomSpeedLimitEvents (devices, routes, customSpeed) {
299
299
  return events
300
300
  }
301
301
 
302
- async function getRoadSpeedLimits(devices, routes, threshold, minimumMinutes = 0) {
302
+ async function getRoadSpeedLimits (devices, routes, threshold, minimumMinutes = 0) {
303
303
  const position = routes[0]
304
304
  const country = crg.get_country(position.latitude, position.longitude)
305
305
  const config = {
@@ -309,7 +309,7 @@ async function getRoadSpeedLimits(devices, routes, threshold, minimumMinutes = 0
309
309
  return method(devices, routes, threshold, minimumMinutes)
310
310
  }
311
311
 
312
- async function getOSMSpeedingEvents(devices, routes, threshold, minimumMinutes = 0) {
312
+ async function getOSMSpeedingEvents (devices, routes, threshold, minimumMinutes = 0) {
313
313
  const chunk = 1000
314
314
  const events = []
315
315
  for (const d of devices) {
@@ -321,8 +321,8 @@ async function getOSMSpeedingEvents(devices, routes, threshold, minimumMinutes =
321
321
  const { features } = await axios.post(`https://api.geoapify.com/v1/mapmatching?apiKey=${apiKey}`, {
322
322
  mode: 'drive',
323
323
  waypoints: slice.map(p => ({
324
- timestamp: p.fixTime,
325
- bearing: p.bearing,
324
+ timestamp: new Date(p.fixTime).toISOString(),
325
+ bearing: p.course,
326
326
  location: [p.longitude, p.latitude]
327
327
  }))
328
328
  }).then(r => r.data)
@@ -359,7 +359,7 @@ async function getOSMSpeedingEvents(devices, routes, threshold, minimumMinutes =
359
359
  cur.attributes = { speedLimit: cur.speed_limit, speed: cur.speed, maxSpeed: cur.speed }
360
360
  cur.eventTime = 0
361
361
  cur.distance = 0
362
- cur.position = {...cur}
362
+ cur.position = { ...cur }
363
363
  acc.push(cur)
364
364
  }
365
365
  return acc