From 1e0619b4caeeb5418c6d81ce9ad91579d897a7a9 Mon Sep 17 00:00:00 2001 From: Nick Patrick Date: Fri, 10 May 2024 17:09:58 -0400 Subject: [PATCH 1/3] fix return, bump version --- README.md | 14 ++++++------- package-lock.json | 2 +- package.json | 2 +- src/api/track.ts | 52 +++++++++++++++++++++++------------------------ src/version.ts | 2 +- 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 2b2757ea..cdde567d 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Radar.initialize('prj_test_pk_...', { /* options */ }); Add the following script in your `html` file ```html - + ``` Then initialize the Radar SDK @@ -73,8 +73,8 @@ To create a map, first initialize the Radar SDK with your publishable key. Then ```html - - + + @@ -98,8 +98,8 @@ To create an autocomplete input, first initialize the Radar SDK with your publis ```html - - + + @@ -130,8 +130,8 @@ To power [geofencing](https://radar.com/documentation/geofencing/overview) exper ```html - - + + diff --git a/package-lock.json b/package-lock.json index 90a1df79..d7865f5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "radar-sdk-js", - "version": "4.2.0", + "version": "4.2.1", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 21813e9c..71454c9a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "radar-sdk-js", - "version": "4.2.0", + "version": "4.2.1", "description": "Web Javascript SDK for Radar, location infrastructure for mobile and web apps.", "homepage": "https://radar.com", "type": "module", diff --git a/src/api/track.ts b/src/api/track.ts index 083800dd..c80cfb18 100644 --- a/src/api/track.ts +++ b/src/api/track.ts @@ -137,14 +137,14 @@ class TrackAPI { }), }; - const token = await signJWT(payload, dk); + const reqToken = await signJWT(payload, dk); response = await Http.request({ host, method: 'POST', path: 'track', data: { - token, + token: reqToken, }, headers: { 'X-Radar-Body-Is-Token': 'true', @@ -160,33 +160,33 @@ class TrackAPI { sclVal, cslVal, }; + } - let { user, events, token, expiresAt } = response; - const location = { latitude, longitude, accuracy }; - let passed; - let expiresIn; - if (expiresAt) { - expiresAt = new Date(expiresAt); - passed = user?.fraud?.passed && user?.country?.passed && user?.state?.passed; - expiresIn = (expiresAt.getTime() - Date.now()) / 1000; - } - - const trackRes = { - user, - events, - location, - token, - expiresAt, - expiresIn, - passed, - } as RadarTrackVerifiedResponse; - - if (options.debug) { - trackRes.response = response; - } + let { user, events, token, expiresAt } = response; + const location = { latitude, longitude, accuracy }; + let passed; + let expiresIn; + if (expiresAt) { + expiresAt = new Date(expiresAt); + passed = user?.fraud?.passed && user?.country?.passed && user?.state?.passed; + expiresIn = (expiresAt.getTime() - Date.now()) / 1000; + } - return trackRes; + const trackRes = { + user, + events, + location, + token, + expiresAt, + expiresIn, + passed, + } as RadarTrackVerifiedResponse; + + if (options.debug) { + trackRes.response = response; } + + return trackRes; } response = await Http.request({ diff --git a/src/version.ts b/src/version.ts index 5897a092..7f14bcdc 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export default '4.2.0'; +export default '4.2.1'; From 140aa60ab909b04084dba180c6eba33162a45df9 Mon Sep 17 00:00:00 2001 From: Nick Patrick Date: Fri, 10 May 2024 17:17:42 -0400 Subject: [PATCH 2/3] 4.2.1-beta.2 --- README.md | 14 +++++++------- package-lock.json | 2 +- package.json | 2 +- src/version.ts | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index cdde567d..bdfd7858 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Radar.initialize('prj_test_pk_...', { /* options */ }); Add the following script in your `html` file ```html - + ``` Then initialize the Radar SDK @@ -73,8 +73,8 @@ To create a map, first initialize the Radar SDK with your publishable key. Then ```html - - + + @@ -98,8 +98,8 @@ To create an autocomplete input, first initialize the Radar SDK with your publis ```html - - + + @@ -130,8 +130,8 @@ To power [geofencing](https://radar.com/documentation/geofencing/overview) exper ```html - - + + diff --git a/package-lock.json b/package-lock.json index d7865f5b..1adf22d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "radar-sdk-js", - "version": "4.2.1", + "version": "4.2.1-beta.2", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 71454c9a..bed2249e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "radar-sdk-js", - "version": "4.2.1", + "version": "4.2.1-beta.2", "description": "Web Javascript SDK for Radar, location infrastructure for mobile and web apps.", "homepage": "https://radar.com", "type": "module", diff --git a/src/version.ts b/src/version.ts index 7f14bcdc..bd2b3b84 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export default '4.2.1'; +export default '4.2.1-beta.2'; From 985842f58c8427f02795c03111bcb739e3e82ff7 Mon Sep 17 00:00:00 2001 From: Nick Patrick Date: Mon, 13 May 2024 08:48:20 -0400 Subject: [PATCH 3/3] bump version --- README.md | 14 +++++++------- package-lock.json | 2 +- package.json | 2 +- src/version.ts | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index bdfd7858..cdde567d 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Radar.initialize('prj_test_pk_...', { /* options */ }); Add the following script in your `html` file ```html - + ``` Then initialize the Radar SDK @@ -73,8 +73,8 @@ To create a map, first initialize the Radar SDK with your publishable key. Then ```html - - + + @@ -98,8 +98,8 @@ To create an autocomplete input, first initialize the Radar SDK with your publis ```html - - + + @@ -130,8 +130,8 @@ To power [geofencing](https://radar.com/documentation/geofencing/overview) exper ```html - - + + diff --git a/package-lock.json b/package-lock.json index 1adf22d1..d7865f5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "radar-sdk-js", - "version": "4.2.1-beta.2", + "version": "4.2.1", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index bed2249e..71454c9a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "radar-sdk-js", - "version": "4.2.1-beta.2", + "version": "4.2.1", "description": "Web Javascript SDK for Radar, location infrastructure for mobile and web apps.", "homepage": "https://radar.com", "type": "module", diff --git a/src/version.ts b/src/version.ts index bd2b3b84..7f14bcdc 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export default '4.2.1-beta.2'; +export default '4.2.1';