radar-sdk-js 4.1.12 → 4.1.13
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 +7 -7
- package/dist/radar.js +9 -3
- package/dist/radar.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/api/track.ts +8 -0
- package/src/version.ts +1 -1
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.
|
|
59
|
+
<script src="https://js.radar.com/v4.1.13/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.
|
|
77
|
-
<script src="https://js.radar.com/v4.1.
|
|
76
|
+
<link href="https://js.radar.com/v4.1.13/radar.css" rel="stylesheet">
|
|
77
|
+
<script src="https://js.radar.com/v4.1.13/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.
|
|
102
|
-
<script src="https://js.radar.com/v4.1.
|
|
101
|
+
<link href="https://js.radar.com/v4.1.13/radar.css" rel="stylesheet">
|
|
102
|
+
<script src="https://js.radar.com/v4.1.13/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.
|
|
134
|
-
<script src="https://js.radar.com/v4.1.
|
|
133
|
+
<link href="https://js.radar.com/v4.1.13/radar.css" rel="stylesheet">
|
|
134
|
+
<script src="https://js.radar.com/v4.1.13/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.
|
|
568
|
+
var SDK_VERSION = '4.1.13';
|
|
569
569
|
|
|
570
570
|
var Http = /** @class */ (function () {
|
|
571
571
|
function Http() {
|
|
@@ -1474,7 +1474,7 @@ var TrackAPI = /** @class */ (function () {
|
|
|
1474
1474
|
}
|
|
1475
1475
|
TrackAPI.trackOnce = function (params) {
|
|
1476
1476
|
return __awaiter(this, void 0, void 0, function () {
|
|
1477
|
-
var options, latitude, longitude, accuracy, desiredAccuracy, deviceLocation, locationAuthorization, err_1, userId, deviceId, installId, sessionId, deviceType, description, metadata, tripOptions, body, response, user, events, location, trackRes;
|
|
1477
|
+
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;
|
|
1478
1478
|
return __generator(this, function (_a) {
|
|
1479
1479
|
switch (_a.label) {
|
|
1480
1480
|
case 0:
|
|
@@ -1505,6 +1505,12 @@ var TrackAPI = /** @class */ (function () {
|
|
|
1505
1505
|
sessionId = Session.getSessionId();
|
|
1506
1506
|
deviceType = params.deviceType || 'Web';
|
|
1507
1507
|
description = params.description || Storage.getItem(Storage.DESCRIPTION);
|
|
1508
|
+
try {
|
|
1509
|
+
timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
1510
|
+
}
|
|
1511
|
+
catch (err) {
|
|
1512
|
+
Logger.warn("Error getting time zone: ".concat(err.message));
|
|
1513
|
+
}
|
|
1508
1514
|
// save userId for trip tracking
|
|
1509
1515
|
if (!userId) {
|
|
1510
1516
|
Logger.warn('userId not provided for trackOnce.');
|
|
@@ -1517,7 +1523,7 @@ var TrackAPI = /** @class */ (function () {
|
|
|
1517
1523
|
if (tripOptions) {
|
|
1518
1524
|
tripOptions.version = '2';
|
|
1519
1525
|
}
|
|
1520
|
-
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 });
|
|
1526
|
+
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 });
|
|
1521
1527
|
return [4 /*yield*/, Http.request({
|
|
1522
1528
|
method: 'POST',
|
|
1523
1529
|
path: 'track',
|
package/dist/radar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radar.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"radar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "4.1.
|
|
1
|
+
declare const _default: "4.1.13";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED
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.
|
|
1
|
+
export default '4.1.13';
|