@aws-amplify/geo 1.3.12-next.20 → 1.3.12-next.36
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/CHANGELOG.md +32 -0
- package/lib/Geo.d.ts +15 -1
- package/lib/Geo.js +77 -21
- package/lib/Geo.js.map +1 -1
- package/lib/Providers/AmazonLocationServiceProvider.d.ts +10 -1
- package/lib/Providers/AmazonLocationServiceProvider.js +135 -42
- package/lib/Providers/AmazonLocationServiceProvider.js.map +1 -1
- package/lib/types/Geo.d.ts +8 -0
- package/lib/types/Provider.d.ts +3 -1
- package/lib/util.d.ts +1 -0
- package/lib/util.js +19 -0
- package/lib/util.js.map +1 -1
- package/lib-esm/Geo.d.ts +15 -1
- package/lib-esm/Geo.js +78 -22
- package/lib-esm/Geo.js.map +1 -1
- package/lib-esm/Providers/AmazonLocationServiceProvider.d.ts +10 -1
- package/lib-esm/Providers/AmazonLocationServiceProvider.js +138 -45
- package/lib-esm/Providers/AmazonLocationServiceProvider.js.map +1 -1
- package/lib-esm/types/Geo.d.ts +8 -0
- package/lib-esm/types/Provider.d.ts +3 -1
- package/lib-esm/util.d.ts +1 -0
- package/lib-esm/util.js +19 -1
- package/lib-esm/util.js.map +1 -1
- package/package.json +11 -5
- package/src/Geo.ts +45 -2
- package/src/Providers/AmazonLocationServiceProvider.ts +131 -21
- package/src/types/Geo.ts +12 -0
- package/src/types/Provider.ts +12 -0
- package/src/util.ts +23 -0
- package/build.js +0 -5
- package/dist/aws-amplify-geo.js +0 -29238
- package/dist/aws-amplify-geo.js.map +0 -1
- package/dist/aws-amplify-geo.min.js +0 -56
- package/dist/aws-amplify-geo.min.js.map +0 -1
- package/index.js +0 -7
- package/webpack.config.dev.js +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,38 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.3.22](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/geo@1.3.21...@aws-amplify/geo@1.3.22) (2022-10-26)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-amplify/geo
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.3.21](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/geo@1.3.20...@aws-amplify/geo@1.3.21) (2022-10-25)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @aws-amplify/geo
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [1.3.20](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/geo@1.3.19...@aws-amplify/geo@1.3.20) (2022-10-14)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @aws-amplify/geo
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [1.3.19](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/geo@1.3.18...@aws-amplify/geo@1.3.19) (2022-10-14)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @aws-amplify/geo
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
6
38
|
## [1.3.18](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/geo@1.3.16...@aws-amplify/geo@1.3.18) (2022-09-30)
|
|
7
39
|
|
|
8
40
|
**Note:** Version bump only for package @aws-amplify/geo
|
package/lib/Geo.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Place, GeoConfig, Coordinates, SearchByTextOptions, SearchByCoordinatesOptions, GeoProvider, MapStyle, GeofenceId, GeofenceInput, GeofenceOptions, SaveGeofencesResults, Geofence, ListGeofenceOptions, ListGeofenceResults, DeleteGeofencesResults } from './types';
|
|
1
|
+
import { Place, GeoConfig, Coordinates, SearchByTextOptions, SearchByCoordinatesOptions, GeoProvider, MapStyle, GeofenceId, GeofenceInput, GeofenceOptions, SaveGeofencesResults, Geofence, ListGeofenceOptions, ListGeofenceResults, DeleteGeofencesResults, searchByPlaceIdOptions } from './types';
|
|
2
2
|
export declare class GeoClass {
|
|
3
3
|
static MODULE: string;
|
|
4
4
|
/**
|
|
@@ -52,6 +52,20 @@ export declare class GeoClass {
|
|
|
52
52
|
* @returns {Promise<Place[]>} - Promise resolves to a list of Places that match search parameters
|
|
53
53
|
*/
|
|
54
54
|
searchByText(text: string, options?: SearchByTextOptions): Promise<Place[]>;
|
|
55
|
+
/**
|
|
56
|
+
* Search for search term suggestions based on input text
|
|
57
|
+
* @param {string} text - The text string that is to be search for
|
|
58
|
+
* @param {SearchByTextOptions} options? - Optional parameters to the search
|
|
59
|
+
* @returns {Promise<SearchForSuggestionsResults>} - Resolves to an array of search suggestion strings
|
|
60
|
+
*/
|
|
61
|
+
searchForSuggestions(text: string, options?: SearchByTextOptions): Promise<import("./types").SearchForSuggestionsResults>;
|
|
62
|
+
/**
|
|
63
|
+
* Search for location by unique ID
|
|
64
|
+
* @param {string} placeId - Unique ID of the location that is to be searched for
|
|
65
|
+
* @param {searchByPlaceIdOptions} options? - Optional parameters to the search
|
|
66
|
+
* @returns {Promise<Place>} - Resolves to a place with the given placeId
|
|
67
|
+
*/
|
|
68
|
+
searchByPlaceId(placeId: string, options?: searchByPlaceIdOptions): Promise<Place>;
|
|
55
69
|
/**
|
|
56
70
|
* Reverse geocoding search via a coordinate point on the map
|
|
57
71
|
* @param coordinates - Coordinates array for the search input
|
package/lib/Geo.js
CHANGED
|
@@ -73,7 +73,7 @@ var GeoClass = /** @class */ (function () {
|
|
|
73
73
|
logger.debug('configure Geo');
|
|
74
74
|
if (!config)
|
|
75
75
|
return this._config;
|
|
76
|
-
var amplifyConfig = core_1.
|
|
76
|
+
var amplifyConfig = core_1.parseAWSExports(config);
|
|
77
77
|
this._config = Object.assign({}, this._config, amplifyConfig.Geo, config);
|
|
78
78
|
this._pluggables.forEach(function (pluggable) {
|
|
79
79
|
pluggable.configure(_this._config[pluggable.getProviderName()]);
|
|
@@ -131,6 +131,62 @@ var GeoClass = /** @class */ (function () {
|
|
|
131
131
|
});
|
|
132
132
|
});
|
|
133
133
|
};
|
|
134
|
+
/**
|
|
135
|
+
* Search for search term suggestions based on input text
|
|
136
|
+
* @param {string} text - The text string that is to be search for
|
|
137
|
+
* @param {SearchByTextOptions} options? - Optional parameters to the search
|
|
138
|
+
* @returns {Promise<SearchForSuggestionsResults>} - Resolves to an array of search suggestion strings
|
|
139
|
+
*/
|
|
140
|
+
GeoClass.prototype.searchForSuggestions = function (text, options) {
|
|
141
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
142
|
+
var _a, providerName, prov, error_2;
|
|
143
|
+
return tslib_1.__generator(this, function (_b) {
|
|
144
|
+
switch (_b.label) {
|
|
145
|
+
case 0:
|
|
146
|
+
_a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
|
|
147
|
+
prov = this.getPluggable(providerName);
|
|
148
|
+
_b.label = 1;
|
|
149
|
+
case 1:
|
|
150
|
+
_b.trys.push([1, 3, , 4]);
|
|
151
|
+
return [4 /*yield*/, prov.searchForSuggestions(text, options)];
|
|
152
|
+
case 2: return [2 /*return*/, _b.sent()];
|
|
153
|
+
case 3:
|
|
154
|
+
error_2 = _b.sent();
|
|
155
|
+
logger.debug(error_2);
|
|
156
|
+
throw error_2;
|
|
157
|
+
case 4: return [2 /*return*/];
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Search for location by unique ID
|
|
164
|
+
* @param {string} placeId - Unique ID of the location that is to be searched for
|
|
165
|
+
* @param {searchByPlaceIdOptions} options? - Optional parameters to the search
|
|
166
|
+
* @returns {Promise<Place>} - Resolves to a place with the given placeId
|
|
167
|
+
*/
|
|
168
|
+
GeoClass.prototype.searchByPlaceId = function (placeId, options) {
|
|
169
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
170
|
+
var providerName, prov, error_3;
|
|
171
|
+
return tslib_1.__generator(this, function (_a) {
|
|
172
|
+
switch (_a.label) {
|
|
173
|
+
case 0:
|
|
174
|
+
providerName = DEFAULT_PROVIDER;
|
|
175
|
+
prov = this.getPluggable(providerName);
|
|
176
|
+
_a.label = 1;
|
|
177
|
+
case 1:
|
|
178
|
+
_a.trys.push([1, 3, , 4]);
|
|
179
|
+
return [4 /*yield*/, prov.searchByPlaceId(placeId, options)];
|
|
180
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
181
|
+
case 3:
|
|
182
|
+
error_3 = _a.sent();
|
|
183
|
+
logger.debug(error_3);
|
|
184
|
+
throw error_3;
|
|
185
|
+
case 4: return [2 /*return*/];
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
};
|
|
134
190
|
/**
|
|
135
191
|
* Reverse geocoding search via a coordinate point on the map
|
|
136
192
|
* @param coordinates - Coordinates array for the search input
|
|
@@ -139,7 +195,7 @@ var GeoClass = /** @class */ (function () {
|
|
|
139
195
|
*/
|
|
140
196
|
GeoClass.prototype.searchByCoordinates = function (coordinates, options) {
|
|
141
197
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
142
|
-
var _a, providerName, prov, _b, lng, lat,
|
|
198
|
+
var _a, providerName, prov, _b, lng, lat, error_4;
|
|
143
199
|
return tslib_1.__generator(this, function (_c) {
|
|
144
200
|
switch (_c.label) {
|
|
145
201
|
case 0:
|
|
@@ -153,9 +209,9 @@ var GeoClass = /** @class */ (function () {
|
|
|
153
209
|
return [4 /*yield*/, prov.searchByCoordinates(coordinates, options)];
|
|
154
210
|
case 2: return [2 /*return*/, _c.sent()];
|
|
155
211
|
case 3:
|
|
156
|
-
|
|
157
|
-
logger.debug(
|
|
158
|
-
throw
|
|
212
|
+
error_4 = _c.sent();
|
|
213
|
+
logger.debug(error_4);
|
|
214
|
+
throw error_4;
|
|
159
215
|
case 4: return [2 /*return*/];
|
|
160
216
|
}
|
|
161
217
|
});
|
|
@@ -171,7 +227,7 @@ var GeoClass = /** @class */ (function () {
|
|
|
171
227
|
*/
|
|
172
228
|
GeoClass.prototype.saveGeofences = function (geofences, options) {
|
|
173
229
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
174
|
-
var _a, providerName, prov, geofenceInputArray,
|
|
230
|
+
var _a, providerName, prov, geofenceInputArray, error_5;
|
|
175
231
|
return tslib_1.__generator(this, function (_b) {
|
|
176
232
|
switch (_b.label) {
|
|
177
233
|
case 0:
|
|
@@ -189,9 +245,9 @@ var GeoClass = /** @class */ (function () {
|
|
|
189
245
|
return [4 /*yield*/, prov.saveGeofences(geofenceInputArray, options)];
|
|
190
246
|
case 2: return [2 /*return*/, _b.sent()];
|
|
191
247
|
case 3:
|
|
192
|
-
|
|
193
|
-
logger.debug(
|
|
194
|
-
throw
|
|
248
|
+
error_5 = _b.sent();
|
|
249
|
+
logger.debug(error_5);
|
|
250
|
+
throw error_5;
|
|
195
251
|
case 4: return [2 /*return*/];
|
|
196
252
|
}
|
|
197
253
|
});
|
|
@@ -205,7 +261,7 @@ var GeoClass = /** @class */ (function () {
|
|
|
205
261
|
*/
|
|
206
262
|
GeoClass.prototype.getGeofence = function (geofenceId, options) {
|
|
207
263
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
208
|
-
var _a, providerName, prov,
|
|
264
|
+
var _a, providerName, prov, error_6;
|
|
209
265
|
return tslib_1.__generator(this, function (_b) {
|
|
210
266
|
switch (_b.label) {
|
|
211
267
|
case 0:
|
|
@@ -217,9 +273,9 @@ var GeoClass = /** @class */ (function () {
|
|
|
217
273
|
return [4 /*yield*/, prov.getGeofence(geofenceId, options)];
|
|
218
274
|
case 2: return [2 /*return*/, _b.sent()];
|
|
219
275
|
case 3:
|
|
220
|
-
|
|
221
|
-
logger.debug(
|
|
222
|
-
throw
|
|
276
|
+
error_6 = _b.sent();
|
|
277
|
+
logger.debug(error_6);
|
|
278
|
+
throw error_6;
|
|
223
279
|
case 4: return [2 /*return*/];
|
|
224
280
|
}
|
|
225
281
|
});
|
|
@@ -234,7 +290,7 @@ var GeoClass = /** @class */ (function () {
|
|
|
234
290
|
*/
|
|
235
291
|
GeoClass.prototype.listGeofences = function (options) {
|
|
236
292
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
237
|
-
var _a, providerName, prov,
|
|
293
|
+
var _a, providerName, prov, error_7;
|
|
238
294
|
return tslib_1.__generator(this, function (_b) {
|
|
239
295
|
switch (_b.label) {
|
|
240
296
|
case 0:
|
|
@@ -246,9 +302,9 @@ var GeoClass = /** @class */ (function () {
|
|
|
246
302
|
return [4 /*yield*/, prov.listGeofences(options)];
|
|
247
303
|
case 2: return [2 /*return*/, _b.sent()];
|
|
248
304
|
case 3:
|
|
249
|
-
|
|
250
|
-
logger.debug(
|
|
251
|
-
throw
|
|
305
|
+
error_7 = _b.sent();
|
|
306
|
+
logger.debug(error_7);
|
|
307
|
+
throw error_7;
|
|
252
308
|
case 4: return [2 /*return*/];
|
|
253
309
|
}
|
|
254
310
|
});
|
|
@@ -264,7 +320,7 @@ var GeoClass = /** @class */ (function () {
|
|
|
264
320
|
*/
|
|
265
321
|
GeoClass.prototype.deleteGeofences = function (geofenceIds, options) {
|
|
266
322
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
267
|
-
var _a, providerName, prov, geofenceIdsInputArray,
|
|
323
|
+
var _a, providerName, prov, geofenceIdsInputArray, error_8;
|
|
268
324
|
return tslib_1.__generator(this, function (_b) {
|
|
269
325
|
switch (_b.label) {
|
|
270
326
|
case 0:
|
|
@@ -282,9 +338,9 @@ var GeoClass = /** @class */ (function () {
|
|
|
282
338
|
return [4 /*yield*/, prov.deleteGeofences(geofenceIdsInputArray, options)];
|
|
283
339
|
case 2: return [2 /*return*/, _b.sent()];
|
|
284
340
|
case 3:
|
|
285
|
-
|
|
286
|
-
logger.debug(
|
|
287
|
-
throw
|
|
341
|
+
error_8 = _b.sent();
|
|
342
|
+
logger.debug(error_8);
|
|
343
|
+
throw error_8;
|
|
288
344
|
case 4: return [2 /*return*/];
|
|
289
345
|
}
|
|
290
346
|
});
|
package/lib/Geo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Geo.js","sourceRoot":"","sources":["../src/Geo.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACH,0CAI2B;AAC3B,2FAA0F;AAE1F,+BAA6C;
|
|
1
|
+
{"version":3,"file":"Geo.js","sourceRoot":"","sources":["../src/Geo.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACH,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;IAC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CAAA,aAAlB,EAA/B,YAAY,mBAAG,gBAAgB,KAAA,CAAmB;wBACpD,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;wBAI7C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;4BAChC,qBAAqB,GAAG,CAAC,WAAW,CAAC,CAAC;yBACtC;6BAAM;4BACN,qBAAqB,GAAG,WAAW,CAAC;yBACpC;;;;wBAIO,qBAAM,IAAI,CAAC,eAAe,CAAC,qBAAqB,EAAE,OAAO,CAAC,EAAA;4BAAjE,sBAAO,SAA0D,EAAC;;;wBAElE,MAAM,CAAC,KAAK,CAAC,OAAK,CAAC,CAAC;wBACpB,MAAM,OAAK,CAAC;;;;;KAEb;IAvSM,eAAM,GAAG,KAAK,CAAC;IAwSvB,eAAC;CAAA,AAzSD,IAySC;AAzSY,4BAAQ;AA2SR,QAAA,GAAG,GAAG,IAAI,QAAQ,EAAE,CAAC;AAClC,cAAO,CAAC,QAAQ,CAAC,WAAG,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GeoConfig, SearchByTextOptions, SearchByCoordinatesOptions, GeoProvider, Place, AmazonLocationServiceMapStyle, Coordinates, GeofenceId, GeofenceInput, AmazonLocationServiceGeofenceOptions, AmazonLocationServiceListGeofenceOptions, ListGeofenceResults, SaveGeofencesResults, AmazonLocationServiceGeofence, AmazonLocationServiceDeleteGeofencesResults } from '../types';
|
|
1
|
+
import { GeoConfig, SearchByTextOptions, SearchByCoordinatesOptions, GeoProvider, Place, AmazonLocationServiceMapStyle, Coordinates, SearchForSuggestionsResults, GeofenceId, GeofenceInput, AmazonLocationServiceGeofenceOptions, AmazonLocationServiceListGeofenceOptions, ListGeofenceResults, SaveGeofencesResults, AmazonLocationServiceGeofence, AmazonLocationServiceDeleteGeofencesResults, searchByPlaceIdOptions } from '../types';
|
|
2
2
|
export declare class AmazonLocationServiceProvider implements GeoProvider {
|
|
3
3
|
static CATEGORY: string;
|
|
4
4
|
static PROVIDER_NAME: string;
|
|
@@ -44,6 +44,15 @@ export declare class AmazonLocationServiceProvider implements GeoProvider {
|
|
|
44
44
|
* @returns {Promise<Place[]>} - Promise resolves to a list of Places that match search parameters
|
|
45
45
|
*/
|
|
46
46
|
searchByText(text: string, options?: SearchByTextOptions): Promise<Place[]>;
|
|
47
|
+
/**
|
|
48
|
+
* Search for suggestions based on the input text
|
|
49
|
+
* @param {string} text - The text string that is to be searched for
|
|
50
|
+
* @param {SearchByTextOptions} options? - Optional parameters to the search
|
|
51
|
+
* @returns {Promise<SearchForSuggestionsResults>} - Resolves to an array of search suggestion strings
|
|
52
|
+
*/
|
|
53
|
+
searchForSuggestions(text: string, options?: SearchByTextOptions): Promise<SearchForSuggestionsResults>;
|
|
54
|
+
private _verifyPlaceId;
|
|
55
|
+
searchByPlaceId(placeId: string, options?: searchByPlaceIdOptions): Promise<Place | undefined>;
|
|
47
56
|
/**
|
|
48
57
|
* Reverse geocoding search via a coordinate point on the map
|
|
49
58
|
* @param coordinates - Coordinates array for the search input
|
|
@@ -105,20 +105,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
105
105
|
* Map search options to Amazon Location Service input object
|
|
106
106
|
*/
|
|
107
107
|
if (options) {
|
|
108
|
-
locationServiceInput
|
|
109
|
-
locationServiceInput.MaxResults = options.maxResults;
|
|
110
|
-
if (options.searchIndexName) {
|
|
111
|
-
locationServiceInput.IndexName = options.searchIndexName;
|
|
112
|
-
}
|
|
113
|
-
if (options['biasPosition'] && options['searchAreaConstraints']) {
|
|
114
|
-
throw new Error('BiasPosition and SearchAreaConstraints are mutually exclusive, please remove one or the other from the options object');
|
|
115
|
-
}
|
|
116
|
-
if (options['biasPosition']) {
|
|
117
|
-
locationServiceInput.BiasPosition = options['biasPosition'];
|
|
118
|
-
}
|
|
119
|
-
if (options['searchAreaConstraints']) {
|
|
120
|
-
locationServiceInput.FilterBBox = options['searchAreaConstraints'];
|
|
121
|
-
}
|
|
108
|
+
locationServiceInput = tslib_1.__assign(tslib_1.__assign({}, locationServiceInput), util_1.mapSearchOptions(options, locationServiceInput));
|
|
122
109
|
}
|
|
123
110
|
client = new client_location_1.LocationClient({
|
|
124
111
|
credentials: this._config.credentials,
|
|
@@ -147,6 +134,112 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
147
134
|
});
|
|
148
135
|
});
|
|
149
136
|
};
|
|
137
|
+
/**
|
|
138
|
+
* Search for suggestions based on the input text
|
|
139
|
+
* @param {string} text - The text string that is to be searched for
|
|
140
|
+
* @param {SearchByTextOptions} options? - Optional parameters to the search
|
|
141
|
+
* @returns {Promise<SearchForSuggestionsResults>} - Resolves to an array of search suggestion strings
|
|
142
|
+
*/
|
|
143
|
+
AmazonLocationServiceProvider.prototype.searchForSuggestions = function (text, options) {
|
|
144
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
145
|
+
var credentialsOK, locationServiceInput, client, command, response, error_2, results;
|
|
146
|
+
return tslib_1.__generator(this, function (_a) {
|
|
147
|
+
switch (_a.label) {
|
|
148
|
+
case 0: return [4 /*yield*/, this._ensureCredentials()];
|
|
149
|
+
case 1:
|
|
150
|
+
credentialsOK = _a.sent();
|
|
151
|
+
if (!credentialsOK) {
|
|
152
|
+
throw new Error('No credentials');
|
|
153
|
+
}
|
|
154
|
+
this._verifySearchIndex(options === null || options === void 0 ? void 0 : options.searchIndexName);
|
|
155
|
+
locationServiceInput = {
|
|
156
|
+
Text: text,
|
|
157
|
+
IndexName: this._config.search_indices.default,
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Map search options to Amazon Location Service input object
|
|
161
|
+
*/
|
|
162
|
+
if (options) {
|
|
163
|
+
locationServiceInput = tslib_1.__assign(tslib_1.__assign({}, locationServiceInput), util_1.mapSearchOptions(options, locationServiceInput));
|
|
164
|
+
}
|
|
165
|
+
client = new client_location_1.LocationClient({
|
|
166
|
+
credentials: this._config.credentials,
|
|
167
|
+
region: this._config.region,
|
|
168
|
+
customUserAgent: core_1.getAmplifyUserAgent(),
|
|
169
|
+
});
|
|
170
|
+
command = new client_location_1.SearchPlaceIndexForSuggestionsCommand(locationServiceInput);
|
|
171
|
+
_a.label = 2;
|
|
172
|
+
case 2:
|
|
173
|
+
_a.trys.push([2, 4, , 5]);
|
|
174
|
+
return [4 /*yield*/, client.send(command)];
|
|
175
|
+
case 3:
|
|
176
|
+
response = _a.sent();
|
|
177
|
+
return [3 /*break*/, 5];
|
|
178
|
+
case 4:
|
|
179
|
+
error_2 = _a.sent();
|
|
180
|
+
logger.debug(error_2);
|
|
181
|
+
throw error_2;
|
|
182
|
+
case 5:
|
|
183
|
+
results = response.Results.map(function (result) { return ({
|
|
184
|
+
text: result.Text,
|
|
185
|
+
placeId: result.PlaceId,
|
|
186
|
+
}); });
|
|
187
|
+
return [2 /*return*/, results];
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
AmazonLocationServiceProvider.prototype._verifyPlaceId = function (placeId) {
|
|
193
|
+
if (placeId.length === 0) {
|
|
194
|
+
var errorString = 'PlaceId cannot be an empty string.';
|
|
195
|
+
logger.debug(errorString);
|
|
196
|
+
throw new Error(errorString);
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
AmazonLocationServiceProvider.prototype.searchByPlaceId = function (placeId, options) {
|
|
200
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
201
|
+
var credentialsOK, client, searchByPlaceIdInput, command, response, error_3, place;
|
|
202
|
+
return tslib_1.__generator(this, function (_a) {
|
|
203
|
+
switch (_a.label) {
|
|
204
|
+
case 0: return [4 /*yield*/, this._ensureCredentials()];
|
|
205
|
+
case 1:
|
|
206
|
+
credentialsOK = _a.sent();
|
|
207
|
+
if (!credentialsOK) {
|
|
208
|
+
throw new Error('No credentials');
|
|
209
|
+
}
|
|
210
|
+
this._verifySearchIndex(options === null || options === void 0 ? void 0 : options.searchIndexName);
|
|
211
|
+
this._verifyPlaceId(placeId);
|
|
212
|
+
client = new client_location_1.LocationClient({
|
|
213
|
+
credentials: this._config.credentials,
|
|
214
|
+
region: this._config.region,
|
|
215
|
+
customUserAgent: core_1.getAmplifyUserAgent(),
|
|
216
|
+
});
|
|
217
|
+
searchByPlaceIdInput = {
|
|
218
|
+
PlaceId: placeId,
|
|
219
|
+
IndexName: (options === null || options === void 0 ? void 0 : options.searchIndexName) || this._config.search_indices.default,
|
|
220
|
+
};
|
|
221
|
+
command = new client_location_1.GetPlaceCommand(searchByPlaceIdInput);
|
|
222
|
+
_a.label = 2;
|
|
223
|
+
case 2:
|
|
224
|
+
_a.trys.push([2, 4, , 5]);
|
|
225
|
+
return [4 /*yield*/, client.send(command)];
|
|
226
|
+
case 3:
|
|
227
|
+
response = _a.sent();
|
|
228
|
+
return [3 /*break*/, 5];
|
|
229
|
+
case 4:
|
|
230
|
+
error_3 = _a.sent();
|
|
231
|
+
logger.debug(error_3);
|
|
232
|
+
throw error_3;
|
|
233
|
+
case 5:
|
|
234
|
+
place = response.Place;
|
|
235
|
+
if (place) {
|
|
236
|
+
return [2 /*return*/, camelcase_keys_1.default(place, { deep: true })];
|
|
237
|
+
}
|
|
238
|
+
return [2 /*return*/];
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
};
|
|
150
243
|
/**
|
|
151
244
|
* Reverse geocoding search via a coordinate point on the map
|
|
152
245
|
* @param coordinates - Coordinates array for the search input
|
|
@@ -155,7 +248,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
155
248
|
*/
|
|
156
249
|
AmazonLocationServiceProvider.prototype.searchByCoordinates = function (coordinates, options) {
|
|
157
250
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
158
|
-
var credentialsOK, locationServiceInput, client, command, response,
|
|
251
|
+
var credentialsOK, locationServiceInput, client, command, response, error_4, PascalResults, results;
|
|
159
252
|
return tslib_1.__generator(this, function (_a) {
|
|
160
253
|
switch (_a.label) {
|
|
161
254
|
case 0: return [4 /*yield*/, this._ensureCredentials()];
|
|
@@ -189,9 +282,9 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
189
282
|
response = _a.sent();
|
|
190
283
|
return [3 /*break*/, 5];
|
|
191
284
|
case 4:
|
|
192
|
-
|
|
193
|
-
logger.debug(
|
|
194
|
-
throw
|
|
285
|
+
error_4 = _a.sent();
|
|
286
|
+
logger.debug(error_4);
|
|
287
|
+
throw error_4;
|
|
195
288
|
case 5:
|
|
196
289
|
PascalResults = response.Results.map(function (result) { return result.Place; });
|
|
197
290
|
results = camelcase_keys_1.default(PascalResults[0], {
|
|
@@ -254,7 +347,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
254
347
|
geofenceBatches.push(PascalGeofences.splice(0, apiLimit));
|
|
255
348
|
}
|
|
256
349
|
return [4 /*yield*/, Promise.all(geofenceBatches.map(function (batch) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
257
|
-
var response,
|
|
350
|
+
var response, error_5;
|
|
258
351
|
return tslib_1.__generator(this, function (_a) {
|
|
259
352
|
switch (_a.label) {
|
|
260
353
|
case 0:
|
|
@@ -264,14 +357,14 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
264
357
|
response = _a.sent();
|
|
265
358
|
return [3 /*break*/, 3];
|
|
266
359
|
case 2:
|
|
267
|
-
|
|
360
|
+
error_5 = _a.sent();
|
|
268
361
|
// If the API call fails, add the geofences to the errors array and move to next batch
|
|
269
362
|
batch.forEach(function (geofence) {
|
|
270
363
|
results.errors.push({
|
|
271
364
|
geofenceId: geofence.GeofenceId,
|
|
272
365
|
error: {
|
|
273
366
|
code: 'APIConnectionError',
|
|
274
|
-
message:
|
|
367
|
+
message: error_5.message,
|
|
275
368
|
},
|
|
276
369
|
});
|
|
277
370
|
});
|
|
@@ -316,7 +409,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
316
409
|
*/
|
|
317
410
|
AmazonLocationServiceProvider.prototype.getGeofence = function (geofenceId, options) {
|
|
318
411
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
319
|
-
var credentialsOK, client, commandInput, command, response,
|
|
412
|
+
var credentialsOK, client, commandInput, command, response, error_6, GeofenceId, CreateTime, UpdateTime, Status, Geometry, geofence;
|
|
320
413
|
return tslib_1.__generator(this, function (_a) {
|
|
321
414
|
switch (_a.label) {
|
|
322
415
|
case 0: return [4 /*yield*/, this._ensureCredentials()];
|
|
@@ -352,9 +445,9 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
352
445
|
response = _a.sent();
|
|
353
446
|
return [3 /*break*/, 5];
|
|
354
447
|
case 4:
|
|
355
|
-
|
|
356
|
-
logger.debug(
|
|
357
|
-
throw
|
|
448
|
+
error_6 = _a.sent();
|
|
449
|
+
logger.debug(error_6);
|
|
450
|
+
throw error_6;
|
|
358
451
|
case 5:
|
|
359
452
|
GeofenceId = response.GeofenceId, CreateTime = response.CreateTime, UpdateTime = response.UpdateTime, Status = response.Status, Geometry = response.Geometry;
|
|
360
453
|
geofence = {
|
|
@@ -380,7 +473,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
380
473
|
*/
|
|
381
474
|
AmazonLocationServiceProvider.prototype.listGeofences = function (options) {
|
|
382
475
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
383
|
-
var credentialsOK, client, listGeofencesInput, command, response,
|
|
476
|
+
var credentialsOK, client, listGeofencesInput, command, response, error_7, NextToken, Entries, results;
|
|
384
477
|
return tslib_1.__generator(this, function (_a) {
|
|
385
478
|
switch (_a.label) {
|
|
386
479
|
case 0: return [4 /*yield*/, this._ensureCredentials()];
|
|
@@ -415,9 +508,9 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
415
508
|
response = _a.sent();
|
|
416
509
|
return [3 /*break*/, 5];
|
|
417
510
|
case 4:
|
|
418
|
-
|
|
419
|
-
logger.debug(
|
|
420
|
-
throw
|
|
511
|
+
error_7 = _a.sent();
|
|
512
|
+
logger.debug(error_7);
|
|
513
|
+
throw error_7;
|
|
421
514
|
case 5:
|
|
422
515
|
NextToken = response.NextToken, Entries = response.Entries;
|
|
423
516
|
results = {
|
|
@@ -486,7 +579,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
486
579
|
geofenceIdBatches.push(geofenceIds.slice(count, (count += 10)));
|
|
487
580
|
}
|
|
488
581
|
return [4 /*yield*/, Promise.all(geofenceIdBatches.map(function (batch) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
489
|
-
var response,
|
|
582
|
+
var response, error_8, badGeofenceIds;
|
|
490
583
|
var _a;
|
|
491
584
|
return tslib_1.__generator(this, function (_b) {
|
|
492
585
|
switch (_b.label) {
|
|
@@ -497,14 +590,14 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
497
590
|
response = _b.sent();
|
|
498
591
|
return [3 /*break*/, 3];
|
|
499
592
|
case 2:
|
|
500
|
-
|
|
593
|
+
error_8 = _b.sent();
|
|
501
594
|
// If the API call fails, add the geofences to the errors array and move to next batch
|
|
502
595
|
batch.forEach(function (geofenceId) {
|
|
503
596
|
var errorObject = {
|
|
504
597
|
geofenceId: geofenceId,
|
|
505
598
|
error: {
|
|
506
|
-
code:
|
|
507
|
-
message:
|
|
599
|
+
code: error_8.message,
|
|
600
|
+
message: error_8.message,
|
|
508
601
|
},
|
|
509
602
|
};
|
|
510
603
|
results.errors.push(errorObject);
|
|
@@ -532,7 +625,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
532
625
|
*/
|
|
533
626
|
AmazonLocationServiceProvider.prototype._ensureCredentials = function () {
|
|
534
627
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
535
|
-
var credentials, cred,
|
|
628
|
+
var credentials, cred, error_9;
|
|
536
629
|
return tslib_1.__generator(this, function (_a) {
|
|
537
630
|
switch (_a.label) {
|
|
538
631
|
case 0:
|
|
@@ -547,8 +640,8 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
547
640
|
this._config.credentials = cred;
|
|
548
641
|
return [2 /*return*/, true];
|
|
549
642
|
case 2:
|
|
550
|
-
|
|
551
|
-
logger.debug('Ensure credentials error. Credentials are:',
|
|
643
|
+
error_9 = _a.sent();
|
|
644
|
+
logger.debug('Ensure credentials error. Credentials are:', error_9);
|
|
552
645
|
return [2 /*return*/, false];
|
|
553
646
|
case 3: return [2 /*return*/];
|
|
554
647
|
}
|
|
@@ -586,7 +679,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
586
679
|
};
|
|
587
680
|
AmazonLocationServiceProvider.prototype._AmazonLocationServiceBatchPutGeofenceCall = function (PascalGeofences, collectionName) {
|
|
588
681
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
589
|
-
var geofenceInput, client, command, response,
|
|
682
|
+
var geofenceInput, client, command, response, error_10;
|
|
590
683
|
return tslib_1.__generator(this, function (_a) {
|
|
591
684
|
switch (_a.label) {
|
|
592
685
|
case 0:
|
|
@@ -608,8 +701,8 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
608
701
|
response = _a.sent();
|
|
609
702
|
return [3 /*break*/, 4];
|
|
610
703
|
case 3:
|
|
611
|
-
|
|
612
|
-
throw
|
|
704
|
+
error_10 = _a.sent();
|
|
705
|
+
throw error_10;
|
|
613
706
|
case 4: return [2 /*return*/, response];
|
|
614
707
|
}
|
|
615
708
|
});
|
|
@@ -617,7 +710,7 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
617
710
|
};
|
|
618
711
|
AmazonLocationServiceProvider.prototype._AmazonLocationServiceBatchDeleteGeofenceCall = function (geofenceIds, collectionName) {
|
|
619
712
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
620
|
-
var deleteGeofencesInput, client, command, response,
|
|
713
|
+
var deleteGeofencesInput, client, command, response, error_11;
|
|
621
714
|
return tslib_1.__generator(this, function (_a) {
|
|
622
715
|
switch (_a.label) {
|
|
623
716
|
case 0:
|
|
@@ -639,8 +732,8 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
639
732
|
response = _a.sent();
|
|
640
733
|
return [3 /*break*/, 4];
|
|
641
734
|
case 3:
|
|
642
|
-
|
|
643
|
-
throw
|
|
735
|
+
error_11 = _a.sent();
|
|
736
|
+
throw error_11;
|
|
644
737
|
case 4: return [2 /*return*/, response];
|
|
645
738
|
}
|
|
646
739
|
});
|