@evergis/api 3.0.77 → 3.0.80

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/api.esm.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { HubConnectionBuilder } from '@microsoft/signalr';
1
2
  import ky, { HTTPError } from 'ky';
2
3
  export { HTTPError, TimeoutError } from 'ky';
3
4
  import { EventEmitter } from '@evergis/event-emitter';
@@ -28,9 +29,6 @@ function _defineProperties(target, props) {
28
29
  function _createClass(Constructor, protoProps, staticProps) {
29
30
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
30
31
  if (staticProps) _defineProperties(Constructor, staticProps);
31
- Object.defineProperty(Constructor, "prototype", {
32
- writable: false
33
- });
34
32
  return Constructor;
35
33
  }
36
34
 
@@ -64,9 +62,6 @@ function _inherits(subClass, superClass) {
64
62
  configurable: true
65
63
  }
66
64
  });
67
- Object.defineProperty(subClass, "prototype", {
68
- writable: false
69
- });
70
65
  if (superClass) _setPrototypeOf(subClass, superClass);
71
66
  }
72
67
 
@@ -125,8 +120,6 @@ function _assertThisInitialized(self) {
125
120
  function _possibleConstructorReturn(self, call) {
126
121
  if (call && (typeof call === "object" || typeof call === "function")) {
127
122
  return call;
128
- } else if (call !== void 0) {
129
- throw new TypeError("Derived constructors may only return object or undefined");
130
123
  }
131
124
 
132
125
  return _assertThisInitialized(self);
@@ -160,7 +153,7 @@ function _superPropBase(object, property) {
160
153
  return object;
161
154
  }
162
155
 
163
- function _get() {
156
+ function _get(target, property, receiver) {
164
157
  if (typeof Reflect !== "undefined" && Reflect.get) {
165
158
  _get = Reflect.get;
166
159
  } else {
@@ -171,14 +164,14 @@ function _get() {
171
164
  var desc = Object.getOwnPropertyDescriptor(base, property);
172
165
 
173
166
  if (desc.get) {
174
- return desc.get.call(arguments.length < 3 ? target : receiver);
167
+ return desc.get.call(receiver);
175
168
  }
176
169
 
177
170
  return desc.value;
178
171
  };
179
172
  }
180
173
 
181
- return _get.apply(this, arguments);
174
+ return _get(target, property, receiver || target);
182
175
  }
183
176
 
184
177
  /* eslint-disable */
@@ -642,49 +635,17 @@ let ImportService = /*#__PURE__*/function (_Service) {
642
635
  * No description
643
636
  *
644
637
  * @tags ImportService
645
- * @name GetExcelDataSchema
646
- * @operationId ImportServiceController_GetExcelDataSchema
647
- * @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.
648
- * @request GET:/import/excelDataSchema
638
+ * @name GetFeaturesCount
639
+ * @operationId ImportServiceController_GetFeaturesCount
640
+ * @summary Returns the features count of the given file in temporary static storage.
641
+ * @request POST:/import/count
649
642
  * @response `200` Success
650
643
  */
651
644
 
652
645
  }, {
653
- key: "getExcelDataSchema",
654
- value: function getExcelDataSchema(query) {
655
- return this.http.get("/import/excelDataSchema", query).json();
656
- }
657
- /**
658
- * No description
659
- *
660
- * @tags ImportService
661
- * @name GetCsvDataSchema
662
- * @operationId ImportServiceController_GetCsvDataSchema
663
- * @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.
664
- * @request GET:/import/csvDataSchema
665
- * @response `200` Success
666
- */
667
-
668
- }, {
669
- key: "getCsvDataSchema",
670
- value: function getCsvDataSchema(query) {
671
- return this.http.get("/import/csvDataSchema", query).json();
672
- }
673
- /**
674
- * No description
675
- *
676
- * @tags ImportService
677
- * @name GetKmlDataSchema
678
- * @operationId ImportServiceController_GetKmlDataSchema
679
- * @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.
680
- * @request GET:/import/kmlDataSchema
681
- * @response `200` Success
682
- */
683
-
684
- }, {
685
- key: "getKmlDataSchema",
686
- value: function getKmlDataSchema(query) {
687
- return this.http.get("/import/kmlDataSchema", query).json();
646
+ key: "getFeaturesCount",
647
+ value: function getFeaturesCount(data) {
648
+ return this.http.post("/import/count", data).json();
688
649
  }
689
650
  /**
690
651
  * No description
@@ -862,8 +823,8 @@ let Notification = /*#__PURE__*/function (_NotificationService) {
862
823
  || event.code === 4002
863
824
  /* InvalidSession */
864
825
  ) {
865
- _this.connectStatus = ConnectionStatus.SessionClosed;
866
- } else if (_this.reconnectTries < _this.MAX_WS_RECONNECT_TRIES) {
826
+ _this.connectStatus = ConnectionStatus.SessionClosed;
827
+ } else if (_this.reconnectTries < _this.MAX_WS_RECONNECT_TRIES) {
867
828
  _this.connectStatus = ConnectionStatus.Break;
868
829
  _this.reconnectTries++;
869
830
 
@@ -1369,7 +1330,7 @@ let Scheduler = /*#__PURE__*/function (_SchedulerService) {
1369
1330
  const taskProgress = await this.getTaskProgress(id);
1370
1331
  this.resolveTaskStatus(taskProgress, resolve, reject);
1371
1332
 
1372
- const taskResultCallback = async _ref => {
1333
+ const taskResultCallback = async (_ref) => {
1373
1334
  let {
1374
1335
  data
1375
1336
  } = _ref;
@@ -1449,38 +1410,8 @@ let LayersService = /*#__PURE__*/function (_Service) {
1449
1410
  }
1450
1411
 
1451
1412
  _createClass(LayersService, [{
1452
- key: "getLayerInfo",
1413
+ key: "getLayersList",
1453
1414
  value:
1454
- /**
1455
- * No description
1456
- *
1457
- * @tags Layers
1458
- * @name GetLayerInfo
1459
- * @operationId LayersController_GetLayerInfoAsync
1460
- * @summary Returns the layer information.
1461
- * @request GET:/layers/{name}
1462
- * @response `200` Success
1463
- * @response `default` Error
1464
- */
1465
- function getLayerInfo(name) {
1466
- return this.http.get("/layers/" + name).json();
1467
- }
1468
- /**
1469
- * No description
1470
- *
1471
- * @tags Layers
1472
- * @name DeleteResource
1473
- * @operationId LayersController_DeleteResource
1474
- * @summary Deletes resource.
1475
- * @request DELETE:/layers/{name}
1476
- * @response `200` Success
1477
- */
1478
-
1479
- }, {
1480
- key: "deleteResource",
1481
- value: function deleteResource(name) {
1482
- return this.http.delete("/layers/" + name, null).then(() => {});
1483
- }
1484
1415
  /**
1485
1416
  * No description
1486
1417
  *
@@ -1491,10 +1422,7 @@ let LayersService = /*#__PURE__*/function (_Service) {
1491
1422
  * @request GET:/layers
1492
1423
  * @response `200` Success
1493
1424
  */
1494
-
1495
- }, {
1496
- key: "getLayersList",
1497
- value: function getLayersList(query) {
1425
+ function getLayersList(query) {
1498
1426
  return this.http.get("/layers", query).json();
1499
1427
  }
1500
1428
  /**
@@ -1529,6 +1457,38 @@ let LayersService = /*#__PURE__*/function (_Service) {
1529
1457
  value: function deleteResources(query) {
1530
1458
  return this.http.delete("/layers", null, query).json();
1531
1459
  }
1460
+ /**
1461
+ * No description
1462
+ *
1463
+ * @tags Layers
1464
+ * @name GetLayerInfo
1465
+ * @operationId LayersController_GetLayerInfoAsync
1466
+ * @summary Returns the layer information.
1467
+ * @request GET:/layers/{name}
1468
+ * @response `200` Success
1469
+ */
1470
+
1471
+ }, {
1472
+ key: "getLayerInfo",
1473
+ value: function getLayerInfo(name) {
1474
+ return this.http.get("/layers/" + name).json();
1475
+ }
1476
+ /**
1477
+ * No description
1478
+ *
1479
+ * @tags Layers
1480
+ * @name DeleteResource
1481
+ * @operationId LayersController_DeleteResource
1482
+ * @summary Deletes resource.
1483
+ * @request DELETE:/layers/{name}
1484
+ * @response `200` Success
1485
+ */
1486
+
1487
+ }, {
1488
+ key: "deleteResource",
1489
+ value: function deleteResource(name) {
1490
+ return this.http.delete("/layers/" + name, null).then(() => {});
1491
+ }
1532
1492
  /**
1533
1493
  * No description
1534
1494
  *
@@ -3024,53 +2984,8 @@ let ProjectsService = /*#__PURE__*/function (_Service) {
3024
2984
  }
3025
2985
 
3026
2986
  _createClass(ProjectsService, [{
3027
- key: "getProjectLayersExtendedInfo",
2987
+ key: "getProjectsList",
3028
2988
  value:
3029
- /**
3030
- * No description
3031
- *
3032
- * @tags Projects
3033
- * @name GetProjectLayersExtendedInfo
3034
- * @operationId ProjectsController_GetProjectLayersExtendedInfo
3035
- * @summary Gets extended project info with layers info.
3036
- * @request GET:/projects/{name}/extended-info
3037
- * @response `200` Success
3038
- */
3039
- function getProjectLayersExtendedInfo(name) {
3040
- return this.http.get("/projects/" + name + "/extended-info").json();
3041
- }
3042
- /**
3043
- * No description
3044
- *
3045
- * @tags Projects
3046
- * @name CreateShareProject
3047
- * @operationId ProjectsController_CreateShareProject
3048
- * @summary Create shared project.
3049
- * @request POST:/projects/{name}/share
3050
- * @response `200` Success
3051
- */
3052
-
3053
- }, {
3054
- key: "createShareProject",
3055
- value: function createShareProject(name, data) {
3056
- return this.http.post("/projects/" + name + "/share", data).json();
3057
- }
3058
- /**
3059
- * No description
3060
- *
3061
- * @tags Projects
3062
- * @name RemoveShareProject
3063
- * @operationId ProjectsController_RemoveShareProject
3064
- * @summary Delete shared project.
3065
- * @request DELETE:/projects/{name}/share
3066
- * @response `200` Success
3067
- */
3068
-
3069
- }, {
3070
- key: "removeShareProject",
3071
- value: function removeShareProject(name) {
3072
- return this.http.delete("/projects/" + name + "/share", null).then(() => {});
3073
- }
3074
2989
  /**
3075
2990
  * No description
3076
2991
  *
@@ -3081,10 +2996,7 @@ let ProjectsService = /*#__PURE__*/function (_Service) {
3081
2996
  * @request GET:/projects
3082
2997
  * @response `200` Success
3083
2998
  */
3084
-
3085
- }, {
3086
- key: "getProjectsList",
3087
- value: function getProjectsList(query) {
2999
+ function getProjectsList(query) {
3088
3000
  return this.http.get("/projects", query).json();
3089
3001
  }
3090
3002
  /**
@@ -3183,6 +3095,22 @@ let ProjectsService = /*#__PURE__*/function (_Service) {
3183
3095
  value: function deleteResource(name) {
3184
3096
  return this.http.delete("/projects/" + name, null).then(() => {});
3185
3097
  }
3098
+ /**
3099
+ * No description
3100
+ *
3101
+ * @tags Projects
3102
+ * @name GetProjectLayersExtendedInfo
3103
+ * @operationId ProjectsController_GetProjectLayersExtendedInfo
3104
+ * @summary Gets extended project info with layers info.
3105
+ * @request GET:/projects/{name}/extended-info
3106
+ * @response `200` Success
3107
+ */
3108
+
3109
+ }, {
3110
+ key: "getProjectLayersExtendedInfo",
3111
+ value: function getProjectLayersExtendedInfo(name) {
3112
+ return this.http.get("/projects/" + name + "/extended-info").json();
3113
+ }
3186
3114
  /**
3187
3115
  * No description
3188
3116
  *
@@ -3482,12 +3410,12 @@ let Resources = /*#__PURE__*/function () {
3482
3410
  }, {
3483
3411
  key: "getDependentNames",
3484
3412
  value: function getDependentNames(deps, depType) {
3485
- return deps.filter(_ref => {
3413
+ return deps.filter((_ref) => {
3486
3414
  let {
3487
3415
  type
3488
3416
  } = _ref;
3489
3417
  return type === depType;
3490
- }).map(_ref2 => {
3418
+ }).map((_ref2) => {
3491
3419
  let {
3492
3420
  name
3493
3421
  } = _ref2;
@@ -5861,6 +5789,7 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
5861
5789
  let {
5862
5790
  url,
5863
5791
  wsUrl,
5792
+ snappingHubUrl,
5864
5793
  http,
5865
5794
  urlPath,
5866
5795
  httpOptions
@@ -5920,6 +5849,9 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
5920
5849
  _this.names = new Names({
5921
5850
  account: _this.account
5922
5851
  });
5852
+ _this.snappingHub = snappingHubUrl ? new HubConnectionBuilder().withUrl(snappingHubUrl, {
5853
+ withCredentials: true
5854
+ }).withAutomaticReconnect().build() : null;
5923
5855
  return _this;
5924
5856
  }
5925
5857
 
@@ -5929,6 +5861,7 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
5929
5861
  let {
5930
5862
  authParams,
5931
5863
  connectWs,
5864
+ connectSignalR,
5932
5865
  initScheduler,
5933
5866
  fetchSettings,
5934
5867
  fetchUser
@@ -5945,6 +5878,10 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
5945
5878
  await this.connectWs();
5946
5879
  }
5947
5880
 
5881
+ if (connectSignalR) {
5882
+ await this.connectSignalR();
5883
+ }
5884
+
5948
5885
  if (initScheduler) {
5949
5886
  await this.initScheduler();
5950
5887
  }
@@ -5992,6 +5929,13 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
5992
5929
  });
5993
5930
  }
5994
5931
  }
5932
+ }, {
5933
+ key: "connectSignalR",
5934
+ value: async function connectSignalR() {
5935
+ if (this.account.isAuth && this.snappingHub) {
5936
+ await this.snappingHub.start();
5937
+ }
5938
+ }
5995
5939
  }, {
5996
5940
  key: "logout",
5997
5941
  value: async function logout() {
@@ -6347,41 +6291,41 @@ function isFeatureLayer(layer) {
6347
6291
 
6348
6292
  /**
6349
6293
  *
6350
-
6294
+
6351
6295
  None
6352
-
6296
+
6353
6297
  Array
6354
-
6298
+
6355
6299
  Min
6356
-
6300
+
6357
6301
  Max
6358
-
6302
+
6359
6303
  Avg
6360
-
6304
+
6361
6305
  Sum
6362
-
6306
+
6363
6307
  Extent
6364
-
6308
+
6365
6309
  Count
6366
-
6310
+
6367
6311
  First
6368
-
6312
+
6369
6313
  Last
6370
-
6314
+
6371
6315
  Median
6372
-
6316
+
6373
6317
  Mod
6374
-
6318
+
6375
6319
  StdDeviation
6376
-
6320
+
6377
6321
  SumOfProduct
6378
-
6322
+
6379
6323
  OnlyValue
6380
-
6324
+
6381
6325
  WeightedAvg
6382
-
6326
+
6383
6327
  DensityIndicators
6384
-
6328
+
6385
6329
  DividedSum
6386
6330
  */
6387
6331
  var AggregationFunction;
@@ -6408,27 +6352,27 @@ var AggregationFunction;
6408
6352
  })(AggregationFunction || (AggregationFunction = {}));
6409
6353
  /**
6410
6354
  * Types of the attributes that are supported by the system.
6411
-
6355
+
6412
6356
  Unknown
6413
-
6357
+
6414
6358
  String
6415
-
6359
+
6416
6360
  Int32
6417
-
6361
+
6418
6362
  Int64
6419
-
6363
+
6420
6364
  Double
6421
-
6365
+
6422
6366
  DateTime
6423
-
6367
+
6424
6368
  Boolean
6425
-
6369
+
6426
6370
  Point
6427
-
6371
+
6428
6372
  Polyline
6429
-
6373
+
6430
6374
  Polygon
6431
-
6375
+
6432
6376
  Multipoint
6433
6377
  */
6434
6378
 
@@ -6450,14 +6394,16 @@ var AttributeType;
6450
6394
  })(AttributeType || (AttributeType = {}));
6451
6395
  /**
6452
6396
  * Describes classification methods.
6453
-
6397
+
6454
6398
  none
6455
-
6399
+
6456
6400
  naturalBreaks
6457
-
6401
+
6458
6402
  equalInterval
6459
-
6403
+
6460
6404
  quantile
6405
+
6406
+ unique
6461
6407
  */
6462
6408
 
6463
6409
 
@@ -6468,13 +6414,16 @@ var ClassificationType;
6468
6414
  ClassificationType["NaturalBreaks"] = "naturalBreaks";
6469
6415
  ClassificationType["EqualInterval"] = "equalInterval";
6470
6416
  ClassificationType["Quantile"] = "quantile";
6417
+ ClassificationType["Distinct"] = "unique";
6471
6418
  })(ClassificationType || (ClassificationType = {}));
6472
6419
  /**
6473
6420
  * Type of attribute.
6474
-
6421
+
6475
6422
  decimal
6476
-
6423
+
6477
6424
  dateTime
6425
+
6426
+ text
6478
6427
  */
6479
6428
 
6480
6429
 
@@ -6483,6 +6432,7 @@ var ClassifyAttributeType;
6483
6432
  (function (ClassifyAttributeType) {
6484
6433
  ClassifyAttributeType["Decimal"] = "decimal";
6485
6434
  ClassifyAttributeType["DateTime"] = "dateTime";
6435
+ ClassifyAttributeType["Text"] = "text";
6486
6436
  })(ClassifyAttributeType || (ClassifyAttributeType = {}));
6487
6437
  /**
6488
6438
  * Types of errors that can occur during layer initialize.
@@ -6515,15 +6465,15 @@ var ConfigurationErrorEnum;
6515
6465
  })(ConfigurationErrorEnum || (ConfigurationErrorEnum = {}));
6516
6466
  /**
6517
6467
  * Type of the error.
6518
-
6468
+
6519
6469
  ResourceLimitExceeded
6520
-
6470
+
6521
6471
  ResourceNotFound
6522
-
6472
+
6523
6473
  InternalError
6524
-
6474
+
6525
6475
  BadRequest
6526
-
6476
+
6527
6477
  DuplicateContent
6528
6478
  */
6529
6479
 
@@ -6578,9 +6528,9 @@ var ErrorType;
6578
6528
  })(ErrorType || (ErrorType = {}));
6579
6529
  /**
6580
6530
  * Type of the feature.
6581
-
6531
+
6582
6532
  Unknown
6583
-
6533
+
6584
6534
  GeometricFeature
6585
6535
  */
6586
6536
 
@@ -6625,17 +6575,17 @@ var FontWeight;
6625
6575
  })(FontWeight || (FontWeight = {}));
6626
6576
  /**
6627
6577
  *
6628
-
6578
+
6629
6579
  unknown
6630
-
6580
+
6631
6581
  point
6632
-
6582
+
6633
6583
  polyline
6634
-
6584
+
6635
6585
  polygon
6636
-
6586
+
6637
6587
  envelope
6638
-
6588
+
6639
6589
  multipoint
6640
6590
  */
6641
6591
 
@@ -6652,13 +6602,13 @@ var GeometryType;
6652
6602
  })(GeometryType || (GeometryType = {}));
6653
6603
  /**
6654
6604
  * Resource group.
6655
-
6605
+
6656
6606
  my
6657
-
6607
+
6658
6608
  role
6659
-
6609
+
6660
6610
  public
6661
-
6611
+
6662
6612
  all
6663
6613
  */
6664
6614
 
@@ -6701,15 +6651,15 @@ var LineEndingType;
6701
6651
  })(LineEndingType || (LineEndingType = {}));
6702
6652
  /**
6703
6653
  *
6704
-
6654
+
6705
6655
  Unknown
6706
-
6656
+
6707
6657
  union
6708
-
6658
+
6709
6659
  intersection
6710
-
6660
+
6711
6661
  subtraction
6712
-
6662
+
6713
6663
  symDifference
6714
6664
  */
6715
6665
 
@@ -6725,19 +6675,19 @@ var Operation;
6725
6675
  })(Operation || (Operation = {}));
6726
6676
  /**
6727
6677
  * User permissions for server security objects (services, projects etc.)
6728
-
6678
+
6729
6679
  none
6730
-
6680
+
6731
6681
  configure
6732
-
6682
+
6733
6683
  write
6734
-
6684
+
6735
6685
  read
6736
-
6686
+
6737
6687
  read,configure
6738
-
6688
+
6739
6689
  read,write
6740
-
6690
+
6741
6691
  read,write,configure
6742
6692
  */
6743
6693
 
@@ -6755,15 +6705,15 @@ var Permissions;
6755
6705
  })(Permissions || (Permissions = {}));
6756
6706
  /**
6757
6707
  * Type of the authorization policy.
6758
-
6708
+
6759
6709
  Unknown
6760
-
6710
+
6761
6711
  CreateTable
6762
-
6712
+
6763
6713
  CreateLayer
6764
-
6714
+
6765
6715
  CreateProject
6766
-
6716
+
6767
6717
  MaxFeaturesInOneTable
6768
6718
  */
6769
6719
 
@@ -6779,17 +6729,17 @@ var PolicyType;
6779
6729
  })(PolicyType || (PolicyType = {}));
6780
6730
  /**
6781
6731
  * The `ResourceType` represents resource manager supports types.
6782
-
6732
+
6783
6733
  Unknown
6784
-
6734
+
6785
6735
  table
6786
-
6736
+
6787
6737
  layer
6788
-
6738
+
6789
6739
  project
6790
-
6740
+
6791
6741
  file
6792
-
6742
+
6793
6743
  feature
6794
6744
  */
6795
6745
 
@@ -6814,21 +6764,21 @@ var ResourceTypeLink;
6814
6764
  })(ResourceTypeLink || (ResourceTypeLink = {}));
6815
6765
  /**
6816
6766
  * Status of the server task.
6817
-
6767
+
6818
6768
  None
6819
-
6769
+
6820
6770
  Scheduled
6821
-
6771
+
6822
6772
  Planning
6823
-
6773
+
6824
6774
  Executing
6825
-
6775
+
6826
6776
  Completed
6827
-
6777
+
6828
6778
  Failed
6829
-
6779
+
6830
6780
  Canceled
6831
-
6781
+
6832
6782
  Timeout
6833
6783
  */
6834
6784
 
@@ -6847,11 +6797,11 @@ var ServerTaskStatus;
6847
6797
  })(ServerTaskStatus || (ServerTaskStatus = {}));
6848
6798
  /**
6849
6799
  * The `StringSubType` provides information about string attribute subtype.
6850
-
6800
+
6851
6801
  None
6852
-
6802
+
6853
6803
  Image
6854
-
6804
+
6855
6805
  PkkCode
6856
6806
  */
6857
6807