@aws-amplify/geo 2.3.6-api-v6-models.b3abc9b.0 → 3.0.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/lib/Geo.d.ts +3 -9
- package/lib/Geo.js +137 -243
- package/lib/index.js +4 -2
- package/{lib-esm/Providers → lib/providers/location-service}/AmazonLocationServiceProvider.d.ts +3 -7
- package/lib/providers/location-service/AmazonLocationServiceProvider.js +618 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/AmazonLocationServiceProvider.d.ts +7 -7
- package/lib/types/AmazonLocationServiceProvider.js +0 -1
- package/lib/types/Geo.d.ts +28 -45
- package/lib/types/Geo.js +0 -1
- package/lib/types/Provider.d.ts +0 -1
- package/lib/types/Provider.js +0 -1
- package/lib/types/index.js +6 -1
- package/lib/util.d.ts +4 -0
- package/lib/util.js +51 -36
- package/lib-esm/Geo.d.ts +3 -9
- package/lib-esm/Geo.js +136 -243
- package/lib-esm/index.js +1 -1
- package/{lib/Providers → lib-esm/providers/location-service}/AmazonLocationServiceProvider.d.ts +3 -7
- package/lib-esm/providers/location-service/AmazonLocationServiceProvider.js +614 -0
- package/lib-esm/tsconfig.tsbuildinfo +1 -0
- package/lib-esm/types/AmazonLocationServiceProvider.d.ts +7 -7
- package/lib-esm/types/AmazonLocationServiceProvider.js +1 -1
- package/lib-esm/types/Geo.d.ts +28 -45
- package/lib-esm/types/Geo.js +1 -1
- package/lib-esm/types/Provider.d.ts +0 -1
- package/lib-esm/types/Provider.js +1 -1
- package/lib-esm/types/index.js +5 -1
- package/lib-esm/util.d.ts +4 -0
- package/lib-esm/util.js +45 -34
- package/package.json +26 -12
- package/src/Geo.ts +12 -36
- package/src/{Providers → providers/location-service}/AmazonLocationServiceProvider.ts +65 -68
- package/src/types/Geo.ts +1 -17
- package/src/types/Provider.ts +0 -3
- package/src/util.ts +24 -3
- package/lib/.tsbuildinfo +0 -3
- package/lib/Geo.js.map +0 -1
- package/lib/Providers/AmazonLocationServiceProvider.js +0 -737
- package/lib/Providers/AmazonLocationServiceProvider.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/types/AmazonLocationServiceProvider.js.map +0 -1
- package/lib/types/Geo.js.map +0 -1
- package/lib/types/Provider.js.map +0 -1
- package/lib/types/index.js.map +0 -1
- package/lib/util.js.map +0 -1
- package/lib-esm/.tsbuildinfo +0 -3
- package/lib-esm/Geo.js.map +0 -1
- package/lib-esm/Providers/AmazonLocationServiceProvider.js +0 -735
- package/lib-esm/Providers/AmazonLocationServiceProvider.js.map +0 -1
- package/lib-esm/index.js.map +0 -1
- package/lib-esm/types/AmazonLocationServiceProvider.js.map +0 -1
- package/lib-esm/types/Geo.js.map +0 -1
- package/lib-esm/types/Provider.js.map +0 -1
- package/lib-esm/types/index.js.map +0 -1
- package/lib-esm/util.js.map +0 -1
package/lib-esm/Geo.js
CHANGED
|
@@ -1,210 +1,145 @@
|
|
|
1
|
-
import { __awaiter, __generator, __read } from "tslib";
|
|
2
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
import { Amplify, ConsoleLogger
|
|
5
|
-
import { AmazonLocationServiceProvider } from './
|
|
3
|
+
import { Amplify, ConsoleLogger } from '@aws-amplify/core';
|
|
4
|
+
import { AmazonLocationServiceProvider } from './providers/location-service/AmazonLocationServiceProvider';
|
|
6
5
|
import { validateCoordinates } from './util';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const logger = new ConsoleLogger('Geo');
|
|
7
|
+
const DEFAULT_PROVIDER = 'AmazonLocationService';
|
|
8
|
+
class GeoClass {
|
|
9
|
+
constructor() {
|
|
11
10
|
this._config = {};
|
|
12
11
|
this._pluggables = [];
|
|
12
|
+
const amplifyConfig = Amplify.getConfig() ?? {};
|
|
13
|
+
this._config = Object.assign({}, this._config, amplifyConfig.Geo);
|
|
14
|
+
const locationProvider = new AmazonLocationServiceProvider(amplifyConfig.Geo);
|
|
15
|
+
this._pluggables.push(locationProvider);
|
|
13
16
|
logger.debug('Geo Options', this._config);
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
16
19
|
* get the name of the module category
|
|
17
20
|
* @returns {string} name of the module category
|
|
18
21
|
*/
|
|
19
|
-
|
|
22
|
+
getModuleName() {
|
|
20
23
|
return GeoClass.MODULE;
|
|
21
|
-
}
|
|
24
|
+
}
|
|
22
25
|
/**
|
|
23
26
|
* add plugin into Geo category
|
|
24
27
|
* @param {Object} pluggable - an instance of the plugin
|
|
25
28
|
*/
|
|
26
|
-
|
|
29
|
+
addPluggable(pluggable) {
|
|
27
30
|
if (pluggable && pluggable.getCategory() === 'Geo') {
|
|
28
31
|
this._pluggables.push(pluggable);
|
|
29
|
-
var config = pluggable.configure(this._config[pluggable.getProviderName()]);
|
|
30
|
-
return config;
|
|
31
32
|
}
|
|
32
|
-
}
|
|
33
|
+
}
|
|
33
34
|
/**
|
|
34
35
|
* Get the plugin object
|
|
35
36
|
* @param providerName - the name of the plugin
|
|
36
37
|
*/
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
getPluggable(providerName) {
|
|
39
|
+
const pluggable = this._pluggables.find(pluggable => pluggable.getProviderName() === providerName);
|
|
39
40
|
if (pluggable === undefined) {
|
|
40
41
|
logger.debug('No plugin found with providerName', providerName);
|
|
41
42
|
throw new Error('No plugin found in Geo for the provider');
|
|
42
43
|
}
|
|
43
44
|
else
|
|
44
45
|
return pluggable;
|
|
45
|
-
}
|
|
46
|
+
}
|
|
46
47
|
/**
|
|
47
48
|
* Remove the plugin object
|
|
48
49
|
* @param providerName - the name of the plugin
|
|
49
50
|
*/
|
|
50
|
-
|
|
51
|
-
this._pluggables = this._pluggables.filter(
|
|
51
|
+
removePluggable(providerName) {
|
|
52
|
+
this._pluggables = this._pluggables.filter(pluggable => pluggable.getProviderName() !== providerName);
|
|
52
53
|
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
|
-
};
|
|
54
|
+
}
|
|
74
55
|
/**
|
|
75
56
|
* Get the map resources that are currently available through the provider
|
|
76
57
|
* @param {string} provider
|
|
77
58
|
* @returns - Array of available map resources
|
|
78
59
|
*/
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
var prov = this.getPluggable(provider);
|
|
60
|
+
getAvailableMaps(provider = DEFAULT_PROVIDER) {
|
|
61
|
+
const prov = this.getPluggable(provider);
|
|
82
62
|
return prov.getAvailableMaps();
|
|
83
|
-
}
|
|
63
|
+
}
|
|
84
64
|
/**
|
|
85
65
|
* Get the map resource set as default in amplify config
|
|
86
66
|
* @param {string} provider
|
|
87
67
|
* @returns - Map resource set as the default in amplify config
|
|
88
68
|
*/
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
var prov = this.getPluggable(provider);
|
|
69
|
+
getDefaultMap(provider = DEFAULT_PROVIDER) {
|
|
70
|
+
const prov = this.getPluggable(provider);
|
|
92
71
|
return prov.getDefaultMap();
|
|
93
|
-
}
|
|
72
|
+
}
|
|
94
73
|
/**
|
|
95
74
|
* Search by text input with optional parameters
|
|
96
75
|
* @param {string} text - The text string that is to be searched for
|
|
97
76
|
* @param {SearchByTextOptions} options? - Optional parameters to the search
|
|
98
77
|
* @returns {Promise<Place[]>} - Promise resolves to a list of Places that match search parameters
|
|
99
78
|
*/
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
}
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
};
|
|
79
|
+
async searchByText(text, options) {
|
|
80
|
+
const { providerName = DEFAULT_PROVIDER } = options || {};
|
|
81
|
+
const prov = this.getPluggable(providerName);
|
|
82
|
+
try {
|
|
83
|
+
return await prov.searchByText(text, options);
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
logger.debug(error);
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
122
90
|
/**
|
|
123
91
|
* Search for search term suggestions based on input text
|
|
124
92
|
* @param {string} text - The text string that is to be search for
|
|
125
93
|
* @param {SearchByTextOptions} options? - Optional parameters to the search
|
|
126
94
|
* @returns {Promise<SearchForSuggestionsResults>} - Resolves to an array of search suggestion strings
|
|
127
95
|
*/
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
}
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
};
|
|
96
|
+
async searchForSuggestions(text, options) {
|
|
97
|
+
const { providerName = DEFAULT_PROVIDER } = options || {};
|
|
98
|
+
const prov = this.getPluggable(providerName);
|
|
99
|
+
try {
|
|
100
|
+
return await prov.searchForSuggestions(text, options);
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
logger.debug(error);
|
|
104
|
+
throw error;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
150
107
|
/**
|
|
151
108
|
* Search for location by unique ID
|
|
152
109
|
* @param {string} placeId - Unique ID of the location that is to be searched for
|
|
153
110
|
* @param {searchByPlaceIdOptions} options? - Optional parameters to the search
|
|
154
111
|
* @returns {Promise<Place>} - Resolves to a place with the given placeId
|
|
155
112
|
*/
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
-
}
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
};
|
|
113
|
+
async searchByPlaceId(placeId, options) {
|
|
114
|
+
const providerName = DEFAULT_PROVIDER;
|
|
115
|
+
const prov = this.getPluggable(providerName);
|
|
116
|
+
try {
|
|
117
|
+
return await prov.searchByPlaceId(placeId, options);
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
logger.debug(error);
|
|
121
|
+
throw error;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
178
124
|
/**
|
|
179
125
|
* Reverse geocoding search via a coordinate point on the map
|
|
180
126
|
* @param coordinates - Coordinates array for the search input
|
|
181
127
|
* @param options - Options parameters for the search
|
|
182
128
|
* @returns {Promise<Place>} - Promise that resolves to a place matching search coordinates
|
|
183
129
|
*/
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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
|
-
}
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
};
|
|
130
|
+
async searchByCoordinates(coordinates, options) {
|
|
131
|
+
const { providerName = DEFAULT_PROVIDER } = options || {};
|
|
132
|
+
const prov = this.getPluggable(providerName);
|
|
133
|
+
const [lng, lat] = coordinates;
|
|
134
|
+
try {
|
|
135
|
+
validateCoordinates(lng, lat);
|
|
136
|
+
return await prov.searchByCoordinates(coordinates, options);
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
logger.debug(error);
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
208
143
|
/**
|
|
209
144
|
* Create geofences
|
|
210
145
|
* @param geofences - Single or array of geofence objects to create
|
|
@@ -213,62 +148,42 @@ var GeoClass = /** @class */ (function () {
|
|
|
213
148
|
* successes: list of geofences successfully created
|
|
214
149
|
* errors: list of geofences that failed to create
|
|
215
150
|
*/
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
case 3:
|
|
236
|
-
error_5 = _b.sent();
|
|
237
|
-
logger.debug(error_5);
|
|
238
|
-
throw error_5;
|
|
239
|
-
case 4: return [2 /*return*/];
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
});
|
|
243
|
-
};
|
|
151
|
+
async saveGeofences(geofences, options) {
|
|
152
|
+
const { providerName = DEFAULT_PROVIDER } = options || {};
|
|
153
|
+
const prov = this.getPluggable(providerName);
|
|
154
|
+
// If single geofence input, make it an array for batch call
|
|
155
|
+
let geofenceInputArray;
|
|
156
|
+
if (!Array.isArray(geofences)) {
|
|
157
|
+
geofenceInputArray = [geofences];
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
geofenceInputArray = geofences;
|
|
161
|
+
}
|
|
162
|
+
try {
|
|
163
|
+
return await prov.saveGeofences(geofenceInputArray, options);
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
logger.debug(error);
|
|
167
|
+
throw error;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
244
170
|
/**
|
|
245
171
|
* Get a single geofence by geofenceId
|
|
246
172
|
* @param geofenceId: GeofenceId - The string id of the geofence to get
|
|
247
173
|
* @param options?: GeofenceOptions - Optional parameters for getting a geofence
|
|
248
174
|
* @returns Promise<Geofence> - Promise that resolves to a geofence object
|
|
249
175
|
*/
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|
-
}
|
|
269
|
-
});
|
|
270
|
-
});
|
|
271
|
-
};
|
|
176
|
+
async getGeofence(geofenceId, options) {
|
|
177
|
+
const { providerName = DEFAULT_PROVIDER } = options || {};
|
|
178
|
+
const prov = this.getPluggable(providerName);
|
|
179
|
+
try {
|
|
180
|
+
return await prov.getGeofence(geofenceId, options);
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
logger.debug(error);
|
|
184
|
+
throw error;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
272
187
|
/**
|
|
273
188
|
* List geofences
|
|
274
189
|
* @param options?: ListGeofenceOptions
|
|
@@ -276,28 +191,17 @@ var GeoClass = /** @class */ (function () {
|
|
|
276
191
|
* entries: list of geofences - 100 geofences are listed per page
|
|
277
192
|
* nextToken: token for next page of geofences
|
|
278
193
|
*/
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
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
|
-
}
|
|
298
|
-
});
|
|
299
|
-
});
|
|
300
|
-
};
|
|
194
|
+
async listGeofences(options) {
|
|
195
|
+
const { providerName = DEFAULT_PROVIDER } = options || {};
|
|
196
|
+
const prov = this.getPluggable(providerName);
|
|
197
|
+
try {
|
|
198
|
+
return await prov.listGeofences(options);
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
logger.debug(error);
|
|
202
|
+
throw error;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
301
205
|
/**
|
|
302
206
|
* Delete geofences
|
|
303
207
|
* @param geofenceIds: string|string[]
|
|
@@ -306,38 +210,27 @@ var GeoClass = /** @class */ (function () {
|
|
|
306
210
|
* successes: list of geofences successfully deleted
|
|
307
211
|
* errors: list of geofences that failed to delete
|
|
308
212
|
*/
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
throw error_8;
|
|
332
|
-
case 4: return [2 /*return*/];
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
});
|
|
336
|
-
};
|
|
337
|
-
GeoClass.MODULE = 'Geo';
|
|
338
|
-
return GeoClass;
|
|
339
|
-
}());
|
|
213
|
+
async deleteGeofences(geofenceIds, options) {
|
|
214
|
+
const { providerName = DEFAULT_PROVIDER } = options || {};
|
|
215
|
+
const prov = this.getPluggable(providerName);
|
|
216
|
+
// If single geofence input, make it an array for batch call
|
|
217
|
+
let geofenceIdsInputArray;
|
|
218
|
+
if (!Array.isArray(geofenceIds)) {
|
|
219
|
+
geofenceIdsInputArray = [geofenceIds];
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
geofenceIdsInputArray = geofenceIds;
|
|
223
|
+
}
|
|
224
|
+
// Delete geofences
|
|
225
|
+
try {
|
|
226
|
+
return await prov.deleteGeofences(geofenceIdsInputArray, options);
|
|
227
|
+
}
|
|
228
|
+
catch (error) {
|
|
229
|
+
logger.debug(error);
|
|
230
|
+
throw error;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
GeoClass.MODULE = 'Geo';
|
|
340
235
|
export { GeoClass };
|
|
341
|
-
export
|
|
342
|
-
Amplify.register(Geo);
|
|
343
|
-
//# sourceMappingURL=Geo.js.map
|
|
236
|
+
export const Geo = new GeoClass();
|
package/lib-esm/index.js
CHANGED
package/{lib/Providers → lib-esm/providers/location-service}/AmazonLocationServiceProvider.d.ts
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GeoConfig, SearchByTextOptions, SearchByCoordinatesOptions, GeoProvider, Place, AmazonLocationServiceMapStyle, Coordinates, SearchForSuggestionsResults, GeofenceId, GeofenceInput, AmazonLocationServiceGeofenceOptions, AmazonLocationServiceListGeofenceOptions, ListGeofenceResults, SaveGeofencesResults, AmazonLocationServiceGeofence, AmazonLocationServiceDeleteGeofencesResults, searchByPlaceIdOptions } from '
|
|
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;
|
|
@@ -6,6 +6,7 @@ export declare class AmazonLocationServiceProvider implements GeoProvider {
|
|
|
6
6
|
* @private
|
|
7
7
|
*/
|
|
8
8
|
private _config;
|
|
9
|
+
private _credentials;
|
|
9
10
|
/**
|
|
10
11
|
* Initialize Geo with AWS configurations
|
|
11
12
|
* @param {Object} config - Configuration object for Geo
|
|
@@ -21,12 +22,6 @@ export declare class AmazonLocationServiceProvider implements GeoProvider {
|
|
|
21
22
|
* @returns {string} name of the provider
|
|
22
23
|
*/
|
|
23
24
|
getProviderName(): string;
|
|
24
|
-
/**
|
|
25
|
-
* Configure Geo part with aws configuration
|
|
26
|
-
* @param {Object} config - Configuration of the Geo
|
|
27
|
-
* @return {Object} - Current configuration
|
|
28
|
-
*/
|
|
29
|
-
configure(config?: any): object;
|
|
30
25
|
/**
|
|
31
26
|
* Get the map resources that are currently available through the provider
|
|
32
27
|
* @returns {AmazonLocationServiceMapStyle[]}- Array of available map resources
|
|
@@ -97,6 +92,7 @@ export declare class AmazonLocationServiceProvider implements GeoProvider {
|
|
|
97
92
|
* @private
|
|
98
93
|
*/
|
|
99
94
|
private _ensureCredentials;
|
|
95
|
+
private _refreshConfig;
|
|
100
96
|
private _verifyMapResources;
|
|
101
97
|
private _verifySearchIndex;
|
|
102
98
|
private _verifyGeofenceCollections;
|