@evergis/api 3.0.78 → 3.0.81

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.
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
6
 
7
+ var signalr = require('@microsoft/signalr');
7
8
  var ky = require('ky');
8
9
  var ky__default = _interopDefault(ky);
9
10
  var eventEmitter = require('@evergis/event-emitter');
@@ -34,9 +35,6 @@ function _defineProperties(target, props) {
34
35
  function _createClass(Constructor, protoProps, staticProps) {
35
36
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
36
37
  if (staticProps) _defineProperties(Constructor, staticProps);
37
- Object.defineProperty(Constructor, "prototype", {
38
- writable: false
39
- });
40
38
  return Constructor;
41
39
  }
42
40
 
@@ -70,9 +68,6 @@ function _inherits(subClass, superClass) {
70
68
  configurable: true
71
69
  }
72
70
  });
73
- Object.defineProperty(subClass, "prototype", {
74
- writable: false
75
- });
76
71
  if (superClass) _setPrototypeOf(subClass, superClass);
77
72
  }
78
73
 
@@ -131,8 +126,6 @@ function _assertThisInitialized(self) {
131
126
  function _possibleConstructorReturn(self, call) {
132
127
  if (call && (typeof call === "object" || typeof call === "function")) {
133
128
  return call;
134
- } else if (call !== void 0) {
135
- throw new TypeError("Derived constructors may only return object or undefined");
136
129
  }
137
130
 
138
131
  return _assertThisInitialized(self);
@@ -166,7 +159,7 @@ function _superPropBase(object, property) {
166
159
  return object;
167
160
  }
168
161
 
169
- function _get() {
162
+ function _get(target, property, receiver) {
170
163
  if (typeof Reflect !== "undefined" && Reflect.get) {
171
164
  _get = Reflect.get;
172
165
  } else {
@@ -177,14 +170,14 @@ function _get() {
177
170
  var desc = Object.getOwnPropertyDescriptor(base, property);
178
171
 
179
172
  if (desc.get) {
180
- return desc.get.call(arguments.length < 3 ? target : receiver);
173
+ return desc.get.call(receiver);
181
174
  }
182
175
 
183
176
  return desc.value;
184
177
  };
185
178
  }
186
179
 
187
- return _get.apply(this, arguments);
180
+ return _get(target, property, receiver || target);
188
181
  }
189
182
 
190
183
  /* eslint-disable */
@@ -511,6 +504,10 @@ function qs(params) {
511
504
  }
512
505
 
513
506
  function toFormData(input) {
507
+ if (input instanceof FormData) {
508
+ return input;
509
+ }
510
+
514
511
  return Object.keys(input).reduce((data, key) => {
515
512
  data.append(key, input[key]);
516
513
  return data;
@@ -648,49 +645,17 @@ let ImportService = /*#__PURE__*/function (_Service) {
648
645
  * No description
649
646
  *
650
647
  * @tags ImportService
651
- * @name GetExcelDataSchema
652
- * @operationId ImportServiceController_GetExcelDataSchema
653
- * @summary Using a file uploaded to the file upload service, reads the headers of the excel file and returns the information about data schema of all layers in that file, available for import.
654
- * @request GET:/import/excelDataSchema
655
- * @response `200` Success
656
- */
657
-
658
- }, {
659
- key: "getExcelDataSchema",
660
- value: function getExcelDataSchema(query) {
661
- return this.http.get("/import/excelDataSchema", query).json();
662
- }
663
- /**
664
- * No description
665
- *
666
- * @tags ImportService
667
- * @name GetCsvDataSchema
668
- * @operationId ImportServiceController_GetCsvDataSchema
669
- * @summary Using a file uploaded to the file upload service, reads the headers of the csv file and returns the information about data schema of all layers in that file, available for import.
670
- * @request GET:/import/csvDataSchema
671
- * @response `200` Success
672
- */
673
-
674
- }, {
675
- key: "getCsvDataSchema",
676
- value: function getCsvDataSchema(query) {
677
- return this.http.get("/import/csvDataSchema", query).json();
678
- }
679
- /**
680
- * No description
681
- *
682
- * @tags ImportService
683
- * @name GetKmlDataSchema
684
- * @operationId ImportServiceController_GetKmlDataSchema
685
- * @summary Using a file uploaded to the file upload service, reads the kml file and returns the information about data schema of all layers in that file, available for import.
686
- * @request GET:/import/kmlDataSchema
648
+ * @name GetFeaturesCount
649
+ * @operationId ImportServiceController_GetFeaturesCount
650
+ * @summary Returns the features count of the given file in temporary static storage.
651
+ * @request POST:/import/count
687
652
  * @response `200` Success
688
653
  */
689
654
 
690
655
  }, {
691
- key: "getKmlDataSchema",
692
- value: function getKmlDataSchema(query) {
693
- return this.http.get("/import/kmlDataSchema", query).json();
656
+ key: "getFeaturesCount",
657
+ value: function getFeaturesCount(data) {
658
+ return this.http.post("/import/count", data).json();
694
659
  }
695
660
  /**
696
661
  * No description
@@ -866,8 +831,8 @@ let Notification = /*#__PURE__*/function (_NotificationService) {
866
831
  || event.code === 4002
867
832
  /* InvalidSession */
868
833
  ) {
869
- _this.connectStatus = exports.ConnectionStatus.SessionClosed;
870
- } else if (_this.reconnectTries < _this.MAX_WS_RECONNECT_TRIES) {
834
+ _this.connectStatus = exports.ConnectionStatus.SessionClosed;
835
+ } else if (_this.reconnectTries < _this.MAX_WS_RECONNECT_TRIES) {
871
836
  _this.connectStatus = exports.ConnectionStatus.Break;
872
837
  _this.reconnectTries++;
873
838
 
@@ -1373,7 +1338,7 @@ let Scheduler = /*#__PURE__*/function (_SchedulerService) {
1373
1338
  const taskProgress = await this.getTaskProgress(id);
1374
1339
  this.resolveTaskStatus(taskProgress, resolve, reject);
1375
1340
 
1376
- const taskResultCallback = async _ref => {
1341
+ const taskResultCallback = async (_ref) => {
1377
1342
  let {
1378
1343
  data
1379
1344
  } = _ref;
@@ -1453,38 +1418,8 @@ let LayersService = /*#__PURE__*/function (_Service) {
1453
1418
  }
1454
1419
 
1455
1420
  _createClass(LayersService, [{
1456
- key: "getLayerInfo",
1421
+ key: "getLayersList",
1457
1422
  value:
1458
- /**
1459
- * No description
1460
- *
1461
- * @tags Layers
1462
- * @name GetLayerInfo
1463
- * @operationId LayersController_GetLayerInfoAsync
1464
- * @summary Returns the layer information.
1465
- * @request GET:/layers/{name}
1466
- * @response `200` Success
1467
- * @response `default` Error
1468
- */
1469
- function getLayerInfo(name) {
1470
- return this.http.get("/layers/" + name).json();
1471
- }
1472
- /**
1473
- * No description
1474
- *
1475
- * @tags Layers
1476
- * @name DeleteResource
1477
- * @operationId LayersController_DeleteResource
1478
- * @summary Deletes resource.
1479
- * @request DELETE:/layers/{name}
1480
- * @response `200` Success
1481
- */
1482
-
1483
- }, {
1484
- key: "deleteResource",
1485
- value: function deleteResource(name) {
1486
- return this.http.delete("/layers/" + name, null).then(() => {});
1487
- }
1488
1423
  /**
1489
1424
  * No description
1490
1425
  *
@@ -1495,10 +1430,7 @@ let LayersService = /*#__PURE__*/function (_Service) {
1495
1430
  * @request GET:/layers
1496
1431
  * @response `200` Success
1497
1432
  */
1498
-
1499
- }, {
1500
- key: "getLayersList",
1501
- value: function getLayersList(query) {
1433
+ function getLayersList(query) {
1502
1434
  return this.http.get("/layers", query).json();
1503
1435
  }
1504
1436
  /**
@@ -1533,6 +1465,38 @@ let LayersService = /*#__PURE__*/function (_Service) {
1533
1465
  value: function deleteResources(query) {
1534
1466
  return this.http.delete("/layers", null, query).json();
1535
1467
  }
1468
+ /**
1469
+ * No description
1470
+ *
1471
+ * @tags Layers
1472
+ * @name GetLayerInfo
1473
+ * @operationId LayersController_GetLayerInfoAsync
1474
+ * @summary Returns the layer information.
1475
+ * @request GET:/layers/{name}
1476
+ * @response `200` Success
1477
+ */
1478
+
1479
+ }, {
1480
+ key: "getLayerInfo",
1481
+ value: function getLayerInfo(name) {
1482
+ return this.http.get("/layers/" + name).json();
1483
+ }
1484
+ /**
1485
+ * No description
1486
+ *
1487
+ * @tags Layers
1488
+ * @name DeleteResource
1489
+ * @operationId LayersController_DeleteResource
1490
+ * @summary Deletes resource.
1491
+ * @request DELETE:/layers/{name}
1492
+ * @response `200` Success
1493
+ */
1494
+
1495
+ }, {
1496
+ key: "deleteResource",
1497
+ value: function deleteResource(name) {
1498
+ return this.http.delete("/layers/" + name, null).then(() => {});
1499
+ }
1536
1500
  /**
1537
1501
  * No description
1538
1502
  *
@@ -3028,53 +2992,8 @@ let ProjectsService = /*#__PURE__*/function (_Service) {
3028
2992
  }
3029
2993
 
3030
2994
  _createClass(ProjectsService, [{
3031
- key: "getProjectLayersExtendedInfo",
2995
+ key: "getProjectsList",
3032
2996
  value:
3033
- /**
3034
- * No description
3035
- *
3036
- * @tags Projects
3037
- * @name GetProjectLayersExtendedInfo
3038
- * @operationId ProjectsController_GetProjectLayersExtendedInfo
3039
- * @summary Gets extended project info with layers info.
3040
- * @request GET:/projects/{name}/extended-info
3041
- * @response `200` Success
3042
- */
3043
- function getProjectLayersExtendedInfo(name) {
3044
- return this.http.get("/projects/" + name + "/extended-info").json();
3045
- }
3046
- /**
3047
- * No description
3048
- *
3049
- * @tags Projects
3050
- * @name CreateShareProject
3051
- * @operationId ProjectsController_CreateShareProject
3052
- * @summary Create shared project.
3053
- * @request POST:/projects/{name}/share
3054
- * @response `200` Success
3055
- */
3056
-
3057
- }, {
3058
- key: "createShareProject",
3059
- value: function createShareProject(name, data) {
3060
- return this.http.post("/projects/" + name + "/share", data).json();
3061
- }
3062
- /**
3063
- * No description
3064
- *
3065
- * @tags Projects
3066
- * @name RemoveShareProject
3067
- * @operationId ProjectsController_RemoveShareProject
3068
- * @summary Delete shared project.
3069
- * @request DELETE:/projects/{name}/share
3070
- * @response `200` Success
3071
- */
3072
-
3073
- }, {
3074
- key: "removeShareProject",
3075
- value: function removeShareProject(name) {
3076
- return this.http.delete("/projects/" + name + "/share", null).then(() => {});
3077
- }
3078
2997
  /**
3079
2998
  * No description
3080
2999
  *
@@ -3085,10 +3004,7 @@ let ProjectsService = /*#__PURE__*/function (_Service) {
3085
3004
  * @request GET:/projects
3086
3005
  * @response `200` Success
3087
3006
  */
3088
-
3089
- }, {
3090
- key: "getProjectsList",
3091
- value: function getProjectsList(query) {
3007
+ function getProjectsList(query) {
3092
3008
  return this.http.get("/projects", query).json();
3093
3009
  }
3094
3010
  /**
@@ -3187,6 +3103,22 @@ let ProjectsService = /*#__PURE__*/function (_Service) {
3187
3103
  value: function deleteResource(name) {
3188
3104
  return this.http.delete("/projects/" + name, null).then(() => {});
3189
3105
  }
3106
+ /**
3107
+ * No description
3108
+ *
3109
+ * @tags Projects
3110
+ * @name GetProjectLayersExtendedInfo
3111
+ * @operationId ProjectsController_GetProjectLayersExtendedInfo
3112
+ * @summary Gets extended project info with layers info.
3113
+ * @request GET:/projects/{name}/extended-info
3114
+ * @response `200` Success
3115
+ */
3116
+
3117
+ }, {
3118
+ key: "getProjectLayersExtendedInfo",
3119
+ value: function getProjectLayersExtendedInfo(name) {
3120
+ return this.http.get("/projects/" + name + "/extended-info").json();
3121
+ }
3190
3122
  /**
3191
3123
  * No description
3192
3124
  *
@@ -3484,12 +3416,12 @@ let Resources = /*#__PURE__*/function () {
3484
3416
  }, {
3485
3417
  key: "getDependentNames",
3486
3418
  value: function getDependentNames(deps, depType) {
3487
- return deps.filter(_ref => {
3419
+ return deps.filter((_ref) => {
3488
3420
  let {
3489
3421
  type
3490
3422
  } = _ref;
3491
3423
  return type === depType;
3492
- }).map(_ref2 => {
3424
+ }).map((_ref2) => {
3493
3425
  let {
3494
3426
  name
3495
3427
  } = _ref2;
@@ -5856,6 +5788,7 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
5856
5788
  let {
5857
5789
  url,
5858
5790
  wsUrl,
5791
+ snappingHubUrl,
5859
5792
  http,
5860
5793
  urlPath,
5861
5794
  httpOptions
@@ -5915,6 +5848,9 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
5915
5848
  _this.names = new Names({
5916
5849
  account: _this.account
5917
5850
  });
5851
+ _this.snappingHub = snappingHubUrl ? new signalr.HubConnectionBuilder().withUrl(snappingHubUrl, {
5852
+ withCredentials: true
5853
+ }).withAutomaticReconnect().build() : null;
5918
5854
  return _this;
5919
5855
  }
5920
5856
 
@@ -5924,6 +5860,7 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
5924
5860
  let {
5925
5861
  authParams,
5926
5862
  connectWs,
5863
+ connectSignalR,
5927
5864
  initScheduler,
5928
5865
  fetchSettings,
5929
5866
  fetchUser
@@ -5940,6 +5877,10 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
5940
5877
  await this.connectWs();
5941
5878
  }
5942
5879
 
5880
+ if (connectSignalR) {
5881
+ await this.connectSignalR();
5882
+ }
5883
+
5943
5884
  if (initScheduler) {
5944
5885
  await this.initScheduler();
5945
5886
  }
@@ -5987,6 +5928,13 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
5987
5928
  });
5988
5929
  }
5989
5930
  }
5931
+ }, {
5932
+ key: "connectSignalR",
5933
+ value: async function connectSignalR() {
5934
+ if (this.account.isAuth && this.snappingHub) {
5935
+ await this.snappingHub.start();
5936
+ }
5937
+ }
5990
5938
  }, {
5991
5939
  key: "logout",
5992
5940
  value: async function logout() {
@@ -6539,11 +6487,6 @@ function isFeatureLayer(layer) {
6539
6487
  ResourceTypeLink["Project"] = "projects";
6540
6488
  })(exports.ResourceTypeLink || (exports.ResourceTypeLink = {}));
6541
6489
 
6542
- (function (SaveMode) {
6543
- SaveMode["Create"] = "create";
6544
- SaveMode["Update"] = "update";
6545
- })(exports.SaveMode || (exports.SaveMode = {}));
6546
-
6547
6490
  (function (ServerTaskStatus) {
6548
6491
  ServerTaskStatus["None"] = "None";
6549
6492
  ServerTaskStatus["Scheduled"] = "Scheduled";