From 61741d5a02b99ce871c7ef26cb7a04c071349511 Mon Sep 17 00:00:00 2001 From: Jeff Kao Date: Tue, 16 Jan 2024 10:39:19 -0500 Subject: [PATCH] expandUnits -> mailable (#142) * expandUnits -> mailable * Bump up version and mark expandUnits as deprecated * Continue to send up expandUnits in http request * Bump code version * Bump package-lock version * Switch to beta release * Remove deprecated layers * send time zone to POST /track * bump version * expandUnits -> mailable * Bump up version and mark expandUnits as deprecated * Continue to send up expandUnits in http request * Bump package-lock version * Switch to beta release * Remove deprecated layers * bump to 4.2.0 * Update package-lock.json * fix rebase * patch bump * bump --------- Co-authored-by: Nick Patrick Co-authored-by: York Wei --- README.md | 14 +++++++------- package-lock.json | 4 ++-- package.json | 2 +- src/api/search.ts | 2 ++ src/api/track.ts | 8 -------- src/types.ts | 6 +++--- src/ui/autocomplete.ts | 3 ++- src/version.ts | 2 +- 8 files changed, 18 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 47bebfef..16d6eb4f 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 ff7660bd..3a63f069 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "radar-sdk-js", - "version": "4.1.13", + "version": "4.1.14", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "radar-sdk-js", - "version": "4.1.9", + "version": "4.1.14", "license": "ISC", "dependencies": { "@types/geojson": "^7946.0.10" diff --git a/package.json b/package.json index e9c63d01..1a25bf30 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "radar-sdk-js", - "version": "4.1.13", + "version": "4.1.14", "description": "Web Javascript SDK for Radar, location infrastructure for mobile and web apps.", "homepage": "https://radar.com", "type": "module", diff --git a/src/api/search.ts b/src/api/search.ts index 86c2bdcc..a7478614 100644 --- a/src/api/search.ts +++ b/src/api/search.ts @@ -22,6 +22,7 @@ class SearchAPI { layers, countryCode, expandUnits, + mailable, } = params; // near can be provided as a string or Location object @@ -42,6 +43,7 @@ class SearchAPI { layers, countryCode, expandUnits, + mailable, }, }); diff --git a/src/api/track.ts b/src/api/track.ts index 6187eeff..c3202bc8 100644 --- a/src/api/track.ts +++ b/src/api/track.ts @@ -42,13 +42,6 @@ class TrackAPI { const deviceType = params.deviceType || 'Web'; const description = params.description || Storage.getItem(Storage.DESCRIPTION); - let timeZone; - try { - timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; - } catch (err: any) { - Logger.warn(`Error getting time zone: ${err.message}`); - } - // save userId for trip tracking if (!userId) { Logger.warn('userId not provided for trackOnce.'); @@ -82,7 +75,6 @@ class TrackAPI { stopped: true, userId, tripOptions, - timeZone, }; const response: any = await Http.request({ diff --git a/src/types.ts b/src/types.ts index 41cf76d0..f0290fd6 100644 --- a/src/types.ts +++ b/src/types.ts @@ -257,9 +257,6 @@ export interface RadarConversionResponse extends RadarResponse { export type RadarGeocodeLayer = | 'place' | 'address' - | 'intersection' - | 'street' - | 'neighborhood' | 'postalCode' | 'locality' | 'county' @@ -341,7 +338,9 @@ export interface RadarAutocompleteParams { limit?: number; layers?: RadarGeocodeLayer[]; countryCode?: string; + /** @deprecated this is always true, regardless of the value passed here */ expandUnits?: boolean; + mailable?: boolean; } export interface RadarAutocompleteResponse extends RadarResponse { @@ -476,6 +475,7 @@ export interface RadarAutocompleteUIOptions { layers?: RadarGeocodeLayer[]; countryCode?: string; expandUnits?: boolean; + mailable?: boolean; placeholder?: string, // Placeholder text for the input field onSelection?: (selection: any) => void, onRequest?: (params: RadarAutocompleteParams) => void, diff --git a/src/ui/autocomplete.ts b/src/ui/autocomplete.ts index 506cff24..17c1de80 100644 --- a/src/ui/autocomplete.ts +++ b/src/ui/autocomplete.ts @@ -236,7 +236,7 @@ class AutocompleteUI { } public async fetchResults(query: string) { - const { limit, layers, countryCode, expandUnits, onRequest } = this.config; + const { limit, layers, countryCode, expandUnits, mailable, onRequest } = this.config; const params: RadarAutocompleteParams = { query, @@ -244,6 +244,7 @@ class AutocompleteUI { layers, countryCode, expandUnits, + mailable, } if (this.near) { diff --git a/src/version.ts b/src/version.ts index 453d880a..0e27c146 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export default '4.1.13'; +export default '4.1.14';