@aws-amplify/geo 2.2.0 → 2.2.1-unstable.01bfa8f.4

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.
Files changed (40) hide show
  1. package/internals/package.json +8 -0
  2. package/lib/Geo.d.ts +3 -41
  3. package/lib/Geo.js +20 -230
  4. package/lib/Geo.js.map +1 -1
  5. package/lib/Providers/AmazonLocationServiceProvider.d.ts +15 -8
  6. package/lib/Providers/AmazonLocationServiceProvider.js +26 -20
  7. package/lib/Providers/AmazonLocationServiceProvider.js.map +1 -1
  8. package/lib/internals/InternalGeo.d.ts +119 -0
  9. package/lib/internals/InternalGeo.js +354 -0
  10. package/lib/internals/InternalGeo.js.map +1 -0
  11. package/lib/internals/index.d.ts +1 -0
  12. package/lib/internals/index.js +7 -0
  13. package/lib/internals/index.js.map +1 -0
  14. package/lib/internals/utils.d.ts +2 -0
  15. package/lib/internals/utils.js +10 -0
  16. package/lib/internals/utils.js.map +1 -0
  17. package/lib/types/Provider.d.ts +9 -8
  18. package/lib-esm/Geo.d.ts +3 -41
  19. package/lib-esm/Geo.js +22 -232
  20. package/lib-esm/Geo.js.map +1 -1
  21. package/lib-esm/Providers/AmazonLocationServiceProvider.d.ts +15 -8
  22. package/lib-esm/Providers/AmazonLocationServiceProvider.js +26 -20
  23. package/lib-esm/Providers/AmazonLocationServiceProvider.js.map +1 -1
  24. package/lib-esm/internals/InternalGeo.d.ts +119 -0
  25. package/lib-esm/internals/InternalGeo.js +352 -0
  26. package/lib-esm/internals/InternalGeo.js.map +1 -0
  27. package/lib-esm/internals/index.d.ts +1 -0
  28. package/lib-esm/internals/index.js +4 -0
  29. package/lib-esm/internals/index.js.map +1 -0
  30. package/lib-esm/internals/utils.d.ts +2 -0
  31. package/lib-esm/internals/utils.js +8 -0
  32. package/lib-esm/internals/utils.js.map +1 -0
  33. package/lib-esm/types/Provider.d.ts +9 -8
  34. package/package.json +6 -5
  35. package/src/Geo.ts +11 -203
  36. package/src/Providers/AmazonLocationServiceProvider.ts +39 -20
  37. package/src/internals/InternalGeo.ts +393 -0
  38. package/src/internals/index.ts +3 -0
  39. package/src/internals/utils.ts +15 -0
  40. package/src/types/Provider.ts +22 -8
package/lib-esm/Geo.js CHANGED
@@ -1,16 +1,12 @@
1
- import { __awaiter, __generator, __read } from "tslib";
1
+ import { __awaiter, __extends, __generator } from "tslib";
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
- import { Amplify, ConsoleLogger as Logger, parseAWSExports, } from '@aws-amplify/core';
5
- import { AmazonLocationServiceProvider } from './Providers/AmazonLocationServiceProvider';
6
- import { validateCoordinates } from './util';
7
- var logger = new Logger('Geo');
8
- var DEFAULT_PROVIDER = 'AmazonLocationService';
9
- var GeoClass = /** @class */ (function () {
4
+ import { Amplify } from '@aws-amplify/core';
5
+ import { InternalGeoClass } from './internals/InternalGeo';
6
+ var GeoClass = /** @class */ (function (_super) {
7
+ __extends(GeoClass, _super);
10
8
  function GeoClass() {
11
- this._config = {};
12
- this._pluggables = [];
13
- logger.debug('Geo Options', this._config);
9
+ return _super !== null && _super.apply(this, arguments) || this;
14
10
  }
15
11
  /**
16
12
  * get the name of the module category
@@ -19,78 +15,6 @@ var GeoClass = /** @class */ (function () {
19
15
  GeoClass.prototype.getModuleName = function () {
20
16
  return GeoClass.MODULE;
21
17
  };
22
- /**
23
- * add plugin into Geo category
24
- * @param {Object} pluggable - an instance of the plugin
25
- */
26
- GeoClass.prototype.addPluggable = function (pluggable) {
27
- if (pluggable && pluggable.getCategory() === 'Geo') {
28
- this._pluggables.push(pluggable);
29
- var config = pluggable.configure(this._config[pluggable.getProviderName()]);
30
- return config;
31
- }
32
- };
33
- /**
34
- * Get the plugin object
35
- * @param providerName - the name of the plugin
36
- */
37
- GeoClass.prototype.getPluggable = function (providerName) {
38
- var pluggable = this._pluggables.find(function (pluggable) { return pluggable.getProviderName() === providerName; });
39
- if (pluggable === undefined) {
40
- logger.debug('No plugin found with providerName', providerName);
41
- throw new Error('No plugin found in Geo for the provider');
42
- }
43
- else
44
- return pluggable;
45
- };
46
- /**
47
- * Remove the plugin object
48
- * @param providerName - the name of the plugin
49
- */
50
- GeoClass.prototype.removePluggable = function (providerName) {
51
- this._pluggables = this._pluggables.filter(function (pluggable) { return pluggable.getProviderName() !== providerName; });
52
- return;
53
- };
54
- /**
55
- * Configure Geo
56
- * @param {Object} config - Configuration object for Geo
57
- * @return {Object} - Current configuration
58
- */
59
- GeoClass.prototype.configure = function (config) {
60
- var _this = this;
61
- logger.debug('configure Geo');
62
- if (!config)
63
- return this._config;
64
- var amplifyConfig = parseAWSExports(config);
65
- this._config = Object.assign({}, this._config, amplifyConfig.Geo, config);
66
- this._pluggables.forEach(function (pluggable) {
67
- pluggable.configure(_this._config[pluggable.getProviderName()]);
68
- });
69
- if (this._pluggables.length === 0) {
70
- this.addPluggable(new AmazonLocationServiceProvider());
71
- }
72
- return this._config;
73
- };
74
- /**
75
- * Get the map resources that are currently available through the provider
76
- * @param {string} provider
77
- * @returns - Array of available map resources
78
- */
79
- GeoClass.prototype.getAvailableMaps = function (provider) {
80
- if (provider === void 0) { provider = DEFAULT_PROVIDER; }
81
- var prov = this.getPluggable(provider);
82
- return prov.getAvailableMaps();
83
- };
84
- /**
85
- * Get the map resource set as default in amplify config
86
- * @param {string} provider
87
- * @returns - Map resource set as the default in amplify config
88
- */
89
- GeoClass.prototype.getDefaultMap = function (provider) {
90
- if (provider === void 0) { provider = DEFAULT_PROVIDER; }
91
- var prov = this.getPluggable(provider);
92
- return prov.getDefaultMap();
93
- };
94
18
  /**
95
19
  * Search by text input with optional parameters
96
20
  * @param {string} text - The text string that is to be searched for
@@ -99,23 +23,8 @@ var GeoClass = /** @class */ (function () {
99
23
  */
100
24
  GeoClass.prototype.searchByText = function (text, options) {
101
25
  return __awaiter(this, void 0, void 0, function () {
102
- var _a, providerName, prov, error_1;
103
- return __generator(this, function (_b) {
104
- switch (_b.label) {
105
- case 0:
106
- _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
107
- prov = this.getPluggable(providerName);
108
- _b.label = 1;
109
- case 1:
110
- _b.trys.push([1, 3, , 4]);
111
- return [4 /*yield*/, prov.searchByText(text, options)];
112
- case 2: return [2 /*return*/, _b.sent()];
113
- case 3:
114
- error_1 = _b.sent();
115
- logger.debug(error_1);
116
- throw error_1;
117
- case 4: return [2 /*return*/];
118
- }
26
+ return __generator(this, function (_a) {
27
+ return [2 /*return*/, _super.prototype.searchByText.call(this, text, options)];
119
28
  });
120
29
  });
121
30
  };
@@ -127,23 +36,8 @@ var GeoClass = /** @class */ (function () {
127
36
  */
128
37
  GeoClass.prototype.searchForSuggestions = function (text, options) {
129
38
  return __awaiter(this, void 0, void 0, function () {
130
- var _a, providerName, prov, error_2;
131
- return __generator(this, function (_b) {
132
- switch (_b.label) {
133
- case 0:
134
- _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
135
- prov = this.getPluggable(providerName);
136
- _b.label = 1;
137
- case 1:
138
- _b.trys.push([1, 3, , 4]);
139
- return [4 /*yield*/, prov.searchForSuggestions(text, options)];
140
- case 2: return [2 /*return*/, _b.sent()];
141
- case 3:
142
- error_2 = _b.sent();
143
- logger.debug(error_2);
144
- throw error_2;
145
- case 4: return [2 /*return*/];
146
- }
39
+ return __generator(this, function (_a) {
40
+ return [2 /*return*/, _super.prototype.searchForSuggestions.call(this, text, options)];
147
41
  });
148
42
  });
149
43
  };
@@ -155,23 +49,8 @@ var GeoClass = /** @class */ (function () {
155
49
  */
156
50
  GeoClass.prototype.searchByPlaceId = function (placeId, options) {
157
51
  return __awaiter(this, void 0, void 0, function () {
158
- var providerName, prov, error_3;
159
52
  return __generator(this, function (_a) {
160
- switch (_a.label) {
161
- case 0:
162
- providerName = DEFAULT_PROVIDER;
163
- prov = this.getPluggable(providerName);
164
- _a.label = 1;
165
- case 1:
166
- _a.trys.push([1, 3, , 4]);
167
- return [4 /*yield*/, prov.searchByPlaceId(placeId, options)];
168
- case 2: return [2 /*return*/, _a.sent()];
169
- case 3:
170
- error_3 = _a.sent();
171
- logger.debug(error_3);
172
- throw error_3;
173
- case 4: return [2 /*return*/];
174
- }
53
+ return [2 /*return*/, _super.prototype.searchByPlaceId.call(this, placeId, options)];
175
54
  });
176
55
  });
177
56
  };
@@ -183,25 +62,8 @@ var GeoClass = /** @class */ (function () {
183
62
  */
184
63
  GeoClass.prototype.searchByCoordinates = function (coordinates, options) {
185
64
  return __awaiter(this, void 0, void 0, function () {
186
- var _a, providerName, prov, _b, lng, lat, error_4;
187
- return __generator(this, function (_c) {
188
- switch (_c.label) {
189
- case 0:
190
- _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
191
- prov = this.getPluggable(providerName);
192
- _b = __read(coordinates, 2), lng = _b[0], lat = _b[1];
193
- _c.label = 1;
194
- case 1:
195
- _c.trys.push([1, 3, , 4]);
196
- validateCoordinates(lng, lat);
197
- return [4 /*yield*/, prov.searchByCoordinates(coordinates, options)];
198
- case 2: return [2 /*return*/, _c.sent()];
199
- case 3:
200
- error_4 = _c.sent();
201
- logger.debug(error_4);
202
- throw error_4;
203
- case 4: return [2 /*return*/];
204
- }
65
+ return __generator(this, function (_a) {
66
+ return [2 /*return*/, _super.prototype.searchByCoordinates.call(this, coordinates, options)];
205
67
  });
206
68
  });
207
69
  };
@@ -215,29 +77,8 @@ var GeoClass = /** @class */ (function () {
215
77
  */
216
78
  GeoClass.prototype.saveGeofences = function (geofences, options) {
217
79
  return __awaiter(this, void 0, void 0, function () {
218
- var _a, providerName, prov, geofenceInputArray, error_5;
219
- return __generator(this, function (_b) {
220
- switch (_b.label) {
221
- case 0:
222
- _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
223
- prov = this.getPluggable(providerName);
224
- if (!Array.isArray(geofences)) {
225
- geofenceInputArray = [geofences];
226
- }
227
- else {
228
- geofenceInputArray = geofences;
229
- }
230
- _b.label = 1;
231
- case 1:
232
- _b.trys.push([1, 3, , 4]);
233
- return [4 /*yield*/, prov.saveGeofences(geofenceInputArray, options)];
234
- case 2: return [2 /*return*/, _b.sent()];
235
- case 3:
236
- error_5 = _b.sent();
237
- logger.debug(error_5);
238
- throw error_5;
239
- case 4: return [2 /*return*/];
240
- }
80
+ return __generator(this, function (_a) {
81
+ return [2 /*return*/, _super.prototype.saveGeofences.call(this, geofences, options)];
241
82
  });
242
83
  });
243
84
  };
@@ -249,23 +90,8 @@ var GeoClass = /** @class */ (function () {
249
90
  */
250
91
  GeoClass.prototype.getGeofence = function (geofenceId, options) {
251
92
  return __awaiter(this, void 0, void 0, function () {
252
- var _a, providerName, prov, error_6;
253
- return __generator(this, function (_b) {
254
- switch (_b.label) {
255
- case 0:
256
- _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
257
- prov = this.getPluggable(providerName);
258
- _b.label = 1;
259
- case 1:
260
- _b.trys.push([1, 3, , 4]);
261
- return [4 /*yield*/, prov.getGeofence(geofenceId, options)];
262
- case 2: return [2 /*return*/, _b.sent()];
263
- case 3:
264
- error_6 = _b.sent();
265
- logger.debug(error_6);
266
- throw error_6;
267
- case 4: return [2 /*return*/];
268
- }
93
+ return __generator(this, function (_a) {
94
+ return [2 /*return*/, _super.prototype.getGeofence.call(this, geofenceId, options)];
269
95
  });
270
96
  });
271
97
  };
@@ -278,23 +104,8 @@ var GeoClass = /** @class */ (function () {
278
104
  */
279
105
  GeoClass.prototype.listGeofences = function (options) {
280
106
  return __awaiter(this, void 0, void 0, function () {
281
- var _a, providerName, prov, error_7;
282
- return __generator(this, function (_b) {
283
- switch (_b.label) {
284
- case 0:
285
- _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
286
- prov = this.getPluggable(providerName);
287
- _b.label = 1;
288
- case 1:
289
- _b.trys.push([1, 3, , 4]);
290
- return [4 /*yield*/, prov.listGeofences(options)];
291
- case 2: return [2 /*return*/, _b.sent()];
292
- case 3:
293
- error_7 = _b.sent();
294
- logger.debug(error_7);
295
- throw error_7;
296
- case 4: return [2 /*return*/];
297
- }
107
+ return __generator(this, function (_a) {
108
+ return [2 /*return*/, _super.prototype.listGeofences.call(this, options)];
298
109
  });
299
110
  });
300
111
  };
@@ -308,35 +119,14 @@ var GeoClass = /** @class */ (function () {
308
119
  */
309
120
  GeoClass.prototype.deleteGeofences = function (geofenceIds, options) {
310
121
  return __awaiter(this, void 0, void 0, function () {
311
- var _a, providerName, prov, geofenceIdsInputArray, error_8;
312
- return __generator(this, function (_b) {
313
- switch (_b.label) {
314
- case 0:
315
- _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
316
- prov = this.getPluggable(providerName);
317
- if (!Array.isArray(geofenceIds)) {
318
- geofenceIdsInputArray = [geofenceIds];
319
- }
320
- else {
321
- geofenceIdsInputArray = geofenceIds;
322
- }
323
- _b.label = 1;
324
- case 1:
325
- _b.trys.push([1, 3, , 4]);
326
- return [4 /*yield*/, prov.deleteGeofences(geofenceIdsInputArray, options)];
327
- case 2: return [2 /*return*/, _b.sent()];
328
- case 3:
329
- error_8 = _b.sent();
330
- logger.debug(error_8);
331
- throw error_8;
332
- case 4: return [2 /*return*/];
333
- }
122
+ return __generator(this, function (_a) {
123
+ return [2 /*return*/, _super.prototype.deleteGeofences.call(this, geofenceIds, options)];
334
124
  });
335
125
  });
336
126
  };
337
127
  GeoClass.MODULE = 'Geo';
338
128
  return GeoClass;
339
- }());
129
+ }(InternalGeoClass));
340
130
  export { GeoClass };
341
131
  export var Geo = new GeoClass();
342
132
  Amplify.register(Geo);
@@ -1 +1 @@
1
- {"version":3,"file":"Geo.js","sourceRoot":"","sources":["../src/Geo.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EACN,OAAO,EACP,aAAa,IAAI,MAAM,EACvB,eAAe,GACf,MAAM,mBAA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,SAAS,EAAE,OAAO,CAAC,EAAC;;;KAC/C;IAED;;;;;OAKG;IACU,8BAAW,GAAxB,UACC,UAAsB,EACtB,OAAyB;;;gBAEzB,sBAAO,iBAAM,WAAW,YAAC,UAAU,EAAE,OAAO,CAAC,EAAC;;;KAC9C;IAED;;;;;;OAMG;IACU,gCAAa,GAA1B,UACC,OAA6B;;;gBAE7B,sBAAO,iBAAM,aAAa,YAAC,OAAO,CAAC,EAAC;;;KACpC;IAED;;;;;;;OAOG;IACU,kCAAe,GAA5B,UACC,WAA8B,EAC9B,OAAyB;;;gBAEzB,sBAAO,iBAAM,eAAe,YAAC,WAAW,EAAE,OAAO,CAAC,EAAC;;;KACnD;IApHM,eAAM,GAAG,KAAK,CAAC;IAqHvB,eAAC;CAAA,AAtHD,CAA8B,gBAAgB,GAsH7C;SAtHY,QAAQ;AAwHrB,MAAM,CAAC,IAAM,GAAG,GAAG,IAAI,QAAQ,EAAE,CAAC;AAClC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { CustomUserAgentDetails } from '@aws-amplify/core';
1
2
  import { GeoConfig, SearchByTextOptions, SearchByCoordinatesOptions, GeoProvider, Place, AmazonLocationServiceMapStyle, Coordinates, SearchForSuggestionsResults, GeofenceId, GeofenceInput, AmazonLocationServiceGeofenceOptions, AmazonLocationServiceListGeofenceOptions, ListGeofenceResults, SaveGeofencesResults, AmazonLocationServiceGeofence, AmazonLocationServiceDeleteGeofencesResults, searchByPlaceIdOptions } from '../types';
2
3
  export declare class AmazonLocationServiceProvider implements GeoProvider {
3
4
  static CATEGORY: string;
@@ -41,58 +42,64 @@ export declare class AmazonLocationServiceProvider implements GeoProvider {
41
42
  * Search by text input with optional parameters
42
43
  * @param {string} text - The text string that is to be searched for
43
44
  * @param {SearchByTextOptions} options? - Optional parameters to the search
45
+ * @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
44
46
  * @returns {Promise<Place[]>} - Promise resolves to a list of Places that match search parameters
45
47
  */
46
- searchByText(text: string, options?: SearchByTextOptions): Promise<Place[]>;
48
+ searchByText(text: string, options?: SearchByTextOptions, customUserAgentDetails?: CustomUserAgentDetails): Promise<Place[]>;
47
49
  /**
48
50
  * Search for suggestions based on the input text
49
51
  * @param {string} text - The text string that is to be searched for
50
52
  * @param {SearchByTextOptions} options? - Optional parameters to the search
53
+ * @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
51
54
  * @returns {Promise<SearchForSuggestionsResults>} - Resolves to an array of search suggestion strings
52
55
  */
53
- searchForSuggestions(text: string, options?: SearchByTextOptions): Promise<SearchForSuggestionsResults>;
56
+ searchForSuggestions(text: string, options?: SearchByTextOptions, customUserAgentDetails?: CustomUserAgentDetails): Promise<SearchForSuggestionsResults>;
54
57
  private _verifyPlaceId;
55
- searchByPlaceId(placeId: string, options?: searchByPlaceIdOptions): Promise<Place | undefined>;
58
+ searchByPlaceId(placeId: string, options?: searchByPlaceIdOptions, customUserAgentDetails?: CustomUserAgentDetails): Promise<Place | undefined>;
56
59
  /**
57
60
  * Reverse geocoding search via a coordinate point on the map
58
61
  * @param coordinates - Coordinates array for the search input
59
62
  * @param options - Options parameters for the search
60
63
  * @returns {Promise<Place>} - Promise that resolves to a place matching search coordinates
61
64
  */
62
- searchByCoordinates(coordinates: Coordinates, options?: SearchByCoordinatesOptions): Promise<Place>;
65
+ searchByCoordinates(coordinates: Coordinates, options?: SearchByCoordinatesOptions, customUserAgentDetails?: CustomUserAgentDetails): Promise<Place>;
63
66
  /**
64
67
  * Create geofences inside of a geofence collection
65
68
  * @param geofences - Array of geofence objects to create
66
69
  * @param options? - Optional parameters for creating geofences
70
+ * @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
67
71
  * @returns {Promise<AmazonLocationServiceSaveGeofencesResults>} - Promise that resolves to an object with:
68
72
  * successes: list of geofences successfully created
69
73
  * errors: list of geofences that failed to create
70
74
  */
71
- saveGeofences(geofences: GeofenceInput[], options?: AmazonLocationServiceGeofenceOptions): Promise<SaveGeofencesResults>;
75
+ saveGeofences(geofences: GeofenceInput[], options?: AmazonLocationServiceGeofenceOptions, customUserAgentDetails?: CustomUserAgentDetails): Promise<SaveGeofencesResults>;
72
76
  /**
73
77
  * Get geofence from a geofence collection
74
78
  * @param geofenceId:string
75
79
  * @param options?: Optional parameters for getGeofence
80
+ * @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
76
81
  * @returns {Promise<AmazonLocationServiceGeofence>} - Promise that resolves to a geofence object
77
82
  */
78
- getGeofence(geofenceId: GeofenceId, options?: AmazonLocationServiceGeofenceOptions): Promise<AmazonLocationServiceGeofence>;
83
+ getGeofence(geofenceId: GeofenceId, options?: AmazonLocationServiceGeofenceOptions, customUserAgentDetails?: CustomUserAgentDetails): Promise<AmazonLocationServiceGeofence>;
79
84
  /**
80
85
  * List geofences from a geofence collection
81
86
  * @param options?: ListGeofenceOptions
87
+ * @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
82
88
  * @returns {Promise<ListGeofencesResults>} - Promise that resolves to an object with:
83
89
  * entries: list of geofences - 100 geofences are listed per page
84
90
  * nextToken: token for next page of geofences
85
91
  */
86
- listGeofences(options?: AmazonLocationServiceListGeofenceOptions): Promise<ListGeofenceResults>;
92
+ listGeofences(options?: AmazonLocationServiceListGeofenceOptions, customUserAgentDetails?: CustomUserAgentDetails): Promise<ListGeofenceResults>;
87
93
  /**
88
94
  * Delete geofences from a geofence collection
89
95
  * @param geofenceIds: string|string[]
90
96
  * @param options?: GeofenceOptions
97
+ * @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
91
98
  * @returns {Promise<DeleteGeofencesResults>} - Promise that resolves to an object with:
92
99
  * successes: list of geofences successfully deleted
93
100
  * errors: list of geofences that failed to delete
94
101
  */
95
- deleteGeofences(geofenceIds: string[], options?: AmazonLocationServiceGeofenceOptions): Promise<AmazonLocationServiceDeleteGeofencesResults>;
102
+ deleteGeofences(geofenceIds: string[], options?: AmazonLocationServiceGeofenceOptions, customUserAgentDetails?: CustomUserAgentDetails): Promise<AmazonLocationServiceDeleteGeofencesResults>;
96
103
  /**
97
104
  * @private
98
105
  */
@@ -71,9 +71,10 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
71
71
  * Search by text input with optional parameters
72
72
  * @param {string} text - The text string that is to be searched for
73
73
  * @param {SearchByTextOptions} options? - Optional parameters to the search
74
+ * @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
74
75
  * @returns {Promise<Place[]>} - Promise resolves to a list of Places that match search parameters
75
76
  */
76
- AmazonLocationServiceProvider.prototype.searchByText = function (text, options) {
77
+ AmazonLocationServiceProvider.prototype.searchByText = function (text, options, customUserAgentDetails) {
77
78
  return __awaiter(this, void 0, void 0, function () {
78
79
  var credentialsOK, locationServiceInput, client, command, response, error_1, PascalResults, results;
79
80
  return __generator(this, function (_a) {
@@ -98,7 +99,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
98
99
  client = new LocationClient({
99
100
  credentials: this._config.credentials,
100
101
  region: this._config.region,
101
- customUserAgent: getAmplifyUserAgentObject(),
102
+ customUserAgent: getAmplifyUserAgentObject(customUserAgentDetails),
102
103
  });
103
104
  command = new SearchPlaceIndexForTextCommand(locationServiceInput);
104
105
  _a.label = 2;
@@ -126,9 +127,10 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
126
127
  * Search for suggestions based on the input text
127
128
  * @param {string} text - The text string that is to be searched for
128
129
  * @param {SearchByTextOptions} options? - Optional parameters to the search
130
+ * @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
129
131
  * @returns {Promise<SearchForSuggestionsResults>} - Resolves to an array of search suggestion strings
130
132
  */
131
- AmazonLocationServiceProvider.prototype.searchForSuggestions = function (text, options) {
133
+ AmazonLocationServiceProvider.prototype.searchForSuggestions = function (text, options, customUserAgentDetails) {
132
134
  return __awaiter(this, void 0, void 0, function () {
133
135
  var credentialsOK, locationServiceInput, client, command, response, error_2, results;
134
136
  return __generator(this, function (_a) {
@@ -153,7 +155,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
153
155
  client = new LocationClient({
154
156
  credentials: this._config.credentials,
155
157
  region: this._config.region,
156
- customUserAgent: getAmplifyUserAgentObject(),
158
+ customUserAgent: getAmplifyUserAgentObject(customUserAgentDetails),
157
159
  });
158
160
  command = new SearchPlaceIndexForSuggestionsCommand(locationServiceInput);
159
161
  _a.label = 2;
@@ -184,7 +186,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
184
186
  throw new Error(errorString);
185
187
  }
186
188
  };
187
- AmazonLocationServiceProvider.prototype.searchByPlaceId = function (placeId, options) {
189
+ AmazonLocationServiceProvider.prototype.searchByPlaceId = function (placeId, options, customUserAgentDetails) {
188
190
  return __awaiter(this, void 0, void 0, function () {
189
191
  var credentialsOK, client, searchByPlaceIdInput, command, response, error_3, place;
190
192
  return __generator(this, function (_a) {
@@ -200,7 +202,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
200
202
  client = new LocationClient({
201
203
  credentials: this._config.credentials,
202
204
  region: this._config.region,
203
- customUserAgent: getAmplifyUserAgentObject(),
205
+ customUserAgent: getAmplifyUserAgentObject(customUserAgentDetails),
204
206
  });
205
207
  searchByPlaceIdInput = {
206
208
  PlaceId: placeId,
@@ -234,7 +236,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
234
236
  * @param options - Options parameters for the search
235
237
  * @returns {Promise<Place>} - Promise that resolves to a place matching search coordinates
236
238
  */
237
- AmazonLocationServiceProvider.prototype.searchByCoordinates = function (coordinates, options) {
239
+ AmazonLocationServiceProvider.prototype.searchByCoordinates = function (coordinates, options, customUserAgentDetails) {
238
240
  return __awaiter(this, void 0, void 0, function () {
239
241
  var credentialsOK, locationServiceInput, client, command, response, error_4, PascalResults, results;
240
242
  return __generator(this, function (_a) {
@@ -259,7 +261,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
259
261
  client = new LocationClient({
260
262
  credentials: this._config.credentials,
261
263
  region: this._config.region,
262
- customUserAgent: getAmplifyUserAgentObject(),
264
+ customUserAgent: getAmplifyUserAgentObject(customUserAgentDetails),
263
265
  });
264
266
  command = new SearchPlaceIndexForPositionCommand(locationServiceInput);
265
267
  _a.label = 2;
@@ -287,11 +289,12 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
287
289
  * Create geofences inside of a geofence collection
288
290
  * @param geofences - Array of geofence objects to create
289
291
  * @param options? - Optional parameters for creating geofences
292
+ * @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
290
293
  * @returns {Promise<AmazonLocationServiceSaveGeofencesResults>} - Promise that resolves to an object with:
291
294
  * successes: list of geofences successfully created
292
295
  * errors: list of geofences that failed to create
293
296
  */
294
- AmazonLocationServiceProvider.prototype.saveGeofences = function (geofences, options) {
297
+ AmazonLocationServiceProvider.prototype.saveGeofences = function (geofences, options, customUserAgentDetails) {
295
298
  return __awaiter(this, void 0, void 0, function () {
296
299
  var credentialsOK, PascalGeofences, results, geofenceBatches, apiLimit;
297
300
  var _this = this;
@@ -340,7 +343,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
340
343
  switch (_a.label) {
341
344
  case 0:
342
345
  _a.trys.push([0, 2, , 3]);
343
- return [4 /*yield*/, this._AmazonLocationServiceBatchPutGeofenceCall(batch, (options === null || options === void 0 ? void 0 : options.collectionName) || this._config.geofenceCollections.default)];
346
+ return [4 /*yield*/, this._AmazonLocationServiceBatchPutGeofenceCall(batch, (options === null || options === void 0 ? void 0 : options.collectionName) || this._config.geofenceCollections.default, customUserAgentDetails)];
344
347
  case 1:
345
348
  response = _a.sent();
346
349
  return [3 /*break*/, 3];
@@ -393,9 +396,10 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
393
396
  * Get geofence from a geofence collection
394
397
  * @param geofenceId:string
395
398
  * @param options?: Optional parameters for getGeofence
399
+ * @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
396
400
  * @returns {Promise<AmazonLocationServiceGeofence>} - Promise that resolves to a geofence object
397
401
  */
398
- AmazonLocationServiceProvider.prototype.getGeofence = function (geofenceId, options) {
402
+ AmazonLocationServiceProvider.prototype.getGeofence = function (geofenceId, options, customUserAgentDetails) {
399
403
  return __awaiter(this, void 0, void 0, function () {
400
404
  var credentialsOK, client, commandInput, command, response, error_6, GeofenceId, CreateTime, UpdateTime, Status, Geometry, geofence;
401
405
  return __generator(this, function (_a) {
@@ -418,7 +422,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
418
422
  client = new LocationClient({
419
423
  credentials: this._config.credentials,
420
424
  region: this._config.region,
421
- customUserAgent: getAmplifyUserAgentObject(),
425
+ customUserAgent: getAmplifyUserAgentObject(customUserAgentDetails),
422
426
  });
423
427
  commandInput = {
424
428
  GeofenceId: geofenceId,
@@ -455,11 +459,12 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
455
459
  /**
456
460
  * List geofences from a geofence collection
457
461
  * @param options?: ListGeofenceOptions
462
+ * @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
458
463
  * @returns {Promise<ListGeofencesResults>} - Promise that resolves to an object with:
459
464
  * entries: list of geofences - 100 geofences are listed per page
460
465
  * nextToken: token for next page of geofences
461
466
  */
462
- AmazonLocationServiceProvider.prototype.listGeofences = function (options) {
467
+ AmazonLocationServiceProvider.prototype.listGeofences = function (options, customUserAgentDetails) {
463
468
  return __awaiter(this, void 0, void 0, function () {
464
469
  var credentialsOK, client, listGeofencesInput, command, response, error_7, NextToken, Entries, results;
465
470
  return __generator(this, function (_a) {
@@ -481,7 +486,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
481
486
  client = new LocationClient({
482
487
  credentials: this._config.credentials,
483
488
  region: this._config.region,
484
- customUserAgent: getAmplifyUserAgentObject(),
489
+ customUserAgent: getAmplifyUserAgentObject(customUserAgentDetails),
485
490
  });
486
491
  listGeofencesInput = {
487
492
  NextToken: options === null || options === void 0 ? void 0 : options.nextToken,
@@ -525,11 +530,12 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
525
530
  * Delete geofences from a geofence collection
526
531
  * @param geofenceIds: string|string[]
527
532
  * @param options?: GeofenceOptions
533
+ * @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
528
534
  * @returns {Promise<DeleteGeofencesResults>} - Promise that resolves to an object with:
529
535
  * successes: list of geofences successfully deleted
530
536
  * errors: list of geofences that failed to delete
531
537
  */
532
- AmazonLocationServiceProvider.prototype.deleteGeofences = function (geofenceIds, options) {
538
+ AmazonLocationServiceProvider.prototype.deleteGeofences = function (geofenceIds, options, customUserAgentDetails) {
533
539
  return __awaiter(this, void 0, void 0, function () {
534
540
  var credentialsOK, badGeofenceIds, results, geofenceIdBatches, count;
535
541
  var _this = this;
@@ -573,7 +579,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
573
579
  switch (_b.label) {
574
580
  case 0:
575
581
  _b.trys.push([0, 2, , 3]);
576
- return [4 /*yield*/, this._AmazonLocationServiceBatchDeleteGeofenceCall(batch, (options === null || options === void 0 ? void 0 : options.collectionName) || this._config.geofenceCollections.default)];
582
+ return [4 /*yield*/, this._AmazonLocationServiceBatchDeleteGeofenceCall(batch, (options === null || options === void 0 ? void 0 : options.collectionName) || this._config.geofenceCollections.default, customUserAgentDetails)];
577
583
  case 1:
578
584
  response = _b.sent();
579
585
  return [3 /*break*/, 3];
@@ -665,7 +671,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
665
671
  throw new Error(errorString);
666
672
  }
667
673
  };
668
- AmazonLocationServiceProvider.prototype._AmazonLocationServiceBatchPutGeofenceCall = function (PascalGeofences, collectionName) {
674
+ AmazonLocationServiceProvider.prototype._AmazonLocationServiceBatchPutGeofenceCall = function (PascalGeofences, collectionName, customUserAgentDetails) {
669
675
  return __awaiter(this, void 0, void 0, function () {
670
676
  var geofenceInput, client, command, response, error_10;
671
677
  return __generator(this, function (_a) {
@@ -678,7 +684,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
678
684
  client = new LocationClient({
679
685
  credentials: this._config.credentials,
680
686
  region: this._config.region,
681
- customUserAgent: getAmplifyUserAgentObject(),
687
+ customUserAgent: getAmplifyUserAgentObject(customUserAgentDetails),
682
688
  });
683
689
  command = new BatchPutGeofenceCommand(geofenceInput);
684
690
  _a.label = 1;
@@ -696,7 +702,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
696
702
  });
697
703
  });
698
704
  };
699
- AmazonLocationServiceProvider.prototype._AmazonLocationServiceBatchDeleteGeofenceCall = function (geofenceIds, collectionName) {
705
+ AmazonLocationServiceProvider.prototype._AmazonLocationServiceBatchDeleteGeofenceCall = function (geofenceIds, collectionName, customUserAgentDetails) {
700
706
  return __awaiter(this, void 0, void 0, function () {
701
707
  var deleteGeofencesInput, client, command, response, error_11;
702
708
  return __generator(this, function (_a) {
@@ -709,7 +715,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
709
715
  client = new LocationClient({
710
716
  credentials: this._config.credentials,
711
717
  region: this._config.region,
712
- customUserAgent: getAmplifyUserAgentObject(),
718
+ customUserAgent: getAmplifyUserAgentObject(customUserAgentDetails),
713
719
  });
714
720
  command = new BatchDeleteGeofenceCommand(deleteGeofencesInput);
715
721
  _a.label = 1;