@evergis/api 3.0.202 → 3.0.204

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
@@ -64,7 +64,7 @@ export declare class Api extends EventEmitter {
64
64
  readonly catalog: CatalogService;
65
65
  readonly queryToken: QueryTokenAccessService;
66
66
  constructor({ url, wsUrl, wsKeepAlive, snappingHubUrl, http, urlPath, httpOptions, }: ApiParams);
67
- init({ authParams, authQueryParams, connectWs, initScheduler, fetchSettings, fetchUser, }: {
67
+ init({ authParams, authQueryParams, connectWs, initScheduler, fetchSettings, fetchUser, useJwt, }: {
68
68
  authParams?: LoginDc;
69
69
  authQueryParams?: AuthenticateParams;
70
70
  connectWs?: boolean;
@@ -72,6 +72,7 @@ export declare class Api extends EventEmitter {
72
72
  initScheduler?: boolean;
73
73
  fetchSettings?: boolean;
74
74
  fetchUser?: boolean;
75
+ useJwt?: boolean;
75
76
  }): Promise<void>;
76
77
  isAcceptedNetwork(network: string): network is SocAuthNetwork;
77
78
  socAuthLogin(network: SocAuthNetwork): Promise<void>;
@@ -28,6 +28,17 @@ export declare class DataSourceService extends Service {
28
28
  * @response `200` OK
29
29
  */
30
30
  createDataSource(data: DataSourceDc): Promise<void>;
31
+ /**
32
+ * No description
33
+ *
34
+ * @tags DataSource
35
+ * @name UpdateDataSource
36
+ * @operationId DataSourceController_UpdateDataSource
37
+ * @summary Update data source.
38
+ * @request PATCH:/ds
39
+ * @response `200` OK
40
+ */
41
+ updateDataSource(data: DataSourceDc): Promise<void>;
31
42
  /**
32
43
  * No description
33
44
  *
@@ -1,4 +1,4 @@
1
- import { AccessControlListDc, BulkOperationResultDc, DeleteResourcesParams2, ExtendedProjectInfoDc, ExtendedProjectLayersInfo, FileUploadResponse, GetProjectsInfoParams, GetProjectsListParams, PagedListProjectInfoDc, ProjectsListDc, ResourceDependenciesDc, SetPermissionsBatchBody, SetPreviewBody } from './data-contracts';
1
+ import { AccessControlListDc, BulkOperationResultDc, DeleteResourcesParams6, ExtendedProjectInfoDc, ExtendedProjectLayersInfo, FileUploadResponse, GetProjectsInfoParams, GetProjectsListParams, PagedListProjectInfoDc, ProjectsListDc, ResourceDependenciesDc, SetPermissionsBatchBody, SetPreviewBody } 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` OK
51
51
  */
52
- deleteResources(query: DeleteResourcesParams2): Promise<BulkOperationResultDc[]>;
52
+ deleteResources(query: DeleteResourcesParams6): Promise<BulkOperationResultDc[]>;
53
53
  /**
54
54
  * No description
55
55
  *
@@ -1,4 +1,4 @@
1
- import { ClassifyDc, ClassifyParams5, GetClassifyDc, GetStatisticsDc, GetSumOfProductDc, StatisticsDbParams, StatisticsDc, SumOfProductParams } from './data-contracts';
1
+ import { ClassifyDc, ClassifyParams7, GetClassifyDc, GetStatisticsDc, GetSumOfProductDc, StatisticsDbParams, StatisticsDc, SumOfProductParams } from './data-contracts';
2
2
  import { Service } from './Service';
3
3
  /**
4
4
  * @title Spatial Processing Core API
@@ -38,7 +38,7 @@ export declare class StatisticService extends Service {
38
38
  * @request GET:/statistics/classify
39
39
  * @response `200` OK
40
40
  */
41
- classify(query: ClassifyParams5): Promise<ClassifyDc>;
41
+ classify(query: ClassifyParams7): Promise<ClassifyDc>;
42
42
  /**
43
43
  * No description
44
44
  *
@@ -1,4 +1,4 @@
1
- import { GetCapabilities1Params, GetCapabilitiesParams2, GetFeatureInfoParams, GetLegendGraphicParams, GetMapParams } from './data-contracts';
1
+ import { GetCapabilities1Params, GetCapabilitiesParams3, 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` OK
18
18
  */
19
- getCapabilities(query: GetCapabilitiesParams2): Promise<void>;
19
+ getCapabilities(query: GetCapabilitiesParams3): Promise<void>;
20
20
  /**
21
21
  * No description
22
22
  *
@@ -891,6 +891,8 @@ export interface CatalogResourceDc {
891
891
  size?: number;
892
892
  /** Content type. */
893
893
  contentType?: string;
894
+ /** Preview. */
895
+ preview?: string;
894
896
  /** Check if resource has children. */
895
897
  hasChildren?: boolean;
896
898
  /** Check if resource is directory. */
@@ -1616,9 +1618,13 @@ export interface DataSourceDc {
1616
1618
  /** Description. */
1617
1619
  description?: string;
1618
1620
  /**
1619
- * Data source type.
1621
+ *
1620
1622
  *
1621
1623
  * Postgres
1624
+ *
1625
+ * S3
1626
+ *
1627
+ * GisServer
1622
1628
  */
1623
1629
  type?: DataSourceType;
1624
1630
  /** Connection string. */
@@ -1641,12 +1647,18 @@ export interface DataSourceDc {
1641
1647
  acl?: AccessControlListDc;
1642
1648
  }
1643
1649
  /**
1644
- * Data source type.
1650
+ *
1645
1651
 
1646
1652
  Postgres
1653
+
1654
+ S3
1655
+
1656
+ GisServer
1647
1657
  */
1648
1658
  export declare enum DataSourceType {
1649
- Postgres = "Postgres"
1659
+ Postgres = "Postgres",
1660
+ S3 = "S3",
1661
+ GisServer = "GisServer"
1650
1662
  }
1651
1663
  /**
1652
1664
  * Configuration of a table for feature layer.
@@ -4352,6 +4364,7 @@ export declare enum Quality {
4352
4364
  * Configuration of a postgres feature layer service.
4353
4365
  */
4354
4366
  export declare type QueryLayerServiceConfigurationDc = ServiceConfigurationBaseDc & {
4367
+ ds?: string | null;
4355
4368
  eql?: string | null;
4356
4369
  eqlParameters?: Record<string, QueryLayerServiceEqlParameterConfigurationDc>;
4357
4370
  srid?: number | null;
@@ -7864,7 +7877,7 @@ export interface GetProjectsListParams {
7864
7877
  tags?: string[];
7865
7878
  }
7866
7879
  export declare type SetPermissionsBatchBody = ResourceAclDc[];
7867
- export interface DeleteResourcesParams2 {
7880
+ export interface DeleteResourcesParams6 {
7868
7881
  /** Resource names. */
7869
7882
  names?: string[];
7870
7883
  }
@@ -8147,7 +8160,7 @@ export interface StatisticsDbParams {
8147
8160
  */
8148
8161
  types?: AggregationFunction[];
8149
8162
  }
8150
- export interface ClassifyParams5 {
8163
+ export interface ClassifyParams7 {
8151
8164
  /** Layer name. */
8152
8165
  name: string;
8153
8166
  /** Attribute name. */
@@ -8437,7 +8450,7 @@ export interface GetPublicCapabilitiesParams {
8437
8450
  /** When omitted or not supported by server, server shall return service metadata document using the MIME type "text/xml". */
8438
8451
  AcceptFormats?: string[];
8439
8452
  }
8440
- export interface GetCapabilitiesParams2 {
8453
+ export interface GetCapabilitiesParams3 {
8441
8454
  /** Output format of service metadata. */
8442
8455
  Format?: string;
8443
8456
  /** Must be WMS. */
@@ -1437,18 +1437,22 @@ let Account = /*#__PURE__*/function (_AccountService) {
1437
1437
 
1438
1438
  _createClass(Account, [{
1439
1439
  key: "login",
1440
- value: function login(params, authParams) {
1440
+ value: async function login(params, authParams, useJwt) {
1441
1441
  if (authParams === void 0) {
1442
1442
  authParams = {};
1443
1443
  }
1444
1444
 
1445
+ if (useJwt === void 0) {
1446
+ useJwt = false;
1447
+ }
1448
+
1445
1449
  if (params) {
1446
- _get(_getPrototypeOf(Account.prototype), "authenticate", this).call(this, authParams, params).then(resonse => {
1447
- if (resonse) {
1448
- window.localStorage.setItem(STORAGE_TOKEN_KEY, resonse.token);
1449
- window.localStorage.setItem(STORAGE_REFRESH_TOKEN_KEY, resonse.refreshToken);
1450
- }
1451
- });
1450
+ const response = await _get(_getPrototypeOf(Account.prototype), "authenticate", this).call(this, authParams, params);
1451
+
1452
+ if (response && useJwt) {
1453
+ window.localStorage.setItem(STORAGE_TOKEN_KEY, response.token);
1454
+ window.localStorage.setItem(STORAGE_REFRESH_TOKEN_KEY, response.refreshToken);
1455
+ }
1452
1456
  }
1453
1457
  }
1454
1458
  }, {
@@ -1467,8 +1471,13 @@ let Account = /*#__PURE__*/function (_AccountService) {
1467
1471
  }, {
1468
1472
  key: "logout",
1469
1473
  value: async function logout() {
1470
- window.localStorage.removeItem(STORAGE_TOKEN_KEY);
1471
- window.localStorage.removeItem(STORAGE_REFRESH_TOKEN_KEY);
1474
+ const token = window.localStorage.getItem(STORAGE_TOKEN_KEY);
1475
+
1476
+ if (token) {
1477
+ window.localStorage.removeItem(STORAGE_TOKEN_KEY);
1478
+ window.localStorage.removeItem(STORAGE_REFRESH_TOKEN_KEY);
1479
+ }
1480
+
1472
1481
  await this.revokeToken();
1473
1482
  updateUserInfo(undefined);
1474
1483
  this.userInfo = {};
@@ -7610,11 +7619,12 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
7610
7619
  connectWs,
7611
7620
  initScheduler,
7612
7621
  fetchSettings,
7613
- fetchUser
7622
+ fetchUser,
7623
+ useJwt
7614
7624
  } = _ref2;
7615
7625
 
7616
7626
  try {
7617
- this.account.login(authParams, authQueryParams);
7627
+ await this.account.login(authParams, authQueryParams, useJwt);
7618
7628
 
7619
7629
  if (fetchUser) {
7620
7630
  await this.account.fetchCurrentUser();
@@ -8174,6 +8184,8 @@ function isFeatureLayer(layer) {
8174
8184
 
8175
8185
  (function (DataSourceType) {
8176
8186
  DataSourceType["Postgres"] = "Postgres";
8187
+ DataSourceType["S3"] = "S3";
8188
+ DataSourceType["GisServer"] = "GisServer";
8177
8189
  })(exports.DataSourceType || (exports.DataSourceType = {}));
8178
8190
 
8179
8191
  (function (ErrorDetailsType) {