radar-sdk-js 4.1.14 → 4.1.15

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/README.md CHANGED
@@ -56,7 +56,7 @@ Radar.initialize('prj_test_pk_...', { /* options */ });
56
56
 
57
57
  Add the following script in your `html` file
58
58
  ```html
59
- <script src="https://js.radar.com/v4.1.14/radar.min.js"></script>
59
+ <script src="https://js.radar.com/v4.1.15/radar.min.js"></script>
60
60
  ```
61
61
 
62
62
  Then initialize the Radar SDK
@@ -73,8 +73,8 @@ To create a map, first initialize the Radar SDK with your publishable key. Then
73
73
  ```html
74
74
  <html>
75
75
  <head>
76
- <link href="https://js.radar.com/v4.1.14/radar.css" rel="stylesheet">
77
- <script src="https://js.radar.com/v4.1.14/radar.min.js"></script>
76
+ <link href="https://js.radar.com/v4.1.15/radar.css" rel="stylesheet">
77
+ <script src="https://js.radar.com/v4.1.15/radar.min.js"></script>
78
78
  </head>
79
79
 
80
80
  <body>
@@ -98,8 +98,8 @@ To create an autocomplete input, first initialize the Radar SDK with your publis
98
98
  ```html
99
99
  <html>
100
100
  <head>
101
- <link href="https://js.radar.com/v4.1.14/radar.css" rel="stylesheet">
102
- <script src="https://js.radar.com/v4.1.14/radar.min.js"></script>
101
+ <link href="https://js.radar.com/v4.1.15/radar.css" rel="stylesheet">
102
+ <script src="https://js.radar.com/v4.1.15/radar.min.js"></script>
103
103
  </head>
104
104
 
105
105
  <body>
@@ -130,8 +130,8 @@ To power [geofencing](https://radar.com/documentation/geofencing/overview) exper
130
130
  ```html
131
131
  <html>
132
132
  <head>
133
- <link href="https://js.radar.com/v4.1.14/radar.css" rel="stylesheet">
134
- <script src="https://js.radar.com/v4.1.14/radar.min.js"></script>
133
+ <link href="https://js.radar.com/v4.1.15/radar.css" rel="stylesheet">
134
+ <script src="https://js.radar.com/v4.1.15/radar.min.js"></script>
135
135
  </head>
136
136
 
137
137
  <body>
package/dist/radar.js CHANGED
@@ -565,7 +565,7 @@ var Navigator = /** @class */ (function () {
565
565
  return Navigator;
566
566
  }());
567
567
 
568
- var SDK_VERSION = '4.1.14';
568
+ var SDK_VERSION = '4.1.15';
569
569
 
570
570
  var Http = /** @class */ (function () {
571
571
  function Http() {
@@ -1475,7 +1475,7 @@ var TrackAPI = /** @class */ (function () {
1475
1475
  }
1476
1476
  TrackAPI.trackOnce = function (params) {
1477
1477
  return __awaiter(this, void 0, void 0, function () {
1478
- var options, latitude, longitude, accuracy, desiredAccuracy, deviceLocation, locationAuthorization, err_1, userId, deviceId, installId, sessionId, deviceType, description, metadata, tripOptions, body, response, user, events, location, trackRes;
1478
+ var options, latitude, longitude, accuracy, desiredAccuracy, deviceLocation, locationAuthorization, err_1, userId, deviceId, installId, sessionId, deviceType, description, timeZone, metadata, tripOptions, body, response, user, events, location, trackRes;
1479
1479
  return __generator(this, function (_a) {
1480
1480
  switch (_a.label) {
1481
1481
  case 0:
@@ -1506,6 +1506,12 @@ var TrackAPI = /** @class */ (function () {
1506
1506
  sessionId = Session.getSessionId();
1507
1507
  deviceType = params.deviceType || 'Web';
1508
1508
  description = params.description || Storage.getItem(Storage.DESCRIPTION);
1509
+ try {
1510
+ timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
1511
+ }
1512
+ catch (err) {
1513
+ Logger.warn("Error getting time zone: ".concat(err.message));
1514
+ }
1509
1515
  // save userId for trip tracking
1510
1516
  if (!userId) {
1511
1517
  Logger.warn('userId not provided for trackOnce.');
@@ -1518,7 +1524,7 @@ var TrackAPI = /** @class */ (function () {
1518
1524
  if (tripOptions) {
1519
1525
  tripOptions.version = '2';
1520
1526
  }
1521
- body = __assign(__assign({}, params), { locationAuthorization: locationAuthorization, accuracy: accuracy, description: description, deviceId: deviceId, deviceType: deviceType, foreground: true, installId: installId, sessionId: sessionId, latitude: latitude, longitude: longitude, metadata: metadata, sdkVersion: SDK_VERSION, stopped: true, userId: userId, tripOptions: tripOptions });
1527
+ body = __assign(__assign({}, params), { locationAuthorization: locationAuthorization, accuracy: accuracy, description: description, deviceId: deviceId, deviceType: deviceType, foreground: true, installId: installId, sessionId: sessionId, latitude: latitude, longitude: longitude, metadata: metadata, sdkVersion: SDK_VERSION, stopped: true, userId: userId, tripOptions: tripOptions, timeZone: timeZone });
1522
1528
  return [4 /*yield*/, Http.request({
1523
1529
  method: 'POST',
1524
1530
  path: 'track',
package/dist/radar.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"radar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
@@ -1,2 +1,2 @@
1
- declare const _default: "4.1.14";
1
+ declare const _default: "4.1.15";
2
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "radar-sdk-js",
3
- "version": "4.1.14",
3
+ "version": "4.1.15",
4
4
  "description": "Web Javascript SDK for Radar, location infrastructure for mobile and web apps.",
5
5
  "homepage": "https://radar.com",
6
6
  "type": "module",
package/src/api/track.ts CHANGED
@@ -42,6 +42,13 @@ class TrackAPI {
42
42
  const deviceType = params.deviceType || 'Web';
43
43
  const description = params.description || Storage.getItem(Storage.DESCRIPTION);
44
44
 
45
+ let timeZone;
46
+ try {
47
+ timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
48
+ } catch (err: any) {
49
+ Logger.warn(`Error getting time zone: ${err.message}`);
50
+ }
51
+
45
52
  // save userId for trip tracking
46
53
  if (!userId) {
47
54
  Logger.warn('userId not provided for trackOnce.');
@@ -75,6 +82,7 @@ class TrackAPI {
75
82
  stopped: true,
76
83
  userId,
77
84
  tripOptions,
85
+ timeZone,
78
86
  };
79
87
 
80
88
  const response: any = await Http.request({
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export default '4.1.14';
1
+ export default '4.1.15';