@evergis/api 4.1.50-alpha.0 → 4.1.51

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
  });
@@ -2826,9 +2829,7 @@ class Api extends EventEmitter {
2826
2829
  window.localStorage.setItem(STORAGE_REFRESH_TOKEN_KEY, refreshTokenResponse.refreshToken);
2827
2830
  }
2828
2831
  request.headers?.set("Authorization", `Bearer ${refreshTokenResponse.token || ""}`);
2829
- }
2830
- else {
2831
- await this.logout();
2832
+ this.refreshingToken = false;
2832
2833
  }
2833
2834
  }
2834
2835
  catch (error) {
@@ -2839,18 +2840,6 @@ class Api extends EventEmitter {
2839
2840
  }
2840
2841
  },
2841
2842
  ],
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
2843
  },
2855
2844
  });
2856
2845
  this.url = url;
@@ -2891,6 +2880,9 @@ class Api extends EventEmitter {
2891
2880
  withCredentials: true,
2892
2881
  skipNegotiation: true,
2893
2882
  transport: signalr.HttpTransportType.WebSockets,
2883
+ accessTokenFactory: () => {
2884
+ return window.localStorage.getItem(STORAGE_TOKEN_KEY) || "";
2885
+ },
2894
2886
  })
2895
2887
  .withAutomaticReconnect()
2896
2888
  .build()
@@ -4948,7 +4940,9 @@ class TablesService extends Service {
4948
4940
  * @response `200` OK
4949
4941
  */
4950
4942
  getTableData({ name, ...query }) {
4951
- return this.http.get(`/tables/${name}/data`, query).json();
4943
+ return this.http
4944
+ .get(`/tables/${name}/data`, query)
4945
+ .json();
4952
4946
  }
4953
4947
  /**
4954
4948
  * No description
@@ -5623,39 +5617,6 @@ exports.ErrorType = void 0;
5623
5617
  /**
5624
5618
  *
5625
5619
 
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
5620
  unknown
5660
5621
 
5661
5622
  point