@gumlet/insights-js-core 1.1.0 → 1.1.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.
@@ -31,5 +31,5 @@ pipelines:
31
31
  - pip
32
32
  script:
33
33
  - pip install awscli
34
- - aws s3 cp ./build/release/ s3://gumlet-cdn/insights/1.1/ --cache-control "public, s-maxage=31536000, max-age=172800" --region us-east-1 --recursive --acl public-read
35
- - curl -X PURGE -H Fastly-Key:$FASTLY_API_TOKEN https://cdn.gumlytics.com/insights/1.1/gumlet-insights.min.js
34
+ - aws s3 cp ./build/release/ s3://gumlet-cdn/insights/1.1.1/ --cache-control "public, s-maxage=31536000, max-age=172800" --region us-east-1 --recursive --acl public-read
35
+ - curl -X PURGE -H Fastly-Key:$FASTLY_API_TOKEN https://cdn.gumlytics.com/insights/1.1.1/gumlet-insights.min.js
@@ -1244,6 +1244,13 @@ class Analytics {
1244
1244
  Object.keys(overrideData).forEach(function(key) {
1245
1245
  sampleData[key] = overrideData[key]
1246
1246
  })
1247
+ if (typeof window !== "undefined" && typeof window.parent !== "undefined" && window.navigator){
1248
+ window.navigator.getBattery().then(battery => {
1249
+ sampleData.battery_level_percentage = battery.level * 100;
1250
+ sampleData.battery_charging = battery.charging;
1251
+ })
1252
+ }
1253
+
1247
1254
  return sampleData;
1248
1255
  }
1249
1256
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gumlet/insights-js-core",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "",
5
5
  "main": "js/core/Analytics.js",
6
6
  "repository": {