fleetmap-reports 1.0.322 → 1.0.326
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/.idea/aws.xml +17 -0
- package/.idea/codeStyles/Project.xml +7 -0
- package/{fleetmap-reports.iml → .idea/fleetmap-reports.iml} +2 -1
- package/.idea/jsLibraryMappings.xml +1 -1
- package/.idea/modules.xml +1 -1
- package/.idea/vcs.xml +1 -1
- package/package.json +1 -1
- package/src/index.test.js +3 -1
- package/src/kms-report.js +5 -0
- package/src/tests/index.js +3 -1
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
package/.idea/aws.xml
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="accountSettings">
|
|
4
|
+
<option name="activeProfile" value="profile:default" />
|
|
5
|
+
<option name="activeRegion" value="us-east-1" />
|
|
6
|
+
<option name="recentlyUsedProfiles">
|
|
7
|
+
<list>
|
|
8
|
+
<option value="profile:default" />
|
|
9
|
+
</list>
|
|
10
|
+
</option>
|
|
11
|
+
<option name="recentlyUsedRegions">
|
|
12
|
+
<list>
|
|
13
|
+
<option value="us-east-1" />
|
|
14
|
+
</list>
|
|
15
|
+
</option>
|
|
16
|
+
</component>
|
|
17
|
+
</project>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="
|
|
2
|
+
<module type="JAVA_MODULE" version="4">
|
|
3
3
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
4
|
<exclude-output />
|
|
5
5
|
<content url="file://$MODULE_DIR$" />
|
|
6
|
+
<orderEntry type="inheritedJdk" />
|
|
6
7
|
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
8
|
</component>
|
|
8
9
|
</module>
|
package/.idea/modules.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<project version="4">
|
|
3
3
|
<component name="ProjectModuleManager">
|
|
4
4
|
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/fleetmap-reports.iml" filepath="$PROJECT_DIR$/.idea/fleetmap-reports.iml" />
|
|
6
6
|
</modules>
|
|
7
7
|
</component>
|
|
8
8
|
</project>
|
package/.idea/vcs.xml
CHANGED
package/package.json
CHANGED
package/src/index.test.js
CHANGED
|
@@ -14,7 +14,9 @@ describe('speedingReport', function() {
|
|
|
14
14
|
const reports = await getReports()
|
|
15
15
|
const userData = await reports.getUserData()
|
|
16
16
|
userData.groupByDay = true
|
|
17
|
-
await reports.kmsReport(new Date(2021, 9), new Date(2021, 10),
|
|
17
|
+
const report = await reports.kmsReport(new Date(2021, 9, 30), new Date(2021, 10),
|
|
18
18
|
userData)
|
|
19
|
+
console.log('report', report)
|
|
20
|
+
console.log(reports.kmsReportToExcel(userData, report[0]))
|
|
19
21
|
})
|
|
20
22
|
})
|
package/src/kms-report.js
CHANGED
|
@@ -411,6 +411,11 @@ function exportKmsReportToExcel(userData, reportData) {
|
|
|
411
411
|
}
|
|
412
412
|
})
|
|
413
413
|
|
|
414
|
+
data = data.concat({
|
|
415
|
+
licenseplate: 'Total',
|
|
416
|
+
distance: data.reduce((prev, curr) => curr.distance ? {distance: (prev.distance || 0) + curr.distance} : prev).distance
|
|
417
|
+
})
|
|
418
|
+
|
|
414
419
|
return {
|
|
415
420
|
headers,
|
|
416
421
|
data,
|
package/src/tests/index.js
CHANGED
|
@@ -14,9 +14,11 @@ const traccarConfig = {
|
|
|
14
14
|
|
|
15
15
|
axiosCookieJarSupport(axios)
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
const getReports = async() => {
|
|
18
18
|
await new SessionApi(traccarConfig, null, axios).sessionPost(process.env.email, process.env.password)
|
|
19
19
|
return new Index(traccarConfig, axios)
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
exports.getReports = getReports
|
|
23
|
+
|
|
22
24
|
|