@aws-amplify/geo 2.3.4-unstable.bdaee91.0 → 2.3.4-user-agent-backup.c6dfb36.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.
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
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@aws-amplify/geo/internals",
3
+ "types": "../lib-esm/internals/index.d.ts",
4
+ "main": "../lib/internals/index.js",
5
+ "module": "../lib-esm/internals/index.js",
6
+ "react-native": "../lib-esm/internals/index.js",
7
+ "sideEffects": false
8
+ }
package/lib/Geo.d.ts CHANGED
@@ -1,50 +1,12 @@
1
- import { Place, GeoConfig, Coordinates, SearchByTextOptions, SearchByCoordinatesOptions, GeoProvider, MapStyle, GeofenceId, GeofenceInput, GeofenceOptions, SaveGeofencesResults, Geofence, ListGeofenceOptions, ListGeofenceResults, DeleteGeofencesResults, searchByPlaceIdOptions } from './types';
2
- export declare class GeoClass {
1
+ import { Place, Coordinates, SearchByTextOptions, SearchByCoordinatesOptions, GeofenceId, GeofenceInput, GeofenceOptions, SaveGeofencesResults, Geofence, ListGeofenceOptions, ListGeofenceResults, DeleteGeofencesResults, searchByPlaceIdOptions } from './types';
2
+ import { InternalGeoClass } from './internals/InternalGeo';
3
+ export declare class GeoClass extends InternalGeoClass {
3
4
  static MODULE: string;
4
- /**
5
- * @private
6
- */
7
- private _config;
8
- private _pluggables;
9
- constructor();
10
5
  /**
11
6
  * get the name of the module category
12
7
  * @returns {string} name of the module category
13
8
  */
14
9
  getModuleName(): string;
15
- /**
16
- * add plugin into Geo category
17
- * @param {Object} pluggable - an instance of the plugin
18
- */
19
- addPluggable(pluggable: GeoProvider): object;
20
- /**
21
- * Get the plugin object
22
- * @param providerName - the name of the plugin
23
- */
24
- getPluggable(providerName: string): GeoProvider;
25
- /**
26
- * Remove the plugin object
27
- * @param providerName - the name of the plugin
28
- */
29
- removePluggable(providerName: string): void;
30
- /**
31
- * Configure Geo
32
- * @param {Object} config - Configuration object for Geo
33
- * @return {Object} - Current configuration
34
- */
35
- configure(config?: any): GeoConfig;
36
- /**
37
- * Get the map resources that are currently available through the provider
38
- * @param {string} provider
39
- * @returns - Array of available map resources
40
- */
41
- getAvailableMaps(provider?: string): MapStyle[];
42
- /**
43
- * Get the map resource set as default in amplify config
44
- * @param {string} provider
45
- * @returns - Map resource set as the default in amplify config
46
- */
47
- getDefaultMap(provider?: string): MapStyle;
48
10
  /**
49
11
  * Search by text input with optional parameters
50
12
  * @param {string} text - The text string that is to be searched for
package/lib/Geo.js CHANGED
@@ -4,15 +4,11 @@ var tslib_1 = require("tslib");
4
4
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
5
  // SPDX-License-Identifier: Apache-2.0
6
6
  var core_1 = require("@aws-amplify/core");
7
- var AmazonLocationServiceProvider_1 = require("./Providers/AmazonLocationServiceProvider");
8
- var util_1 = require("./util");
9
- var logger = new core_1.ConsoleLogger('Geo');
10
- var DEFAULT_PROVIDER = 'AmazonLocationService';
11
- var GeoClass = /** @class */ (function () {
7
+ var InternalGeo_1 = require("./internals/InternalGeo");
8
+ var GeoClass = /** @class */ (function (_super) {
9
+ tslib_1.__extends(GeoClass, _super);
12
10
  function GeoClass() {
13
- this._config = {};
14
- this._pluggables = [];
15
- logger.debug('Geo Options', this._config);
11
+ return _super !== null && _super.apply(this, arguments) || this;
16
12
  }
17
13
  /**
18
14
  * get the name of the module category
@@ -21,78 +17,6 @@ var GeoClass = /** @class */ (function () {
21
17
  GeoClass.prototype.getModuleName = function () {
22
18
  return GeoClass.MODULE;
23
19
  };
24
- /**
25
- * add plugin into Geo category
26
- * @param {Object} pluggable - an instance of the plugin
27
- */
28
- GeoClass.prototype.addPluggable = function (pluggable) {
29
- if (pluggable && pluggable.getCategory() === 'Geo') {
30
- this._pluggables.push(pluggable);
31
- var config = pluggable.configure(this._config[pluggable.getProviderName()]);
32
- return config;
33
- }
34
- };
35
- /**
36
- * Get the plugin object
37
- * @param providerName - the name of the plugin
38
- */
39
- GeoClass.prototype.getPluggable = function (providerName) {
40
- var pluggable = this._pluggables.find(function (pluggable) { return pluggable.getProviderName() === providerName; });
41
- if (pluggable === undefined) {
42
- logger.debug('No plugin found with providerName', providerName);
43
- throw new Error('No plugin found in Geo for the provider');
44
- }
45
- else
46
- return pluggable;
47
- };
48
- /**
49
- * Remove the plugin object
50
- * @param providerName - the name of the plugin
51
- */
52
- GeoClass.prototype.removePluggable = function (providerName) {
53
- this._pluggables = this._pluggables.filter(function (pluggable) { return pluggable.getProviderName() !== providerName; });
54
- return;
55
- };
56
- /**
57
- * Configure Geo
58
- * @param {Object} config - Configuration object for Geo
59
- * @return {Object} - Current configuration
60
- */
61
- GeoClass.prototype.configure = function (config) {
62
- var _this = this;
63
- logger.debug('configure Geo');
64
- if (!config)
65
- return this._config;
66
- var amplifyConfig = core_1.parseAWSExports(config);
67
- this._config = Object.assign({}, this._config, amplifyConfig.Geo, config);
68
- this._pluggables.forEach(function (pluggable) {
69
- pluggable.configure(_this._config[pluggable.getProviderName()]);
70
- });
71
- if (this._pluggables.length === 0) {
72
- this.addPluggable(new AmazonLocationServiceProvider_1.AmazonLocationServiceProvider());
73
- }
74
- return this._config;
75
- };
76
- /**
77
- * Get the map resources that are currently available through the provider
78
- * @param {string} provider
79
- * @returns - Array of available map resources
80
- */
81
- GeoClass.prototype.getAvailableMaps = function (provider) {
82
- if (provider === void 0) { provider = DEFAULT_PROVIDER; }
83
- var prov = this.getPluggable(provider);
84
- return prov.getAvailableMaps();
85
- };
86
- /**
87
- * Get the map resource set as default in amplify config
88
- * @param {string} provider
89
- * @returns - Map resource set as the default in amplify config
90
- */
91
- GeoClass.prototype.getDefaultMap = function (provider) {
92
- if (provider === void 0) { provider = DEFAULT_PROVIDER; }
93
- var prov = this.getPluggable(provider);
94
- return prov.getDefaultMap();
95
- };
96
20
  /**
97
21
  * Search by text input with optional parameters
98
22
  * @param {string} text - The text string that is to be searched for
@@ -101,23 +25,8 @@ var GeoClass = /** @class */ (function () {
101
25
  */
102
26
  GeoClass.prototype.searchByText = function (text, options) {
103
27
  return tslib_1.__awaiter(this, void 0, void 0, function () {
104
- var _a, providerName, prov, error_1;
105
- return tslib_1.__generator(this, function (_b) {
106
- switch (_b.label) {
107
- case 0:
108
- _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
109
- prov = this.getPluggable(providerName);
110
- _b.label = 1;
111
- case 1:
112
- _b.trys.push([1, 3, , 4]);
113
- return [4 /*yield*/, prov.searchByText(text, options)];
114
- case 2: return [2 /*return*/, _b.sent()];
115
- case 3:
116
- error_1 = _b.sent();
117
- logger.debug(error_1);
118
- throw error_1;
119
- case 4: return [2 /*return*/];
120
- }
28
+ return tslib_1.__generator(this, function (_a) {
29
+ return [2 /*return*/, _super.prototype.searchByText.call(this, text, options)];
121
30
  });
122
31
  });
123
32
  };
@@ -129,23 +38,8 @@ var GeoClass = /** @class */ (function () {
129
38
  */
130
39
  GeoClass.prototype.searchForSuggestions = function (text, options) {
131
40
  return tslib_1.__awaiter(this, void 0, void 0, function () {
132
- var _a, providerName, prov, error_2;
133
- return tslib_1.__generator(this, function (_b) {
134
- switch (_b.label) {
135
- case 0:
136
- _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
137
- prov = this.getPluggable(providerName);
138
- _b.label = 1;
139
- case 1:
140
- _b.trys.push([1, 3, , 4]);
141
- return [4 /*yield*/, prov.searchForSuggestions(text, options)];
142
- case 2: return [2 /*return*/, _b.sent()];
143
- case 3:
144
- error_2 = _b.sent();
145
- logger.debug(error_2);
146
- throw error_2;
147
- case 4: return [2 /*return*/];
148
- }
41
+ return tslib_1.__generator(this, function (_a) {
42
+ return [2 /*return*/, _super.prototype.searchForSuggestions.call(this, text, options)];
149
43
  });
150
44
  });
151
45
  };
@@ -157,23 +51,8 @@ var GeoClass = /** @class */ (function () {
157
51
  */
158
52
  GeoClass.prototype.searchByPlaceId = function (placeId, options) {
159
53
  return tslib_1.__awaiter(this, void 0, void 0, function () {
160
- var providerName, prov, error_3;
161
54
  return tslib_1.__generator(this, function (_a) {
162
- switch (_a.label) {
163
- case 0:
164
- providerName = DEFAULT_PROVIDER;
165
- prov = this.getPluggable(providerName);
166
- _a.label = 1;
167
- case 1:
168
- _a.trys.push([1, 3, , 4]);
169
- return [4 /*yield*/, prov.searchByPlaceId(placeId, options)];
170
- case 2: return [2 /*return*/, _a.sent()];
171
- case 3:
172
- error_3 = _a.sent();
173
- logger.debug(error_3);
174
- throw error_3;
175
- case 4: return [2 /*return*/];
176
- }
55
+ return [2 /*return*/, _super.prototype.searchByPlaceId.call(this, placeId, options)];
177
56
  });
178
57
  });
179
58
  };
@@ -185,25 +64,8 @@ var GeoClass = /** @class */ (function () {
185
64
  */
186
65
  GeoClass.prototype.searchByCoordinates = function (coordinates, options) {
187
66
  return tslib_1.__awaiter(this, void 0, void 0, function () {
188
- var _a, providerName, prov, _b, lng, lat, error_4;
189
- return tslib_1.__generator(this, function (_c) {
190
- switch (_c.label) {
191
- case 0:
192
- _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
193
- prov = this.getPluggable(providerName);
194
- _b = tslib_1.__read(coordinates, 2), lng = _b[0], lat = _b[1];
195
- _c.label = 1;
196
- case 1:
197
- _c.trys.push([1, 3, , 4]);
198
- util_1.validateCoordinates(lng, lat);
199
- return [4 /*yield*/, prov.searchByCoordinates(coordinates, options)];
200
- case 2: return [2 /*return*/, _c.sent()];
201
- case 3:
202
- error_4 = _c.sent();
203
- logger.debug(error_4);
204
- throw error_4;
205
- case 4: return [2 /*return*/];
206
- }
67
+ return tslib_1.__generator(this, function (_a) {
68
+ return [2 /*return*/, _super.prototype.searchByCoordinates.call(this, coordinates, options)];
207
69
  });
208
70
  });
209
71
  };
@@ -217,29 +79,8 @@ var GeoClass = /** @class */ (function () {
217
79
  */
218
80
  GeoClass.prototype.saveGeofences = function (geofences, options) {
219
81
  return tslib_1.__awaiter(this, void 0, void 0, function () {
220
- var _a, providerName, prov, geofenceInputArray, error_5;
221
- return tslib_1.__generator(this, function (_b) {
222
- switch (_b.label) {
223
- case 0:
224
- _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
225
- prov = this.getPluggable(providerName);
226
- if (!Array.isArray(geofences)) {
227
- geofenceInputArray = [geofences];
228
- }
229
- else {
230
- geofenceInputArray = geofences;
231
- }
232
- _b.label = 1;
233
- case 1:
234
- _b.trys.push([1, 3, , 4]);
235
- return [4 /*yield*/, prov.saveGeofences(geofenceInputArray, options)];
236
- case 2: return [2 /*return*/, _b.sent()];
237
- case 3:
238
- error_5 = _b.sent();
239
- logger.debug(error_5);
240
- throw error_5;
241
- case 4: return [2 /*return*/];
242
- }
82
+ return tslib_1.__generator(this, function (_a) {
83
+ return [2 /*return*/, _super.prototype.saveGeofences.call(this, geofences, options)];
243
84
  });
244
85
  });
245
86
  };
@@ -251,23 +92,8 @@ var GeoClass = /** @class */ (function () {
251
92
  */
252
93
  GeoClass.prototype.getGeofence = function (geofenceId, options) {
253
94
  return tslib_1.__awaiter(this, void 0, void 0, function () {
254
- var _a, providerName, prov, error_6;
255
- return tslib_1.__generator(this, function (_b) {
256
- switch (_b.label) {
257
- case 0:
258
- _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
259
- prov = this.getPluggable(providerName);
260
- _b.label = 1;
261
- case 1:
262
- _b.trys.push([1, 3, , 4]);
263
- return [4 /*yield*/, prov.getGeofence(geofenceId, options)];
264
- case 2: return [2 /*return*/, _b.sent()];
265
- case 3:
266
- error_6 = _b.sent();
267
- logger.debug(error_6);
268
- throw error_6;
269
- case 4: return [2 /*return*/];
270
- }
95
+ return tslib_1.__generator(this, function (_a) {
96
+ return [2 /*return*/, _super.prototype.getGeofence.call(this, geofenceId, options)];
271
97
  });
272
98
  });
273
99
  };
@@ -280,23 +106,8 @@ var GeoClass = /** @class */ (function () {
280
106
  */
281
107
  GeoClass.prototype.listGeofences = function (options) {
282
108
  return tslib_1.__awaiter(this, void 0, void 0, function () {
283
- var _a, providerName, prov, error_7;
284
- return tslib_1.__generator(this, function (_b) {
285
- switch (_b.label) {
286
- case 0:
287
- _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
288
- prov = this.getPluggable(providerName);
289
- _b.label = 1;
290
- case 1:
291
- _b.trys.push([1, 3, , 4]);
292
- return [4 /*yield*/, prov.listGeofences(options)];
293
- case 2: return [2 /*return*/, _b.sent()];
294
- case 3:
295
- error_7 = _b.sent();
296
- logger.debug(error_7);
297
- throw error_7;
298
- case 4: return [2 /*return*/];
299
- }
109
+ return tslib_1.__generator(this, function (_a) {
110
+ return [2 /*return*/, _super.prototype.listGeofences.call(this, options)];
300
111
  });
301
112
  });
302
113
  };
@@ -310,35 +121,14 @@ var GeoClass = /** @class */ (function () {
310
121
  */
311
122
  GeoClass.prototype.deleteGeofences = function (geofenceIds, options) {
312
123
  return tslib_1.__awaiter(this, void 0, void 0, function () {
313
- var _a, providerName, prov, geofenceIdsInputArray, error_8;
314
- return tslib_1.__generator(this, function (_b) {
315
- switch (_b.label) {
316
- case 0:
317
- _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
318
- prov = this.getPluggable(providerName);
319
- if (!Array.isArray(geofenceIds)) {
320
- geofenceIdsInputArray = [geofenceIds];
321
- }
322
- else {
323
- geofenceIdsInputArray = geofenceIds;
324
- }
325
- _b.label = 1;
326
- case 1:
327
- _b.trys.push([1, 3, , 4]);
328
- return [4 /*yield*/, prov.deleteGeofences(geofenceIdsInputArray, options)];
329
- case 2: return [2 /*return*/, _b.sent()];
330
- case 3:
331
- error_8 = _b.sent();
332
- logger.debug(error_8);
333
- throw error_8;
334
- case 4: return [2 /*return*/];
335
- }
124
+ return tslib_1.__generator(this, function (_a) {
125
+ return [2 /*return*/, _super.prototype.deleteGeofences.call(this, geofenceIds, options)];
336
126
  });
337
127
  });
338
128
  };
339
129
  GeoClass.MODULE = 'Geo';
340
130
  return GeoClass;
341
- }());
131
+ }(InternalGeo_1.InternalGeoClass));
342
132
  exports.GeoClass = GeoClass;
343
133
  exports.Geo = new GeoClass();
344
134
  core_1.Amplify.register(exports.Geo);
package/lib/Geo.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Geo.js","sourceRoot":"","sources":["../src/Geo.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,0CAI2B;AAC3B,2FAA0F;AAE1F,+BAA6C;AAqB7C,IAAM,MAAM,GAAG,IAAI,oBAAM,CAAC,KAAK,CAAC,CAAC;AAEjC,IAAM,gBAAgB,GAAG,uBAAuB,CAAC;AACjD;IAQC;QACC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACI,gCAAa,GAApB;QACC,OAAO,QAAQ,CAAC,MAAM,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,+BAAY,GAAnB,UAAoB,SAAsB;QACzC,IAAI,SAAS,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;YACnD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACjC,IAAM,MAAM,GAAG,SAAS,CAAC,SAAS,CACjC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC,CACzC,CAAC;YAEF,OAAO,MAAM,CAAC;SACd;IACF,CAAC;IAED;;;OAGG;IACI,+BAAY,GAAnB,UAAoB,YAAoB;QACvC,IAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CACtC,UAAA,SAAS,IAAI,OAAA,SAAS,CAAC,eAAe,EAAE,KAAK,YAAY,EAA5C,CAA4C,CACzD,CAAC;QACF,IAAI,SAAS,K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,OAAO,CAAC,EAAC;;;KACvD;IAED;;;;;;;OAOG;IACU,gCAAa,GAA1B,UACC,SAA0C,EAC1C,OAAyB;;;gBAEzB,sBAAO,iBAAM,aAAa,YAAC,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,8BAAgB,GAsH7C;AAtHY,4BAAQ;AAwHR,QAAA,GAAG,GAAG,IAAI,QAAQ,EAAE,CAAC;AAClC,cAAO,CAAC,QAAQ,CAAC,WAAG,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
  */