@aws-amplify/geo 3.0.1-console-preview.5a31ca1.0 → 3.0.1-console-preview.8d88eef.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.js CHANGED
@@ -5,10 +5,9 @@ var tslib_1 = require("tslib");
5
5
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
6
6
  // SPDX-License-Identifier: Apache-2.0
7
7
  var core_1 = require("@aws-amplify/core");
8
- var utils_1 = require("@aws-amplify/core/internals/utils");
9
8
  var AmazonLocationServiceProvider_1 = require("./providers/location-service/AmazonLocationServiceProvider");
10
9
  var util_1 = require("./util");
11
- var logger = new utils_1.ConsoleLogger('Geo');
10
+ var logger = new core_1.ConsoleLogger('Geo');
12
11
  var DEFAULT_PROVIDER = 'AmazonLocationService';
13
12
  var GeoClass = exports.GeoClass = /** @class */ (function () {
14
13
  function GeoClass() {
@@ -9,7 +9,7 @@ var core_1 = require("@aws-amplify/core");
9
9
  var utils_1 = require("@aws-amplify/core/internals/utils");
10
10
  var client_location_1 = require("@aws-sdk/client-location");
11
11
  var util_1 = require("../../util");
12
- var logger = new utils_1.ConsoleLogger('AmazonLocationServiceProvider');
12
+ var logger = new core_1.ConsoleLogger('AmazonLocationServiceProvider');
13
13
  var AmazonLocationServiceProvider = exports.AmazonLocationServiceProvider = /** @class */ (function () {
14
14
  /**
15
15
  * Initialize Geo with AWS configurations
@@ -90,7 +90,7 @@ var AmazonLocationServiceProvider = exports.AmazonLocationServiceProvider = /**
90
90
  client = new client_location_1.LocationClient({
91
91
  credentials: this._credentials,
92
92
  region: this._config.region,
93
- customUserAgent: (0, utils_1.getAmplifyUserAgentObject)(),
93
+ customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.SearchByText),
94
94
  });
95
95
  command = new client_location_1.SearchPlaceIndexForTextCommand(locationServiceInput);
96
96
  _a.label = 2;
@@ -145,7 +145,7 @@ var AmazonLocationServiceProvider = exports.AmazonLocationServiceProvider = /**
145
145
  client = new client_location_1.LocationClient({
146
146
  credentials: this._credentials,
147
147
  region: this._config.region,
148
- customUserAgent: (0, utils_1.getAmplifyUserAgentObject)(),
148
+ customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.SearchForSuggestions),
149
149
  });
150
150
  command = new client_location_1.SearchPlaceIndexForSuggestionsCommand(locationServiceInput);
151
151
  _a.label = 2;
@@ -192,7 +192,7 @@ var AmazonLocationServiceProvider = exports.AmazonLocationServiceProvider = /**
192
192
  client = new client_location_1.LocationClient({
193
193
  credentials: this._credentials,
194
194
  region: this._config.region,
195
- customUserAgent: (0, utils_1.getAmplifyUserAgentObject)(),
195
+ customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.SearchByPlaceId),
196
196
  });
197
197
  searchByPlaceIdInput = {
198
198
  PlaceId: placeId,
@@ -251,7 +251,7 @@ var AmazonLocationServiceProvider = exports.AmazonLocationServiceProvider = /**
251
251
  client = new client_location_1.LocationClient({
252
252
  credentials: this._credentials,
253
253
  region: this._config.region,
254
- customUserAgent: (0, utils_1.getAmplifyUserAgentObject)(),
254
+ customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.SearchByCoordinates),
255
255
  });
256
256
  command = new client_location_1.SearchPlaceIndexForPositionCommand(locationServiceInput);
257
257
  _a.label = 2;
@@ -413,7 +413,7 @@ var AmazonLocationServiceProvider = exports.AmazonLocationServiceProvider = /**
413
413
  client = new client_location_1.LocationClient({
414
414
  credentials: this._credentials,
415
415
  region: this._config.region,
416
- customUserAgent: (0, utils_1.getAmplifyUserAgentObject)(),
416
+ customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.GetGeofence),
417
417
  });
418
418
  commandInput = {
419
419
  GeofenceId: geofenceId,
@@ -476,7 +476,7 @@ var AmazonLocationServiceProvider = exports.AmazonLocationServiceProvider = /**
476
476
  client = new client_location_1.LocationClient({
477
477
  credentials: this._credentials,
478
478
  region: this._config.region,
479
- customUserAgent: (0, utils_1.getAmplifyUserAgentObject)(),
479
+ customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.ListGeofences),
480
480
  });
481
481
  listGeofencesInput = {
482
482
  NextToken: options === null || options === void 0 ? void 0 : options.nextToken,
@@ -686,7 +686,7 @@ var AmazonLocationServiceProvider = exports.AmazonLocationServiceProvider = /**
686
686
  client = new client_location_1.LocationClient({
687
687
  credentials: this._credentials,
688
688
  region: this._config.region,
689
- customUserAgent: (0, utils_1.getAmplifyUserAgentObject)(),
689
+ customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.SaveGeofences),
690
690
  });
691
691
  command = new client_location_1.BatchPutGeofenceCommand(geofenceInput);
692
692
  _a.label = 1;
@@ -717,7 +717,7 @@ var AmazonLocationServiceProvider = exports.AmazonLocationServiceProvider = /**
717
717
  client = new client_location_1.LocationClient({
718
718
  credentials: this._credentials,
719
719
  region: this._config.region,
720
- customUserAgent: (0, utils_1.getAmplifyUserAgentObject)(),
720
+ customUserAgent: (0, util_1.getGeoUserAgent)(utils_1.GeoAction.DeleteGeofences),
721
721
  });
722
722
  command = new client_location_1.BatchDeleteGeofenceCommand(deleteGeofencesInput);
723
723
  _a.label = 1;