@aws-amplify/geo 3.0.21 → 3.0.22-unstable.1a6d358.0
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/dist/cjs/Geo.js +5 -6
- package/dist/cjs/Geo.js.map +1 -1
- package/dist/cjs/providers/location-service/AmazonLocationServiceProvider.js +22 -36
- package/dist/cjs/providers/location-service/AmazonLocationServiceProvider.js.map +1 -1
- package/dist/cjs/util.js +7 -7
- package/dist/cjs/util.js.map +1 -1
- package/dist/esm/Geo.d.ts +4 -4
- package/dist/esm/Geo.mjs +5 -6
- package/dist/esm/Geo.mjs.map +1 -1
- package/dist/esm/providers/location-service/AmazonLocationServiceProvider.d.ts +4 -4
- package/dist/esm/providers/location-service/AmazonLocationServiceProvider.mjs +22 -36
- package/dist/esm/providers/location-service/AmazonLocationServiceProvider.mjs.map +1 -1
- package/dist/esm/types/AmazonLocationServiceProvider.d.ts +1 -1
- package/dist/esm/types/Geo.d.ts +24 -24
- package/dist/esm/types/Provider.d.ts +1 -1
- package/dist/esm/util.d.ts +1 -1
- package/dist/esm/util.mjs +7 -7
- package/dist/esm/util.mjs.map +1 -1
- package/package.json +89 -88
- package/src/Geo.ts +16 -16
- package/src/providers/location-service/AmazonLocationServiceProvider.ts +69 -65
- package/src/types/AmazonLocationServiceProvider.ts +4 -4
- package/src/types/Geo.ts +24 -24
- package/src/types/Provider.ts +6 -6
- package/src/util.ts +10 -9
package/dist/cjs/Geo.js
CHANGED
|
@@ -40,13 +40,13 @@ class GeoClass {
|
|
|
40
40
|
* @param providerName the name of the plugin
|
|
41
41
|
*/
|
|
42
42
|
getPluggable(providerName) {
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
43
|
+
const targetPluggable = this._pluggables.find(pluggable => pluggable.getProviderName() === providerName);
|
|
44
|
+
if (targetPluggable === undefined) {
|
|
45
45
|
logger.debug('No plugin found with providerName', providerName);
|
|
46
46
|
throw new Error('No plugin found in Geo for the provider');
|
|
47
47
|
}
|
|
48
48
|
else
|
|
49
|
-
return
|
|
49
|
+
return targetPluggable;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* Remove the plugin object
|
|
@@ -54,7 +54,6 @@ class GeoClass {
|
|
|
54
54
|
*/
|
|
55
55
|
removePluggable(providerName) {
|
|
56
56
|
this._pluggables = this._pluggables.filter(pluggable => pluggable.getProviderName() !== providerName);
|
|
57
|
-
return;
|
|
58
57
|
}
|
|
59
58
|
/**
|
|
60
59
|
* Get the map resources that are currently available through the provider
|
|
@@ -95,7 +94,7 @@ class GeoClass {
|
|
|
95
94
|
* Search for search term suggestions based on input text
|
|
96
95
|
* @param {string} text The text string that is to be search for
|
|
97
96
|
* @param {SearchByTextOptions} options Optional parameters to the search
|
|
98
|
-
* @returns {
|
|
97
|
+
* @returns a `Promise` of {@link SearchForSuggestionsResults} that resolves to an array of search suggestion strings
|
|
99
98
|
*/
|
|
100
99
|
async searchForSuggestions(text, options) {
|
|
101
100
|
const { providerName = DEFAULT_PROVIDER } = options || {};
|
|
@@ -191,7 +190,7 @@ class GeoClass {
|
|
|
191
190
|
/**
|
|
192
191
|
* List geofences
|
|
193
192
|
* @param options ListGeofenceOptions
|
|
194
|
-
* @returns
|
|
193
|
+
* @returns a promise that resolves to an object that conforms to {@link ListGeofenceResults}:
|
|
195
194
|
* entries: list of geofences - 100 geofences are listed per page
|
|
196
195
|
* nextToken: token for next page of geofences
|
|
197
196
|
*/
|
package/dist/cjs/Geo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Geo.js","sources":["../../src/Geo.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Geo = exports.GeoClass = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst core_1 = require(\"@aws-amplify/core\");\nconst AmazonLocationServiceProvider_1 = require(\"./providers/location-service/AmazonLocationServiceProvider\");\nconst util_1 = require(\"./util\");\nconst logger = new core_1.ConsoleLogger('Geo');\nconst DEFAULT_PROVIDER = 'AmazonLocationService';\nclass GeoClass {\n constructor() {\n this._config = undefined;\n this._pluggables = [];\n const amplifyConfig = core_1.Amplify.getConfig() ?? {};\n this._config = Object.assign({}, this._config, amplifyConfig.Geo);\n const locationProvider = new AmazonLocationServiceProvider_1.AmazonLocationServiceProvider(amplifyConfig.Geo);\n this._pluggables.push(locationProvider);\n logger.debug('Geo Options', this._config);\n }\n /**\n * get the name of the module category\n * @returns {string} name of the module category\n */\n getModuleName() {\n return GeoClass.MODULE;\n }\n /**\n * add plugin into Geo category\n * @param {Object} pluggable an instance of the plugin\n */\n addPluggable(pluggable) {\n if (pluggable && pluggable.getCategory() === 'Geo') {\n this._pluggables.push(pluggable);\n }\n }\n /**\n * Get the plugin object\n * @param providerName the name of the plugin\n */\n getPluggable(providerName) {\n const pluggable = this._pluggables.find(pluggable => pluggable.getProviderName() === providerName);\n if (pluggable === undefined) {\n logger.debug('No plugin found with providerName', providerName);\n throw new Error('No plugin found in Geo for the provider');\n }\n else\n return pluggable;\n }\n /**\n * Remove the plugin object\n * @param providerName the name of the plugin\n */\n removePluggable(providerName) {\n this._pluggables = this._pluggables.filter(pluggable => pluggable.getProviderName() !== providerName);\n return;\n }\n /**\n * Get the map resources that are currently available through the provider\n * @param {string} provider\n * @returns - Array of available map resources\n */\n getAvailableMaps(provider = DEFAULT_PROVIDER) {\n const prov = this.getPluggable(provider);\n return prov.getAvailableMaps();\n }\n /**\n * Get the map resource set as default in amplify config\n * @param {string} provider\n * @returns - Map resource set as the default in amplify config\n */\n getDefaultMap(provider = DEFAULT_PROVIDER) {\n const prov = this.getPluggable(provider);\n return prov.getDefaultMap();\n }\n /**\n * Search by text input with optional parameters\n * @param {string} text The text string that is to be searched for\n * @param {SearchByTextOptions} options Optional parameters to the search\n * @returns {Promise<Place[]>} - Promise resolves to a list of Places that match search parameters\n */\n async searchByText(text, options) {\n const { providerName = DEFAULT_PROVIDER } = options || {};\n const prov = this.getPluggable(providerName);\n try {\n return await prov.searchByText(text, options);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n }\n /**\n * Search for search term suggestions based on input text\n * @param {string} text The text string that is to be search for\n * @param {SearchByTextOptions} options Optional parameters to the search\n * @returns {Promise<SearchForSuggestionsResults>} - Resolves to an array of search suggestion strings\n */\n async searchForSuggestions(text, options) {\n const { providerName = DEFAULT_PROVIDER } = options || {};\n const prov = this.getPluggable(providerName);\n try {\n return await prov.searchForSuggestions(text, options);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n }\n /**\n * Search for location by unique ID\n * @param {string} placeId Unique ID of the location that is to be searched for\n * @param {searchByPlaceIdOptions} options Optional parameters to the search\n * @returns {Promise<Place>} - Resolves to a place with the given placeId\n */\n async searchByPlaceId(placeId, options) {\n const providerName = DEFAULT_PROVIDER;\n const prov = this.getPluggable(providerName);\n try {\n return await prov.searchByPlaceId(placeId, options);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n }\n /**\n * Reverse geocoding search via a coordinate point on the map\n * @param coordinates Coordinates array for the search input\n * @param options Options parameters for the search\n * @returns {Promise<Place>} - Promise that resolves to a place matching search coordinates\n */\n async searchByCoordinates(coordinates, options) {\n const { providerName = DEFAULT_PROVIDER } = options || {};\n const prov = this.getPluggable(providerName);\n const [lng, lat] = coordinates;\n try {\n (0, util_1.validateCoordinates)(lng, lat);\n return await prov.searchByCoordinates(coordinates, options);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n }\n /**\n * Create geofences\n * @param geofences Single or array of geofence objects to create\n * @param options Optional parameters for creating geofences\n * @returns {Promise<SaveGeofencesResults>} - Promise that resolves to an object with:\n * successes: list of geofences successfully created\n * errors: list of geofences that failed to create\n */\n async saveGeofences(geofences, options) {\n const { providerName = DEFAULT_PROVIDER } = options || {};\n const prov = this.getPluggable(providerName);\n // If single geofence input, make it an array for batch call\n let geofenceInputArray;\n if (!Array.isArray(geofences)) {\n geofenceInputArray = [geofences];\n }\n else {\n geofenceInputArray = geofences;\n }\n try {\n return await prov.saveGeofences(geofenceInputArray, options);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n }\n /**\n * Get a single geofence by geofenceId\n * @param geofenceId The string id of the geofence to get\n * @param options Optional parameters for getting a geofence\n * @returns Promise<Geofence> - Promise that resolves to a geofence object\n */\n async getGeofence(geofenceId, options) {\n const { providerName = DEFAULT_PROVIDER } = options || {};\n const prov = this.getPluggable(providerName);\n try {\n return await prov.getGeofence(geofenceId, options);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n }\n /**\n * List geofences\n * @param options ListGeofenceOptions\n * @returns {Promise<ListGeofencesResults>} - Promise that resolves to an object with:\n * entries: list of geofences - 100 geofences are listed per page\n * nextToken: token for next page of geofences\n */\n async listGeofences(options) {\n const { providerName = DEFAULT_PROVIDER } = options || {};\n const prov = this.getPluggable(providerName);\n try {\n return await prov.listGeofences(options);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n }\n /**\n * Delete geofences\n * @param geofenceIds string|string[]\n * @param options GeofenceOptions\n * @returns {Promise<DeleteGeofencesResults>} - Promise that resolves to an object with:\n * successes: list of geofences successfully deleted\n * errors: list of geofences that failed to delete\n */\n async deleteGeofences(geofenceIds, options) {\n const { providerName = DEFAULT_PROVIDER } = options || {};\n const prov = this.getPluggable(providerName);\n // If single geofence input, make it an array for batch call\n let geofenceIdsInputArray;\n if (!Array.isArray(geofenceIds)) {\n geofenceIdsInputArray = [geofenceIds];\n }\n else {\n geofenceIdsInputArray = geofenceIds;\n }\n // Delete geofences\n try {\n return await prov.deleteGeofences(geofenceIdsInputArray, options);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n }\n}\nexports.GeoClass = GeoClass;\nGeoClass.MODULE = 'Geo';\nexports.Geo = new GeoClass();\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAA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AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,eAAe,CAAC,WAAW,EAAE,OAAO,EAAE;AAChD,QAAQ,MAAM,EAAE,YAAY,GAAG,gBAAgB,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;AAClE,QAAQ,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;AACrD;AACA,QAAQ,IAAI,qBAAqB,CAAC;AAClC,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;AACzC,YAAY,qBAAqB,GAAG,CAAC,WAAW,CAAC,CAAC;AAClD,SAAS;AACT,aAAa;AACb,YAAY,qBAAqB,GAAG,WAAW,CAAC;AAChD,SAAS;AACT;AACA,QAAQ,IAAI;AACZ,YAAY,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;AAC9E,SAAS;AACT,QAAQ,OAAO,KAAK,EAAE;AACtB,YAAY,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAChC,YAAY,MAAM,KAAK,CAAC;AACxB,SAAS;AACT,KAAK;AACL,CAAC;AACD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5B,QAAQ,CAAC,MAAM,GAAG,KAAK,CAAC;AACxB,OAAO,CAAC,GAAG,GAAG,IAAI,QAAQ,EAAE;;"}
|
|
1
|
+
{"version":3,"file":"Geo.js","sources":["../../src/Geo.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Geo = exports.GeoClass = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst core_1 = require(\"@aws-amplify/core\");\nconst AmazonLocationServiceProvider_1 = require(\"./providers/location-service/AmazonLocationServiceProvider\");\nconst util_1 = require(\"./util\");\nconst logger = new core_1.ConsoleLogger('Geo');\nconst DEFAULT_PROVIDER = 'AmazonLocationService';\nclass GeoClass {\n constructor() {\n this._config = undefined;\n this._pluggables = [];\n const amplifyConfig = core_1.Amplify.getConfig() ?? {};\n this._config = Object.assign({}, this._config, amplifyConfig.Geo);\n const locationProvider = new AmazonLocationServiceProvider_1.AmazonLocationServiceProvider(amplifyConfig.Geo);\n this._pluggables.push(locationProvider);\n logger.debug('Geo Options', this._config);\n }\n /**\n * get the name of the module category\n * @returns {string} name of the module category\n */\n getModuleName() {\n return GeoClass.MODULE;\n }\n /**\n * add plugin into Geo category\n * @param {Object} pluggable an instance of the plugin\n */\n addPluggable(pluggable) {\n if (pluggable && pluggable.getCategory() === 'Geo') {\n this._pluggables.push(pluggable);\n }\n }\n /**\n * Get the plugin object\n * @param providerName the name of the plugin\n */\n getPluggable(providerName) {\n const targetPluggable = this._pluggables.find(pluggable => pluggable.getProviderName() === providerName);\n if (targetPluggable === undefined) {\n logger.debug('No plugin found with providerName', providerName);\n throw new Error('No plugin found in Geo for the provider');\n }\n else\n return targetPluggable;\n }\n /**\n * Remove the plugin object\n * @param providerName the name of the plugin\n */\n removePluggable(providerName) {\n this._pluggables = this._pluggables.filter(pluggable => pluggable.getProviderName() !== providerName);\n }\n /**\n * Get the map resources that are currently available through the provider\n * @param {string} provider\n * @returns - Array of available map resources\n */\n getAvailableMaps(provider = DEFAULT_PROVIDER) {\n const prov = this.getPluggable(provider);\n return prov.getAvailableMaps();\n }\n /**\n * Get the map resource set as default in amplify config\n * @param {string} provider\n * @returns - Map resource set as the default in amplify config\n */\n getDefaultMap(provider = DEFAULT_PROVIDER) {\n const prov = this.getPluggable(provider);\n return prov.getDefaultMap();\n }\n /**\n * Search by text input with optional parameters\n * @param {string} text The text string that is to be searched for\n * @param {SearchByTextOptions} options Optional parameters to the search\n * @returns {Promise<Place[]>} - Promise resolves to a list of Places that match search parameters\n */\n async searchByText(text, options) {\n const { providerName = DEFAULT_PROVIDER } = options || {};\n const prov = this.getPluggable(providerName);\n try {\n return await prov.searchByText(text, options);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n }\n /**\n * Search for search term suggestions based on input text\n * @param {string} text The text string that is to be search for\n * @param {SearchByTextOptions} options Optional parameters to the search\n * @returns a `Promise` of {@link SearchForSuggestionsResults} that resolves to an array of search suggestion strings\n */\n async searchForSuggestions(text, options) {\n const { providerName = DEFAULT_PROVIDER } = options || {};\n const prov = this.getPluggable(providerName);\n try {\n return await prov.searchForSuggestions(text, options);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n }\n /**\n * Search for location by unique ID\n * @param {string} placeId Unique ID of the location that is to be searched for\n * @param {searchByPlaceIdOptions} options Optional parameters to the search\n * @returns {Promise<Place>} - Resolves to a place with the given placeId\n */\n async searchByPlaceId(placeId, options) {\n const providerName = DEFAULT_PROVIDER;\n const prov = this.getPluggable(providerName);\n try {\n return await prov.searchByPlaceId(placeId, options);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n }\n /**\n * Reverse geocoding search via a coordinate point on the map\n * @param coordinates Coordinates array for the search input\n * @param options Options parameters for the search\n * @returns {Promise<Place>} - Promise that resolves to a place matching search coordinates\n */\n async searchByCoordinates(coordinates, options) {\n const { providerName = DEFAULT_PROVIDER } = options || {};\n const prov = this.getPluggable(providerName);\n const [lng, lat] = coordinates;\n try {\n (0, util_1.validateCoordinates)(lng, lat);\n return await prov.searchByCoordinates(coordinates, options);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n }\n /**\n * Create geofences\n * @param geofences Single or array of geofence objects to create\n * @param options Optional parameters for creating geofences\n * @returns {Promise<SaveGeofencesResults>} - Promise that resolves to an object with:\n * successes: list of geofences successfully created\n * errors: list of geofences that failed to create\n */\n async saveGeofences(geofences, options) {\n const { providerName = DEFAULT_PROVIDER } = options || {};\n const prov = this.getPluggable(providerName);\n // If single geofence input, make it an array for batch call\n let geofenceInputArray;\n if (!Array.isArray(geofences)) {\n geofenceInputArray = [geofences];\n }\n else {\n geofenceInputArray = geofences;\n }\n try {\n return await prov.saveGeofences(geofenceInputArray, options);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n }\n /**\n * Get a single geofence by geofenceId\n * @param geofenceId The string id of the geofence to get\n * @param options Optional parameters for getting a geofence\n * @returns Promise<Geofence> - Promise that resolves to a geofence object\n */\n async getGeofence(geofenceId, options) {\n const { providerName = DEFAULT_PROVIDER } = options || {};\n const prov = this.getPluggable(providerName);\n try {\n return await prov.getGeofence(geofenceId, options);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n }\n /**\n * List geofences\n * @param options ListGeofenceOptions\n * @returns a promise that resolves to an object that conforms to {@link ListGeofenceResults}:\n * entries: list of geofences - 100 geofences are listed per page\n * nextToken: token for next page of geofences\n */\n async listGeofences(options) {\n const { providerName = DEFAULT_PROVIDER } = options || {};\n const prov = this.getPluggable(providerName);\n try {\n return await prov.listGeofences(options);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n }\n /**\n * Delete geofences\n * @param geofenceIds string|string[]\n * @param options GeofenceOptions\n * @returns {Promise<DeleteGeofencesResults>} - Promise that resolves to an object with:\n * successes: list of geofences successfully deleted\n * errors: list of geofences that failed to delete\n */\n async deleteGeofences(geofenceIds, options) {\n const { providerName = DEFAULT_PROVIDER } = options || {};\n const prov = this.getPluggable(providerName);\n // If single geofence input, make it an array for batch call\n let geofenceIdsInputArray;\n if (!Array.isArray(geofenceIds)) {\n geofenceIdsInputArray = [geofenceIds];\n }\n else {\n geofenceIdsInputArray = geofenceIds;\n }\n // Delete geofences\n try {\n return await prov.deleteGeofences(geofenceIdsInputArray, options);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n }\n}\nexports.GeoClass = GeoClass;\nGeoClass.MODULE = 'Geo';\nexports.Geo = new GeoClass();\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,QAAQ,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EAAE,YAAY,GAAG,gBAAgB,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;AAClE,QAAQ,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;AACrD;AACA,QAAQ,IAAI,qBAAqB,CAAC;AAClC,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;AACzC,YAAY,qBAAqB,GAAG,CAAC,WAAW,CAAC,CAAC;AAClD,SAAS;AACT,aAAa;AACb,YAAY,qBAAqB,GAAG,WAAW,CAAC;AAChD,SAAS;AACT;AACA,QAAQ,IAAI;AACZ,YAAY,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;AAC9E,SAAS;AACT,QAAQ,OAAO,KAAK,EAAE;AACtB,YAAY,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAChC,YAAY,MAAM,KAAK,CAAC;AACxB,SAAS;AACT,KAAK;AACL,CAAC;AACD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5B,QAAQ,CAAC,MAAM,GAAG,KAAK,CAAC;AACxB,OAAO,CAAC,GAAG,GAAG,IAAI,QAAQ,EAAE;;"}
|
|
@@ -17,7 +17,7 @@ class AmazonLocationServiceProvider {
|
|
|
17
17
|
* @param {Object} config - Configuration object for Geo
|
|
18
18
|
*/
|
|
19
19
|
constructor(config) {
|
|
20
|
-
this._config = config
|
|
20
|
+
this._config = config || {};
|
|
21
21
|
logger.debug('Geo Options', this._config);
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
@@ -42,9 +42,9 @@ class AmazonLocationServiceProvider {
|
|
|
42
42
|
this._verifyMapResources();
|
|
43
43
|
const mapStyles = [];
|
|
44
44
|
const availableMaps = this._config.maps.items;
|
|
45
|
-
const region = this._config
|
|
45
|
+
const { region } = this._config;
|
|
46
46
|
for (const mapName in availableMaps) {
|
|
47
|
-
const style = availableMaps[mapName]
|
|
47
|
+
const { style } = availableMaps[mapName];
|
|
48
48
|
mapStyles.push({ mapName, style, region });
|
|
49
49
|
}
|
|
50
50
|
return mapStyles;
|
|
@@ -56,8 +56,8 @@ class AmazonLocationServiceProvider {
|
|
|
56
56
|
getDefaultMap() {
|
|
57
57
|
this._verifyMapResources();
|
|
58
58
|
const mapName = this._config.maps.default;
|
|
59
|
-
const style = this._config.maps.items[mapName]
|
|
60
|
-
const region = this._config
|
|
59
|
+
const { style } = this._config.maps.items[mapName];
|
|
60
|
+
const { region } = this._config;
|
|
61
61
|
return { mapName, style, region };
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
@@ -200,7 +200,6 @@ class AmazonLocationServiceProvider {
|
|
|
200
200
|
if (place) {
|
|
201
201
|
return (0, camelcase_keys_1.default)(place, { deep: true });
|
|
202
202
|
}
|
|
203
|
-
return;
|
|
204
203
|
}
|
|
205
204
|
/**
|
|
206
205
|
* Reverse geocoding search via a coordinate point on the map
|
|
@@ -253,7 +252,7 @@ class AmazonLocationServiceProvider {
|
|
|
253
252
|
* Create geofences inside of a geofence collection
|
|
254
253
|
* @param geofences Array of geofence objects to create
|
|
255
254
|
* @param options Optional parameters for creating geofences
|
|
256
|
-
* @returns
|
|
255
|
+
* @returns a promise that resolves to an object that conforms to {@link SaveGeofencesResults}:
|
|
257
256
|
* successes: list of geofences successfully created
|
|
258
257
|
* errors: list of geofences that failed to create
|
|
259
258
|
*/
|
|
@@ -314,23 +313,23 @@ class AmazonLocationServiceProvider {
|
|
|
314
313
|
}
|
|
315
314
|
// Push all successes to results
|
|
316
315
|
response.Successes?.forEach(success => {
|
|
317
|
-
const { GeofenceId, CreateTime, UpdateTime } = success;
|
|
316
|
+
const { GeofenceId: geofenceId, CreateTime, UpdateTime } = success;
|
|
318
317
|
results.successes.push({
|
|
319
|
-
geofenceId:
|
|
318
|
+
geofenceId: geofenceId,
|
|
320
319
|
createTime: CreateTime,
|
|
321
320
|
updateTime: UpdateTime,
|
|
322
321
|
});
|
|
323
322
|
});
|
|
324
323
|
// Push all errors to results
|
|
325
324
|
response.Errors?.forEach(error => {
|
|
326
|
-
const { Error, GeofenceId } = error;
|
|
325
|
+
const { Error, GeofenceId: geofenceId } = error;
|
|
327
326
|
const { Code, Message } = Error;
|
|
328
327
|
results.errors.push({
|
|
329
328
|
error: {
|
|
330
329
|
code: Code,
|
|
331
330
|
message: Message,
|
|
332
331
|
},
|
|
333
|
-
geofenceId:
|
|
332
|
+
geofenceId: geofenceId,
|
|
334
333
|
});
|
|
335
334
|
});
|
|
336
335
|
}));
|
|
@@ -378,10 +377,10 @@ class AmazonLocationServiceProvider {
|
|
|
378
377
|
throw error;
|
|
379
378
|
}
|
|
380
379
|
// Convert response to camelCase for return
|
|
381
|
-
const { GeofenceId, CreateTime, UpdateTime, Status, Geometry } = response;
|
|
380
|
+
const { GeofenceId: responseGeofenceId, CreateTime, UpdateTime, Status, Geometry, } = response;
|
|
382
381
|
const geofence = {
|
|
383
382
|
createTime: CreateTime,
|
|
384
|
-
geofenceId:
|
|
383
|
+
geofenceId: responseGeofenceId,
|
|
385
384
|
geometry: {
|
|
386
385
|
polygon: Geometry.Polygon,
|
|
387
386
|
},
|
|
@@ -393,7 +392,7 @@ class AmazonLocationServiceProvider {
|
|
|
393
392
|
/**
|
|
394
393
|
* List geofences from a geofence collection
|
|
395
394
|
* @param options ListGeofenceOptions
|
|
396
|
-
* @returns
|
|
395
|
+
* @returns a promise that resolves to an object that conforms to {@link ListGeofenceResults}:
|
|
397
396
|
* entries: list of geofences - 100 geofences are listed per page
|
|
398
397
|
* nextToken: token for next page of geofences
|
|
399
398
|
*/
|
|
@@ -435,9 +434,9 @@ class AmazonLocationServiceProvider {
|
|
|
435
434
|
// Convert response to camelCase for return
|
|
436
435
|
const { NextToken, Entries } = response;
|
|
437
436
|
const results = {
|
|
438
|
-
entries: Entries.map(({ GeofenceId, CreateTime, UpdateTime, Status, Geometry }) => {
|
|
437
|
+
entries: Entries.map(({ GeofenceId: geofenceId, CreateTime, UpdateTime, Status, Geometry, }) => {
|
|
439
438
|
return {
|
|
440
|
-
geofenceId:
|
|
439
|
+
geofenceId: geofenceId,
|
|
441
440
|
createTime: CreateTime,
|
|
442
441
|
updateTime: UpdateTime,
|
|
443
442
|
status: Status,
|
|
@@ -454,7 +453,7 @@ class AmazonLocationServiceProvider {
|
|
|
454
453
|
* Delete geofences from a geofence collection
|
|
455
454
|
* @param geofenceIds string|string[]
|
|
456
455
|
* @param options GeofenceOptions
|
|
457
|
-
* @returns
|
|
456
|
+
* @returns a promise that resolves to an object that conforms to {@link AmazonLocationServiceDeleteGeofencesResults}:
|
|
458
457
|
* successes: list of geofences successfully deleted
|
|
459
458
|
* errors: list of geofences that failed to delete
|
|
460
459
|
*/
|
|
@@ -475,6 +474,7 @@ class AmazonLocationServiceProvider {
|
|
|
475
474
|
catch (error) {
|
|
476
475
|
return true;
|
|
477
476
|
}
|
|
477
|
+
return false;
|
|
478
478
|
});
|
|
479
479
|
if (badGeofenceIds.length > 0) {
|
|
480
480
|
throw new Error(`Invalid geofence ids: ${badGeofenceIds.join(', ')}`);
|
|
@@ -509,8 +509,8 @@ class AmazonLocationServiceProvider {
|
|
|
509
509
|
});
|
|
510
510
|
return;
|
|
511
511
|
}
|
|
512
|
-
const
|
|
513
|
-
results.successes.push(...batch.filter(Id => !
|
|
512
|
+
const targetBadGeofenceIds = response.Errors.map(({ geofenceId }) => geofenceId);
|
|
513
|
+
results.successes.push(...batch.filter(Id => !targetBadGeofenceIds.includes(Id)));
|
|
514
514
|
}));
|
|
515
515
|
return results;
|
|
516
516
|
}
|
|
@@ -519,7 +519,7 @@ class AmazonLocationServiceProvider {
|
|
|
519
519
|
*/
|
|
520
520
|
async _ensureCredentials() {
|
|
521
521
|
try {
|
|
522
|
-
const credentials =
|
|
522
|
+
const { credentials } = await (0, core_1.fetchAuthSession)();
|
|
523
523
|
if (!credentials)
|
|
524
524
|
return false;
|
|
525
525
|
logger.debug('Set credentials for storage. Credentials are:', credentials);
|
|
@@ -583,14 +583,7 @@ class AmazonLocationServiceProvider {
|
|
|
583
583
|
customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.SaveGeofences),
|
|
584
584
|
});
|
|
585
585
|
const command = new client_location_1.BatchPutGeofenceCommand(geofenceInput);
|
|
586
|
-
|
|
587
|
-
try {
|
|
588
|
-
response = await client.send(command);
|
|
589
|
-
}
|
|
590
|
-
catch (error) {
|
|
591
|
-
throw error;
|
|
592
|
-
}
|
|
593
|
-
return response;
|
|
586
|
+
return client.send(command);
|
|
594
587
|
}
|
|
595
588
|
async _AmazonLocationServiceBatchDeleteGeofenceCall(geofenceIds, collectionName) {
|
|
596
589
|
// Create the BatchDeleteGeofence input
|
|
@@ -604,14 +597,7 @@ class AmazonLocationServiceProvider {
|
|
|
604
597
|
customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.DeleteGeofences),
|
|
605
598
|
});
|
|
606
599
|
const command = new client_location_1.BatchDeleteGeofenceCommand(deleteGeofencesInput);
|
|
607
|
-
|
|
608
|
-
try {
|
|
609
|
-
response = await client.send(command);
|
|
610
|
-
}
|
|
611
|
-
catch (error) {
|
|
612
|
-
throw error;
|
|
613
|
-
}
|
|
614
|
-
return response;
|
|
600
|
+
return client.send(command);
|
|
615
601
|
}
|
|
616
602
|
}
|
|
617
603
|
exports.AmazonLocationServiceProvider = AmazonLocationServiceProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmazonLocationServiceProvider.js","sources":["../../../../src/providers/location-service/AmazonLocationServiceProvider.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AmazonLocationServiceProvider = void 0;\nconst tslib_1 = require(\"tslib\");\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst camelcase_keys_1 = tslib_1.__importDefault(require(\"camelcase-keys\"));\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst client_location_1 = require(\"@aws-sdk/client-location\");\nconst util_1 = require(\"../../util\");\nconst logger = new core_1.ConsoleLogger('AmazonLocationServiceProvider');\nclass AmazonLocationServiceProvider {\n /**\n * Initialize Geo with AWS configurations\n * @param {Object} config - Configuration object for Geo\n */\n constructor(config) {\n this._config = config ? config : {};\n logger.debug('Geo Options', this._config);\n }\n /**\n * get the category of the plugin\n * @returns {string} name of the category\n */\n getCategory() {\n return AmazonLocationServiceProvider.CATEGORY;\n }\n /**\n * get provider name of the plugin\n * @returns {string} name of the provider\n */\n getProviderName() {\n return AmazonLocationServiceProvider.PROVIDER_NAME;\n }\n /**\n * Get the map resources that are currently available through the provider\n * @returns {AmazonLocationServiceMapStyle[]}- Array of available map resources\n */\n getAvailableMaps() {\n this._verifyMapResources();\n const mapStyles = [];\n const availableMaps = this._config.maps.items;\n const region = this._config.region;\n for (const mapName in availableMaps) {\n const style = availableMaps[mapName].style;\n mapStyles.push({ mapName, style, region });\n }\n return mapStyles;\n }\n /**\n * Get the map resource set as default in amplify config\n * @returns {AmazonLocationServiceMapStyle} - Map resource set as the default in amplify config\n */\n getDefaultMap() {\n this._verifyMapResources();\n const mapName = this._config.maps.default;\n const style = this._config.maps.items[mapName].style;\n const region = this._config.region;\n return { mapName, style, region };\n }\n /**\n * Search by text input with optional parameters\n * @param {string} text The text string that is to be searched for\n * @param {SearchByTextOptions} options Optional parameters to the search\n * @returns {Promise<Place[]>} - Promise resolves to a list of Places that match search parameters\n */\n async searchByText(text, options) {\n const credentialsOK = await this._ensureCredentials();\n if (!credentialsOK) {\n throw new Error('No credentials');\n }\n this._verifySearchIndex(options?.searchIndexName);\n /**\n * Setup the searchInput\n */\n let locationServiceInput = {\n Text: text,\n IndexName: this._config.search_indices.default,\n };\n /**\n * Map search options to Amazon Location Service input object\n */\n if (options) {\n locationServiceInput = {\n ...locationServiceInput,\n ...(0, util_1.mapSearchOptions)(options, locationServiceInput),\n };\n }\n const client = new client_location_1.LocationClient({\n credentials: this._credentials,\n region: this._config.region,\n customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.SearchByText),\n });\n const command = new client_location_1.SearchPlaceIndexForTextCommand(locationServiceInput);\n let response;\n try {\n response = await client.send(command);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n /**\n * The response from Amazon Location Service is a \"Results\" array of objects with a single `Place` item,\n * which are Place objects in PascalCase.\n * Here we want to flatten that to an array of results and change them to camelCase\n */\n const PascalResults = response.Results.map(result => result.Place);\n const results = (0, camelcase_keys_1.default)(PascalResults, {\n deep: true,\n });\n return results;\n }\n /**\n * Search for suggestions based on the input text\n * @param {string} text The text string that is to be searched for\n * @param {SearchByTextOptions} options Optional parameters to the search\n * @returns {Promise<SearchForSuggestionsResults>} - Resolves to an array of search suggestion strings\n */\n async searchForSuggestions(text, options) {\n const credentialsOK = await this._ensureCredentials();\n if (!credentialsOK) {\n throw new Error('No credentials');\n }\n this._verifySearchIndex(options?.searchIndexName);\n /**\n * Setup the searchInput\n */\n let locationServiceInput = {\n Text: text,\n IndexName: this._config.search_indices.default,\n };\n /**\n * Map search options to Amazon Location Service input object\n */\n if (options) {\n locationServiceInput = {\n ...locationServiceInput,\n ...(0, util_1.mapSearchOptions)(options, locationServiceInput),\n };\n }\n const client = new client_location_1.LocationClient({\n credentials: this._credentials,\n region: this._config.region,\n customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.SearchForSuggestions),\n });\n const command = new client_location_1.SearchPlaceIndexForSuggestionsCommand(locationServiceInput);\n let response;\n try {\n response = await client.send(command);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n /**\n * The response from Amazon Location Service is a \"Results\" array of objects with `Text` and `PlaceId`.\n */\n const results = response.Results.map(result => ({\n text: result.Text,\n placeId: result.PlaceId,\n }));\n return results;\n }\n _verifyPlaceId(placeId) {\n if (placeId.length === 0) {\n const errorString = 'PlaceId cannot be an empty string.';\n logger.debug(errorString);\n throw new Error(errorString);\n }\n }\n async searchByPlaceId(placeId, options) {\n const credentialsOK = await this._ensureCredentials();\n if (!credentialsOK) {\n throw new Error('No credentials');\n }\n this._verifySearchIndex(options?.searchIndexName);\n this._verifyPlaceId(placeId);\n const client = new client_location_1.LocationClient({\n credentials: this._credentials,\n region: this._config.region,\n customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.SearchByPlaceId),\n });\n const searchByPlaceIdInput = {\n PlaceId: placeId,\n IndexName: options?.searchIndexName || this._config.search_indices.default,\n };\n const command = new client_location_1.GetPlaceCommand(searchByPlaceIdInput);\n let response;\n try {\n response = await client.send(command);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n const place = response.Place;\n if (place) {\n return (0, camelcase_keys_1.default)(place, { deep: true });\n }\n return;\n }\n /**\n * Reverse geocoding search via a coordinate point on the map\n * @param coordinates Coordinates array for the search input\n * @param options Options parameters for the search\n * @returns {Promise<Place>} - Promise that resolves to a place matching search coordinates\n */\n async searchByCoordinates(coordinates, options) {\n const credentialsOK = await this._ensureCredentials();\n if (!credentialsOK) {\n throw new Error('No credentials');\n }\n this._verifySearchIndex(options?.searchIndexName);\n const locationServiceInput = {\n Position: coordinates,\n IndexName: this._config.search_indices.default,\n };\n if (options) {\n if (options.searchIndexName) {\n locationServiceInput.IndexName = options.searchIndexName;\n }\n locationServiceInput.MaxResults = options.maxResults;\n }\n const client = new client_location_1.LocationClient({\n credentials: this._credentials,\n region: this._config.region,\n customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.SearchByCoordinates),\n });\n const command = new client_location_1.SearchPlaceIndexForPositionCommand(locationServiceInput);\n let response;\n try {\n response = await client.send(command);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n /**\n * The response from Amazon Location Service is a \"Results\" array with a single `Place` object\n * which are Place objects in PascalCase.\n * Here we want to flatten that to an array of results and change them to camelCase\n */\n const PascalResults = response.Results.map(result => result.Place);\n const results = (0, camelcase_keys_1.default)(PascalResults[0], {\n deep: true,\n });\n return results;\n }\n /**\n * Create geofences inside of a geofence collection\n * @param geofences Array of geofence objects to create\n * @param options Optional parameters for creating geofences\n * @returns {Promise<AmazonLocationServiceSaveGeofencesResults>} - Promise that resolves to an object with:\n * successes: list of geofences successfully created\n * errors: list of geofences that failed to create\n */\n async saveGeofences(geofences, options) {\n if (geofences.length < 1) {\n throw new Error('Geofence input array is empty');\n }\n const credentialsOK = await this._ensureCredentials();\n if (!credentialsOK) {\n throw new Error('No credentials');\n }\n // Verify geofence collection exists in aws-config.js\n try {\n this._verifyGeofenceCollections(options?.collectionName);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n (0, util_1.validateGeofencesInput)(geofences);\n // Convert geofences to PascalCase for Amazon Location Service format\n const PascalGeofences = geofences.map(({ geofenceId, geometry: { polygon } }) => {\n return {\n GeofenceId: geofenceId,\n Geometry: {\n Polygon: polygon,\n },\n };\n });\n const results = {\n successes: [],\n errors: [],\n };\n const geofenceBatches = [];\n while (PascalGeofences.length > 0) {\n // Splice off 10 geofences from input clone due to Amazon Location Service API limit\n const apiLimit = 10;\n geofenceBatches.push(PascalGeofences.splice(0, apiLimit));\n }\n await Promise.all(geofenceBatches.map(async (batch) => {\n // Make API call for the 10 geofences\n let response;\n try {\n response = await this._AmazonLocationServiceBatchPutGeofenceCall(batch, options?.collectionName || this._config.geofenceCollections.default);\n }\n catch (error) {\n // If the API call fails, add the geofences to the errors array and move to next batch\n batch.forEach(geofence => {\n results.errors.push({\n geofenceId: geofence.GeofenceId,\n error: {\n code: 'APIConnectionError',\n message: error.message,\n },\n });\n });\n return;\n }\n // Push all successes to results\n response.Successes?.forEach(success => {\n const { GeofenceId, CreateTime, UpdateTime } = success;\n results.successes.push({\n geofenceId: GeofenceId,\n createTime: CreateTime,\n updateTime: UpdateTime,\n });\n });\n // Push all errors to results\n response.Errors?.forEach(error => {\n const { Error, GeofenceId } = error;\n const { Code, Message } = Error;\n results.errors.push({\n error: {\n code: Code,\n message: Message,\n },\n geofenceId: GeofenceId,\n });\n });\n }));\n return results;\n }\n /**\n * Get geofence from a geofence collection\n * @param geofenceId string\n * @param options Optional parameters for getGeofence\n * @returns {Promise<AmazonLocationServiceGeofence>} - Promise that resolves to a geofence object\n */\n async getGeofence(geofenceId, options) {\n const credentialsOK = await this._ensureCredentials();\n if (!credentialsOK) {\n throw new Error('No credentials');\n }\n // Verify geofence collection exists in aws-config.js\n try {\n this._verifyGeofenceCollections(options?.collectionName);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n (0, util_1.validateGeofenceId)(geofenceId);\n // Create Amazon Location Service Client\n const client = new client_location_1.LocationClient({\n credentials: this._credentials,\n region: this._config.region,\n customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.GetGeofence),\n });\n // Create Amazon Location Service command\n const commandInput = {\n GeofenceId: geofenceId,\n CollectionName: options?.collectionName || this._config.geofenceCollections.default,\n };\n const command = new client_location_1.GetGeofenceCommand(commandInput);\n // Make API call\n let response;\n try {\n response = await client.send(command);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n // Convert response to camelCase for return\n const { GeofenceId, CreateTime, UpdateTime, Status, Geometry } = response;\n const geofence = {\n createTime: CreateTime,\n geofenceId: GeofenceId,\n geometry: {\n polygon: Geometry.Polygon,\n },\n status: Status,\n updateTime: UpdateTime,\n };\n return geofence;\n }\n /**\n * List geofences from a geofence collection\n * @param options ListGeofenceOptions\n * @returns {Promise<ListGeofencesResults>} - Promise that resolves to an object with:\n * entries: list of geofences - 100 geofences are listed per page\n * nextToken: token for next page of geofences\n */\n async listGeofences(options) {\n const credentialsOK = await this._ensureCredentials();\n if (!credentialsOK) {\n throw new Error('No credentials');\n }\n // Verify geofence collection exists in aws-config.js\n try {\n this._verifyGeofenceCollections(options?.collectionName);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n // Create Amazon Location Service Client\n const client = new client_location_1.LocationClient({\n credentials: this._credentials,\n region: this._config.region,\n customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.ListGeofences),\n });\n // Create Amazon Location Service input\n const listGeofencesInput = {\n NextToken: options?.nextToken,\n CollectionName: options?.collectionName || this._config.geofenceCollections.default,\n };\n // Create Amazon Location Service command\n const command = new client_location_1.ListGeofencesCommand(listGeofencesInput);\n // Make API call\n let response;\n try {\n response = await client.send(command);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n // Convert response to camelCase for return\n const { NextToken, Entries } = response;\n const results = {\n entries: Entries.map(({ GeofenceId, CreateTime, UpdateTime, Status, Geometry }) => {\n return {\n geofenceId: GeofenceId,\n createTime: CreateTime,\n updateTime: UpdateTime,\n status: Status,\n geometry: {\n polygon: Geometry.Polygon,\n },\n };\n }),\n nextToken: NextToken,\n };\n return results;\n }\n /**\n * Delete geofences from a geofence collection\n * @param geofenceIds string|string[]\n * @param options GeofenceOptions\n * @returns {Promise<DeleteGeofencesResults>} - Promise that resolves to an object with:\n * successes: list of geofences successfully deleted\n * errors: list of geofences that failed to delete\n */\n async deleteGeofences(geofenceIds, options) {\n if (geofenceIds.length < 1) {\n throw new Error('GeofenceId input array is empty');\n }\n const credentialsOK = await this._ensureCredentials();\n if (!credentialsOK) {\n throw new Error('No credentials');\n }\n this._verifyGeofenceCollections(options?.collectionName);\n // Validate all geofenceIds are valid\n const badGeofenceIds = geofenceIds.filter(geofenceId => {\n try {\n (0, util_1.validateGeofenceId)(geofenceId);\n }\n catch (error) {\n return true;\n }\n });\n if (badGeofenceIds.length > 0) {\n throw new Error(`Invalid geofence ids: ${badGeofenceIds.join(', ')}`);\n }\n const results = {\n successes: [],\n errors: [],\n };\n const geofenceIdBatches = [];\n let count = 0;\n while (count < geofenceIds.length) {\n geofenceIdBatches.push(geofenceIds.slice(count, (count += 10)));\n }\n await Promise.all(geofenceIdBatches.map(async (batch) => {\n let response;\n try {\n response = await this._AmazonLocationServiceBatchDeleteGeofenceCall(batch, options?.collectionName || this._config.geofenceCollections.default);\n }\n catch (error) {\n // If the API call fails, add the geofences to the errors array and move to next batch\n batch.forEach(geofenceId => {\n const errorObject = {\n geofenceId,\n error: {\n code: error\n .message,\n message: error\n .message,\n },\n };\n results.errors.push(errorObject);\n });\n return;\n }\n const badGeofenceIds = response.Errors.map(({ geofenceId }) => geofenceId);\n results.successes.push(...batch.filter(Id => !badGeofenceIds.includes(Id)));\n }));\n return results;\n }\n /**\n * @private\n */\n async _ensureCredentials() {\n try {\n const credentials = (await (0, core_1.fetchAuthSession)()).credentials;\n if (!credentials)\n return false;\n logger.debug('Set credentials for storage. Credentials are:', credentials);\n this._credentials = credentials;\n return true;\n }\n catch (error) {\n logger.debug('Ensure credentials error. Credentials are:', error);\n return false;\n }\n }\n _refreshConfig() {\n this._config = core_1.Amplify.getConfig().Geo?.LocationService;\n if (!this._config) {\n const errorString = \"No Geo configuration found in amplify config, run 'amplify add geo' to create one and run `amplify push` after\";\n logger.debug(errorString);\n throw new Error(errorString);\n }\n }\n _verifyMapResources() {\n this._refreshConfig();\n if (!this._config.maps) {\n const errorString = \"No map resources found in amplify config, run 'amplify add geo' to create one and run `amplify push` after\";\n logger.debug(errorString);\n throw new Error(errorString);\n }\n if (!this._config.maps.default) {\n const errorString = \"No default map resource found in amplify config, run 'amplify add geo' to create one and run `amplify push` after\";\n logger.debug(errorString);\n throw new Error(errorString);\n }\n }\n _verifySearchIndex(optionalSearchIndex) {\n this._refreshConfig();\n if ((!this._config.searchIndices || !this._config.searchIndices.default) &&\n !optionalSearchIndex) {\n const errorString = 'No Search Index found in amplify config, please run `amplify add geo` to create one and run `amplify push` after.';\n logger.debug(errorString);\n throw new Error(errorString);\n }\n }\n _verifyGeofenceCollections(optionalGeofenceCollectionName) {\n this._refreshConfig();\n if ((!this._config.geofenceCollections ||\n !this._config.geofenceCollections.default) &&\n !optionalGeofenceCollectionName) {\n const errorString = 'No Geofence Collections found, please run `amplify add geo` to create one and run `amplify push` after.';\n logger.debug(errorString);\n throw new Error(errorString);\n }\n }\n async _AmazonLocationServiceBatchPutGeofenceCall(PascalGeofences, collectionName) {\n // Create the BatchPutGeofence input\n const geofenceInput = {\n Entries: PascalGeofences,\n CollectionName: collectionName || this._config.geofenceCollections.default,\n };\n const client = new client_location_1.LocationClient({\n credentials: this._credentials,\n region: this._config.region,\n customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.SaveGeofences),\n });\n const command = new client_location_1.BatchPutGeofenceCommand(geofenceInput);\n let response;\n try {\n response = await client.send(command);\n }\n catch (error) {\n throw error;\n }\n return response;\n }\n async _AmazonLocationServiceBatchDeleteGeofenceCall(geofenceIds, collectionName) {\n // Create the BatchDeleteGeofence input\n const deleteGeofencesInput = {\n GeofenceIds: geofenceIds,\n CollectionName: collectionName || this._config.geofenceCollections.default,\n };\n const client = new client_location_1.LocationClient({\n credentials: this._credentials,\n region: this._config.region,\n customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.DeleteGeofences),\n });\n const command = new client_location_1.BatchDeleteGeofenceCommand(deleteGeofencesInput);\n let response;\n try {\n response = await client.send(command);\n }\n catch (error) {\n throw error;\n }\n return response;\n }\n}\nexports.AmazonLocationServiceProvider = AmazonLocationServiceProvider;\nAmazonLocationServiceProvider.CATEGORY = 'Geo';\nAmazonLocationServiceProvider.PROVIDER_NAME = 'AmazonLocationService';\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,6BAA6B,GAAG,KAAK,CAAC,CAAC;AAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AACjC;AACA;AACA,MAAM,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAC5E,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;AA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,CAAC,CAAC;AAClD,SAAS;AACT,QAAQ,OAAO,KAAK,EAAE;AACtB,YAAY,MAAM,KAAK,CAAC;AACxB,SAAS;AACT,QAAQ,OAAO,QAAQ,CAAC;AACxB,KAAK;AACL,CAAC;AACD,OAAO,CAAC,6BAA6B,GAAG,6BAA6B,CAAC;AACtE,6BAA6B,CAAC,QAAQ,GAAG,KAAK,CAAC;AAC/C,6BAA6B,CAAC,aAAa,GAAG,uBAAuB;;"}
|
|
1
|
+
{"version":3,"file":"AmazonLocationServiceProvider.js","sources":["../../../../src/providers/location-service/AmazonLocationServiceProvider.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AmazonLocationServiceProvider = void 0;\nconst tslib_1 = require(\"tslib\");\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst camelcase_keys_1 = tslib_1.__importDefault(require(\"camelcase-keys\"));\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst client_location_1 = require(\"@aws-sdk/client-location\");\nconst util_1 = require(\"../../util\");\nconst logger = new core_1.ConsoleLogger('AmazonLocationServiceProvider');\nclass AmazonLocationServiceProvider {\n /**\n * Initialize Geo with AWS configurations\n * @param {Object} config - Configuration object for Geo\n */\n constructor(config) {\n this._config = config || {};\n logger.debug('Geo Options', this._config);\n }\n /**\n * get the category of the plugin\n * @returns {string} name of the category\n */\n getCategory() {\n return AmazonLocationServiceProvider.CATEGORY;\n }\n /**\n * get provider name of the plugin\n * @returns {string} name of the provider\n */\n getProviderName() {\n return AmazonLocationServiceProvider.PROVIDER_NAME;\n }\n /**\n * Get the map resources that are currently available through the provider\n * @returns {AmazonLocationServiceMapStyle[]}- Array of available map resources\n */\n getAvailableMaps() {\n this._verifyMapResources();\n const mapStyles = [];\n const availableMaps = this._config.maps.items;\n const { region } = this._config;\n for (const mapName in availableMaps) {\n const { style } = availableMaps[mapName];\n mapStyles.push({ mapName, style, region });\n }\n return mapStyles;\n }\n /**\n * Get the map resource set as default in amplify config\n * @returns {AmazonLocationServiceMapStyle} - Map resource set as the default in amplify config\n */\n getDefaultMap() {\n this._verifyMapResources();\n const mapName = this._config.maps.default;\n const { style } = this._config.maps.items[mapName];\n const { region } = this._config;\n return { mapName, style, region };\n }\n /**\n * Search by text input with optional parameters\n * @param {string} text The text string that is to be searched for\n * @param {SearchByTextOptions} options Optional parameters to the search\n * @returns {Promise<Place[]>} - Promise resolves to a list of Places that match search parameters\n */\n async searchByText(text, options) {\n const credentialsOK = await this._ensureCredentials();\n if (!credentialsOK) {\n throw new Error('No credentials');\n }\n this._verifySearchIndex(options?.searchIndexName);\n /**\n * Setup the searchInput\n */\n let locationServiceInput = {\n Text: text,\n IndexName: this._config.search_indices.default,\n };\n /**\n * Map search options to Amazon Location Service input object\n */\n if (options) {\n locationServiceInput = {\n ...locationServiceInput,\n ...(0, util_1.mapSearchOptions)(options, locationServiceInput),\n };\n }\n const client = new client_location_1.LocationClient({\n credentials: this._credentials,\n region: this._config.region,\n customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.SearchByText),\n });\n const command = new client_location_1.SearchPlaceIndexForTextCommand(locationServiceInput);\n let response;\n try {\n response = await client.send(command);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n /**\n * The response from Amazon Location Service is a \"Results\" array of objects with a single `Place` item,\n * which are Place objects in PascalCase.\n * Here we want to flatten that to an array of results and change them to camelCase\n */\n const PascalResults = response.Results.map(result => result.Place);\n const results = (0, camelcase_keys_1.default)(PascalResults, {\n deep: true,\n });\n return results;\n }\n /**\n * Search for suggestions based on the input text\n * @param {string} text The text string that is to be searched for\n * @param {SearchByTextOptions} options Optional parameters to the search\n * @returns {Promise<SearchForSuggestionsResults>} - Resolves to an array of search suggestion strings\n */\n async searchForSuggestions(text, options) {\n const credentialsOK = await this._ensureCredentials();\n if (!credentialsOK) {\n throw new Error('No credentials');\n }\n this._verifySearchIndex(options?.searchIndexName);\n /**\n * Setup the searchInput\n */\n let locationServiceInput = {\n Text: text,\n IndexName: this._config.search_indices.default,\n };\n /**\n * Map search options to Amazon Location Service input object\n */\n if (options) {\n locationServiceInput = {\n ...locationServiceInput,\n ...(0, util_1.mapSearchOptions)(options, locationServiceInput),\n };\n }\n const client = new client_location_1.LocationClient({\n credentials: this._credentials,\n region: this._config.region,\n customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.SearchForSuggestions),\n });\n const command = new client_location_1.SearchPlaceIndexForSuggestionsCommand(locationServiceInput);\n let response;\n try {\n response = await client.send(command);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n /**\n * The response from Amazon Location Service is a \"Results\" array of objects with `Text` and `PlaceId`.\n */\n const results = response.Results.map(result => ({\n text: result.Text,\n placeId: result.PlaceId,\n }));\n return results;\n }\n _verifyPlaceId(placeId) {\n if (placeId.length === 0) {\n const errorString = 'PlaceId cannot be an empty string.';\n logger.debug(errorString);\n throw new Error(errorString);\n }\n }\n async searchByPlaceId(placeId, options) {\n const credentialsOK = await this._ensureCredentials();\n if (!credentialsOK) {\n throw new Error('No credentials');\n }\n this._verifySearchIndex(options?.searchIndexName);\n this._verifyPlaceId(placeId);\n const client = new client_location_1.LocationClient({\n credentials: this._credentials,\n region: this._config.region,\n customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.SearchByPlaceId),\n });\n const searchByPlaceIdInput = {\n PlaceId: placeId,\n IndexName: options?.searchIndexName || this._config.search_indices.default,\n };\n const command = new client_location_1.GetPlaceCommand(searchByPlaceIdInput);\n let response;\n try {\n response = await client.send(command);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n const place = response.Place;\n if (place) {\n return (0, camelcase_keys_1.default)(place, { deep: true });\n }\n }\n /**\n * Reverse geocoding search via a coordinate point on the map\n * @param coordinates Coordinates array for the search input\n * @param options Options parameters for the search\n * @returns {Promise<Place>} - Promise that resolves to a place matching search coordinates\n */\n async searchByCoordinates(coordinates, options) {\n const credentialsOK = await this._ensureCredentials();\n if (!credentialsOK) {\n throw new Error('No credentials');\n }\n this._verifySearchIndex(options?.searchIndexName);\n const locationServiceInput = {\n Position: coordinates,\n IndexName: this._config.search_indices.default,\n };\n if (options) {\n if (options.searchIndexName) {\n locationServiceInput.IndexName = options.searchIndexName;\n }\n locationServiceInput.MaxResults = options.maxResults;\n }\n const client = new client_location_1.LocationClient({\n credentials: this._credentials,\n region: this._config.region,\n customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.SearchByCoordinates),\n });\n const command = new client_location_1.SearchPlaceIndexForPositionCommand(locationServiceInput);\n let response;\n try {\n response = await client.send(command);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n /**\n * The response from Amazon Location Service is a \"Results\" array with a single `Place` object\n * which are Place objects in PascalCase.\n * Here we want to flatten that to an array of results and change them to camelCase\n */\n const PascalResults = response.Results.map(result => result.Place);\n const results = (0, camelcase_keys_1.default)(PascalResults[0], {\n deep: true,\n });\n return results;\n }\n /**\n * Create geofences inside of a geofence collection\n * @param geofences Array of geofence objects to create\n * @param options Optional parameters for creating geofences\n * @returns a promise that resolves to an object that conforms to {@link SaveGeofencesResults}:\n * successes: list of geofences successfully created\n * errors: list of geofences that failed to create\n */\n async saveGeofences(geofences, options) {\n if (geofences.length < 1) {\n throw new Error('Geofence input array is empty');\n }\n const credentialsOK = await this._ensureCredentials();\n if (!credentialsOK) {\n throw new Error('No credentials');\n }\n // Verify geofence collection exists in aws-config.js\n try {\n this._verifyGeofenceCollections(options?.collectionName);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n (0, util_1.validateGeofencesInput)(geofences);\n // Convert geofences to PascalCase for Amazon Location Service format\n const PascalGeofences = geofences.map(({ geofenceId, geometry: { polygon } }) => {\n return {\n GeofenceId: geofenceId,\n Geometry: {\n Polygon: polygon,\n },\n };\n });\n const results = {\n successes: [],\n errors: [],\n };\n const geofenceBatches = [];\n while (PascalGeofences.length > 0) {\n // Splice off 10 geofences from input clone due to Amazon Location Service API limit\n const apiLimit = 10;\n geofenceBatches.push(PascalGeofences.splice(0, apiLimit));\n }\n await Promise.all(geofenceBatches.map(async (batch) => {\n // Make API call for the 10 geofences\n let response;\n try {\n response = await this._AmazonLocationServiceBatchPutGeofenceCall(batch, options?.collectionName || this._config.geofenceCollections.default);\n }\n catch (error) {\n // If the API call fails, add the geofences to the errors array and move to next batch\n batch.forEach(geofence => {\n results.errors.push({\n geofenceId: geofence.GeofenceId,\n error: {\n code: 'APIConnectionError',\n message: error.message,\n },\n });\n });\n return;\n }\n // Push all successes to results\n response.Successes?.forEach(success => {\n const { GeofenceId: geofenceId, CreateTime, UpdateTime } = success;\n results.successes.push({\n geofenceId: geofenceId,\n createTime: CreateTime,\n updateTime: UpdateTime,\n });\n });\n // Push all errors to results\n response.Errors?.forEach(error => {\n const { Error, GeofenceId: geofenceId } = error;\n const { Code, Message } = Error;\n results.errors.push({\n error: {\n code: Code,\n message: Message,\n },\n geofenceId: geofenceId,\n });\n });\n }));\n return results;\n }\n /**\n * Get geofence from a geofence collection\n * @param geofenceId string\n * @param options Optional parameters for getGeofence\n * @returns {Promise<AmazonLocationServiceGeofence>} - Promise that resolves to a geofence object\n */\n async getGeofence(geofenceId, options) {\n const credentialsOK = await this._ensureCredentials();\n if (!credentialsOK) {\n throw new Error('No credentials');\n }\n // Verify geofence collection exists in aws-config.js\n try {\n this._verifyGeofenceCollections(options?.collectionName);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n (0, util_1.validateGeofenceId)(geofenceId);\n // Create Amazon Location Service Client\n const client = new client_location_1.LocationClient({\n credentials: this._credentials,\n region: this._config.region,\n customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.GetGeofence),\n });\n // Create Amazon Location Service command\n const commandInput = {\n GeofenceId: geofenceId,\n CollectionName: options?.collectionName || this._config.geofenceCollections.default,\n };\n const command = new client_location_1.GetGeofenceCommand(commandInput);\n // Make API call\n let response;\n try {\n response = await client.send(command);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n // Convert response to camelCase for return\n const { GeofenceId: responseGeofenceId, CreateTime, UpdateTime, Status, Geometry, } = response;\n const geofence = {\n createTime: CreateTime,\n geofenceId: responseGeofenceId,\n geometry: {\n polygon: Geometry.Polygon,\n },\n status: Status,\n updateTime: UpdateTime,\n };\n return geofence;\n }\n /**\n * List geofences from a geofence collection\n * @param options ListGeofenceOptions\n * @returns a promise that resolves to an object that conforms to {@link ListGeofenceResults}:\n * entries: list of geofences - 100 geofences are listed per page\n * nextToken: token for next page of geofences\n */\n async listGeofences(options) {\n const credentialsOK = await this._ensureCredentials();\n if (!credentialsOK) {\n throw new Error('No credentials');\n }\n // Verify geofence collection exists in aws-config.js\n try {\n this._verifyGeofenceCollections(options?.collectionName);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n // Create Amazon Location Service Client\n const client = new client_location_1.LocationClient({\n credentials: this._credentials,\n region: this._config.region,\n customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.ListGeofences),\n });\n // Create Amazon Location Service input\n const listGeofencesInput = {\n NextToken: options?.nextToken,\n CollectionName: options?.collectionName || this._config.geofenceCollections.default,\n };\n // Create Amazon Location Service command\n const command = new client_location_1.ListGeofencesCommand(listGeofencesInput);\n // Make API call\n let response;\n try {\n response = await client.send(command);\n }\n catch (error) {\n logger.debug(error);\n throw error;\n }\n // Convert response to camelCase for return\n const { NextToken, Entries } = response;\n const results = {\n entries: Entries.map(({ GeofenceId: geofenceId, CreateTime, UpdateTime, Status, Geometry, }) => {\n return {\n geofenceId: geofenceId,\n createTime: CreateTime,\n updateTime: UpdateTime,\n status: Status,\n geometry: {\n polygon: Geometry.Polygon,\n },\n };\n }),\n nextToken: NextToken,\n };\n return results;\n }\n /**\n * Delete geofences from a geofence collection\n * @param geofenceIds string|string[]\n * @param options GeofenceOptions\n * @returns a promise that resolves to an object that conforms to {@link AmazonLocationServiceDeleteGeofencesResults}:\n * successes: list of geofences successfully deleted\n * errors: list of geofences that failed to delete\n */\n async deleteGeofences(geofenceIds, options) {\n if (geofenceIds.length < 1) {\n throw new Error('GeofenceId input array is empty');\n }\n const credentialsOK = await this._ensureCredentials();\n if (!credentialsOK) {\n throw new Error('No credentials');\n }\n this._verifyGeofenceCollections(options?.collectionName);\n // Validate all geofenceIds are valid\n const badGeofenceIds = geofenceIds.filter(geofenceId => {\n try {\n (0, util_1.validateGeofenceId)(geofenceId);\n }\n catch (error) {\n return true;\n }\n return false;\n });\n if (badGeofenceIds.length > 0) {\n throw new Error(`Invalid geofence ids: ${badGeofenceIds.join(', ')}`);\n }\n const results = {\n successes: [],\n errors: [],\n };\n const geofenceIdBatches = [];\n let count = 0;\n while (count < geofenceIds.length) {\n geofenceIdBatches.push(geofenceIds.slice(count, (count += 10)));\n }\n await Promise.all(geofenceIdBatches.map(async (batch) => {\n let response;\n try {\n response = await this._AmazonLocationServiceBatchDeleteGeofenceCall(batch, options?.collectionName || this._config.geofenceCollections.default);\n }\n catch (error) {\n // If the API call fails, add the geofences to the errors array and move to next batch\n batch.forEach(geofenceId => {\n const errorObject = {\n geofenceId,\n error: {\n code: error\n .message,\n message: error\n .message,\n },\n };\n results.errors.push(errorObject);\n });\n return;\n }\n const targetBadGeofenceIds = response.Errors.map(({ geofenceId }) => geofenceId);\n results.successes.push(...batch.filter(Id => !targetBadGeofenceIds.includes(Id)));\n }));\n return results;\n }\n /**\n * @private\n */\n async _ensureCredentials() {\n try {\n const { credentials } = await (0, core_1.fetchAuthSession)();\n if (!credentials)\n return false;\n logger.debug('Set credentials for storage. Credentials are:', credentials);\n this._credentials = credentials;\n return true;\n }\n catch (error) {\n logger.debug('Ensure credentials error. Credentials are:', error);\n return false;\n }\n }\n _refreshConfig() {\n this._config = core_1.Amplify.getConfig().Geo?.LocationService;\n if (!this._config) {\n const errorString = \"No Geo configuration found in amplify config, run 'amplify add geo' to create one and run `amplify push` after\";\n logger.debug(errorString);\n throw new Error(errorString);\n }\n }\n _verifyMapResources() {\n this._refreshConfig();\n if (!this._config.maps) {\n const errorString = \"No map resources found in amplify config, run 'amplify add geo' to create one and run `amplify push` after\";\n logger.debug(errorString);\n throw new Error(errorString);\n }\n if (!this._config.maps.default) {\n const errorString = \"No default map resource found in amplify config, run 'amplify add geo' to create one and run `amplify push` after\";\n logger.debug(errorString);\n throw new Error(errorString);\n }\n }\n _verifySearchIndex(optionalSearchIndex) {\n this._refreshConfig();\n if ((!this._config.searchIndices || !this._config.searchIndices.default) &&\n !optionalSearchIndex) {\n const errorString = 'No Search Index found in amplify config, please run `amplify add geo` to create one and run `amplify push` after.';\n logger.debug(errorString);\n throw new Error(errorString);\n }\n }\n _verifyGeofenceCollections(optionalGeofenceCollectionName) {\n this._refreshConfig();\n if ((!this._config.geofenceCollections ||\n !this._config.geofenceCollections.default) &&\n !optionalGeofenceCollectionName) {\n const errorString = 'No Geofence Collections found, please run `amplify add geo` to create one and run `amplify push` after.';\n logger.debug(errorString);\n throw new Error(errorString);\n }\n }\n async _AmazonLocationServiceBatchPutGeofenceCall(PascalGeofences, collectionName) {\n // Create the BatchPutGeofence input\n const geofenceInput = {\n Entries: PascalGeofences,\n CollectionName: collectionName || this._config.geofenceCollections.default,\n };\n const client = new client_location_1.LocationClient({\n credentials: this._credentials,\n region: this._config.region,\n customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.SaveGeofences),\n });\n const command = new client_location_1.BatchPutGeofenceCommand(geofenceInput);\n return client.send(command);\n }\n async _AmazonLocationServiceBatchDeleteGeofenceCall(geofenceIds, collectionName) {\n // Create the BatchDeleteGeofence input\n const deleteGeofencesInput = {\n GeofenceIds: geofenceIds,\n CollectionName: collectionName || this._config.geofenceCollections.default,\n };\n const client = new client_location_1.LocationClient({\n credentials: this._credentials,\n region: this._config.region,\n customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.DeleteGeofences),\n });\n const command = new client_location_1.BatchDeleteGeofenceCommand(deleteGeofencesInput);\n return client.send(command);\n }\n}\nexports.AmazonLocationServiceProvider = AmazonLocationServiceProvider;\nAmazonLocationServiceProvider.CATEGORY = 'Geo';\nAmazonLocationServiceProvider.PROVIDER_NAME = 'AmazonLocationService';\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,6BAA6B,GAAG,KAAK,CAAC,CAAC;AAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AACjC;AACA;AACA,MAAM,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAC5E,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;AAC7D,MAAM,iBAAiB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAC9D,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AACrC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,+BAA+B,CAAC,CAAC;AACzE,MAAM,6BAA6B,CAAC;AACpC;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,EAAE,CAAC;AACpC,QAAQ,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;AAClD,KAAK;AACL;AACA;AACA;AACA;AACA,IAAI,WAAW,GAAG;AAClB,QAAQ,OAAO,6BAA6B,CAAC,QAAQ,CAAC;AACtD,KAAK;AACL;AACA;AACA;AACA;AACA,IAAI,eAAe,GAAG;AACtB,QAAQ,OAAO,6BAA6B,CAAC,aAAa,CAAC;AAC3D,KAAK;AACL;AACA;AACA;AACA;AACA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MAAM,GAAG,IAAI,iBAAiB,CAAC,cAAc,CAAC;AAC5D,YAAY,WAAW,EAAE,IAAI,CAAC,YAAY;AAC1C,YAAY,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;AACvC,YAAY,eAAe,EAAE,IAAI,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,SAAS,CAAC,eAAe,CAAC;AAC3F,SAAS,CAAC,CAAC;AACX,QAAQ,MAAM,OAAO,GAAG,IAAI,iBAAiB,CAAC,0BAA0B,CAAC,oBAAoB,CAAC,CAAC;AAC/F,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACpC,KAAK;AACL,CAAC;AACD,OAAO,CAAC,6BAA6B,GAAG,6BAA6B,CAAC;AACtE,6BAA6B,CAAC,QAAQ,GAAG,KAAK,CAAC;AAC/C,6BAA6B,CAAC,aAAa,GAAG,uBAAuB;;"}
|
package/dist/cjs/util.js
CHANGED
|
@@ -11,10 +11,10 @@ function validateCoordinates(lng, lat) {
|
|
|
11
11
|
if (!Number.isFinite(lng) || !Number.isFinite(lat)) {
|
|
12
12
|
throw new Error(`Invalid coordinates: [${lng},${lat}]`);
|
|
13
13
|
}
|
|
14
|
-
if (lat < -90 ||
|
|
14
|
+
if (lat < -90 || lat > 90) {
|
|
15
15
|
throw new Error('Latitude must be between -90 and 90 degrees inclusive.');
|
|
16
16
|
}
|
|
17
|
-
else if (lng < -180 ||
|
|
17
|
+
else if (lng < -180 || lng > 180) {
|
|
18
18
|
throw new Error('Longitude must be between -180 and 180 degrees inclusive.');
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -127,14 +127,14 @@ function mapSearchOptions(options, locationServiceInput) {
|
|
|
127
127
|
if (options.searchIndexName) {
|
|
128
128
|
locationServiceModifiedInput.IndexName = options.searchIndexName;
|
|
129
129
|
}
|
|
130
|
-
if (options
|
|
130
|
+
if (options.biasPosition && options.searchAreaConstraints) {
|
|
131
131
|
throw new Error('BiasPosition and SearchAreaConstraints are mutually exclusive, please remove one or the other from the options object');
|
|
132
132
|
}
|
|
133
|
-
if (options
|
|
134
|
-
locationServiceModifiedInput.BiasPosition = options
|
|
133
|
+
if (options.biasPosition) {
|
|
134
|
+
locationServiceModifiedInput.BiasPosition = options.biasPosition;
|
|
135
135
|
}
|
|
136
|
-
if (options
|
|
137
|
-
locationServiceModifiedInput.FilterBBox = options
|
|
136
|
+
if (options.searchAreaConstraints) {
|
|
137
|
+
locationServiceModifiedInput.FilterBBox = options.searchAreaConstraints;
|
|
138
138
|
}
|
|
139
139
|
return locationServiceModifiedInput;
|
|
140
140
|
}
|
package/dist/cjs/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sources":["../../src/util.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getGeoUserAgentString = exports.getGeoUserAgent = exports.mapSearchOptions = exports.validateGeofencesInput = exports.validatePolygon = exports.validateLinearRing = exports.validateGeofenceId = exports.validateCoordinates = void 0;\nconst tslib_1 = require(\"tslib\");\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst boolean_clockwise_1 = tslib_1.__importDefault(require(\"@turf/boolean-clockwise\"));\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nfunction validateCoordinates(lng, lat) {\n if (!Number.isFinite(lng) || !Number.isFinite(lat)) {\n throw new Error(`Invalid coordinates: [${lng},${lat}]`);\n }\n if (lat < -90 || 90 < lat) {\n throw new Error('Latitude must be between -90 and 90 degrees inclusive.');\n }\n else if (lng < -180 || 180 < lng) {\n throw new Error('Longitude must be between -180 and 180 degrees inclusive.');\n }\n}\nexports.validateCoordinates = validateCoordinates;\nfunction validateGeofenceId(geofenceId) {\n const geofenceIdRegex = /^[-._\\p{L}\\p{N}]+$/iu;\n // Check if geofenceId is valid\n if (!geofenceIdRegex.test(geofenceId)) {\n throw new Error(`Invalid geofenceId: '${geofenceId}' - IDs can only contain alphanumeric characters, hyphens, underscores and periods.`);\n }\n}\nexports.validateGeofenceId = validateGeofenceId;\nfunction validateLinearRing(linearRing, geofenceId) {\n const errorPrefix = geofenceId ? `${geofenceId}: ` : '';\n // Validate LinearRing size, must be at least 4 points\n if (linearRing.length < 4) {\n throw new Error(`${errorPrefix}LinearRing must contain 4 or more coordinates.`);\n }\n // Validate all coordinates are valid, error with which ones are bad\n const badCoordinates = [];\n linearRing.forEach(coordinates => {\n try {\n validateCoordinates(coordinates[0], coordinates[1]);\n }\n catch (error) {\n badCoordinates.push({ coordinates, error: error.message });\n }\n });\n if (badCoordinates.length > 0) {\n throw new Error(`${errorPrefix}One or more of the coordinates in the Polygon LinearRing are not valid: ${JSON.stringify(badCoordinates)}`);\n }\n // Validate first and last coordinates are the same\n const [lngA, latA] = linearRing[0];\n const [lngB, latB] = linearRing[linearRing.length - 1];\n if (lngA !== lngB || latA !== latB) {\n throw new Error(`${errorPrefix}LinearRing's first and last coordinates are not the same`);\n }\n if ((0, boolean_clockwise_1.default)(linearRing)) {\n throw new Error(`${errorPrefix}LinearRing coordinates must be wound counterclockwise`);\n }\n}\nexports.validateLinearRing = validateLinearRing;\nfunction validatePolygon(polygon, geofenceId) {\n const errorPrefix = geofenceId ? `${geofenceId}: ` : '';\n if (!Array.isArray(polygon)) {\n throw new Error(`${errorPrefix}Polygon is of incorrect structure. It should be an array of LinearRings`);\n }\n if (polygon.length < 1) {\n throw new Error(`${errorPrefix}Polygon must have a single LinearRing array.`);\n }\n if (polygon.length > 1) {\n throw new Error(`${errorPrefix}Polygon must have a single LinearRing array. Note: We do not currently support polygons with holes, multipolygons, polygons that are wound clockwise, or that cross the antimeridian.`);\n }\n const verticesCount = polygon.reduce((prev, linearRing) => prev + linearRing.length, 0);\n if (verticesCount > 1000) {\n throw new Error(`${errorPrefix}Polygon has more than the maximum 1000 vertices.`);\n }\n polygon.forEach(linearRing => {\n validateLinearRing(linearRing, geofenceId);\n });\n}\nexports.validatePolygon = validatePolygon;\nfunction validateGeofencesInput(geofences) {\n const geofenceIds = {};\n geofences.forEach((geofence) => {\n // verify all required properties are present\n // Validate geofenceId exists\n if (!geofence.geofenceId) {\n throw new Error(`Geofence '${geofence}' is missing geofenceId`);\n }\n const { geofenceId } = geofence;\n validateGeofenceId(geofenceId);\n // Validate geofenceId is unique\n if (geofenceIds[geofenceId]) {\n throw new Error(`Duplicate geofenceId: ${geofenceId}`);\n }\n else {\n geofenceIds[geofenceId] = true;\n }\n // Validate geometry exists\n if (!geofence.geometry) {\n throw new Error(`Geofence '${geofenceId}' is missing geometry`);\n }\n const { geometry } = geofence;\n // Validate polygon exists\n if (!geometry.polygon) {\n throw new Error(`Geofence '${geofenceId}' is missing geometry.polygon`);\n }\n const { polygon } = geometry;\n // Validate polygon length and structure\n try {\n validatePolygon(polygon, geofenceId);\n }\n catch (error) {\n if (error.message.includes('Polygon has more than the maximum 1000 vertices.')) {\n throw new Error(`Geofence '${geofenceId}' has more than the maximum of 1000 vertices`);\n }\n }\n // Validate LinearRing length, structure, and coordinates\n const [linearRing] = polygon;\n validateLinearRing(linearRing, geofenceId);\n });\n}\nexports.validateGeofencesInput = validateGeofencesInput;\nfunction mapSearchOptions(options, locationServiceInput) {\n const locationServiceModifiedInput = { ...locationServiceInput };\n locationServiceModifiedInput.FilterCountries = options.countries;\n locationServiceModifiedInput.MaxResults = options.maxResults;\n locationServiceModifiedInput.Language = options.language;\n if (options.searchIndexName) {\n locationServiceModifiedInput.IndexName = options.searchIndexName;\n }\n if (options['biasPosition'] && options['searchAreaConstraints']) {\n throw new Error('BiasPosition and SearchAreaConstraints are mutually exclusive, please remove one or the other from the options object');\n }\n if (options['biasPosition']) {\n locationServiceModifiedInput.BiasPosition = options['biasPosition'];\n }\n if (options['searchAreaConstraints']) {\n locationServiceModifiedInput.FilterBBox = options['searchAreaConstraints'];\n }\n return locationServiceModifiedInput;\n}\nexports.mapSearchOptions = mapSearchOptions;\nfunction getGeoUserAgent(action) {\n return (0, utils_1.getAmplifyUserAgentObject)({\n category: utils_1.Category.Geo,\n action,\n });\n}\nexports.getGeoUserAgent = getGeoUserAgent;\nfunction getGeoUserAgentString(action) {\n return (0, utils_1.getAmplifyUserAgent)({\n category: utils_1.Category.Geo,\n action,\n });\n}\nexports.getGeoUserAgentString = getGeoUserAgentString;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,GAAG,KAAK,CAAC,CAAC;AAC/O,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AACjC;AACA;AACA,MAAM,mBAAmB,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,CAAC;AACxF,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;AAC7D,SAAS,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE;AACvC,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACxD,QAAQ,MAAM,IAAI,KAAK,CAAC,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAChE,KAAK;AACL,IAAI,IAAI,GAAG,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,EAAE;AAC/B,QAAQ,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;AAClF,KAAK;AACL,SAAS,IAAI,GA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\", { value: true });\nexports.getGeoUserAgentString = exports.getGeoUserAgent = exports.mapSearchOptions = exports.validateGeofencesInput = exports.validatePolygon = exports.validateLinearRing = exports.validateGeofenceId = exports.validateCoordinates = void 0;\nconst tslib_1 = require(\"tslib\");\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst boolean_clockwise_1 = tslib_1.__importDefault(require(\"@turf/boolean-clockwise\"));\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nfunction validateCoordinates(lng, lat) {\n if (!Number.isFinite(lng) || !Number.isFinite(lat)) {\n throw new Error(`Invalid coordinates: [${lng},${lat}]`);\n }\n if (lat < -90 || lat > 90) {\n throw new Error('Latitude must be between -90 and 90 degrees inclusive.');\n }\n else if (lng < -180 || lng > 180) {\n throw new Error('Longitude must be between -180 and 180 degrees inclusive.');\n }\n}\nexports.validateCoordinates = validateCoordinates;\nfunction validateGeofenceId(geofenceId) {\n const geofenceIdRegex = /^[-._\\p{L}\\p{N}]+$/iu;\n // Check if geofenceId is valid\n if (!geofenceIdRegex.test(geofenceId)) {\n throw new Error(`Invalid geofenceId: '${geofenceId}' - IDs can only contain alphanumeric characters, hyphens, underscores and periods.`);\n }\n}\nexports.validateGeofenceId = validateGeofenceId;\nfunction validateLinearRing(linearRing, geofenceId) {\n const errorPrefix = geofenceId ? `${geofenceId}: ` : '';\n // Validate LinearRing size, must be at least 4 points\n if (linearRing.length < 4) {\n throw new Error(`${errorPrefix}LinearRing must contain 4 or more coordinates.`);\n }\n // Validate all coordinates are valid, error with which ones are bad\n const badCoordinates = [];\n linearRing.forEach(coordinates => {\n try {\n validateCoordinates(coordinates[0], coordinates[1]);\n }\n catch (error) {\n badCoordinates.push({ coordinates, error: error.message });\n }\n });\n if (badCoordinates.length > 0) {\n throw new Error(`${errorPrefix}One or more of the coordinates in the Polygon LinearRing are not valid: ${JSON.stringify(badCoordinates)}`);\n }\n // Validate first and last coordinates are the same\n const [lngA, latA] = linearRing[0];\n const [lngB, latB] = linearRing[linearRing.length - 1];\n if (lngA !== lngB || latA !== latB) {\n throw new Error(`${errorPrefix}LinearRing's first and last coordinates are not the same`);\n }\n if ((0, boolean_clockwise_1.default)(linearRing)) {\n throw new Error(`${errorPrefix}LinearRing coordinates must be wound counterclockwise`);\n }\n}\nexports.validateLinearRing = validateLinearRing;\nfunction validatePolygon(polygon, geofenceId) {\n const errorPrefix = geofenceId ? `${geofenceId}: ` : '';\n if (!Array.isArray(polygon)) {\n throw new Error(`${errorPrefix}Polygon is of incorrect structure. It should be an array of LinearRings`);\n }\n if (polygon.length < 1) {\n throw new Error(`${errorPrefix}Polygon must have a single LinearRing array.`);\n }\n if (polygon.length > 1) {\n throw new Error(`${errorPrefix}Polygon must have a single LinearRing array. Note: We do not currently support polygons with holes, multipolygons, polygons that are wound clockwise, or that cross the antimeridian.`);\n }\n const verticesCount = polygon.reduce((prev, linearRing) => prev + linearRing.length, 0);\n if (verticesCount > 1000) {\n throw new Error(`${errorPrefix}Polygon has more than the maximum 1000 vertices.`);\n }\n polygon.forEach(linearRing => {\n validateLinearRing(linearRing, geofenceId);\n });\n}\nexports.validatePolygon = validatePolygon;\nfunction validateGeofencesInput(geofences) {\n const geofenceIds = {};\n geofences.forEach((geofence) => {\n // verify all required properties are present\n // Validate geofenceId exists\n if (!geofence.geofenceId) {\n throw new Error(`Geofence '${geofence}' is missing geofenceId`);\n }\n const { geofenceId } = geofence;\n validateGeofenceId(geofenceId);\n // Validate geofenceId is unique\n if (geofenceIds[geofenceId]) {\n throw new Error(`Duplicate geofenceId: ${geofenceId}`);\n }\n else {\n geofenceIds[geofenceId] = true;\n }\n // Validate geometry exists\n if (!geofence.geometry) {\n throw new Error(`Geofence '${geofenceId}' is missing geometry`);\n }\n const { geometry } = geofence;\n // Validate polygon exists\n if (!geometry.polygon) {\n throw new Error(`Geofence '${geofenceId}' is missing geometry.polygon`);\n }\n const { polygon } = geometry;\n // Validate polygon length and structure\n try {\n validatePolygon(polygon, geofenceId);\n }\n catch (error) {\n if (error.message.includes('Polygon has more than the maximum 1000 vertices.')) {\n throw new Error(`Geofence '${geofenceId}' has more than the maximum of 1000 vertices`);\n }\n }\n // Validate LinearRing length, structure, and coordinates\n const [linearRing] = polygon;\n validateLinearRing(linearRing, geofenceId);\n });\n}\nexports.validateGeofencesInput = validateGeofencesInput;\nfunction mapSearchOptions(options, locationServiceInput) {\n const locationServiceModifiedInput = { ...locationServiceInput };\n locationServiceModifiedInput.FilterCountries = options.countries;\n locationServiceModifiedInput.MaxResults = options.maxResults;\n locationServiceModifiedInput.Language = options.language;\n if (options.searchIndexName) {\n locationServiceModifiedInput.IndexName = options.searchIndexName;\n }\n if (options.biasPosition && options.searchAreaConstraints) {\n throw new Error('BiasPosition and SearchAreaConstraints are mutually exclusive, please remove one or the other from the options object');\n }\n if (options.biasPosition) {\n locationServiceModifiedInput.BiasPosition = options.biasPosition;\n }\n if (options.searchAreaConstraints) {\n locationServiceModifiedInput.FilterBBox = options.searchAreaConstraints;\n }\n return locationServiceModifiedInput;\n}\nexports.mapSearchOptions = mapSearchOptions;\nfunction getGeoUserAgent(action) {\n return (0, utils_1.getAmplifyUserAgentObject)({\n category: utils_1.Category.Geo,\n action,\n });\n}\nexports.getGeoUserAgent = getGeoUserAgent;\nfunction getGeoUserAgentString(action) {\n return (0, utils_1.getAmplifyUserAgent)({\n category: utils_1.Category.Geo,\n action,\n });\n}\nexports.getGeoUserAgentString = getGeoUserAgentString;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,mB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