@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.
- package/internals/package.json +8 -0
- package/lib/Geo.d.ts +3 -41
- package/lib/Geo.js +20 -230
- package/lib/Geo.js.map +1 -1
- package/lib/Providers/AmazonLocationServiceProvider.d.ts +15 -8
- package/lib/Providers/AmazonLocationServiceProvider.js +26 -20
- package/lib/Providers/AmazonLocationServiceProvider.js.map +1 -1
- package/lib/internals/InternalGeo.d.ts +119 -0
- package/lib/internals/InternalGeo.js +354 -0
- package/lib/internals/InternalGeo.js.map +1 -0
- package/lib/internals/index.d.ts +1 -0
- package/lib/internals/index.js +7 -0
- package/lib/internals/index.js.map +1 -0
- package/lib/internals/utils.d.ts +2 -0
- package/lib/internals/utils.js +10 -0
- package/lib/internals/utils.js.map +1 -0
- package/lib/types/Provider.d.ts +9 -8
- package/lib-esm/Geo.d.ts +3 -41
- package/lib-esm/Geo.js +22 -232
- package/lib-esm/Geo.js.map +1 -1
- package/lib-esm/Providers/AmazonLocationServiceProvider.d.ts +15 -8
- package/lib-esm/Providers/AmazonLocationServiceProvider.js +26 -20
- package/lib-esm/Providers/AmazonLocationServiceProvider.js.map +1 -1
- package/lib-esm/internals/InternalGeo.d.ts +119 -0
- package/lib-esm/internals/InternalGeo.js +352 -0
- package/lib-esm/internals/InternalGeo.js.map +1 -0
- package/lib-esm/internals/index.d.ts +1 -0
- package/lib-esm/internals/index.js +4 -0
- package/lib-esm/internals/index.js.map +1 -0
- package/lib-esm/internals/utils.d.ts +2 -0
- package/lib-esm/internals/utils.js +8 -0
- package/lib-esm/internals/utils.js.map +1 -0
- package/lib-esm/types/Provider.d.ts +9 -8
- package/package.json +6 -5
- package/src/Geo.ts +11 -203
- package/src/Providers/AmazonLocationServiceProvider.ts +39 -20
- package/src/internals/InternalGeo.ts +393 -0
- package/src/internals/index.ts +3 -0
- package/src/internals/utils.ts +15 -0
- package/src/types/Provider.ts +22 -8
package/lib/Geo.d.ts
CHANGED
|
@@ -1,50 +1,12 @@
|
|
|
1
|
-
import { Place,
|
|
2
|
-
|
|
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
|
|
8
|
-
var
|
|
9
|
-
|
|
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
|
|
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
|
-
|
|
105
|
-
|
|
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
|
-
|
|
133
|
-
|
|
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
|
-
|
|
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
|
-
|
|
189
|
-
|
|
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
|
-
|
|
221
|
-
|
|
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
|
-
|
|
255
|
-
|
|
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
|
-
|
|
284
|
-
|
|
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
|
-
|
|
314
|
-
|
|
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,
|
|
1
|
+
{"version":3,"file":"Geo.js","sourceRoot":"","sources":["../src/Geo.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,0CAAqE;AAgBrE,uDAA2D;AAE3D;IAA8B,oCAAgB;IAA9C;;IAsHA,CAAC;IAnHA;;;OAGG;IACI,gCAAa,GAApB;QACC,OAAO,QAAQ,CAAC,MAAM,CAAC;IACxB,CAAC;IAED;;;;;OAKG;IACU,+BAAY,GAAzB,UACC,IAAY,EACZ,OAA6B;;;gBAE7B,sBAAO,iBAAM,YAAY,YAAC,IAAI,EAAE,OAAO,CAAC,EAAC;;;KACzC;IAED;;;;;OAKG;IACU,uCAAoB,GAAjC,UACC,IAAY,EACZ,OAA6B;;;gBAE7B,sBAAO,iBAAM,oBAAoB,YAAC,IAAI,EAAE,OAAO,CAAC,EAAC;;;KACjD;IAED;;;;;OAKG;IACU,kCAAe,GAA5B,UACC,OAAe,EACf,OAAgC;;;gBAEhC,sBAAO,iBAAM,eAAe,YAAC,OAAO,EAAE,OAAO,CAAC,EAAC;;;KAC/C;IAED;;;;;OAKG;IACU,sCAAmB,GAAhC,UACC,WAAwB,EACxB,OAAoC;;;gBAEpC,sBAAO,iBAAM,mBAAmB,YAAC,WAAW,EAAE,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
|
*/
|