@evergis/api 3.0.79 → 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.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { HubConnection } from '@microsoft/signalr';
1
2
  import { Options as KyOptions } from 'ky';
2
3
  import { EventEmitter } from '@evergis/event-emitter';
3
4
  import { Account, External, ClientSettings, PortalSettings, FileUpload, General, Geocode, Import, Layers, Names, Namespace, Notification, Projects, ResourceCatalog, Resources, Scheduler, Security, Styles, Tables, Tools, AccountPreview, BulkOperations, IceRouter, Statistic, Feedback } from './services';
@@ -7,6 +8,7 @@ import { LoginDc } from './__generated__/data-contracts';
7
8
  export declare type ApiParams = {
8
9
  url: string;
9
10
  wsUrl?: string;
11
+ snappingHubUrl?: string;
10
12
  http?: HttpClient;
11
13
  httpOptions?: KyOptions;
12
14
  urlPath?: string;
@@ -49,10 +51,12 @@ export declare class Api extends EventEmitter {
49
51
  readonly iceRouter: IceRouter;
50
52
  readonly statistic: Statistic;
51
53
  readonly feedback: Feedback;
52
- constructor({ url, wsUrl, http, urlPath, httpOptions }: ApiParams);
53
- init({ authParams, connectWs, initScheduler, fetchSettings, fetchUser, }: {
54
+ readonly snappingHub: HubConnection | null;
55
+ constructor({ url, wsUrl, snappingHubUrl, http, urlPath, httpOptions }: ApiParams);
56
+ init({ authParams, connectWs, connectSignalR, initScheduler, fetchSettings, fetchUser, }: {
54
57
  authParams?: LoginDc;
55
58
  connectWs?: boolean;
59
+ connectSignalR?: boolean;
56
60
  initScheduler?: boolean;
57
61
  fetchSettings?: boolean;
58
62
  fetchUser?: boolean;
@@ -60,6 +64,7 @@ export declare class Api extends EventEmitter {
60
64
  isAcceptedNetwork(network: string): network is SocAuthNetwork;
61
65
  socAuthLogin(network: SocAuthNetwork): Promise<void>;
62
66
  connectWs(): Promise<void>;
67
+ connectSignalR(): Promise<void>;
63
68
  logout(): Promise<void>;
64
69
  initScheduler(): Promise<void>;
65
70
  private defineUrlPath;
@@ -1,4 +1,4 @@
1
- import { GetCsvDataSchemaParams, GetDataSchemaParams, GetExcelDataSchemaParams, GetKmlDataSchemaParams, GetRasterAttributesParams, ImportDataSchema } from './data-contracts';
1
+ import { GetDataSchemaParams, GetFeaturesCountPayload, GetRasterAttributesParams, ImportDataSchema } from './data-contracts';
2
2
  import { Service } from './Service';
3
3
  /**
4
4
  * @title Spatial Processing Core API
@@ -21,35 +21,13 @@ export declare class ImportService extends Service {
21
21
  * No description
22
22
  *
23
23
  * @tags ImportService
24
- * @name GetExcelDataSchema
25
- * @operationId ImportServiceController_GetExcelDataSchema
26
- * @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.
27
- * @request GET:/import/excelDataSchema
24
+ * @name GetFeaturesCount
25
+ * @operationId ImportServiceController_GetFeaturesCount
26
+ * @summary Returns the features count of the given file in temporary static storage.
27
+ * @request POST:/import/count
28
28
  * @response `200` Success
29
29
  */
30
- getExcelDataSchema(query: GetExcelDataSchemaParams): Promise<ImportDataSchema>;
31
- /**
32
- * No description
33
- *
34
- * @tags ImportService
35
- * @name GetCsvDataSchema
36
- * @operationId ImportServiceController_GetCsvDataSchema
37
- * @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.
38
- * @request GET:/import/csvDataSchema
39
- * @response `200` Success
40
- */
41
- getCsvDataSchema(query: GetCsvDataSchemaParams): Promise<ImportDataSchema>;
42
- /**
43
- * No description
44
- *
45
- * @tags ImportService
46
- * @name GetKmlDataSchema
47
- * @operationId ImportServiceController_GetKmlDataSchema
48
- * @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.
49
- * @request GET:/import/kmlDataSchema
50
- * @response `200` Success
51
- */
52
- getKmlDataSchema(query: GetKmlDataSchemaParams): Promise<ImportDataSchema>;
30
+ getFeaturesCount(data: GetFeaturesCountPayload): Promise<number>;
53
31
  /**
54
32
  * No description
55
33
  *
@@ -1,4 +1,4 @@
1
- import { AccessControlListDc, AddPermissionsBody, BulkOperationResultDc, CreateProjectPayload, DeleteResourcesParams9, ExtendedProjectLayersInfo, FileUploadResponse, GetProjectsListParams, IListResponse, ListResponseProjectInfoDc, ResourceDependenciesDc, SetPermissionsBatchBody, SetPermissionsBody, SetPreviewBody, UpdateProjectPayload } from './data-contracts';
1
+ import { AccessControlListDc, AddPermissionsBody, BulkOperationResultDc, CreateProjectPayload, DeleteResourcesParams4, ExtendedProjectLayersInfo, FileUploadResponse, GetProjectsListParams, IListResponse, ListResponseProjectInfoDc, ResourceDependenciesDc, SetPermissionsBatchBody, SetPermissionsBody, SetPreviewBody, UpdateProjectPayload } from './data-contracts';
2
2
  import { Service } from './Service';
3
3
  /**
4
4
  * @title Spatial Processing Core API
@@ -49,7 +49,7 @@ export declare class ProjectsService extends Service {
49
49
  * @request DELETE:/projects
50
50
  * @response `200` Success
51
51
  */
52
- deleteResources(query: DeleteResourcesParams9): Promise<BulkOperationResultDc[]>;
52
+ deleteResources(query: DeleteResourcesParams4): Promise<BulkOperationResultDc[]>;
53
53
  /**
54
54
  * No description
55
55
  *
@@ -1,4 +1,4 @@
1
- import { ClassifyDc, ClassifyParams4, StatisticsDbParams, StatisticsDc, SumOfProductParams } from './data-contracts';
1
+ import { ClassifyDc, ClassifyParams2, StatisticsDbParams, StatisticsDc, SumOfProductParams } from './data-contracts';
2
2
  import { Service } from './Service';
3
3
  /**
4
4
  * @title Spatial Processing Core API
@@ -27,7 +27,7 @@ export declare class StatisticService extends Service {
27
27
  * @request GET:/statistics/classify
28
28
  * @response `200` Success
29
29
  */
30
- classify(query: ClassifyParams4): Promise<ClassifyDc>;
30
+ classify(query: ClassifyParams2): Promise<ClassifyDc>;
31
31
  /**
32
32
  * No description
33
33
  *
@@ -1,4 +1,4 @@
1
- import { AccessControlListDc, AddPermissionsInput, BulkOperationResultDc, CreateTablePayload, DeleteResourcesParams6, DeleteTableDataParams, FileUploadResponse, GetTableDataParams, GetTableListParams, GetUniqueDataRowsParams, IListResponse, ListResponseIEnumerable1, MapRemoteTableParams, MapRemoteTablePayload, MapTableParams, MapTablePayload, MapViewParams, MapViewPayload, ResourceDependenciesDc, SetPermissionsBatchInput, SetPermissionsInput, SetPreviewInput, TableListDc, UpdateTableDataParams, UpdateTableDataPayload, UpdateTablePayload, WriteTableDataPayload } from './data-contracts';
1
+ import { AccessControlListDc, AddPermissionsInput, BulkOperationResultDc, CreateTablePayload, DeleteResourcesParams10, DeleteTableDataParams, FileUploadResponse, GetTableDataParams, GetTableListParams, GetUniqueDataRowsParams, IListResponse, ListResponseIEnumerable1, MapRemoteTableParams, MapRemoteTablePayload, MapTableParams, MapTablePayload, MapViewParams, MapViewPayload, ResourceDependenciesDc, SetPermissionsBatchInput, SetPermissionsInput, SetPreviewInput, TableListDc, UpdateTableDataParams, UpdateTableDataPayload, UpdateTablePayload, WriteTableDataPayload } from './data-contracts';
2
2
  import { Service } from './Service';
3
3
  /**
4
4
  * @title Spatial Processing Core API
@@ -49,7 +49,7 @@ export declare class TablesService extends Service {
49
49
  * @request DELETE:/tables
50
50
  * @response `200` Success
51
51
  */
52
- deleteResources(query: DeleteResourcesParams6): Promise<BulkOperationResultDc[]>;
52
+ deleteResources(query: DeleteResourcesParams10): Promise<BulkOperationResultDc[]>;
53
53
  /**
54
54
  * No description
55
55
  *
@@ -1,4 +1,4 @@
1
- import { GetCapabilities1Params, GetCapabilitiesParams1, GetFeatureInfoParams, GetLegendGraphicParams, GetMapParams } from './data-contracts';
1
+ import { GetCapabilities1Params, GetCapabilitiesParams2, GetFeatureInfoParams, GetLegendGraphicParams, GetMapParams } from './data-contracts';
2
2
  import { Service } from './Service';
3
3
  /**
4
4
  * @title Spatial Processing Core API
@@ -16,7 +16,7 @@ export declare class WmsServerService extends Service {
16
16
  * @request GET:/wms#REQUEST=GetCapabilities
17
17
  * @response `200` Success
18
18
  */
19
- getCapabilities(query: GetCapabilitiesParams1): Promise<void>;
19
+ getCapabilities(query: GetCapabilitiesParams2): Promise<void>;
20
20
  /**
21
21
  * No description
22
22
  *
@@ -2277,12 +2277,25 @@ export interface ImportDataSchema {
2277
2277
  /** Importing file type. */
2278
2278
  type: string;
2279
2279
  }
2280
+ /**
2281
+ * Data schema of a file for import.
2282
+ */
2283
+ export interface ImportFileFeaturesCountDc {
2284
+ /** Name of the layer. */
2285
+ name?: string;
2286
+ /** Id of the file in the temporary static storage. */
2287
+ fileId: string;
2288
+ /** Condition. */
2289
+ condition?: string;
2290
+ }
2280
2291
  /**
2281
2292
  * Schema of a layer in an imported file.
2282
2293
  */
2283
2294
  export interface ImportLayerDataSchema {
2284
2295
  /** Name of the layer. */
2285
2296
  name: string;
2297
+ /** First feature in the layer. */
2298
+ firstRow?: Record<string, any>;
2286
2299
  /**
2287
2300
  * Number of objects in the layer.
2288
2301
  * @format int64
@@ -5760,18 +5773,10 @@ export interface GetDataSchemaParams {
5760
5773
  /** File id. */
5761
5774
  fileId?: string;
5762
5775
  }
5763
- export interface GetExcelDataSchemaParams {
5764
- /** Id of the excel file in the temporary static storage. */
5765
- fileId?: string;
5766
- }
5767
- export interface GetCsvDataSchemaParams {
5768
- /** Id of the csv file in the temporary static storage. */
5769
- fileId?: string;
5770
- }
5771
- export interface GetKmlDataSchemaParams {
5772
- /** Id of the kml file in the temporary static storage. */
5773
- fileId?: string;
5774
- }
5776
+ /**
5777
+ * Data schema of a file for import.
5778
+ */
5779
+ export declare type GetFeaturesCountPayload = ImportFileFeaturesCountDc;
5775
5780
  export interface GetRasterAttributesParams {
5776
5781
  /** File name in the temporary static storage. */
5777
5782
  fileName?: string;
@@ -6367,7 +6372,7 @@ export interface GetProjectsListParams {
6367
6372
  */
6368
6373
  export declare type CreateProjectPayload = ExtendedProjectInfoDc | ResourceInfoDc | ProjectInfoDc;
6369
6374
  export declare type SetPermissionsBatchBody = ResourceAclDc[];
6370
- export interface DeleteResourcesParams9 {
6375
+ export interface DeleteResourcesParams4 {
6371
6376
  /** Resource names. */
6372
6377
  names?: string[];
6373
6378
  }
@@ -6559,7 +6564,7 @@ export interface StatisticsDbParams {
6559
6564
  /** Type of required statistic function. */
6560
6565
  types?: AggregationFunction[];
6561
6566
  }
6562
- export interface ClassifyParams4 {
6567
+ export interface ClassifyParams2 {
6563
6568
  /** Layer name. */
6564
6569
  name?: string;
6565
6570
  /** Attribute name. */
@@ -6664,7 +6669,7 @@ export interface GetTableListParams {
6664
6669
  */
6665
6670
  export declare type CreateTablePayload = DetailedTableInfoDc | ResourceInfoDc | TableInfoDc;
6666
6671
  export declare type SetPermissionsBatchInput = ResourceAclDc[];
6667
- export interface DeleteResourcesParams6 {
6672
+ export interface DeleteResourcesParams10 {
6668
6673
  /** Resource names. */
6669
6674
  names?: string[];
6670
6675
  }
@@ -6769,7 +6774,7 @@ export interface GetCapabilitiesParams {
6769
6774
  /** When omitted or not supported by server, server shall return service metadata document using the MIME type "text/xml". */
6770
6775
  AcceptFormats?: string[];
6771
6776
  }
6772
- export interface GetCapabilitiesParams1 {
6777
+ export interface GetCapabilitiesParams2 {
6773
6778
  /** Output format of service metadata. */
6774
6779
  Format?: string;
6775
6780
  /** Must be WMS. */
@@ -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');
@@ -640,49 +641,17 @@ let ImportService = /*#__PURE__*/function (_Service) {
640
641
  * No description
641
642
  *
642
643
  * @tags ImportService
643
- * @name GetExcelDataSchema
644
- * @operationId ImportServiceController_GetExcelDataSchema
645
- * @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.
646
- * @request GET:/import/excelDataSchema
644
+ * @name GetFeaturesCount
645
+ * @operationId ImportServiceController_GetFeaturesCount
646
+ * @summary Returns the features count of the given file in temporary static storage.
647
+ * @request POST:/import/count
647
648
  * @response `200` Success
648
649
  */
649
650
 
650
651
  }, {
651
- key: "getExcelDataSchema",
652
- value: function getExcelDataSchema(query) {
653
- return this.http.get("/import/excelDataSchema", query).json();
654
- }
655
- /**
656
- * No description
657
- *
658
- * @tags ImportService
659
- * @name GetCsvDataSchema
660
- * @operationId ImportServiceController_GetCsvDataSchema
661
- * @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.
662
- * @request GET:/import/csvDataSchema
663
- * @response `200` Success
664
- */
665
-
666
- }, {
667
- key: "getCsvDataSchema",
668
- value: function getCsvDataSchema(query) {
669
- return this.http.get("/import/csvDataSchema", query).json();
670
- }
671
- /**
672
- * No description
673
- *
674
- * @tags ImportService
675
- * @name GetKmlDataSchema
676
- * @operationId ImportServiceController_GetKmlDataSchema
677
- * @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.
678
- * @request GET:/import/kmlDataSchema
679
- * @response `200` Success
680
- */
681
-
682
- }, {
683
- key: "getKmlDataSchema",
684
- value: function getKmlDataSchema(query) {
685
- return this.http.get("/import/kmlDataSchema", query).json();
652
+ key: "getFeaturesCount",
653
+ value: function getFeaturesCount(data) {
654
+ return this.http.post("/import/count", data).json();
686
655
  }
687
656
  /**
688
657
  * No description
@@ -5815,6 +5784,7 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
5815
5784
  let {
5816
5785
  url,
5817
5786
  wsUrl,
5787
+ snappingHubUrl,
5818
5788
  http,
5819
5789
  urlPath,
5820
5790
  httpOptions
@@ -5874,6 +5844,9 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
5874
5844
  _this.names = new Names({
5875
5845
  account: _this.account
5876
5846
  });
5847
+ _this.snappingHub = snappingHubUrl ? new signalr.HubConnectionBuilder().withUrl(snappingHubUrl, {
5848
+ withCredentials: true
5849
+ }).withAutomaticReconnect().build() : null;
5877
5850
  return _this;
5878
5851
  }
5879
5852
 
@@ -5883,6 +5856,7 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
5883
5856
  let {
5884
5857
  authParams,
5885
5858
  connectWs,
5859
+ connectSignalR,
5886
5860
  initScheduler,
5887
5861
  fetchSettings,
5888
5862
  fetchUser
@@ -5899,6 +5873,10 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
5899
5873
  await this.connectWs();
5900
5874
  }
5901
5875
 
5876
+ if (connectSignalR) {
5877
+ await this.connectSignalR();
5878
+ }
5879
+
5902
5880
  if (initScheduler) {
5903
5881
  await this.initScheduler();
5904
5882
  }
@@ -5946,6 +5924,13 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
5946
5924
  });
5947
5925
  }
5948
5926
  }
5927
+ }, {
5928
+ key: "connectSignalR",
5929
+ value: async function connectSignalR() {
5930
+ if (this.account.isAuth && this.snappingHub) {
5931
+ await this.snappingHub.start();
5932
+ }
5933
+ }
5949
5934
  }, {
5950
5935
  key: "logout",
5951
5936
  value: async function logout() {