@evergis/api 4.1.50-alpha.0 → 4.1.50

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/dist/index.js CHANGED
@@ -1417,7 +1417,7 @@ class EqlService extends Service {
1417
1417
  * @response `200` OK
1418
1418
  */
1419
1419
  getLayerParameters(query) {
1420
- return this.http.get(`/eql/getParam`, query).then(() => { });
1420
+ return this.http.get(`/eql/getParam`, query).text();
1421
1421
  }
1422
1422
  /**
1423
1423
  * No description
@@ -2784,9 +2784,11 @@ class Api extends EventEmitter {
2784
2784
  http;
2785
2785
  wsUrl;
2786
2786
  urlPath;
2787
+ refreshingToken;
2787
2788
  constructor({ url, wsUrl, wsKeepAlive, snappingHubUrl, http, urlPath, httpOptions, }) {
2788
2789
  super();
2789
2790
  const { hooks } = httpOptions || {};
2791
+ this.refreshingToken = false;
2790
2792
  this.http =
2791
2793
  http ||
2792
2794
  new HttpClient({
@@ -2817,7 +2819,8 @@ class Api extends EventEmitter {
2817
2819
  case 401:
2818
2820
  try {
2819
2821
  const refreshToken = window.localStorage.getItem(STORAGE_REFRESH_TOKEN_KEY);
2820
- if (refreshToken) {
2822
+ if (!this.refreshingToken && refreshToken) {
2823
+ this.refreshingToken = true;
2821
2824
  const refreshTokenResponse = await this.account.refreshToken({
2822
2825
  refreshToken,
2823
2826
  });
@@ -2827,9 +2830,6 @@ class Api extends EventEmitter {
2827
2830
  }
2828
2831
  request.headers?.set("Authorization", `Bearer ${refreshTokenResponse.token || ""}`);
2829
2832
  }
2830
- else {
2831
- await this.logout();
2832
- }
2833
2833
  }
2834
2834
  catch (error) {
2835
2835
  await this.logout();
@@ -2839,18 +2839,6 @@ class Api extends EventEmitter {
2839
2839
  }
2840
2840
  },
2841
2841
  ],
2842
- /* afterResponse: [
2843
- (request, options, response) => {
2844
- const apiEvent = apiEventsByResponseStatus[response?.status];
2845
-
2846
- if (apiEvent) {
2847
- this.emit(apiEvent, errorHandler(new HTTPError(response, request, options)));
2848
- }
2849
-
2850
- return response;
2851
- },
2852
- ...(hooks?.afterResponse || []),
2853
- ], */
2854
2842
  },
2855
2843
  });
2856
2844
  this.url = url;
@@ -4948,7 +4936,9 @@ class TablesService extends Service {
4948
4936
  * @response `200` OK
4949
4937
  */
4950
4938
  getTableData({ name, ...query }) {
4951
- return this.http.get(`/tables/${name}/data`, query).json();
4939
+ return this.http
4940
+ .get(`/tables/${name}/data`, query)
4941
+ .json();
4952
4942
  }
4953
4943
  /**
4954
4944
  * No description
@@ -5623,39 +5613,6 @@ exports.ErrorType = void 0;
5623
5613
  /**
5624
5614
  *
5625
5615
 
5626
- Point
5627
-
5628
- MultiPoint
5629
-
5630
- LineString
5631
-
5632
- MultiLineString
5633
-
5634
- Polygon
5635
-
5636
- MultiPolygon
5637
-
5638
- GeometryCollection
5639
-
5640
- Feature
5641
-
5642
- FeatureCollection
5643
- */
5644
- exports.GeoJsonObjectType = void 0;
5645
- (function (GeoJsonObjectType) {
5646
- GeoJsonObjectType["Point"] = "Point";
5647
- GeoJsonObjectType["MultiPoint"] = "MultiPoint";
5648
- GeoJsonObjectType["LineString"] = "LineString";
5649
- GeoJsonObjectType["MultiLineString"] = "MultiLineString";
5650
- GeoJsonObjectType["Polygon"] = "Polygon";
5651
- GeoJsonObjectType["MultiPolygon"] = "MultiPolygon";
5652
- GeoJsonObjectType["GeometryCollection"] = "GeometryCollection";
5653
- GeoJsonObjectType["Feature"] = "Feature";
5654
- GeoJsonObjectType["FeatureCollection"] = "FeatureCollection";
5655
- })(exports.GeoJsonObjectType || (exports.GeoJsonObjectType = {}));
5656
- /**
5657
- *
5658
-
5659
5616
  unknown
5660
5617
 
5661
5618
  point