@evergis/api 4.1.9 → 4.1.12

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,13 +1,30 @@
1
1
  import ky, { HTTPError } from 'ky';
2
2
  export { HTTPError, TimeoutError } from 'ky';
3
- import { HubConnectionBuilder, HttpTransportType, HubConnectionState } from '@microsoft/signalr';
4
3
  import { stringify } from 'query-string';
4
+ import { HubConnectionBuilder, HttpTransportType, HubConnectionState } from '@microsoft/signalr';
5
5
  import { customAlphabet } from 'nanoid';
6
6
 
7
7
  const API_USER_INFO_KEY = "@evergis/user-info";
8
8
  const STORAGE_TOKEN_KEY = "evergis-jwt-token";
9
9
  const STORAGE_REFRESH_TOKEN_KEY = "evergis-refresh-token";
10
10
 
11
+ const useToken = () => {
12
+ const token = window.localStorage.getItem(STORAGE_TOKEN_KEY);
13
+ const refreshToken = window.localStorage.getItem(STORAGE_REFRESH_TOKEN_KEY);
14
+ return { token, refreshToken };
15
+ };
16
+
17
+ const getUserInfo = () => JSON.parse(localStorage.getItem(API_USER_INFO_KEY) || "null") || void 0;
18
+ const updateUserInfo = (newUserInfo) => {
19
+ if (newUserInfo) {
20
+ const oldUserInfo = getUserInfo();
21
+ localStorage.setItem(API_USER_INFO_KEY, JSON.stringify({ ...oldUserInfo, ...newUserInfo }));
22
+ }
23
+ else {
24
+ localStorage.removeItem(API_USER_INFO_KEY);
25
+ }
26
+ };
27
+
11
28
  /* eslint-disable */
12
29
  /* tslint:disable */
13
30
  /*
@@ -120,672 +137,647 @@ class Service {
120
137
  * @version 1.5.1.0
121
138
  * @baseUrl /sp
122
139
  */
123
- class DataSourceService extends Service {
140
+ class AccountService extends Service {
124
141
  /**
125
142
  * No description
126
143
  *
127
- * @tags DataSource
128
- * @name CreateArcGisDataSource
129
- * @operationId DataSourceController_CreateArcGisDataSource
130
- * @summary Create S3 data source.
131
- * @request POST:/ds/arcgis
144
+ * @tags Account
145
+ * @name GetUsers
146
+ * @operationId AccountController_GetUsers
147
+ * @summary Returns the list of users that correspond to the given conditions.
148
+ * @request GET:/account/user/list
132
149
  * @secure
133
150
  * @response `200` OK
134
151
  */
135
- createArcGisDataSource(data) {
136
- return this.http.post(`/ds/arcgis`, data).then(() => { });
152
+ getUsers(query) {
153
+ return this.http.get(`/account/user/list`, query).json();
137
154
  }
138
155
  /**
139
156
  * No description
140
157
  *
141
- * @tags DataSource
142
- * @name UpdateArcGisDataSource
143
- * @operationId DataSourceController_UpdateArcGisDataSource
144
- * @summary Update arcgis data source.
145
- * @request PATCH:/ds/arcgis
158
+ * @tags Account
159
+ * @name GetExtendedUsers
160
+ * @operationId AccountController_GetExtendedUsers
161
+ * @summary Returns the list of extended users informations that correspond to the given conditions.
162
+ * @request GET:/account/user/extendedlist
146
163
  * @secure
147
164
  * @response `200` OK
148
165
  */
149
- updateArcGisDataSource(data) {
150
- return this.http.patch(`/ds/arcgis`, data).then(() => { });
166
+ getExtendedUsers(query) {
167
+ return this.http.get(`/account/user/extendedlist`, query).json();
151
168
  }
152
169
  /**
153
170
  * No description
154
171
  *
155
- * @tags DataSource
156
- * @name GetDataSourcesList
157
- * @operationId DataSourceController_GetDataSourcesList
158
- * @summary Returns list of the available data sources.
159
- * @request GET:/ds
172
+ * @tags Account
173
+ * @name GetUserInfo
174
+ * @operationId AccountController_GetUserInfo
175
+ * @summary Get current user basic information.
176
+ * @request GET:/account
160
177
  * @secure
161
178
  * @response `200` OK
162
179
  */
163
- getDataSourcesList(query) {
164
- return this.http.get(`/ds`, query).json();
180
+ getUserInfo() {
181
+ return this.http.get(`/account`).json();
165
182
  }
166
183
  /**
167
184
  * No description
168
185
  *
169
- * @tags DataSource
170
- * @name CreateDataSource
171
- * @operationId DataSourceController_CreateDataSource
172
- * @summary Create postgresql data source.
173
- * @request POST:/ds
186
+ * @tags Account
187
+ * @name GetUserInfo1
188
+ * @operationId AccountController_GetUserInfo_1
189
+ * @summary Get user basic information.
190
+ * @request GET:/account/{username}
174
191
  * @secure
175
192
  * @response `200` OK
176
193
  */
177
- createDataSource(data) {
178
- return this.http.post(`/ds`, data).then(() => { });
194
+ getUserInfo1(username) {
195
+ return this.http.get(`/account/${username}`).json();
179
196
  }
180
197
  /**
181
198
  * No description
182
199
  *
183
- * @tags DataSource
184
- * @name UpdateDataSource
185
- * @operationId DataSourceController_UpdateDataSource
186
- * @summary Update postgresql data source.
187
- * @request PATCH:/ds
200
+ * @tags Account
201
+ * @name GetExtendedUserInfo
202
+ * @operationId AccountController_GetExtendedUserInfo
203
+ * @summary Get current user extended information.
204
+ * @request GET:/account/extended
188
205
  * @secure
189
206
  * @response `200` OK
190
207
  */
191
- updateDataSource(data) {
192
- return this.http.patch(`/ds`, data).then(() => { });
208
+ getExtendedUserInfo() {
209
+ return this.http.get(`/account/extended`).json();
193
210
  }
194
211
  /**
195
212
  * No description
196
213
  *
197
- * @tags DataSource
198
- * @name GetDataSource
199
- * @operationId DataSourceController_GetDataSource
200
- * @summary Get data source by name.
201
- * @request GET:/ds/{name}
214
+ * @tags Account
215
+ * @name GetExtendedUserInfo1
216
+ * @operationId AccountController_GetExtendedUserInfo_1
217
+ * @summary Get user extended information.
218
+ * @request GET:/account/extended/{username}
202
219
  * @secure
203
220
  * @response `200` OK
204
221
  */
205
- getDataSource(name) {
206
- return this.http
207
- .get(`/ds/${name}`)
208
- .json();
222
+ getExtendedUserInfo1(username) {
223
+ return this.http.get(`/account/extended/${username}`).json();
209
224
  }
210
225
  /**
211
226
  * No description
212
227
  *
213
- * @tags DataSource
214
- * @name RemoveDataSource
215
- * @operationId DataSourceController_RemoveDataSource
216
- * @summary Remove data source by name.
217
- * @request DELETE:/ds/{name}
228
+ * @tags Account
229
+ * @name IsUsernameExists
230
+ * @operationId AccountController_IsUsernameExists
231
+ * @summary Checks if the user with the given name is registered in the system.
232
+ * @request GET:/account/user/exists
218
233
  * @secure
219
234
  * @response `200` OK
220
235
  */
221
- removeDataSource(name) {
222
- return this.http.delete(`/ds/${name}`, null).then(() => { });
236
+ isUsernameExists(query) {
237
+ return this.http.get(`/account/user/exists`, query).json();
223
238
  }
224
239
  /**
225
240
  * No description
226
241
  *
227
- * @tags DataSource
228
- * @name TestConnection
229
- * @operationId DataSourceController_TestConnection
230
- * @summary Test ds connection.
231
- * @request POST:/ds/testConnection
242
+ * @tags Account
243
+ * @name IsEmailExists
244
+ * @operationId AccountController_IsEmailExists
245
+ * @summary Checks if the user with the given email is registered in the system.
246
+ * @request GET:/account/user/email/exists
232
247
  * @secure
233
248
  * @response `200` OK
234
249
  */
235
- testConnection(data) {
236
- return this.http.post(`/ds/testConnection`, data).json();
250
+ isEmailExists(query) {
251
+ return this.http.get(`/account/user/email/exists`, query).json();
237
252
  }
238
253
  /**
239
254
  * No description
240
255
  *
241
- * @tags DataSource
242
- * @name CreateMosRuDataSource
243
- * @operationId DataSourceController_CreateMosRuDataSource
244
- * @summary Create data.mos.ru data source.
245
- * @request POST:/ds/dataMosRu
256
+ * @tags Account
257
+ * @name RegisterUser
258
+ * @operationId AccountController_RegisterUser
259
+ * @summary Register new user.
260
+ * @request POST:/account/register
246
261
  * @secure
247
262
  * @response `200` OK
248
263
  */
249
- createMosRuDataSource(data) {
250
- return this.http.post(`/ds/dataMosRu`, data).then(() => { });
264
+ registerUser(data) {
265
+ return this.http.post(`/account/register`, data).text();
251
266
  }
252
267
  /**
253
- * No description
268
+ * @description Only for users with Everpoint.Sdk.Security.Abstractions.ISecurityManager.SuperuserRole role.
254
269
  *
255
- * @tags DataSource
256
- * @name UpdateMosRuDataSource
257
- * @operationId DataSourceController_UpdateMosRuDataSource
258
- * @summary Update data.mos.ru data source.
259
- * @request PATCH:/ds/dataMosRu
270
+ * @tags Account
271
+ * @name CreateUser
272
+ * @operationId AccountController_CreateUser
273
+ * @summary Create new user.
274
+ * @request POST:/account/user
260
275
  * @secure
261
276
  * @response `200` OK
262
277
  */
263
- updateMosRuDataSource(data) {
264
- return this.http.patch(`/ds/dataMosRu`, data).then(() => { });
278
+ createUser(query, data) {
279
+ return this.http.post(`/account/user`, data, query).then(() => { });
265
280
  }
266
281
  /**
267
282
  * No description
268
283
  *
269
- * @tags DataSource
270
- * @name CreateS3DataSource
271
- * @operationId DataSourceController_CreateS3DataSource
272
- * @summary Create S3 data source.
273
- * @request POST:/ds/s3
284
+ * @tags Account
285
+ * @name UpdateUser
286
+ * @operationId AccountController_UpdateUser
287
+ * @summary Update exist user.
288
+ * @request PATCH:/account/user
274
289
  * @secure
275
290
  * @response `200` OK
276
291
  */
277
- createS3DataSource(data) {
278
- return this.http.post(`/ds/s3`, data).then(() => { });
292
+ updateUser(data) {
293
+ return this.http.patch(`/account/user`, data).then(() => { });
279
294
  }
280
295
  /**
281
- * No description
296
+ * @description Only for users with Everpoint.Sdk.Security.Abstractions.ISecurityManager.SuperuserRole role.
282
297
  *
283
- * @tags DataSource
284
- * @name UpdateS3DataSource
285
- * @operationId DataSourceController_UpdateS3DataSource
286
- * @summary Create S3 data source.
287
- * @request PATCH:/ds/s3
298
+ * @tags Account
299
+ * @name ConfirmEmail
300
+ * @operationId AccountController_ConfirmEmail
301
+ * @summary Confirm user email.
302
+ * @request POST:/account/user/{username}/email/confirm
288
303
  * @secure
289
304
  * @response `200` OK
290
305
  */
291
- updateS3DataSource(data) {
292
- return this.http.patch(`/ds/s3`, data).then(() => { });
306
+ confirmEmail(username) {
307
+ return this.http.post(`/account/user/${username}/email/confirm`, null).then(() => { });
293
308
  }
294
309
  /**
295
310
  * No description
296
311
  *
297
- * @tags DataSource
298
- * @name CreateSparkDataSource
299
- * @operationId DataSourceController_CreateSparkDataSource
300
- * @summary Create spark data source.
301
- * @request POST:/ds/spark
312
+ * @tags Account
313
+ * @name VerifyEmail
314
+ * @operationId AccountController_VerifyEmail
315
+ * @summary Send email with verification code.
316
+ * @request POST:/account/user/{username}/email/verify
302
317
  * @secure
303
318
  * @response `200` OK
304
319
  */
305
- createSparkDataSource(data) {
306
- return this.http.post(`/ds/spark`, data).then(() => { });
320
+ verifyEmail(username) {
321
+ return this.http.post(`/account/user/${username}/email/verify`, null).then(() => { });
307
322
  }
308
323
  /**
309
324
  * No description
310
325
  *
311
- * @tags DataSource
312
- * @name UpdateSparkDataSource
313
- * @operationId DataSourceController_UpdateSparkDataSource
314
- * @summary Update spark data source.
315
- * @request PATCH:/ds/spark
326
+ * @tags Account
327
+ * @name SetEmail
328
+ * @operationId AccountController_SetEmail
329
+ * @summary For a user that does not have a set email, sets the email and password. Requires email confirmation through link.
330
+ * @request POST:/account/setEmail
316
331
  * @secure
317
332
  * @response `200` OK
318
333
  */
319
- updateSparkDataSource(data) {
320
- return this.http.patch(`/ds/spark`, data).then(() => { });
334
+ setEmail(data) {
335
+ return this.http.post(`/account/setEmail`, toFormData(data)).then(() => { });
321
336
  }
322
337
  /**
323
338
  * No description
324
339
  *
325
- * @tags DataSource
326
- * @name CreateArcGisDataSource1
327
- * @operationId DataSourceController_CreateArcGisDataSource_1
328
- * @summary Create WMS data source.
329
- * @request POST:/ds/wms
340
+ * @tags Account
341
+ * @name ConfirmEmail1
342
+ * @operationId AccountController_ConfirmEmail_1
343
+ * @summary Confirm user email by code.
344
+ * @request POST:/account/user/email/confirm
330
345
  * @secure
331
346
  * @response `200` OK
332
347
  */
333
- createArcGisDataSource1(data) {
334
- return this.http.post(`/ds/wms`, data).then(() => { });
348
+ confirmEmail1(query) {
349
+ return this.http.post(`/account/user/email/confirm`, null, query).then(() => { });
335
350
  }
336
351
  /**
337
352
  * No description
338
353
  *
339
- * @tags DataSource
340
- * @name UpdateArcGisDataSource1
341
- * @operationId DataSourceController_UpdateArcGisDataSource_1
342
- * @summary Update WMS data source.
343
- * @request PATCH:/ds/wms
354
+ * @tags Account
355
+ * @name ChangeEmail
356
+ * @operationId AccountController_ChangeEmail
357
+ * @summary Send email message with confirmation code to new email address.
358
+ * @request POST:/account/user/email/change
344
359
  * @secure
345
360
  * @response `200` OK
346
361
  */
347
- updateArcGisDataSource1(data) {
348
- return this.http.patch(`/ds/wms`, data).then(() => { });
362
+ changeEmail(query) {
363
+ return this.http.post(`/account/user/email/change`, null, query).then(() => { });
349
364
  }
350
- }
351
-
352
- /* eslint-disable */
353
- /* tslint:disable */
354
- /*
355
- * ---------------------------------------------------------------
356
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
357
- * ## ##
358
- * ## AUTHOR: acacode ##
359
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
360
- * ---------------------------------------------------------------
361
- */
362
- // @ts-nocheck
363
- /**
364
- * @title Spatial Processing Core API
365
- * @version 1.5.1.0
366
- * @baseUrl /sp
367
- */
368
- class QueryTokenAccessService extends Service {
369
365
  /**
370
366
  * No description
371
367
  *
372
- * @tags QueryTokenAccess
373
- * @name GetTokensList
374
- * @operationId QueryTokenAccessController_GetTokensList
375
- * @request GET:/accessToken/list/{username}
368
+ * @tags Account
369
+ * @name ConfirmChangeEmail
370
+ * @operationId AccountController_ConfirmChangeEmail
371
+ * @summary Check confirmation code and change email address.
372
+ * @request POST:/account/user/email/change/confirm
376
373
  * @secure
377
374
  * @response `200` OK
378
375
  */
379
- getTokensList({ username, ...query }) {
380
- return this.http.get(`/accessToken/list/${username}`, query).json();
376
+ confirmChangeEmail(query) {
377
+ return this.http.post(`/account/user/email/change/confirm`, null, query).then(() => { });
381
378
  }
382
379
  /**
383
380
  * No description
384
381
  *
385
- * @tags QueryTokenAccess
386
- * @name CreateToken
387
- * @operationId QueryTokenAccessController_CreateTokenAsync
388
- * @request PUT:/accessToken/{username}
382
+ * @tags Account
383
+ * @name SetUserPassword
384
+ * @operationId AccountController_SetUserPassword
385
+ * @summary Set user password.
386
+ * @request PATCH:/account/password/set
389
387
  * @secure
390
388
  * @response `200` OK
391
389
  */
392
- createToken(username) {
393
- return this.http.put(`/accessToken/${username}`, null).text();
390
+ setUserPassword(data) {
391
+ return this.http.patch(`/account/password/set`, data).then(() => { });
394
392
  }
395
393
  /**
396
394
  * No description
397
395
  *
398
- * @tags QueryTokenAccess
399
- * @name DisableToken
400
- * @operationId QueryTokenAccessController_DisableToken
401
- * @request POST:/accessToken/{token}/disable
396
+ * @tags Account
397
+ * @name ChangePassword
398
+ * @operationId AccountController_ChangePassword
399
+ * @summary Change current user password.
400
+ * @request PATCH:/account/password/change
402
401
  * @secure
403
402
  * @response `200` OK
404
403
  */
405
- disableToken(token) {
406
- return this.http.post(`/accessToken/${token}/disable`, null).then(() => { });
404
+ changePassword(data) {
405
+ return this.http.patch(`/account/password/change`, toFormData(data)).then(() => { });
407
406
  }
408
407
  /**
409
408
  * No description
410
409
  *
411
- * @tags QueryTokenAccess
412
- * @name EnableToken
413
- * @operationId QueryTokenAccessController_EnableToken
414
- * @request POST:/accessToken/{token}/enable
410
+ * @tags Account
411
+ * @name ResetPassword
412
+ * @operationId AccountController_ResetPassword
413
+ * @summary Send reset password message.
414
+ * @request POST:/account/password/reset
415
415
  * @secure
416
416
  * @response `200` OK
417
417
  */
418
- enableToken(token) {
419
- return this.http.post(`/accessToken/${token}/enable`, null).then(() => { });
418
+ resetPassword(query) {
419
+ return this.http.post(`/account/password/reset`, null, query).then(() => { });
420
420
  }
421
421
  /**
422
422
  * No description
423
423
  *
424
- * @tags QueryTokenAccess
425
- * @name RevokeToken
426
- * @operationId QueryTokenAccessController_RevokeToken
427
- * @request DELETE:/accessToken/{token}
424
+ * @tags Account
425
+ * @name ResetPasswordCallback
426
+ * @operationId AccountController_ResetPasswordCallback
427
+ * @summary Reset password.
428
+ * @request POST:/account/password/reset/confirm
428
429
  * @secure
429
430
  * @response `200` OK
430
431
  */
431
- revokeToken(token) {
432
- return this.http.delete(`/accessToken/${token}`, null).then(() => { });
432
+ resetPasswordCallback(data) {
433
+ return this.http.post(`/account/password/reset/confirm`, toFormData(data)).then(() => { });
433
434
  }
434
- }
435
-
436
- /* eslint-disable */
437
- /* tslint:disable */
438
- /*
439
- * ---------------------------------------------------------------
440
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
441
- * ## ##
442
- * ## AUTHOR: acacode ##
443
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
444
- * ---------------------------------------------------------------
445
- */
446
- // @ts-nocheck
447
- /**
448
- * @title Spatial Processing Core API
449
- * @version 1.5.1.0
450
- * @baseUrl /sp
451
- */
452
- class SpatialReferencesService extends Service {
453
435
  /**
454
436
  * No description
455
437
  *
456
- * @tags SpatialReferences
457
- * @name GetAvailiableCs
458
- * @operationId SpatialReferencesController_GetAvailiableCsAsync
459
- * @summary Returns list of available spatial references.
460
- * @request GET:/srs/list
438
+ * @tags Account
439
+ * @name RemoveUser
440
+ * @operationId AccountController_RemoveUser
441
+ * @summary Remove user.
442
+ * @request DELETE:/account/user/{username}
461
443
  * @secure
462
444
  * @response `200` OK
463
445
  */
464
- getAvailiableCs() {
465
- return this.http.get(`/srs/list`).json();
446
+ removeUser(username) {
447
+ return this.http.delete(`/account/user/${username}`, null).then(() => { });
466
448
  }
467
449
  /**
468
450
  * No description
469
451
  *
470
- * @tags SpatialReferences
471
- * @name GetProj4Representation
472
- * @operationId SpatialReferencesController_GetProj4RepresentationAsync
473
- * @summary Returns a WKT representation of spatial reference.
474
- * @request GET:/srs/{name}/proj4
452
+ * @tags Account
453
+ * @name CreateNamespace
454
+ * @operationId AccountController_CreateNamespace
455
+ * @summary Creates a new namespace.
456
+ * @request POST:/account/namespace
475
457
  * @secure
476
458
  * @response `200` OK
477
459
  */
478
- getProj4Representation(name) {
479
- return this.http.get(`/srs/${name}/proj4`).text();
460
+ createNamespace(query) {
461
+ return this.http.post(`/account/namespace`, null, query).json();
480
462
  }
481
463
  /**
482
464
  * No description
483
465
  *
484
- * @tags SpatialReferences
485
- * @name GetWktRepresentation
486
- * @operationId SpatialReferencesController_GetWktRepresentationAsync
487
- * @summary Returns a WKT representation of spatial reference.
488
- * @request GET:/srs/{name}/wkt
466
+ * @tags Account
467
+ * @name RemoveNamespace
468
+ * @operationId AccountController_RemoveNamespaceAsync
469
+ * @summary Remove namespace.
470
+ * @request DELETE:/account/namespace/{name}
489
471
  * @secure
490
472
  * @response `200` OK
491
473
  */
492
- getWktRepresentation(name) {
493
- return this.http.get(`/srs/${name}/wkt`).text();
474
+ removeNamespace(name) {
475
+ return this.http.delete(`/account/namespace/${name}`, null).then(() => { });
494
476
  }
495
- }
496
-
497
- /* eslint-disable */
498
- /* tslint:disable */
499
- /*
500
- * ---------------------------------------------------------------
501
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
502
- * ## ##
503
- * ## AUTHOR: acacode ##
504
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
505
- * ---------------------------------------------------------------
506
- */
507
- // @ts-nocheck
508
- /**
509
- * @title Spatial Processing Core API
510
- * @version 1.5.1.0
511
- * @baseUrl /sp
512
- */
513
- class CatalogService extends Service {
514
477
  /**
515
478
  * No description
516
479
  *
517
- * @tags Catalog
518
- * @name GetParents
519
- * @operationId CatalogController_GetParents
520
- * @summary Get parents.
521
- * @request GET:/resources/{resourceId}/parents
480
+ * @tags Account
481
+ * @name ActivateUser
482
+ * @operationId AccountController_ActivateUser
483
+ * @summary Activate user.
484
+ * @request POST:/account/user/{username}/activate
522
485
  * @secure
523
486
  * @response `200` OK
524
487
  */
525
- getParents(resourceId) {
526
- return this.http.get(`/resources/${resourceId}/parents`).json();
488
+ activateUser(username) {
489
+ return this.http.post(`/account/user/${username}/activate`, null).then(() => { });
527
490
  }
528
491
  /**
529
492
  * No description
530
493
  *
531
- * @tags Catalog
532
- * @name GetTags
533
- * @operationId CatalogController_GetTags
534
- * @summary Get all tags of given user.
535
- * @request GET:/resources/tags
494
+ * @tags Account
495
+ * @name DeactivateUser
496
+ * @operationId AccountController_DeactivateUser
497
+ * @summary Deactivate user.
498
+ * @request POST:/account/user/{username}/deactivate
536
499
  * @secure
537
500
  * @response `200` OK
538
501
  */
539
- getTags(query) {
540
- return this.http.get(`/resources/tags`, query).json();
502
+ deactivateUser(username) {
503
+ return this.http.post(`/account/user/${username}/deactivate`, null).then(() => { });
541
504
  }
542
505
  /**
543
506
  * No description
544
507
  *
545
- * @tags Catalog
546
- * @name PutTags
547
- * @operationId CatalogController_PutTags
548
- * @summary Put tags to resource.
549
- * @request PUT:/resources/{resourceId}/tags
508
+ * @tags Account
509
+ * @name Authenticate
510
+ * @operationId AccountController_Authenticate
511
+ * @summary Login.
512
+ * @request POST:/account/login
550
513
  * @secure
551
514
  * @response `200` OK
552
515
  */
553
- putTags(resourceId, data) {
554
- return this.http.put(`/resources/${resourceId}/tags`, data).json();
516
+ authenticate(query, data) {
517
+ return this.http.post(`/account/login`, data, query).json();
555
518
  }
556
519
  /**
557
520
  * No description
558
521
  *
559
- * @tags Catalog
560
- * @name PostGetAll
561
- * @operationId CatalogController_PostGetAll
562
- * @summary Get all resource with given.
563
- * @request POST:/resources
522
+ * @tags Account
523
+ * @name RefreshToken
524
+ * @operationId AccountController_RefreshToken
525
+ * @summary Refresh JWT token.
526
+ * @request POST:/account/refresh-token
564
527
  * @secure
565
528
  * @response `200` OK
566
529
  */
567
- postGetAll(query, data) {
568
- return this.http.post(`/resources`, data, query).json();
530
+ refreshToken(data) {
531
+ return this.http.post(`/account/refresh-token`, data).json();
569
532
  }
570
533
  /**
571
534
  * No description
572
535
  *
573
- * @tags Catalog
574
- * @name GetResource
575
- * @operationId CatalogController_GetResource
576
- * @summary Get resource with given id.
577
- * @request GET:/resources/{resourceId}
536
+ * @tags Account
537
+ * @name RevokeToken
538
+ * @operationId AccountController_RevokeToken
539
+ * @summary Revoke refresh token.
540
+ * @request DELETE:/account/revoke-token
578
541
  * @secure
579
542
  * @response `200` OK
580
543
  */
581
- getResource(resourceId) {
582
- return this.http.get(`/resources/${resourceId}`).json();
544
+ revokeToken() {
545
+ return this.http.delete(`/account/revoke-token`, null).then(() => { });
583
546
  }
584
547
  /**
585
548
  * No description
586
549
  *
587
- * @tags Catalog
588
- * @name PatchResource
589
- * @operationId CatalogController_PatchResource
590
- * @summary Update resource.
591
- * @request PATCH:/resources/{resourceId}
550
+ * @tags Account
551
+ * @name LdapLogin
552
+ * @operationId AccountController_LdapLogin
553
+ * @summary The external login callback.
554
+ * @request POST:/account/external/login/ldap
592
555
  * @secure
593
556
  * @response `200` OK
594
557
  */
595
- patchResource(resourceId, data) {
596
- return this.http.patch(`/resources/${resourceId}`, data).json();
558
+ ldapLogin(data) {
559
+ return this.http.post(`/account/external/login/ldap`, data).json();
597
560
  }
598
561
  /**
599
562
  * No description
600
563
  *
601
- * @tags Catalog
602
- * @name DeleteResource
603
- * @operationId CatalogController_DeleteResource
604
- * @summary Delete resource.
605
- * @request DELETE:/resources/{resourceId}
564
+ * @tags Account
565
+ * @name RegisterClient
566
+ * @operationId AccountController_RegisterClient
567
+ * @summary Register new client.
568
+ * @request POST:/account/oauth2/client
606
569
  * @secure
607
570
  * @response `200` OK
608
571
  */
609
- deleteResource(resourceId) {
610
- return this.http.delete(`/resources/${resourceId}`, null).then(() => { });
572
+ registerClient(data) {
573
+ return this.http.post(`/account/oauth2/client`, data).json();
611
574
  }
612
575
  /**
613
576
  * No description
614
577
  *
615
- * @tags Catalog
616
- * @name MoveResource
617
- * @operationId CatalogController_MoveResource
618
- * @summary Rename resource with given id.
619
- * @request POST:/resources/move/{resourceId}
620
- * @secure
621
- * @response `200` OK
578
+ * @tags Account
579
+ * @name UnbindClient
580
+ * @operationId AccountController_UnbindClient
581
+ * @summary Unbind client with id.
582
+ * @request DELETE:/account/oauth2/client/{clientId}
583
+ * @secure
584
+ * @response `200` OK
622
585
  */
623
- moveResource(resourceId, data) {
624
- return this.http.post(`/resources/move/${resourceId}`, data).json();
586
+ unbindClient(clientId) {
587
+ return this.http.delete(`/account/oauth2/client/${clientId}`, null).then(() => { });
625
588
  }
626
589
  /**
627
590
  * No description
628
591
  *
629
- * @tags Catalog
630
- * @name CreateDirectory
631
- * @operationId CatalogController_CreateDirectory
632
- * @summary Create directory.
633
- * @request POST:/resources/directory
592
+ * @tags Account
593
+ * @name Token
594
+ * @operationId AccountController_Token
595
+ * @summary Get access token request.
596
+ * @request POST:/account/oauth2/token
634
597
  * @secure
635
598
  * @response `200` OK
636
599
  */
637
- createDirectory(data) {
638
- return this.http.post(`/resources/directory`, data).json();
600
+ token(data) {
601
+ return this.http.post(`/account/oauth2/token`, data).json();
639
602
  }
640
603
  /**
641
604
  * No description
642
605
  *
643
- * @tags Catalog
644
- * @name CreateFile
645
- * @operationId CatalogController_CreateFile
646
- * @summary Create new file.
647
- * @request PATCH:/resources/file
606
+ * @tags Account
607
+ * @name GetRoles
608
+ * @operationId AccountController_GetRoles
609
+ * @summary Enumerate exist roles.
610
+ * @request GET:/account/role/list
648
611
  * @secure
649
612
  * @response `200` OK
650
613
  */
651
- createFile(data) {
652
- return this.http.patch(`/resources/file`, toFormData(data)).json();
614
+ getRoles(query) {
615
+ return this.http.get(`/account/role/list`, query).json();
653
616
  }
654
617
  /**
655
618
  * No description
656
619
  *
657
- * @tags Catalog
658
- * @name CreateFile1
659
- * @operationId CatalogController_CreateFile_1
660
- * @summary Create new file.
661
- * @request POST:/resources/file
620
+ * @tags Account
621
+ * @name CreateRole
622
+ * @operationId AccountController_CreateRole
623
+ * @summary Create new role.
624
+ * @request POST:/account/role
662
625
  * @secure
663
626
  * @response `200` OK
664
627
  */
665
- createFile1(data) {
666
- return this.http.post(`/resources/file`, toFormData(data)).json();
628
+ createRole(data) {
629
+ return this.http.post(`/account/role`, data).then(() => { });
667
630
  }
668
631
  /**
669
632
  * No description
670
633
  *
671
- * @tags Catalog
672
- * @name GetPermissions
673
- * @operationId CatalogController_GetPermissions
674
- * @summary Set permissions to the resource.
675
- * @request GET:/resources/{resourceId}/permissions
634
+ * @tags Account
635
+ * @name UpdateRole
636
+ * @operationId AccountController_UpdateRole
637
+ * @summary Update exist role.
638
+ * @request PATCH:/account/role
676
639
  * @secure
677
640
  * @response `200` OK
678
641
  */
679
- getPermissions(resourceId) {
680
- return this.http.get(`/resources/${resourceId}/permissions`).json();
642
+ updateRole(data) {
643
+ return this.http.patch(`/account/role`, data).then(() => { });
681
644
  }
682
645
  /**
683
646
  * No description
684
647
  *
685
- * @tags Catalog
686
- * @name SetPermissions1
687
- * @operationId CatalogController_SetPermissions_1
688
- * @summary Set permissions to the resource.
689
- * @request PUT:/resources/{resourceId}/permissions
648
+ * @tags Account
649
+ * @name RemoveRole
650
+ * @operationId AccountController_RemoveRole
651
+ * @summary Remove role.
652
+ * @request DELETE:/account/role/{rolename}
690
653
  * @secure
691
654
  * @response `200` OK
692
655
  */
693
- setPermissions1(resourceId, data) {
694
- return this.http.put(`/resources/${resourceId}/permissions`, data).then(() => { });
656
+ removeRole(rolename) {
657
+ return this.http.delete(`/account/role/${rolename}`, null).then(() => { });
695
658
  }
696
659
  /**
697
660
  * No description
698
661
  *
699
- * @tags Catalog
700
- * @name SetPermissions
701
- * @operationId CatalogController_SetPermissions
702
- * @summary Set permissions to the resource.
703
- * @request PUT:/resources/permissions
662
+ * @tags Account
663
+ * @name AddToRole
664
+ * @operationId AccountController_AddToRole
665
+ * @summary Add user to role.
666
+ * @request POST:/account/user/{username}/role/{role}
704
667
  * @secure
705
668
  * @response `200` OK
706
669
  */
707
- setPermissions(data) {
708
- return this.http.put(`/resources/permissions`, data).then(() => { });
670
+ addToRole(username, role) {
671
+ return this.http.post(`/account/user/${username}/role/${role}`, null).then(() => { });
709
672
  }
710
673
  /**
711
674
  * No description
712
675
  *
713
- * @tags Catalog
714
- * @name GetFile
715
- * @operationId CatalogController_GetFile
716
- * @summary Download file.
717
- * @request GET:/resources/file/{resourceId}
676
+ * @tags Account
677
+ * @name RemoveFromRole
678
+ * @operationId AccountController_RemoveFromRole
679
+ * @summary Remove user from role.
680
+ * @request DELETE:/account/user/{username}/role/{role}
718
681
  * @secure
719
682
  * @response `200` OK
720
683
  */
721
- getFile(resourceId) {
722
- return this.http.get(`/resources/file/${resourceId}`).blob();
684
+ removeFromRole(username, role) {
685
+ return this.http.delete(`/account/user/${username}/role/${role}`, null).then(() => { });
723
686
  }
724
687
  /**
725
688
  * No description
726
689
  *
727
- * @tags Catalog
728
- * @name CleanResources
729
- * @operationId CatalogController_CleanResources
730
- * @summary Clean user resources.
731
- * @request POST:/resources/clean
690
+ * @tags Account
691
+ * @name PostUsedProjects
692
+ * @operationId AccountController_PostUsedProjects
693
+ * @summary Set used project.
694
+ * @request POST:/account/latest_projects
732
695
  * @secure
733
696
  * @response `200` OK
734
697
  */
735
- cleanResources() {
736
- return this.http.post(`/resources/clean`, null).then(() => { });
698
+ postUsedProjects(data) {
699
+ return this.http.post(`/account/latest_projects`, data).json();
737
700
  }
738
701
  /**
739
702
  * No description
740
703
  *
741
- * @tags Catalog
742
- * @name CopyResources
743
- * @operationId CatalogController_CopyResources
744
- * @summary Copy a set of resources.
745
- * @request POST:/resources/copy
704
+ * @tags Account
705
+ * @name GetUsedProjects
706
+ * @operationId AccountController_GetUsedProjects
707
+ * @summary Get used projects.
708
+ * @request GET:/account/latest_projects
746
709
  * @secure
747
710
  * @response `200` OK
748
711
  */
749
- copyResources(data) {
750
- return this.http.post(`/resources/copy`, data).json();
712
+ getUsedProjects() {
713
+ return this.http.get(`/account/latest_projects`).json();
714
+ }
715
+ /**
716
+ * No description
717
+ *
718
+ * @tags Account
719
+ * @name TruncateUsedProjects
720
+ * @operationId AccountController_TruncateUsedProjects
721
+ * @summary Truncate used projects.
722
+ * @request DELETE:/account/latest_projects
723
+ * @secure
724
+ * @response `200` OK
725
+ */
726
+ truncateUsedProjects() {
727
+ return this.http.delete(`/account/latest_projects`, null).then(() => { });
751
728
  }
752
729
  }
753
730
 
754
- var ApiEvent;
755
- (function (ApiEvent) {
756
- ApiEvent["ConnectionLost"] = "ConnectionLost";
757
- ApiEvent["Unauthorized"] = "Unauthorized";
758
- ApiEvent["SessionClosed"] = "SessionClosed";
759
- })(ApiEvent || (ApiEvent = {}));
760
-
761
- class EventEmitter {
762
- handlers = {
763
- "*": [],
764
- };
765
- on(type, handler) {
766
- if (!this.handlers[type]) {
767
- this.handlers[type] = [];
731
+ class Account extends AccountService {
732
+ userInfo;
733
+ get username() {
734
+ return this.userInfo?.username || "";
735
+ }
736
+ get isAuth() {
737
+ return !!this.userInfo?.username && this.userInfo.username !== "public";
738
+ }
739
+ get user() {
740
+ if (this.userInfo) {
741
+ return this.userInfo;
768
742
  }
769
- this.handlers[type].push(handler);
743
+ const userInfo = getUserInfo();
744
+ if (userInfo) {
745
+ this.userInfo = userInfo;
746
+ }
747
+ return userInfo;
770
748
  }
771
- off(type, handler) {
772
- if (!this.handlers[type])
773
- return;
774
- const index = this.handlers[type].indexOf(handler);
775
- if (index === -1)
776
- return;
777
- this.handlers[type].splice(index, 1);
749
+ async login(params, authParams = {}, useJwt = false) {
750
+ if (params) {
751
+ const response = await super.authenticate(authParams, params);
752
+ if (response && useJwt) {
753
+ window.localStorage.setItem(STORAGE_TOKEN_KEY, response.token);
754
+ window.localStorage.setItem(STORAGE_REFRESH_TOKEN_KEY, response.refreshToken);
755
+ }
756
+ }
778
757
  }
779
- emit(type, event) {
780
- this.handlers[type] && this.handlers[type].map(handler => handler(event));
781
- this.handlers["*"].map(handler => handler(type, event));
758
+ async fetchCurrentUser() {
759
+ this.userInfo = await this.getUserInfo();
760
+ return this.userInfo;
782
761
  }
783
- once(type, handler) {
784
- const onceHandler = event => {
785
- this.off(type, onceHandler);
786
- handler(event);
787
- };
788
- this.on(type, onceHandler);
762
+ async logout() {
763
+ const token = window.localStorage.getItem(STORAGE_TOKEN_KEY);
764
+ if (token) {
765
+ window.localStorage.removeItem(STORAGE_TOKEN_KEY);
766
+ window.localStorage.removeItem(STORAGE_REFRESH_TOKEN_KEY);
767
+ }
768
+ await this.revokeToken();
769
+ updateUserInfo(undefined);
770
+ this.userInfo = {};
771
+ }
772
+ async updateCurrentUser(userInfo) {
773
+ await super.updateUser({
774
+ username: this.username,
775
+ ...userInfo,
776
+ });
777
+ updateUserInfo(userInfo);
778
+ }
779
+ setPassword(password) {
780
+ return this.setUserPassword({ username: this.username, password });
789
781
  }
790
782
  }
791
783
 
@@ -805,765 +797,876 @@ class EventEmitter {
805
797
  * @version 1.5.1.0
806
798
  * @baseUrl /sp
807
799
  */
808
- class AccountService extends Service {
800
+ class AccountPreviewService extends Service {
809
801
  /**
810
802
  * No description
811
803
  *
812
- * @tags Account
813
- * @name GetUsers
814
- * @operationId AccountController_GetUsers
815
- * @summary Returns the list of users that correspond to the given conditions.
816
- * @request GET:/account/user/list
804
+ * @tags AccountPreview
805
+ * @name GetPreview
806
+ * @operationId AccountPreviewController_GetPreview
807
+ * @summary Get current user preview image.
808
+ * @request GET:/account/user/preview
817
809
  * @secure
818
810
  * @response `200` OK
819
811
  */
820
- getUsers(query) {
821
- return this.http.get(`/account/user/list`, query).json();
812
+ getPreview() {
813
+ return this.http.createUrl(`/account/user/preview`);
822
814
  }
823
815
  /**
824
816
  * No description
825
817
  *
826
- * @tags Account
827
- * @name GetExtendedUsers
828
- * @operationId AccountController_GetExtendedUsers
829
- * @summary Returns the list of extended users informations that correspond to the given conditions.
830
- * @request GET:/account/user/extendedlist
818
+ * @tags AccountPreview
819
+ * @name UploadPreview
820
+ * @operationId AccountPreviewController_UploadPreview
821
+ * @summary Set current user preview image.
822
+ * @request POST:/account/user/preview
831
823
  * @secure
832
824
  * @response `200` OK
833
825
  */
834
- getExtendedUsers(query) {
835
- return this.http.get(`/account/user/extendedlist`, query).json();
826
+ uploadPreview(data) {
827
+ return this.http.post(`/account/user/preview`, toFormData(data)).json();
836
828
  }
837
829
  /**
838
830
  * No description
839
831
  *
840
- * @tags Account
841
- * @name GetUserInfo
842
- * @operationId AccountController_GetUserInfo
843
- * @summary Get current user basic information.
844
- * @request GET:/account
832
+ * @tags AccountPreview
833
+ * @name DeletePreview
834
+ * @operationId AccountPreviewController_DeletePreview
835
+ * @summary Delete current user preview.
836
+ * @request DELETE:/account/user/preview
845
837
  * @secure
846
838
  * @response `200` OK
847
839
  */
848
- getUserInfo() {
849
- return this.http.get(`/account`).json();
840
+ deletePreview() {
841
+ return this.http.delete(`/account/user/preview`, null).then(() => { });
850
842
  }
851
843
  /**
852
844
  * No description
853
845
  *
854
- * @tags Account
855
- * @name GetUserInfo1
856
- * @operationId AccountController_GetUserInfo_1
857
- * @summary Get user basic information.
858
- * @request GET:/account/{username}
846
+ * @tags AccountPreview
847
+ * @name GetPreview1
848
+ * @operationId AccountPreviewController_GetPreview_1
849
+ * @summary Get user preview image.
850
+ * @request GET:/account/user/preview/{username}
859
851
  * @secure
860
852
  * @response `200` OK
861
853
  */
862
- getUserInfo1(username) {
863
- return this.http.get(`/account/${username}`).json();
854
+ getPreview1(username) {
855
+ return this.http.createUrl(`/account/user/preview/${username}`);
864
856
  }
865
857
  /**
866
858
  * No description
867
859
  *
868
- * @tags Account
869
- * @name GetExtendedUserInfo
870
- * @operationId AccountController_GetExtendedUserInfo
871
- * @summary Get current user extended information.
872
- * @request GET:/account/extended
860
+ * @tags AccountPreview
861
+ * @name UploadPreview1
862
+ * @operationId AccountPreviewController_UploadPreview_1
863
+ * @summary Set user preview image.
864
+ * @request POST:/account/user/preview/{username}
873
865
  * @secure
874
866
  * @response `200` OK
875
867
  */
876
- getExtendedUserInfo() {
877
- return this.http.get(`/account/extended`).json();
868
+ uploadPreview1(username, data) {
869
+ return this.http.post(`/account/user/preview/${username}`, toFormData(data)).json();
878
870
  }
879
871
  /**
880
872
  * No description
881
873
  *
882
- * @tags Account
883
- * @name GetExtendedUserInfo1
884
- * @operationId AccountController_GetExtendedUserInfo_1
885
- * @summary Get user extended information.
886
- * @request GET:/account/extended/{username}
874
+ * @tags AccountPreview
875
+ * @name DeletePreview1
876
+ * @operationId AccountPreviewController_DeletePreview_1
877
+ * @summary Delete user preview.
878
+ * @request DELETE:/account/user/preview/{username}
887
879
  * @secure
888
880
  * @response `200` OK
889
881
  */
890
- getExtendedUserInfo1(username) {
891
- return this.http.get(`/account/extended/${username}`).json();
882
+ deletePreview1(username) {
883
+ return this.http.delete(`/account/user/preview/${username}`, null).then(() => { });
892
884
  }
885
+ }
886
+
887
+ class AccountPreview extends AccountPreviewService {
888
+ }
889
+
890
+ /* eslint-disable */
891
+ /* tslint:disable */
892
+ /*
893
+ * ---------------------------------------------------------------
894
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
895
+ * ## ##
896
+ * ## AUTHOR: acacode ##
897
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
898
+ * ---------------------------------------------------------------
899
+ */
900
+ // @ts-nocheck
901
+ /**
902
+ * @title Spatial Processing Core API
903
+ * @version 1.5.1.0
904
+ * @baseUrl /sp
905
+ */
906
+ class BulkOperationsService extends Service {
893
907
  /**
894
908
  * No description
895
909
  *
896
- * @tags Account
897
- * @name IsUsernameExists
898
- * @operationId AccountController_IsUsernameExists
899
- * @summary Checks if the user with the given name is registered in the system.
900
- * @request GET:/account/user/exists
910
+ * @tags BulkOperations
911
+ * @name BatchResourcesPermissionsSet
912
+ * @operationId BulkOperationsController_BatchResourcesPermissionsSet
913
+ * @summary Perform resources set acl access batch operation.
914
+ * @request PUT:/bulk/resources/permissions
901
915
  * @secure
902
916
  * @response `200` OK
903
917
  */
904
- isUsernameExists(query) {
905
- return this.http.get(`/account/user/exists`, query).json();
918
+ batchResourcesPermissionsSet(data) {
919
+ return this.http.put(`/bulk/resources/permissions`, data).json();
906
920
  }
921
+ }
922
+
923
+ class BulkOperations extends BulkOperationsService {
924
+ }
925
+
926
+ /* eslint-disable */
927
+ /* tslint:disable */
928
+ /*
929
+ * ---------------------------------------------------------------
930
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
931
+ * ## ##
932
+ * ## AUTHOR: acacode ##
933
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
934
+ * ---------------------------------------------------------------
935
+ */
936
+ // @ts-nocheck
937
+ /**
938
+ * @title Spatial Processing Core API
939
+ * @version 1.5.1.0
940
+ * @baseUrl /sp
941
+ */
942
+ class CamerasService extends Service {
907
943
  /**
908
944
  * No description
909
945
  *
910
- * @tags Account
911
- * @name IsEmailExists
912
- * @operationId AccountController_IsEmailExists
913
- * @summary Checks if the user with the given email is registered in the system.
914
- * @request GET:/account/user/email/exists
946
+ * @tags Cameras
947
+ * @name GetCameras
948
+ * @operationId CamerasController_GetCameras
949
+ * @summary Get cameras list.
950
+ * @request GET:/cameras
915
951
  * @secure
916
952
  * @response `200` OK
917
953
  */
918
- isEmailExists(query) {
919
- return this.http.get(`/account/user/email/exists`, query).json();
954
+ getCameras(query) {
955
+ return this.http.get(`/cameras`, query).json();
920
956
  }
921
957
  /**
922
958
  * No description
923
959
  *
924
- * @tags Account
925
- * @name RegisterUser
926
- * @operationId AccountController_RegisterUser
927
- * @summary Register new user.
928
- * @request POST:/account/register
960
+ * @tags Cameras
961
+ * @name GetArchiveFeed
962
+ * @operationId CamerasController_GetArchiveFeed
963
+ * @summary Streams an FLV-over-HTTP archive feed starting at specific time.
964
+ * @request GET:/cameras/{cameraId}/archiveFeed
929
965
  * @secure
930
966
  * @response `200` OK
931
967
  */
932
- registerUser(data) {
933
- return this.http.post(`/account/register`, data).text();
968
+ getArchiveFeed({ cameraId, ...query }) {
969
+ return this.http.get(`/cameras/${cameraId}/archiveFeed`, query).blob();
934
970
  }
935
971
  /**
936
- * @description Only for users with SPCore.Security.Abstractions.ISecurityManager.SuperuserRole role.
972
+ * No description
937
973
  *
938
- * @tags Account
939
- * @name CreateUser
940
- * @operationId AccountController_CreateUser
941
- * @summary Create new user.
942
- * @request POST:/account/user
974
+ * @tags Cameras
975
+ * @name GetArchiveTimeline
976
+ * @operationId CamerasController_GetArchiveTimeline
977
+ * @summary Returns a list of records available within a given timeframe.
978
+ * @request GET:/cameras/{cameraId}/archiveTimeline
943
979
  * @secure
944
980
  * @response `200` OK
945
981
  */
946
- createUser(query, data) {
947
- return this.http.post(`/account/user`, data, query).then(() => { });
982
+ getArchiveTimeline({ cameraId, ...query }) {
983
+ return this.http.get(`/cameras/${cameraId}/archiveTimeline`, query).json();
948
984
  }
949
985
  /**
950
986
  * No description
951
987
  *
952
- * @tags Account
953
- * @name UpdateUser
954
- * @operationId AccountController_UpdateUser
955
- * @summary Update exist user.
956
- * @request PATCH:/account/user
988
+ * @tags Cameras
989
+ * @name GetArchiveCalendar
990
+ * @operationId CamerasController_GetArchiveCalendar
991
+ * @summary Returns a list of records available within a given timeframe.
992
+ * @request GET:/cameras/{cameraId}/archiveCalendar
957
993
  * @secure
958
994
  * @response `200` OK
959
995
  */
960
- updateUser(data) {
961
- return this.http.patch(`/account/user`, data).then(() => { });
996
+ getArchiveCalendar({ cameraId, ...query }) {
997
+ return this.http.get(`/cameras/${cameraId}/archiveCalendar`, query).json();
962
998
  }
963
999
  /**
964
- * @description Only for users with SPCore.Security.Abstractions.ISecurityManager.SuperuserRole role.
1000
+ * No description
965
1001
  *
966
- * @tags Account
967
- * @name ConfirmEmail
968
- * @operationId AccountController_ConfirmEmail
969
- * @summary Confirm user email.
970
- * @request POST:/account/user/{username}/email/confirm
1002
+ * @tags Cameras
1003
+ * @name GetArchiveSnapshot
1004
+ * @operationId CamerasController_GetArchiveSnapshot
1005
+ * @summary Returns a JPEG image from the Camera’s archive.
1006
+ * @request GET:/cameras/{cameraId}/archiveSnapshot
971
1007
  * @secure
972
1008
  * @response `200` OK
973
1009
  */
974
- confirmEmail(username) {
975
- return this.http.post(`/account/user/${username}/email/confirm`, null).then(() => { });
1010
+ getArchiveSnapshot({ cameraId, ...query }) {
1011
+ return this.http.get(`/cameras/${cameraId}/archiveSnapshot`, query).blob();
976
1012
  }
977
1013
  /**
978
1014
  * No description
979
1015
  *
980
- * @tags Account
981
- * @name VerifyEmail
982
- * @operationId AccountController_VerifyEmail
983
- * @summary Send email with verification code.
984
- * @request POST:/account/user/{username}/email/verify
1016
+ * @tags Cameras
1017
+ * @name GetLiveFeed
1018
+ * @operationId CamerasController_GetLiveFeed
1019
+ * @summary Streams live video feed from the Camera.
1020
+ * @request GET:/cameras/{cameraId}/liveFeed
985
1021
  * @secure
986
1022
  * @response `200` OK
987
1023
  */
988
- verifyEmail(username) {
989
- return this.http.post(`/account/user/${username}/email/verify`, null).then(() => { });
1024
+ getLiveFeed({ cameraId, ...query }) {
1025
+ return this.http.get(`/cameras/${cameraId}/liveFeed`, query).blob();
990
1026
  }
991
1027
  /**
992
1028
  * No description
993
1029
  *
994
- * @tags Account
995
- * @name SetEmail
996
- * @operationId AccountController_SetEmail
997
- * @summary For a user that does not have a set email, sets the email and password. Requires email confirmation through link.
998
- * @request POST:/account/setEmail
1030
+ * @tags Cameras
1031
+ * @name GetLiveSnapshot
1032
+ * @operationId CamerasController_GetLiveSnapshot
1033
+ * @summary Returns a JPEG image from the Camera’s live feed.
1034
+ * @request GET:/cameras/{cameraId}/liveSnapshot
999
1035
  * @secure
1000
1036
  * @response `200` OK
1001
1037
  */
1002
- setEmail(data) {
1003
- return this.http.post(`/account/setEmail`, toFormData(data)).then(() => { });
1038
+ getLiveSnapshot(cameraId) {
1039
+ return this.http.get(`/cameras/${cameraId}/liveSnapshot`).blob();
1004
1040
  }
1005
1041
  /**
1006
1042
  * No description
1007
1043
  *
1008
- * @tags Account
1009
- * @name ConfirmEmail1
1010
- * @operationId AccountController_ConfirmEmail_1
1011
- * @summary Confirm user email by code.
1012
- * @request POST:/account/user/email/confirm
1044
+ * @tags Cameras
1045
+ * @name GetLivePreviewStream
1046
+ * @operationId CamerasController_GetLivePreviewStream
1047
+ * @summary Get live preview stream.
1048
+ * @request GET:/cameras/{cameraId}/getLivePreviewsStream
1013
1049
  * @secure
1014
1050
  * @response `200` OK
1015
1051
  */
1016
- confirmEmail1(query) {
1017
- return this.http.post(`/account/user/email/confirm`, null, query).then(() => { });
1052
+ getLivePreviewStream({ cameraId, ...query }) {
1053
+ return this.http.get(`/cameras/${cameraId}/getLivePreviewsStream`, query).json();
1018
1054
  }
1055
+ }
1056
+
1057
+ class Cameras extends CamerasService {
1058
+ }
1059
+
1060
+ /* eslint-disable */
1061
+ /* tslint:disable */
1062
+ /*
1063
+ * ---------------------------------------------------------------
1064
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
1065
+ * ## ##
1066
+ * ## AUTHOR: acacode ##
1067
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
1068
+ * ---------------------------------------------------------------
1069
+ */
1070
+ // @ts-nocheck
1071
+ /**
1072
+ * @title Spatial Processing Core API
1073
+ * @version 1.5.1.0
1074
+ * @baseUrl /sp
1075
+ */
1076
+ class ClientSettingsService extends Service {
1019
1077
  /**
1020
1078
  * No description
1021
1079
  *
1022
- * @tags Account
1023
- * @name ChangeEmail
1024
- * @operationId AccountController_ChangeEmail
1025
- * @summary Send email message with confirmation code to new email address.
1026
- * @request POST:/account/user/email/change
1080
+ * @tags ClientSettings
1081
+ * @name GetConfigurationsList
1082
+ * @operationId ClientSettingsController_GetConfigurationsList
1083
+ * @summary Get client configurations.
1084
+ * @request GET:/settings/config
1027
1085
  * @secure
1028
1086
  * @response `200` OK
1029
1087
  */
1030
- changeEmail(query) {
1031
- return this.http.post(`/account/user/email/change`, null, query).then(() => { });
1088
+ getConfigurationsList(query) {
1089
+ return this.http.get(`/settings/config`, query).json();
1032
1090
  }
1033
1091
  /**
1034
1092
  * No description
1035
1093
  *
1036
- * @tags Account
1037
- * @name ConfirmChangeEmail
1038
- * @operationId AccountController_ConfirmChangeEmail
1039
- * @summary Check confirmation code and change email address.
1040
- * @request POST:/account/user/email/change/confirm
1094
+ * @tags ClientSettings
1095
+ * @name GetConfiguration
1096
+ * @operationId ClientSettingsController_GetConfiguration
1097
+ * @summary Get config for urlPath.
1098
+ * @request GET:/settings
1041
1099
  * @secure
1042
1100
  * @response `200` OK
1043
1101
  */
1044
- confirmChangeEmail(query) {
1045
- return this.http.post(`/account/user/email/change/confirm`, null, query).then(() => { });
1102
+ getConfiguration(query) {
1103
+ return this.http.get(`/settings`, query).text();
1046
1104
  }
1047
1105
  /**
1048
1106
  * No description
1049
1107
  *
1050
- * @tags Account
1051
- * @name SetUserPassword
1052
- * @operationId AccountController_SetUserPassword
1053
- * @summary Set user password.
1054
- * @request PATCH:/account/password/set
1108
+ * @tags ClientSettings
1109
+ * @name SetConfiguration
1110
+ * @operationId ClientSettingsController_SetConfiguration
1111
+ * @summary Set config for urlPath.
1112
+ * @request POST:/settings
1055
1113
  * @secure
1056
1114
  * @response `200` OK
1057
1115
  */
1058
- setUserPassword(data) {
1059
- return this.http.patch(`/account/password/set`, data).then(() => { });
1116
+ setConfiguration(query, data) {
1117
+ return this.http.post(`/settings`, data, query).then(() => { });
1060
1118
  }
1061
1119
  /**
1062
1120
  * No description
1063
1121
  *
1064
- * @tags Account
1065
- * @name ChangePassword
1066
- * @operationId AccountController_ChangePassword
1067
- * @summary Change current user password.
1068
- * @request PATCH:/account/password/change
1122
+ * @tags ClientSettings
1123
+ * @name RemoveConfiguration
1124
+ * @operationId ClientSettingsController_RemoveConfiguration
1125
+ * @summary Remove config for urlPath.
1126
+ * @request DELETE:/settings
1069
1127
  * @secure
1070
1128
  * @response `200` OK
1071
1129
  */
1072
- changePassword(data) {
1073
- return this.http.patch(`/account/password/change`, toFormData(data)).then(() => { });
1130
+ removeConfiguration(query) {
1131
+ return this.http.delete(`/settings`, null, query).then(() => { });
1132
+ }
1133
+ }
1134
+
1135
+ class ClientSettings extends ClientSettingsService {
1136
+ settings = {
1137
+ modules: [],
1138
+ connection: {
1139
+ url: "",
1140
+ },
1141
+ };
1142
+ async fetchClientSettings(query) {
1143
+ const config = JSON.parse(await this.getConfiguration(query));
1144
+ this.updateClientSettings(config);
1145
+ return config;
1146
+ }
1147
+ updateClientSettings(update) {
1148
+ Object.assign(this.settings, update);
1074
1149
  }
1150
+ }
1151
+
1152
+ /* eslint-disable */
1153
+ /* tslint:disable */
1154
+ /*
1155
+ * ---------------------------------------------------------------
1156
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
1157
+ * ## ##
1158
+ * ## AUTHOR: acacode ##
1159
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
1160
+ * ---------------------------------------------------------------
1161
+ */
1162
+ // @ts-nocheck
1163
+ /**
1164
+ * @title Spatial Processing Core API
1165
+ * @version 1.5.1.0
1166
+ * @baseUrl /sp
1167
+ */
1168
+ class EqlService extends Service {
1075
1169
  /**
1076
1170
  * No description
1077
1171
  *
1078
- * @tags Account
1079
- * @name ResetPassword
1080
- * @operationId AccountController_ResetPassword
1081
- * @summary Send reset password message.
1082
- * @request POST:/account/password/reset
1172
+ * @tags Eql
1173
+ * @name GetPagedQueryResult
1174
+ * @operationId EqlController_GetPagedQueryResult
1175
+ * @summary Perform resources set acl access batch operation.
1176
+ * @request POST:/eql/query
1083
1177
  * @secure
1084
1178
  * @response `200` OK
1085
1179
  */
1086
- resetPassword(query) {
1087
- return this.http.post(`/account/password/reset`, null, query).then(() => { });
1180
+ getPagedQueryResult(query, data) {
1181
+ return this.http.post(`/eql/query`, data, query).json();
1088
1182
  }
1089
1183
  /**
1090
1184
  * No description
1091
1185
  *
1092
- * @tags Account
1093
- * @name ResetPasswordCallback
1094
- * @operationId AccountController_ResetPasswordCallback
1095
- * @summary Reset password.
1096
- * @request POST:/account/password/reset/confirm
1186
+ * @tags Eql
1187
+ * @name GetQueryDescription
1188
+ * @operationId EqlController_GetQueryDescription
1189
+ * @summary Get EQL result columns definitions.
1190
+ * @request POST:/eql/description
1097
1191
  * @secure
1098
1192
  * @response `200` OK
1099
1193
  */
1100
- resetPasswordCallback(data) {
1101
- return this.http.post(`/account/password/reset/confirm`, toFormData(data)).then(() => { });
1194
+ getQueryDescription(data) {
1195
+ return this.http.post(`/eql/description`, data).json();
1102
1196
  }
1103
1197
  /**
1104
1198
  * No description
1105
1199
  *
1106
- * @tags Account
1107
- * @name RemoveUser
1108
- * @operationId AccountController_RemoveUser
1109
- * @summary Remove user.
1110
- * @request DELETE:/account/user/{username}
1200
+ * @tags Eql
1201
+ * @name GetVectorTile
1202
+ * @operationId EqlController_GetVectorTile
1203
+ * @summary Get vector tile by query.
1204
+ * @request GET:/eql/vt/{z}/{x}/{y}.pbf
1111
1205
  * @secure
1112
1206
  * @response `200` OK
1113
1207
  */
1114
- removeUser(username) {
1115
- return this.http.delete(`/account/user/${username}`, null).then(() => { });
1208
+ getVectorTile({ z, x, y, ...query }) {
1209
+ return this.http.get(`/eql/vt/{z}/{x}/{y}.pbf`, query).then(() => { });
1116
1210
  }
1117
1211
  /**
1118
1212
  * No description
1119
1213
  *
1120
- * @tags Account
1121
- * @name CreateNamespace
1122
- * @operationId AccountController_CreateNamespace
1123
- * @summary Creates a new namespace.
1124
- * @request POST:/account/namespace
1214
+ * @tags Eql
1215
+ * @name GetQueryHistory
1216
+ * @operationId EqlController_GetQueryHistory
1217
+ * @summary Get EQL requests history.
1218
+ * @request GET:/eql/query/history
1125
1219
  * @secure
1126
1220
  * @response `200` OK
1127
1221
  */
1128
- createNamespace(query) {
1129
- return this.http.post(`/account/namespace`, null, query).json();
1222
+ getQueryHistory(query) {
1223
+ return this.http.get(`/eql/query/history`, query).json();
1130
1224
  }
1131
1225
  /**
1132
1226
  * No description
1133
1227
  *
1134
- * @tags Account
1135
- * @name RemoveNamespace
1136
- * @operationId AccountController_RemoveNamespaceAsync
1137
- * @summary Remove namespace.
1138
- * @request DELETE:/account/namespace/{name}
1228
+ * @tags Eql
1229
+ * @name SetLayerParameterValue
1230
+ * @operationId EqlController_SetLayerParameterValue
1231
+ * @summary Set EQL layer parameter.
1232
+ * @request POST:/eql/setParam
1139
1233
  * @secure
1140
1234
  * @response `200` OK
1141
1235
  */
1142
- removeNamespace(name) {
1143
- return this.http.delete(`/account/namespace/${name}`, null).then(() => { });
1236
+ setLayerParameterValue(query) {
1237
+ return this.http.post(`/eql/setParam`, null, query).then(() => { });
1144
1238
  }
1145
1239
  /**
1146
1240
  * No description
1147
1241
  *
1148
- * @tags Account
1149
- * @name ActivateUser
1150
- * @operationId AccountController_ActivateUser
1151
- * @summary Activate user.
1152
- * @request POST:/account/user/{username}/activate
1242
+ * @tags Eql
1243
+ * @name SetLayerParameters
1244
+ * @operationId EqlController_SetLayerParameters
1245
+ * @summary Set EQL layer parameters.
1246
+ * @request POST:/eql/setParams
1153
1247
  * @secure
1154
1248
  * @response `200` OK
1155
1249
  */
1156
- activateUser(username) {
1157
- return this.http.post(`/account/user/${username}/activate`, null).then(() => { });
1250
+ setLayerParameters(query, data) {
1251
+ return this.http.post(`/eql/setParams`, data, query).then(() => { });
1158
1252
  }
1159
1253
  /**
1160
1254
  * No description
1161
1255
  *
1162
- * @tags Account
1163
- * @name DeactivateUser
1164
- * @operationId AccountController_DeactivateUser
1165
- * @summary Deactivate user.
1166
- * @request POST:/account/user/{username}/deactivate
1256
+ * @tags Eql
1257
+ * @name GetLayerParameters
1258
+ * @operationId EqlController_GetLayerParameters
1259
+ * @summary Get EQL parameter.
1260
+ * @request GET:/eql/getParam
1167
1261
  * @secure
1168
1262
  * @response `200` OK
1169
1263
  */
1170
- deactivateUser(username) {
1171
- return this.http.post(`/account/user/${username}/deactivate`, null).then(() => { });
1264
+ getLayerParameters(query) {
1265
+ return this.http.get(`/eql/getParam`, query).text();
1172
1266
  }
1173
1267
  /**
1174
1268
  * No description
1175
1269
  *
1176
- * @tags Account
1177
- * @name Authenticate
1178
- * @operationId AccountController_Authenticate
1179
- * @summary Login.
1180
- * @request POST:/account/login
1270
+ * @tags Eql
1271
+ * @name GetLayerParameters1
1272
+ * @operationId EqlController_GetLayerParameters_1
1273
+ * @summary Get all EQL parameters.
1274
+ * @request GET:/eql/getParams
1181
1275
  * @secure
1182
1276
  * @response `200` OK
1183
1277
  */
1184
- authenticate(query, data) {
1185
- return this.http.post(`/account/login`, data, query).json();
1278
+ getLayerParameters1(query) {
1279
+ return this.http.get(`/eql/getParams`, query).json();
1186
1280
  }
1187
1281
  /**
1188
1282
  * No description
1189
1283
  *
1190
- * @tags Account
1191
- * @name RefreshToken
1192
- * @operationId AccountController_RefreshToken
1193
- * @summary Refresh JWT token.
1194
- * @request POST:/account/refresh-token
1284
+ * @tags Eql
1285
+ * @name RemoveLayerParameterValue
1286
+ * @operationId EqlController_RemoveLayerParameterValue
1287
+ * @summary Remove EQL layer parameter.
1288
+ * @request DELETE:/eql/removeParam
1195
1289
  * @secure
1196
1290
  * @response `200` OK
1197
1291
  */
1198
- refreshToken(data) {
1199
- return this.http.post(`/account/refresh-token`, data).json();
1292
+ removeLayerParameterValue(query) {
1293
+ return this.http.delete(`/eql/removeParam`, null, query).then(() => { });
1200
1294
  }
1201
1295
  /**
1202
1296
  * No description
1203
1297
  *
1204
- * @tags Account
1205
- * @name RevokeToken
1206
- * @operationId AccountController_RevokeToken
1207
- * @summary Revoke refresh token.
1208
- * @request DELETE:/account/revoke-token
1298
+ * @tags Eql
1299
+ * @name GetAvailiableLayerParameters
1300
+ * @operationId EqlController_GetAvailiableLayerParameters
1301
+ * @summary Get availiable layer parameters values.
1302
+ * @request GET:/eql/getAvailiableParams
1209
1303
  * @secure
1210
1304
  * @response `200` OK
1211
1305
  */
1212
- revokeToken() {
1213
- return this.http.delete(`/account/revoke-token`, null).then(() => { });
1306
+ getAvailiableLayerParameters(query) {
1307
+ return this.http.get(`/eql/getAvailiableParams`, query).json();
1214
1308
  }
1215
1309
  /**
1216
1310
  * No description
1217
1311
  *
1218
- * @tags Account
1219
- * @name LdapLogin
1220
- * @operationId AccountController_LdapLogin
1221
- * @summary The external login callback.
1222
- * @request POST:/account/external/login/ldap
1312
+ * @tags Eql
1313
+ * @name Get
1314
+ * @operationId EqlController_Get
1315
+ * @summary Returns the query by its id.
1316
+ * @request GET:/eql/query/{id}
1223
1317
  * @secure
1224
1318
  * @response `200` OK
1225
1319
  */
1226
- ldapLogin(data) {
1227
- return this.http.post(`/account/external/login/ldap`, data).json();
1320
+ get(id) {
1321
+ return this.http.get(`/eql/query/${id}`).json();
1228
1322
  }
1229
1323
  /**
1230
1324
  * No description
1231
1325
  *
1232
- * @tags Account
1233
- * @name RegisterClient
1234
- * @operationId AccountController_RegisterClient
1235
- * @summary Register new client.
1236
- * @request POST:/account/oauth2/client
1326
+ * @tags Eql
1327
+ * @name Update
1328
+ * @operationId EqlController_Update
1329
+ * @summary Replaces a query and gives it a new id.
1330
+ * @request POST:/eql/query/{id}
1237
1331
  * @secure
1238
1332
  * @response `200` OK
1239
1333
  */
1240
- registerClient(data) {
1241
- return this.http.post(`/account/oauth2/client`, data).json();
1334
+ update(id, data) {
1335
+ return this.http.post(`/eql/query/${id}`, data).then(() => { });
1242
1336
  }
1243
1337
  /**
1244
1338
  * No description
1245
1339
  *
1246
- * @tags Account
1247
- * @name UnbindClient
1248
- * @operationId AccountController_UnbindClient
1249
- * @summary Unbind client with id.
1250
- * @request DELETE:/account/oauth2/client/{clientId}
1340
+ * @tags Eql
1341
+ * @name Create
1342
+ * @operationId EqlController_Create
1343
+ * @summary Creates a new query.
1344
+ * @request POST:/eql/query/save
1251
1345
  * @secure
1252
1346
  * @response `200` OK
1253
1347
  */
1254
- unbindClient(clientId) {
1255
- return this.http.delete(`/account/oauth2/client/${clientId}`, null).then(() => { });
1348
+ create(data) {
1349
+ return this.http.post(`/eql/query/save`, data).text();
1256
1350
  }
1351
+ }
1352
+
1353
+ class Eql extends EqlService {
1354
+ }
1355
+
1356
+ /* eslint-disable */
1357
+ /* tslint:disable */
1358
+ /*
1359
+ * ---------------------------------------------------------------
1360
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
1361
+ * ## ##
1362
+ * ## AUTHOR: acacode ##
1363
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
1364
+ * ---------------------------------------------------------------
1365
+ */
1366
+ // @ts-nocheck
1367
+ /**
1368
+ * @title Spatial Processing Core API
1369
+ * @version 1.5.1.0
1370
+ * @baseUrl /sp
1371
+ */
1372
+ class FeedbackService extends Service {
1257
1373
  /**
1258
1374
  * No description
1259
1375
  *
1260
- * @tags Account
1261
- * @name Token
1262
- * @operationId AccountController_Token
1263
- * @summary Get access token request.
1264
- * @request POST:/account/oauth2/token
1376
+ * @tags Feedback
1377
+ * @name IncreaseResourcesLimit
1378
+ * @operationId FeedbackController_IncreaseResourcesLimit
1379
+ * @summary Increase resources limit request.
1380
+ * @request POST:/feedback/limits
1265
1381
  * @secure
1266
1382
  * @response `200` OK
1267
1383
  */
1268
- token(data) {
1269
- return this.http.post(`/account/oauth2/token`, data).json();
1384
+ increaseResourcesLimit(query) {
1385
+ return this.http.post(`/feedback/limits`, null, query).json();
1270
1386
  }
1271
1387
  /**
1272
1388
  * No description
1273
1389
  *
1274
- * @tags Account
1275
- * @name GetRoles
1276
- * @operationId AccountController_GetRoles
1277
- * @summary Enumerate exist roles.
1278
- * @request GET:/account/role/list
1390
+ * @tags Feedback
1391
+ * @name Feedback
1392
+ * @operationId FeedbackController_Feedback
1393
+ * @summary Feedback request.
1394
+ * @request POST:/feedback
1279
1395
  * @secure
1280
1396
  * @response `200` OK
1281
1397
  */
1282
- getRoles(query) {
1283
- return this.http.get(`/account/role/list`, query).json();
1398
+ feedback(query, data) {
1399
+ return this.http.post(`/feedback`, toFormData(data), query).json();
1284
1400
  }
1401
+ }
1402
+
1403
+ class Feedback extends FeedbackService {
1404
+ }
1405
+
1406
+ /* eslint-disable */
1407
+ /* tslint:disable */
1408
+ /*
1409
+ * ---------------------------------------------------------------
1410
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
1411
+ * ## ##
1412
+ * ## AUTHOR: acacode ##
1413
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
1414
+ * ---------------------------------------------------------------
1415
+ */
1416
+ // @ts-nocheck
1417
+ /**
1418
+ * @title Spatial Processing Core API
1419
+ * @version 1.5.1.0
1420
+ * @baseUrl /sp
1421
+ */
1422
+ class CatalogService extends Service {
1285
1423
  /**
1286
1424
  * No description
1287
1425
  *
1288
- * @tags Account
1289
- * @name CreateRole
1290
- * @operationId AccountController_CreateRole
1291
- * @summary Create new role.
1292
- * @request POST:/account/role
1426
+ * @tags Catalog
1427
+ * @name GetParents
1428
+ * @operationId CatalogController_GetParents
1429
+ * @summary Get parents.
1430
+ * @request GET:/resources/{resourceId}/parents
1293
1431
  * @secure
1294
1432
  * @response `200` OK
1295
1433
  */
1296
- createRole(data) {
1297
- return this.http.post(`/account/role`, data).then(() => { });
1434
+ getParents(resourceId) {
1435
+ return this.http.get(`/resources/${resourceId}/parents`).json();
1298
1436
  }
1299
1437
  /**
1300
1438
  * No description
1301
1439
  *
1302
- * @tags Account
1303
- * @name UpdateRole
1304
- * @operationId AccountController_UpdateRole
1305
- * @summary Update exist role.
1306
- * @request PATCH:/account/role
1440
+ * @tags Catalog
1441
+ * @name GetTags
1442
+ * @operationId CatalogController_GetTags
1443
+ * @summary Get all tags of given user.
1444
+ * @request GET:/resources/tags
1307
1445
  * @secure
1308
1446
  * @response `200` OK
1309
1447
  */
1310
- updateRole(data) {
1311
- return this.http.patch(`/account/role`, data).then(() => { });
1448
+ getTags(query) {
1449
+ return this.http.get(`/resources/tags`, query).json();
1312
1450
  }
1313
1451
  /**
1314
1452
  * No description
1315
1453
  *
1316
- * @tags Account
1317
- * @name RemoveRole
1318
- * @operationId AccountController_RemoveRole
1319
- * @summary Remove role.
1320
- * @request DELETE:/account/role/{rolename}
1454
+ * @tags Catalog
1455
+ * @name PutTags
1456
+ * @operationId CatalogController_PutTags
1457
+ * @summary Put tags to resource.
1458
+ * @request PUT:/resources/{resourceId}/tags
1321
1459
  * @secure
1322
1460
  * @response `200` OK
1323
1461
  */
1324
- removeRole(rolename) {
1325
- return this.http.delete(`/account/role/${rolename}`, null).then(() => { });
1462
+ putTags(resourceId, data) {
1463
+ return this.http.put(`/resources/${resourceId}/tags`, data).json();
1326
1464
  }
1327
1465
  /**
1328
1466
  * No description
1329
1467
  *
1330
- * @tags Account
1331
- * @name AddToRole
1332
- * @operationId AccountController_AddToRole
1333
- * @summary Add user to role.
1334
- * @request POST:/account/user/{username}/role/{role}
1468
+ * @tags Catalog
1469
+ * @name PostGetAll
1470
+ * @operationId CatalogController_PostGetAll
1471
+ * @summary Get all resource with given.
1472
+ * @request POST:/resources
1335
1473
  * @secure
1336
1474
  * @response `200` OK
1337
1475
  */
1338
- addToRole(username, role) {
1339
- return this.http.post(`/account/user/${username}/role/${role}`, null).then(() => { });
1476
+ postGetAll(query, data) {
1477
+ return this.http.post(`/resources`, data, query).json();
1340
1478
  }
1341
1479
  /**
1342
1480
  * No description
1343
1481
  *
1344
- * @tags Account
1345
- * @name RemoveFromRole
1346
- * @operationId AccountController_RemoveFromRole
1347
- * @summary Remove user from role.
1348
- * @request DELETE:/account/user/{username}/role/{role}
1482
+ * @tags Catalog
1483
+ * @name GetResource
1484
+ * @operationId CatalogController_GetResource
1485
+ * @summary Get resource with given id.
1486
+ * @request GET:/resources/{resourceId}
1349
1487
  * @secure
1350
1488
  * @response `200` OK
1351
1489
  */
1352
- removeFromRole(username, role) {
1353
- return this.http.delete(`/account/user/${username}/role/${role}`, null).then(() => { });
1490
+ getResource(resourceId) {
1491
+ return this.http.get(`/resources/${resourceId}`).json();
1354
1492
  }
1355
1493
  /**
1356
1494
  * No description
1357
1495
  *
1358
- * @tags Account
1359
- * @name PostUsedProjects
1360
- * @operationId AccountController_PostUsedProjects
1361
- * @summary Set used project.
1362
- * @request POST:/account/latest_projects
1496
+ * @tags Catalog
1497
+ * @name PatchResource
1498
+ * @operationId CatalogController_PatchResource
1499
+ * @summary Update resource.
1500
+ * @request PATCH:/resources/{resourceId}
1363
1501
  * @secure
1364
1502
  * @response `200` OK
1365
1503
  */
1366
- postUsedProjects(data) {
1367
- return this.http.post(`/account/latest_projects`, data).json();
1504
+ patchResource(resourceId, data) {
1505
+ return this.http.patch(`/resources/${resourceId}`, data).json();
1368
1506
  }
1369
1507
  /**
1370
1508
  * No description
1371
1509
  *
1372
- * @tags Account
1373
- * @name GetUsedProjects
1374
- * @operationId AccountController_GetUsedProjects
1375
- * @summary Get used projects.
1376
- * @request GET:/account/latest_projects
1510
+ * @tags Catalog
1511
+ * @name DeleteResource
1512
+ * @operationId CatalogController_DeleteResource
1513
+ * @summary Delete resource.
1514
+ * @request DELETE:/resources/{resourceId}
1377
1515
  * @secure
1378
1516
  * @response `200` OK
1379
1517
  */
1380
- getUsedProjects() {
1381
- return this.http.get(`/account/latest_projects`).json();
1518
+ deleteResource(resourceId) {
1519
+ return this.http.delete(`/resources/${resourceId}`, null).then(() => { });
1382
1520
  }
1383
1521
  /**
1384
1522
  * No description
1385
1523
  *
1386
- * @tags Account
1387
- * @name TruncateUsedProjects
1388
- * @operationId AccountController_TruncateUsedProjects
1389
- * @summary Truncate used projects.
1390
- * @request DELETE:/account/latest_projects
1524
+ * @tags Catalog
1525
+ * @name MoveResource
1526
+ * @operationId CatalogController_MoveResource
1527
+ * @summary Rename resource with given id.
1528
+ * @request POST:/resources/move/{resourceId}
1391
1529
  * @secure
1392
1530
  * @response `200` OK
1393
1531
  */
1394
- truncateUsedProjects() {
1395
- return this.http.delete(`/account/latest_projects`, null).then(() => { });
1396
- }
1397
- }
1398
-
1399
- const getUserInfo = () => JSON.parse(localStorage.getItem(API_USER_INFO_KEY) || "null") || void 0;
1400
- const updateUserInfo = (newUserInfo) => {
1401
- if (newUserInfo) {
1402
- const oldUserInfo = getUserInfo();
1403
- localStorage.setItem(API_USER_INFO_KEY, JSON.stringify({ ...oldUserInfo, ...newUserInfo }));
1404
- }
1405
- else {
1406
- localStorage.removeItem(API_USER_INFO_KEY);
1407
- }
1408
- };
1409
-
1410
- class Account extends AccountService {
1411
- userInfo;
1412
- async login(params, authParams = {}, useJwt = false) {
1413
- if (params) {
1414
- const response = await super.authenticate(authParams, params);
1415
- if (response && useJwt) {
1416
- window.localStorage.setItem(STORAGE_TOKEN_KEY, response.token);
1417
- window.localStorage.setItem(STORAGE_REFRESH_TOKEN_KEY, response.refreshToken);
1418
- }
1419
- }
1532
+ moveResource(resourceId, data) {
1533
+ return this.http.post(`/resources/move/${resourceId}`, data).json();
1420
1534
  }
1421
- async fetchCurrentUser() {
1422
- this.userInfo = await this.getUserInfo();
1423
- return this.userInfo;
1535
+ /**
1536
+ * No description
1537
+ *
1538
+ * @tags Catalog
1539
+ * @name CreateDirectory
1540
+ * @operationId CatalogController_CreateDirectory
1541
+ * @summary Create directory.
1542
+ * @request POST:/resources/directory
1543
+ * @secure
1544
+ * @response `200` OK
1545
+ */
1546
+ createDirectory(data) {
1547
+ return this.http.post(`/resources/directory`, data).json();
1424
1548
  }
1425
- get username() {
1426
- return this.userInfo?.username || "";
1549
+ /**
1550
+ * No description
1551
+ *
1552
+ * @tags Catalog
1553
+ * @name CreateFile
1554
+ * @operationId CatalogController_CreateFile
1555
+ * @summary Create new file.
1556
+ * @request PATCH:/resources/file
1557
+ * @secure
1558
+ * @response `200` OK
1559
+ */
1560
+ createFile(data) {
1561
+ return this.http.patch(`/resources/file`, toFormData(data)).json();
1427
1562
  }
1428
- async logout() {
1429
- const token = window.localStorage.getItem(STORAGE_TOKEN_KEY);
1430
- if (token) {
1431
- window.localStorage.removeItem(STORAGE_TOKEN_KEY);
1432
- window.localStorage.removeItem(STORAGE_REFRESH_TOKEN_KEY);
1433
- }
1434
- await this.revokeToken();
1435
- updateUserInfo(undefined);
1436
- this.userInfo = {};
1437
- }
1438
- async updateCurrentUser(userInfo) {
1439
- await super.updateUser({
1440
- username: this.username,
1441
- ...userInfo,
1442
- });
1443
- updateUserInfo(userInfo);
1444
- }
1445
- setPassword(password) {
1446
- return this.setUserPassword({ username: this.username, password });
1447
- }
1448
- get isAuth() {
1449
- return !!this.userInfo?.username && this.userInfo.username !== "public";
1450
- }
1451
- get user() {
1452
- if (this.userInfo) {
1453
- return this.userInfo;
1454
- }
1455
- const userInfo = getUserInfo();
1456
- if (userInfo) {
1457
- this.userInfo = userInfo;
1458
- }
1459
- return userInfo;
1563
+ /**
1564
+ * No description
1565
+ *
1566
+ * @tags Catalog
1567
+ * @name CreateFile1
1568
+ * @operationId CatalogController_CreateFile_1
1569
+ * @summary Create new file.
1570
+ * @request POST:/resources/file
1571
+ * @secure
1572
+ * @response `200` OK
1573
+ */
1574
+ createFile1(data) {
1575
+ return this.http.post(`/resources/file`, toFormData(data)).json();
1460
1576
  }
1461
- }
1462
-
1463
- /* eslint-disable */
1464
- /* tslint:disable */
1465
- /*
1466
- * ---------------------------------------------------------------
1467
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
1468
- * ## ##
1469
- * ## AUTHOR: acacode ##
1470
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
1471
- * ---------------------------------------------------------------
1472
- */
1473
- // @ts-nocheck
1474
- /**
1475
- * @title Spatial Processing Core API
1476
- * @version 1.5.1.0
1477
- * @baseUrl /sp
1478
- */
1479
- class AccountPreviewService extends Service {
1480
1577
  /**
1481
1578
  * No description
1482
1579
  *
1483
- * @tags AccountPreview
1484
- * @name GetPreview
1485
- * @operationId AccountPreviewController_GetPreview
1486
- * @summary Get current user preview image.
1487
- * @request GET:/account/user/preview
1580
+ * @tags Catalog
1581
+ * @name GetPermissions
1582
+ * @operationId CatalogController_GetPermissions
1583
+ * @summary Set permissions to the resource.
1584
+ * @request GET:/resources/{resourceId}/permissions
1488
1585
  * @secure
1489
1586
  * @response `200` OK
1490
1587
  */
1491
- getPreview() {
1492
- return this.http.createUrl(`/account/user/preview`);
1588
+ getPermissions(resourceId) {
1589
+ return this.http.get(`/resources/${resourceId}/permissions`).json();
1493
1590
  }
1494
1591
  /**
1495
1592
  * No description
1496
1593
  *
1497
- * @tags AccountPreview
1498
- * @name UploadPreview
1499
- * @operationId AccountPreviewController_UploadPreview
1500
- * @summary Set current user preview image.
1501
- * @request POST:/account/user/preview
1594
+ * @tags Catalog
1595
+ * @name SetPermissions1
1596
+ * @operationId CatalogController_SetPermissions_1
1597
+ * @summary Set permissions to the resource.
1598
+ * @request PUT:/resources/{resourceId}/permissions
1502
1599
  * @secure
1503
1600
  * @response `200` OK
1504
1601
  */
1505
- uploadPreview(data) {
1506
- return this.http.post(`/account/user/preview`, toFormData(data)).json();
1602
+ setPermissions1(resourceId, data) {
1603
+ return this.http.put(`/resources/${resourceId}/permissions`, data).then(() => { });
1507
1604
  }
1508
1605
  /**
1509
1606
  * No description
1510
1607
  *
1511
- * @tags AccountPreview
1512
- * @name DeletePreview
1513
- * @operationId AccountPreviewController_DeletePreview
1514
- * @summary Delete current user preview.
1515
- * @request DELETE:/account/user/preview
1608
+ * @tags Catalog
1609
+ * @name SetPermissions
1610
+ * @operationId CatalogController_SetPermissions
1611
+ * @summary Set permissions to the resource.
1612
+ * @request PUT:/resources/permissions
1516
1613
  * @secure
1517
1614
  * @response `200` OK
1518
1615
  */
1519
- deletePreview() {
1520
- return this.http.delete(`/account/user/preview`, null).then(() => { });
1616
+ setPermissions(data) {
1617
+ return this.http.put(`/resources/permissions`, data).then(() => { });
1521
1618
  }
1522
1619
  /**
1523
1620
  * No description
1524
1621
  *
1525
- * @tags AccountPreview
1526
- * @name GetPreview1
1527
- * @operationId AccountPreviewController_GetPreview_1
1528
- * @summary Get user preview image.
1529
- * @request GET:/account/user/preview/{username}
1622
+ * @tags Catalog
1623
+ * @name GetFile
1624
+ * @operationId CatalogController_GetFile
1625
+ * @summary Download file.
1626
+ * @request GET:/resources/file/{resourceId}
1530
1627
  * @secure
1531
1628
  * @response `200` OK
1532
1629
  */
1533
- getPreview1(username) {
1534
- return this.http.createUrl(`/account/user/preview/${username}`);
1630
+ getFile(resourceId) {
1631
+ return this.http.get(`/resources/file/${resourceId}`).blob();
1535
1632
  }
1536
1633
  /**
1537
1634
  * No description
1538
1635
  *
1539
- * @tags AccountPreview
1540
- * @name UploadPreview1
1541
- * @operationId AccountPreviewController_UploadPreview_1
1542
- * @summary Set user preview image.
1543
- * @request POST:/account/user/preview/{username}
1636
+ * @tags Catalog
1637
+ * @name CleanResources
1638
+ * @operationId CatalogController_CleanResources
1639
+ * @summary Clean user resources.
1640
+ * @request POST:/resources/clean
1544
1641
  * @secure
1545
1642
  * @response `200` OK
1546
1643
  */
1547
- uploadPreview1(username, data) {
1548
- return this.http.post(`/account/user/preview/${username}`, toFormData(data)).json();
1644
+ cleanResources() {
1645
+ return this.http.post(`/resources/clean`, null).then(() => { });
1549
1646
  }
1550
1647
  /**
1551
1648
  * No description
1552
1649
  *
1553
- * @tags AccountPreview
1554
- * @name DeletePreview1
1555
- * @operationId AccountPreviewController_DeletePreview_1
1556
- * @summary Delete user preview.
1557
- * @request DELETE:/account/user/preview/{username}
1650
+ * @tags Catalog
1651
+ * @name CopyResources
1652
+ * @operationId CatalogController_CopyResources
1653
+ * @summary Copy a set of resources.
1654
+ * @request POST:/resources/copy
1558
1655
  * @secure
1559
1656
  * @response `200` OK
1560
1657
  */
1561
- deletePreview1(username) {
1562
- return this.http.delete(`/account/user/preview/${username}`, null).then(() => { });
1658
+ copyResources(data) {
1659
+ return this.http.post(`/resources/copy`, data).json();
1563
1660
  }
1564
1661
  }
1565
1662
 
1566
- class AccountPreview extends AccountPreviewService {
1663
+ class FileUpload extends CatalogService {
1664
+ upload(file, rewrite) {
1665
+ return this.createFile1({ file, rewrite: !!rewrite });
1666
+ }
1667
+ replaceFile(params) {
1668
+ return this.createFile(params);
1669
+ }
1567
1670
  }
1568
1671
 
1569
1672
  /* eslint-disable */
@@ -1582,24 +1685,52 @@ class AccountPreview extends AccountPreviewService {
1582
1685
  * @version 1.5.1.0
1583
1686
  * @baseUrl /sp
1584
1687
  */
1585
- class BulkOperationsService extends Service {
1688
+ class FiltersService extends Service {
1586
1689
  /**
1587
1690
  * No description
1588
1691
  *
1589
- * @tags BulkOperations
1590
- * @name BatchResourcesPermissionsSet
1591
- * @operationId BulkOperationsController_BatchResourcesPermissionsSet
1592
- * @summary Perform resources set acl access batch operation.
1593
- * @request PUT:/bulk/resources/permissions
1692
+ * @tags FiltersService
1693
+ * @name Get
1694
+ * @operationId FiltersServiceController_Get
1695
+ * @summary Returns the filter by its id.
1696
+ * @request GET:/filters/{id}
1594
1697
  * @secure
1595
1698
  * @response `200` OK
1596
1699
  */
1597
- batchResourcesPermissionsSet(data) {
1598
- return this.http.put(`/bulk/resources/permissions`, data).json();
1700
+ get(id) {
1701
+ return this.http.get(`/filters/${id}`).json();
1702
+ }
1703
+ /**
1704
+ * No description
1705
+ *
1706
+ * @tags FiltersService
1707
+ * @name Update
1708
+ * @operationId FiltersServiceController_Update
1709
+ * @summary Replaces a filter and gives it a new id.
1710
+ * @request POST:/filters/{id}
1711
+ * @secure
1712
+ * @response `200` OK
1713
+ */
1714
+ update(id, data) {
1715
+ return this.http.post(`/filters/${id}`, data).json();
1716
+ }
1717
+ /**
1718
+ * No description
1719
+ *
1720
+ * @tags FiltersService
1721
+ * @name Create
1722
+ * @operationId FiltersServiceController_Create
1723
+ * @summary Creates a new filter.
1724
+ * @request POST:/filters
1725
+ * @secure
1726
+ * @response `200` OK
1727
+ */
1728
+ create(data) {
1729
+ return this.http.post(`/filters`, data).json();
1599
1730
  }
1600
1731
  }
1601
1732
 
1602
- class BulkOperations extends BulkOperationsService {
1733
+ class Filters extends FiltersService {
1603
1734
  }
1604
1735
 
1605
1736
  /* eslint-disable */
@@ -1618,122 +1749,65 @@ class BulkOperations extends BulkOperationsService {
1618
1749
  * @version 1.5.1.0
1619
1750
  * @baseUrl /sp
1620
1751
  */
1621
- class CamerasService extends Service {
1752
+ class GeocodeService extends Service {
1622
1753
  /**
1623
1754
  * No description
1624
1755
  *
1625
- * @tags Cameras
1626
- * @name GetCameras
1627
- * @operationId CamerasController_GetCameras
1628
- * @summary Get cameras list.
1629
- * @request GET:/cameras
1756
+ * @tags GeocodeService
1757
+ * @name Geocode
1758
+ * @operationId GeocodeServiceController_Geocode
1759
+ * @summary Returns geocode geometry.
1760
+ * @request GET:/geocode/{providerName}
1630
1761
  * @secure
1631
1762
  * @response `200` OK
1632
1763
  */
1633
- getCameras(query) {
1634
- return this.http.get(`/cameras`, query).json();
1764
+ geocode({ providerName, ...query }) {
1765
+ return this.http.get(`/geocode/${providerName}`, query).json();
1635
1766
  }
1636
1767
  /**
1637
1768
  * No description
1638
1769
  *
1639
- * @tags Cameras
1640
- * @name GetArchiveFeed
1641
- * @operationId CamerasController_GetArchiveFeed
1642
- * @summary Streams an FLV-over-HTTP archive feed starting at specific time.
1643
- * @request GET:/cameras/{cameraId}/archiveFeed
1770
+ * @tags GeocodeService
1771
+ * @name GeocodeByPoint
1772
+ * @operationId GeocodeServiceController_GeocodeByPoint
1773
+ * @summary Returns geocode address from point geometry.
1774
+ * @request GET:/geocode/{providerName}/geocodeByPoint
1644
1775
  * @secure
1645
1776
  * @response `200` OK
1646
1777
  */
1647
- getArchiveFeed({ cameraId, ...query }) {
1648
- return this.http.get(`/cameras/${cameraId}/archiveFeed`, query).blob();
1778
+ geocodeByPoint({ providerName, ...query }) {
1779
+ return this.http.get(`/geocode/${providerName}/geocodeByPoint`, query).json();
1649
1780
  }
1650
1781
  /**
1651
1782
  * No description
1652
1783
  *
1653
- * @tags Cameras
1654
- * @name GetArchiveTimeline
1655
- * @operationId CamerasController_GetArchiveTimeline
1656
- * @summary Returns a list of records available within a given timeframe.
1657
- * @request GET:/cameras/{cameraId}/archiveTimeline
1784
+ * @tags GeocodeService
1785
+ * @name Suggest
1786
+ * @operationId GeocodeServiceController_Suggest
1787
+ * @summary Returns geocode suggest.
1788
+ * @request GET:/geocode/{providerName}/suggest
1658
1789
  * @secure
1659
1790
  * @response `200` OK
1660
1791
  */
1661
- getArchiveTimeline({ cameraId, ...query }) {
1662
- return this.http.get(`/cameras/${cameraId}/archiveTimeline`, query).json();
1663
- }
1664
- /**
1665
- * No description
1666
- *
1667
- * @tags Cameras
1668
- * @name GetArchiveCalendar
1669
- * @operationId CamerasController_GetArchiveCalendar
1670
- * @summary Returns a list of records available within a given timeframe.
1671
- * @request GET:/cameras/{cameraId}/archiveCalendar
1672
- * @secure
1673
- * @response `200` OK
1674
- */
1675
- getArchiveCalendar({ cameraId, ...query }) {
1676
- return this.http.get(`/cameras/${cameraId}/archiveCalendar`, query).json();
1677
- }
1678
- /**
1679
- * No description
1680
- *
1681
- * @tags Cameras
1682
- * @name GetArchiveSnapshot
1683
- * @operationId CamerasController_GetArchiveSnapshot
1684
- * @summary Returns a JPEG image from the Camera’s archive.
1685
- * @request GET:/cameras/{cameraId}/archiveSnapshot
1686
- * @secure
1687
- * @response `200` OK
1688
- */
1689
- getArchiveSnapshot({ cameraId, ...query }) {
1690
- return this.http.get(`/cameras/${cameraId}/archiveSnapshot`, query).blob();
1691
- }
1692
- /**
1693
- * No description
1694
- *
1695
- * @tags Cameras
1696
- * @name GetLiveFeed
1697
- * @operationId CamerasController_GetLiveFeed
1698
- * @summary Streams live video feed from the Camera.
1699
- * @request GET:/cameras/{cameraId}/liveFeed
1700
- * @secure
1701
- * @response `200` OK
1702
- */
1703
- getLiveFeed({ cameraId, ...query }) {
1704
- return this.http.get(`/cameras/${cameraId}/liveFeed`, query).blob();
1705
- }
1706
- /**
1707
- * No description
1708
- *
1709
- * @tags Cameras
1710
- * @name GetLiveSnapshot
1711
- * @operationId CamerasController_GetLiveSnapshot
1712
- * @summary Returns a JPEG image from the Camera’s live feed.
1713
- * @request GET:/cameras/{cameraId}/liveSnapshot
1714
- * @secure
1715
- * @response `200` OK
1716
- */
1717
- getLiveSnapshot(cameraId) {
1718
- return this.http.get(`/cameras/${cameraId}/liveSnapshot`).blob();
1719
- }
1720
- /**
1721
- * No description
1722
- *
1723
- * @tags Cameras
1724
- * @name GetLivePreviewStream
1725
- * @operationId CamerasController_GetLivePreviewStream
1726
- * @summary Get live preview stream.
1727
- * @request GET:/cameras/{cameraId}/getLivePreviewsStream
1728
- * @secure
1729
- * @response `200` OK
1730
- */
1731
- getLivePreviewStream({ cameraId, ...query }) {
1732
- return this.http.get(`/cameras/${cameraId}/getLivePreviewsStream`, query).json();
1792
+ suggest({ providerName, ...query }) {
1793
+ return this.http.get(`/geocode/${providerName}/suggest`, query).json();
1733
1794
  }
1734
1795
  }
1735
1796
 
1736
- class Cameras extends CamerasService {
1797
+ const GEOCODE_PROVIDER = "geocode2gis";
1798
+ class Geocode extends GeocodeService {
1799
+ geocode2Gis(params) {
1800
+ return this.geocode({
1801
+ providerName: GEOCODE_PROVIDER,
1802
+ ...params,
1803
+ });
1804
+ }
1805
+ suggest2Gis(params) {
1806
+ return this.suggest({
1807
+ providerName: GEOCODE_PROVIDER,
1808
+ ...params,
1809
+ });
1810
+ }
1737
1811
  }
1738
1812
 
1739
1813
  /* eslint-disable */
@@ -1752,483 +1826,444 @@ class Cameras extends CamerasService {
1752
1826
  * @version 1.5.1.0
1753
1827
  * @baseUrl /sp
1754
1828
  */
1755
- class ClientSettingsService extends Service {
1829
+ class ImportService extends Service {
1756
1830
  /**
1757
1831
  * No description
1758
1832
  *
1759
- * @tags ClientSettings
1760
- * @name GetConfigurationsList
1761
- * @operationId ClientSettingsController_GetConfigurationsList
1762
- * @summary Get client configurations.
1763
- * @request GET:/settings/config
1833
+ * @tags ImportService
1834
+ * @name GetDataSchema
1835
+ * @operationId ImportServiceController_GetDataSchema
1836
+ * @summary Using a file uploaded to the file upload service, reads the headers of the file and returns the information about data schema of all layers in that file, available for import.
1837
+ * @request GET:/import/dataSchema
1764
1838
  * @secure
1765
1839
  * @response `200` OK
1766
1840
  */
1767
- getConfigurationsList(query) {
1768
- return this.http.get(`/settings/config`, query).json();
1841
+ getDataSchema(query) {
1842
+ return this.http.get(`/import/dataSchema`, query).json();
1769
1843
  }
1770
1844
  /**
1771
1845
  * No description
1772
1846
  *
1773
- * @tags ClientSettings
1774
- * @name GetConfiguration
1775
- * @operationId ClientSettingsController_GetConfiguration
1776
- * @summary Get config for urlPath.
1777
- * @request GET:/settings
1847
+ * @tags ImportService
1848
+ * @name GetFeaturesCount
1849
+ * @operationId ImportServiceController_GetFeaturesCount
1850
+ * @summary Returns the features count of the given file in temporary static storage.
1851
+ * @request POST:/import/count
1778
1852
  * @secure
1779
1853
  * @response `200` OK
1780
1854
  */
1781
- getConfiguration(query) {
1782
- return this.http.get(`/settings`, query).text();
1855
+ getFeaturesCount(data) {
1856
+ return this.http.post(`/import/count`, data).json();
1783
1857
  }
1784
1858
  /**
1785
1859
  * No description
1786
1860
  *
1787
- * @tags ClientSettings
1788
- * @name SetConfiguration
1789
- * @operationId ClientSettingsController_SetConfiguration
1790
- * @summary Set config for urlPath.
1791
- * @request POST:/settings
1861
+ * @tags ImportService
1862
+ * @name ReadPart
1863
+ * @operationId ImportServiceController_ReadPart
1864
+ * @summary Returns the features of the given file in temporary static storage.
1865
+ * @request GET:/import/read
1792
1866
  * @secure
1793
1867
  * @response `200` OK
1794
1868
  */
1795
- setConfiguration(query, data) {
1796
- return this.http.post(`/settings`, data, query).then(() => { });
1869
+ readPart(query) {
1870
+ return this.http.get(`/import/read`, query).json();
1797
1871
  }
1798
1872
  /**
1799
1873
  * No description
1800
1874
  *
1801
- * @tags ClientSettings
1802
- * @name RemoveConfiguration
1803
- * @operationId ClientSettingsController_RemoveConfiguration
1804
- * @summary Remove config for urlPath.
1805
- * @request DELETE:/settings
1875
+ * @tags ImportService
1876
+ * @name GetExternalWmsLayers
1877
+ * @operationId ImportServiceController_GetExternalWmsLayers
1878
+ * @summary Get list of external WMS layers.
1879
+ * @request GET:/import/wms
1806
1880
  * @secure
1807
1881
  * @response `200` OK
1808
1882
  */
1809
- removeConfiguration(query) {
1810
- return this.http.delete(`/settings`, null, query).then(() => { });
1811
- }
1812
- }
1813
-
1814
- class ClientSettings extends ClientSettingsService {
1815
- settings = {
1816
- modules: [],
1817
- connection: {
1818
- url: "",
1819
- },
1820
- };
1821
- async fetchClientSettings(query) {
1822
- const config = JSON.parse(await this.getConfiguration(query));
1823
- this.updateClientSettings(config);
1824
- return config;
1825
- }
1826
- updateClientSettings(update) {
1827
- Object.assign(this.settings, update);
1883
+ getExternalWmsLayers(query) {
1884
+ return this.http.get(`/import/wms`, query).json();
1828
1885
  }
1829
- }
1830
-
1831
- /* eslint-disable */
1832
- /* tslint:disable */
1833
- /*
1834
- * ---------------------------------------------------------------
1835
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
1836
- * ## ##
1837
- * ## AUTHOR: acacode ##
1838
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
1839
- * ---------------------------------------------------------------
1840
- */
1841
- // @ts-nocheck
1842
- /**
1843
- * @title Spatial Processing Core API
1844
- * @version 1.5.1.0
1845
- * @baseUrl /sp
1846
- */
1847
- class EqlService extends Service {
1848
1886
  /**
1849
1887
  * No description
1850
1888
  *
1851
- * @tags Eql
1852
- * @name GetPagedQueryResult
1853
- * @operationId EqlController_GetPagedQueryResult
1854
- * @summary Perform resources set acl access batch operation.
1855
- * @request POST:/eql/query
1889
+ * @tags ImportService
1890
+ * @name GetExternalPbfLayers
1891
+ * @operationId ImportServiceController_GetExternalPbfLayers
1892
+ * @summary Get list of external PBF layers.
1893
+ * @request GET:/import/pbf
1856
1894
  * @secure
1857
1895
  * @response `200` OK
1858
1896
  */
1859
- getPagedQueryResult(query, data) {
1860
- return this.http.post(`/eql/query`, data, query).json();
1897
+ getExternalPbfLayers(query) {
1898
+ return this.http.get(`/import/pbf`, query).json();
1861
1899
  }
1862
1900
  /**
1863
1901
  * No description
1864
1902
  *
1865
- * @tags Eql
1866
- * @name GetQueryDescription
1867
- * @operationId EqlController_GetQueryDescription
1868
- * @summary Get EQL result columns definitions.
1869
- * @request POST:/eql/description
1903
+ * @tags ImportService
1904
+ * @name GetExternalPbfFeatures
1905
+ * @operationId ImportServiceController_GetExternalPbfFeatures
1906
+ * @summary Get features list in external PBF layer.
1907
+ * @request GET:/import/pbf/features
1870
1908
  * @secure
1871
1909
  * @response `200` OK
1872
1910
  */
1873
- getQueryDescription(data) {
1874
- return this.http.post(`/eql/description`, data).json();
1911
+ getExternalPbfFeatures(query) {
1912
+ return this.http.get(`/import/pbf/features`, query).json();
1875
1913
  }
1876
1914
  /**
1877
1915
  * No description
1878
1916
  *
1879
- * @tags Eql
1880
- * @name GetVectorTile
1881
- * @operationId EqlController_GetVectorTile
1882
- * @summary Get vector tile by query.
1883
- * @request GET:/eql/vt/{z}/{x}/{y}.pbf
1917
+ * @tags ImportService
1918
+ * @name GetExternalArcgisFsLayers
1919
+ * @operationId ImportServiceController_GetExternalArcgisFSLayers
1920
+ * @summary Get list of external ArcGis FeatureServer layers.
1921
+ * @request GET:/import/arcgisfeatureservice
1884
1922
  * @secure
1885
1923
  * @response `200` OK
1886
1924
  */
1887
- getVectorTile({ z, x, y, ...query }) {
1888
- return this.http.get(`/eql/vt/{z}/{x}/{y}.pbf`, query).then(() => { });
1925
+ getExternalArcgisFsLayers(query) {
1926
+ return this.http.get(`/import/arcgisfeatureservice`, query).json();
1889
1927
  }
1890
1928
  /**
1891
1929
  * No description
1892
1930
  *
1893
- * @tags Eql
1894
- * @name GetQueryHistory
1895
- * @operationId EqlController_GetQueryHistory
1896
- * @summary Get EQL requests history.
1897
- * @request GET:/eql/query/history
1931
+ * @tags ImportService
1932
+ * @name GetExternalArcGisLayers
1933
+ * @operationId ImportServiceController_GetExternalArcGisLayers
1934
+ * @summary Get list of external ArcGis MapServer layers.
1935
+ * @request GET:/import/arcgismapservice
1898
1936
  * @secure
1899
1937
  * @response `200` OK
1900
1938
  */
1901
- getQueryHistory(query) {
1902
- return this.http.get(`/eql/query/history`, query).json();
1939
+ getExternalArcGisLayers(query) {
1940
+ return this.http.get(`/import/arcgismapservice`, query).json();
1903
1941
  }
1904
1942
  /**
1905
1943
  * No description
1906
1944
  *
1907
- * @tags Eql
1908
- * @name SetLayerParameterValue
1909
- * @operationId EqlController_SetLayerParameterValue
1910
- * @summary Set EQL layer parameter.
1911
- * @request POST:/eql/setParam
1945
+ * @tags ImportService
1946
+ * @name GetRasterAttributes
1947
+ * @operationId ImportServiceController_GetRasterAttributes
1948
+ * @summary Parse raster attributes from file name.
1949
+ * @request GET:/import/rasterAttributes
1912
1950
  * @secure
1913
1951
  * @response `200` OK
1914
1952
  */
1915
- setLayerParameterValue(query) {
1916
- return this.http.post(`/eql/setParam`, null, query).then(() => { });
1953
+ getRasterAttributes(query) {
1954
+ return this.http.get(`/import/rasterAttributes`, query).json();
1917
1955
  }
1918
1956
  /**
1919
1957
  * No description
1920
1958
  *
1921
- * @tags Eql
1922
- * @name SetLayerParameters
1923
- * @operationId EqlController_SetLayerParameters
1924
- * @summary Set EQL layer parameters.
1925
- * @request POST:/eql/setParams
1959
+ * @tags ImportService
1960
+ * @name GetRasterMeta
1961
+ * @operationId ImportServiceController_GetRasterMeta
1962
+ * @summary Get raster meta data.
1963
+ * @request GET:/import/rasterMeta
1926
1964
  * @secure
1927
1965
  * @response `200` OK
1928
1966
  */
1929
- setLayerParameters(query, data) {
1930
- return this.http.post(`/eql/setParams`, data, query).then(() => { });
1967
+ getRasterMeta(query) {
1968
+ return this.http.get(`/import/rasterMeta`, query).json();
1931
1969
  }
1932
- /**
1933
- * No description
1934
- *
1935
- * @tags Eql
1936
- * @name GetLayerParameters
1937
- * @operationId EqlController_GetLayerParameters
1938
- * @summary Get EQL parameter.
1939
- * @request GET:/eql/getParam
1940
- * @secure
1941
- * @response `200` OK
1942
- */
1943
- getLayerParameters(query) {
1944
- return this.http.get(`/eql/getParam`, query).text();
1970
+ }
1971
+
1972
+ class Import extends ImportService {
1973
+ }
1974
+
1975
+ var ErrorReason;
1976
+ (function (ErrorReason) {
1977
+ /** When request has status code less than 400 */
1978
+ ErrorReason["HTTP_OTHER"] = "other";
1979
+ /** When request has status code in range 400 - 499 */
1980
+ ErrorReason["HTTP_CLIENT"] = "client";
1981
+ /** When request has status code 500 or more */
1982
+ ErrorReason["HTTP_SERVER"] = "server";
1983
+ /** When it's not a http bad response */
1984
+ ErrorReason["UNKNOWN"] = "unknown";
1985
+ })(ErrorReason || (ErrorReason = {}));
1986
+ const handleBaseError = (e) => ({
1987
+ type: "base",
1988
+ reason: ErrorReason.UNKNOWN,
1989
+ origin: e,
1990
+ });
1991
+ const handleHTTPError = (e) => {
1992
+ const status = e.response.status;
1993
+ let reason = ErrorReason.HTTP_OTHER;
1994
+ if (status >= 400 && status < 500) {
1995
+ reason = ErrorReason.HTTP_CLIENT;
1996
+ }
1997
+ if (status >= 500) {
1998
+ reason = ErrorReason.HTTP_SERVER;
1945
1999
  }
2000
+ return {
2001
+ type: "http",
2002
+ reason,
2003
+ status,
2004
+ origin: e,
2005
+ };
2006
+ };
2007
+ const errorHandler = (e) => {
2008
+ if (e instanceof HTTPError)
2009
+ return handleHTTPError(e);
2010
+ return handleBaseError(e);
2011
+ };
2012
+ const isHandledError = (e) => e && e.type && e.reason;
2013
+ const isHTTPError = (e) => isHandledError(e) && e.type === "http";
2014
+
2015
+ function formDataFromFile(file) {
2016
+ const data = new FormData();
2017
+ data.append("file", file);
2018
+ return data;
2019
+ }
2020
+
2021
+ function isString(v) {
2022
+ return typeof v === "string";
2023
+ }
2024
+
2025
+ /* eslint-disable */
2026
+ /* tslint:disable */
2027
+ /*
2028
+ * ---------------------------------------------------------------
2029
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
2030
+ * ## ##
2031
+ * ## AUTHOR: acacode ##
2032
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
2033
+ * ---------------------------------------------------------------
2034
+ */
2035
+ // @ts-nocheck
2036
+ /**
2037
+ * @title Spatial Processing Core API
2038
+ * @version 1.5.1.0
2039
+ * @baseUrl /sp
2040
+ */
2041
+ class DataSourceService extends Service {
1946
2042
  /**
1947
2043
  * No description
1948
2044
  *
1949
- * @tags Eql
1950
- * @name GetLayerParameters1
1951
- * @operationId EqlController_GetLayerParameters_1
1952
- * @summary Get all EQL parameters.
1953
- * @request GET:/eql/getParams
2045
+ * @tags DataSource
2046
+ * @name CreateArcGisDataSource
2047
+ * @operationId DataSourceController_CreateArcGisDataSource
2048
+ * @summary Create S3 data source.
2049
+ * @request POST:/ds/arcgis
1954
2050
  * @secure
1955
2051
  * @response `200` OK
1956
2052
  */
1957
- getLayerParameters1(query) {
1958
- return this.http.get(`/eql/getParams`, query).json();
2053
+ createArcGisDataSource(data) {
2054
+ return this.http.post(`/ds/arcgis`, data).then(() => { });
1959
2055
  }
1960
2056
  /**
1961
2057
  * No description
1962
2058
  *
1963
- * @tags Eql
1964
- * @name RemoveLayerParameterValue
1965
- * @operationId EqlController_RemoveLayerParameterValue
1966
- * @summary Remove EQL layer parameter.
1967
- * @request DELETE:/eql/removeParam
2059
+ * @tags DataSource
2060
+ * @name UpdateArcGisDataSource
2061
+ * @operationId DataSourceController_UpdateArcGisDataSource
2062
+ * @summary Update arcgis data source.
2063
+ * @request PATCH:/ds/arcgis
1968
2064
  * @secure
1969
2065
  * @response `200` OK
1970
2066
  */
1971
- removeLayerParameterValue(query) {
1972
- return this.http.delete(`/eql/removeParam`, null, query).then(() => { });
2067
+ updateArcGisDataSource(data) {
2068
+ return this.http.patch(`/ds/arcgis`, data).then(() => { });
1973
2069
  }
1974
2070
  /**
1975
2071
  * No description
1976
2072
  *
1977
- * @tags Eql
1978
- * @name GetAvailiableLayerParameters
1979
- * @operationId EqlController_GetAvailiableLayerParameters
1980
- * @summary Get availiable layer parameters values.
1981
- * @request GET:/eql/getAvailiableParams
2073
+ * @tags DataSource
2074
+ * @name GetDataSourcesList
2075
+ * @operationId DataSourceController_GetDataSourcesList
2076
+ * @summary Returns list of the available data sources.
2077
+ * @request GET:/ds
1982
2078
  * @secure
1983
2079
  * @response `200` OK
1984
2080
  */
1985
- getAvailiableLayerParameters(query) {
1986
- return this.http.get(`/eql/getAvailiableParams`, query).json();
2081
+ getDataSourcesList(query) {
2082
+ return this.http.get(`/ds`, query).json();
1987
2083
  }
1988
2084
  /**
1989
2085
  * No description
1990
2086
  *
1991
- * @tags Eql
1992
- * @name Get
1993
- * @operationId EqlController_Get
1994
- * @summary Returns the query by its id.
1995
- * @request GET:/eql/query/{id}
2087
+ * @tags DataSource
2088
+ * @name CreateDataSource
2089
+ * @operationId DataSourceController_CreateDataSource
2090
+ * @summary Create postgresql data source.
2091
+ * @request POST:/ds
1996
2092
  * @secure
1997
2093
  * @response `200` OK
1998
2094
  */
1999
- get(id) {
2000
- return this.http.get(`/eql/query/${id}`).json();
2095
+ createDataSource(data) {
2096
+ return this.http.post(`/ds`, data).then(() => { });
2001
2097
  }
2002
2098
  /**
2003
2099
  * No description
2004
2100
  *
2005
- * @tags Eql
2006
- * @name Update
2007
- * @operationId EqlController_Update
2008
- * @summary Replaces a query and gives it a new id.
2009
- * @request POST:/eql/query/{id}
2101
+ * @tags DataSource
2102
+ * @name UpdateDataSource
2103
+ * @operationId DataSourceController_UpdateDataSource
2104
+ * @summary Update postgresql data source.
2105
+ * @request PATCH:/ds
2010
2106
  * @secure
2011
2107
  * @response `200` OK
2012
2108
  */
2013
- update(id, data) {
2014
- return this.http.post(`/eql/query/${id}`, data).then(() => { });
2109
+ updateDataSource(data) {
2110
+ return this.http.patch(`/ds`, data).then(() => { });
2015
2111
  }
2016
2112
  /**
2017
2113
  * No description
2018
2114
  *
2019
- * @tags Eql
2020
- * @name Create
2021
- * @operationId EqlController_Create
2022
- * @summary Creates a new query.
2023
- * @request POST:/eql/query/save
2115
+ * @tags DataSource
2116
+ * @name GetDataSource
2117
+ * @operationId DataSourceController_GetDataSource
2118
+ * @summary Get data source by name.
2119
+ * @request GET:/ds/{name}
2024
2120
  * @secure
2025
2121
  * @response `200` OK
2026
2122
  */
2027
- create(data) {
2028
- return this.http.post(`/eql/query/save`, data).text();
2123
+ getDataSource(name) {
2124
+ return this.http
2125
+ .get(`/ds/${name}`)
2126
+ .json();
2029
2127
  }
2030
- }
2031
-
2032
- class Eql extends EqlService {
2033
- }
2034
-
2035
- /* eslint-disable */
2036
- /* tslint:disable */
2037
- /*
2038
- * ---------------------------------------------------------------
2039
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
2040
- * ## ##
2041
- * ## AUTHOR: acacode ##
2042
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
2043
- * ---------------------------------------------------------------
2044
- */
2045
- // @ts-nocheck
2046
- /**
2047
- * @title Spatial Processing Core API
2048
- * @version 1.5.1.0
2049
- * @baseUrl /sp
2050
- */
2051
- class FeedbackService extends Service {
2052
2128
  /**
2053
2129
  * No description
2054
2130
  *
2055
- * @tags Feedback
2056
- * @name IncreaseResourcesLimit
2057
- * @operationId FeedbackController_IncreaseResourcesLimit
2058
- * @summary Increase resources limit request.
2059
- * @request POST:/feedback/limits
2131
+ * @tags DataSource
2132
+ * @name RemoveDataSource
2133
+ * @operationId DataSourceController_RemoveDataSource
2134
+ * @summary Remove data source by name.
2135
+ * @request DELETE:/ds/{name}
2060
2136
  * @secure
2061
2137
  * @response `200` OK
2062
2138
  */
2063
- increaseResourcesLimit(query) {
2064
- return this.http.post(`/feedback/limits`, null, query).json();
2139
+ removeDataSource(name) {
2140
+ return this.http.delete(`/ds/${name}`, null).then(() => { });
2065
2141
  }
2066
2142
  /**
2067
2143
  * No description
2068
2144
  *
2069
- * @tags Feedback
2070
- * @name Feedback
2071
- * @operationId FeedbackController_Feedback
2072
- * @summary Feedback request.
2073
- * @request POST:/feedback
2145
+ * @tags DataSource
2146
+ * @name TestConnection
2147
+ * @operationId DataSourceController_TestConnection
2148
+ * @summary Test ds connection.
2149
+ * @request POST:/ds/testConnection
2074
2150
  * @secure
2075
2151
  * @response `200` OK
2076
2152
  */
2077
- feedback(query, data) {
2078
- return this.http.post(`/feedback`, toFormData(data), query).json();
2079
- }
2080
- }
2081
-
2082
- class Feedback extends FeedbackService {
2083
- }
2084
-
2085
- class FileUpload extends CatalogService {
2086
- upload(file, rewrite) {
2087
- return this.createFile1({ file, rewrite: !!rewrite });
2088
- }
2089
- replaceFile(params) {
2090
- return this.createFile(params);
2153
+ testConnection(data) {
2154
+ return this.http.post(`/ds/testConnection`, data).json();
2091
2155
  }
2092
- }
2093
-
2094
- /* eslint-disable */
2095
- /* tslint:disable */
2096
- /*
2097
- * ---------------------------------------------------------------
2098
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
2099
- * ## ##
2100
- * ## AUTHOR: acacode ##
2101
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
2102
- * ---------------------------------------------------------------
2103
- */
2104
- // @ts-nocheck
2105
- /**
2106
- * @title Spatial Processing Core API
2107
- * @version 1.5.1.0
2108
- * @baseUrl /sp
2109
- */
2110
- class FiltersService extends Service {
2111
2156
  /**
2112
2157
  * No description
2113
2158
  *
2114
- * @tags FiltersService
2115
- * @name Get
2116
- * @operationId FiltersServiceController_Get
2117
- * @summary Returns the filter by its id.
2118
- * @request GET:/filters/{id}
2159
+ * @tags DataSource
2160
+ * @name CreateMosRuDataSource
2161
+ * @operationId DataSourceController_CreateMosRuDataSource
2162
+ * @summary Create data.mos.ru data source.
2163
+ * @request POST:/ds/dataMosRu
2119
2164
  * @secure
2120
2165
  * @response `200` OK
2121
2166
  */
2122
- get(id) {
2123
- return this.http.get(`/filters/${id}`).json();
2167
+ createMosRuDataSource(data) {
2168
+ return this.http.post(`/ds/dataMosRu`, data).then(() => { });
2124
2169
  }
2125
2170
  /**
2126
2171
  * No description
2127
2172
  *
2128
- * @tags FiltersService
2129
- * @name Update
2130
- * @operationId FiltersServiceController_Update
2131
- * @summary Replaces a filter and gives it a new id.
2132
- * @request POST:/filters/{id}
2173
+ * @tags DataSource
2174
+ * @name UpdateMosRuDataSource
2175
+ * @operationId DataSourceController_UpdateMosRuDataSource
2176
+ * @summary Update data.mos.ru data source.
2177
+ * @request PATCH:/ds/dataMosRu
2133
2178
  * @secure
2134
2179
  * @response `200` OK
2135
2180
  */
2136
- update(id, data) {
2137
- return this.http.post(`/filters/${id}`, data).json();
2181
+ updateMosRuDataSource(data) {
2182
+ return this.http.patch(`/ds/dataMosRu`, data).then(() => { });
2138
2183
  }
2139
2184
  /**
2140
2185
  * No description
2141
2186
  *
2142
- * @tags FiltersService
2143
- * @name Create
2144
- * @operationId FiltersServiceController_Create
2145
- * @summary Creates a new filter.
2146
- * @request POST:/filters
2187
+ * @tags DataSource
2188
+ * @name CreateS3DataSource
2189
+ * @operationId DataSourceController_CreateS3DataSource
2190
+ * @summary Create S3 data source.
2191
+ * @request POST:/ds/s3
2147
2192
  * @secure
2148
2193
  * @response `200` OK
2149
2194
  */
2150
- create(data) {
2151
- return this.http.post(`/filters`, data).json();
2195
+ createS3DataSource(data) {
2196
+ return this.http.post(`/ds/s3`, data).then(() => { });
2152
2197
  }
2153
- }
2154
-
2155
- class Filters extends FiltersService {
2156
- }
2157
-
2158
- /* eslint-disable */
2159
- /* tslint:disable */
2160
- /*
2161
- * ---------------------------------------------------------------
2162
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
2163
- * ## ##
2164
- * ## AUTHOR: acacode ##
2165
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
2166
- * ---------------------------------------------------------------
2167
- */
2168
- // @ts-nocheck
2169
- /**
2170
- * @title Spatial Processing Core API
2171
- * @version 1.5.1.0
2172
- * @baseUrl /sp
2173
- */
2174
- class GeocodeService extends Service {
2175
2198
  /**
2176
2199
  * No description
2177
2200
  *
2178
- * @tags GeocodeService
2179
- * @name Geocode
2180
- * @operationId GeocodeServiceController_Geocode
2181
- * @summary Returns geocode geometry.
2182
- * @request GET:/geocode/{providerName}
2201
+ * @tags DataSource
2202
+ * @name UpdateS3DataSource
2203
+ * @operationId DataSourceController_UpdateS3DataSource
2204
+ * @summary Create S3 data source.
2205
+ * @request PATCH:/ds/s3
2183
2206
  * @secure
2184
2207
  * @response `200` OK
2185
2208
  */
2186
- geocode({ providerName, ...query }) {
2187
- return this.http.get(`/geocode/${providerName}`, query).json();
2209
+ updateS3DataSource(data) {
2210
+ return this.http.patch(`/ds/s3`, data).then(() => { });
2188
2211
  }
2189
2212
  /**
2190
2213
  * No description
2191
2214
  *
2192
- * @tags GeocodeService
2193
- * @name GeocodeByPoint
2194
- * @operationId GeocodeServiceController_GeocodeByPoint
2195
- * @summary Returns geocode address from point geometry.
2196
- * @request GET:/geocode/{providerName}/geocodeByPoint
2215
+ * @tags DataSource
2216
+ * @name CreateSparkDataSource
2217
+ * @operationId DataSourceController_CreateSparkDataSource
2218
+ * @summary Create spark data source.
2219
+ * @request POST:/ds/spark
2197
2220
  * @secure
2198
2221
  * @response `200` OK
2199
2222
  */
2200
- geocodeByPoint({ providerName, ...query }) {
2201
- return this.http.get(`/geocode/${providerName}/geocodeByPoint`, query).json();
2223
+ createSparkDataSource(data) {
2224
+ return this.http.post(`/ds/spark`, data).then(() => { });
2202
2225
  }
2203
2226
  /**
2204
2227
  * No description
2205
2228
  *
2206
- * @tags GeocodeService
2207
- * @name Suggest
2208
- * @operationId GeocodeServiceController_Suggest
2209
- * @summary Returns geocode suggest.
2210
- * @request GET:/geocode/{providerName}/suggest
2229
+ * @tags DataSource
2230
+ * @name UpdateSparkDataSource
2231
+ * @operationId DataSourceController_UpdateSparkDataSource
2232
+ * @summary Update spark data source.
2233
+ * @request PATCH:/ds/spark
2211
2234
  * @secure
2212
2235
  * @response `200` OK
2213
2236
  */
2214
- suggest({ providerName, ...query }) {
2215
- return this.http.get(`/geocode/${providerName}/suggest`, query).json();
2237
+ updateSparkDataSource(data) {
2238
+ return this.http.patch(`/ds/spark`, data).then(() => { });
2216
2239
  }
2217
- }
2218
-
2219
- const GEOCODE_PROVIDER = "geocode2gis";
2220
- class Geocode extends GeocodeService {
2221
- geocode2Gis(params) {
2222
- return this.geocode({
2223
- providerName: GEOCODE_PROVIDER,
2224
- ...params,
2225
- });
2240
+ /**
2241
+ * No description
2242
+ *
2243
+ * @tags DataSource
2244
+ * @name CreateArcGisDataSource1
2245
+ * @operationId DataSourceController_CreateArcGisDataSource_1
2246
+ * @summary Create WMS data source.
2247
+ * @request POST:/ds/wms
2248
+ * @secure
2249
+ * @response `200` OK
2250
+ */
2251
+ createArcGisDataSource1(data) {
2252
+ return this.http.post(`/ds/wms`, data).then(() => { });
2226
2253
  }
2227
- suggest2Gis(params) {
2228
- return this.suggest({
2229
- providerName: GEOCODE_PROVIDER,
2230
- ...params,
2231
- });
2254
+ /**
2255
+ * No description
2256
+ *
2257
+ * @tags DataSource
2258
+ * @name UpdateArcGisDataSource1
2259
+ * @operationId DataSourceController_UpdateArcGisDataSource_1
2260
+ * @summary Update WMS data source.
2261
+ * @request PATCH:/ds/wms
2262
+ * @secure
2263
+ * @response `200` OK
2264
+ */
2265
+ updateArcGisDataSource1(data) {
2266
+ return this.http.patch(`/ds/wms`, data).then(() => { });
2232
2267
  }
2233
2268
  }
2234
2269
 
@@ -2248,200 +2283,394 @@ class Geocode extends GeocodeService {
2248
2283
  * @version 1.5.1.0
2249
2284
  * @baseUrl /sp
2250
2285
  */
2251
- class ImportService extends Service {
2286
+ class QueryTokenAccessService extends Service {
2252
2287
  /**
2253
2288
  * No description
2254
2289
  *
2255
- * @tags ImportService
2256
- * @name GetDataSchema
2257
- * @operationId ImportServiceController_GetDataSchema
2258
- * @summary Using a file uploaded to the file upload service, reads the headers of the file and returns the information about data schema of all layers in that file, available for import.
2259
- * @request GET:/import/dataSchema
2290
+ * @tags QueryTokenAccess
2291
+ * @name GetTokensList
2292
+ * @operationId QueryTokenAccessController_GetTokensList
2293
+ * @request GET:/accessToken/list/{username}
2260
2294
  * @secure
2261
2295
  * @response `200` OK
2262
2296
  */
2263
- getDataSchema(query) {
2264
- return this.http.get(`/import/dataSchema`, query).json();
2297
+ getTokensList({ username, ...query }) {
2298
+ return this.http.get(`/accessToken/list/${username}`, query).json();
2265
2299
  }
2266
2300
  /**
2267
2301
  * No description
2268
2302
  *
2269
- * @tags ImportService
2270
- * @name GetFeaturesCount
2271
- * @operationId ImportServiceController_GetFeaturesCount
2272
- * @summary Returns the features count of the given file in temporary static storage.
2273
- * @request POST:/import/count
2303
+ * @tags QueryTokenAccess
2304
+ * @name CreateToken
2305
+ * @operationId QueryTokenAccessController_CreateTokenAsync
2306
+ * @request PUT:/accessToken/{username}
2274
2307
  * @secure
2275
2308
  * @response `200` OK
2276
2309
  */
2277
- getFeaturesCount(data) {
2278
- return this.http.post(`/import/count`, data).json();
2310
+ createToken({ username, ...query }) {
2311
+ return this.http.put(`/accessToken/${username}`, null, query).text();
2279
2312
  }
2280
2313
  /**
2281
2314
  * No description
2282
2315
  *
2283
- * @tags ImportService
2284
- * @name ReadPart
2285
- * @operationId ImportServiceController_ReadPart
2286
- * @summary Returns the features of the given file in temporary static storage.
2287
- * @request GET:/import/read
2316
+ * @tags QueryTokenAccess
2317
+ * @name DisableToken
2318
+ * @operationId QueryTokenAccessController_DisableToken
2319
+ * @request POST:/accessToken/{token}/disable
2288
2320
  * @secure
2289
2321
  * @response `200` OK
2290
2322
  */
2291
- readPart(query) {
2292
- return this.http.get(`/import/read`, query).json();
2323
+ disableToken(token) {
2324
+ return this.http.post(`/accessToken/${token}/disable`, null).then(() => { });
2293
2325
  }
2294
2326
  /**
2295
2327
  * No description
2296
2328
  *
2297
- * @tags ImportService
2298
- * @name GetExternalWmsLayers
2299
- * @operationId ImportServiceController_GetExternalWmsLayers
2300
- * @summary Get list of external WMS layers.
2301
- * @request GET:/import/wms
2329
+ * @tags QueryTokenAccess
2330
+ * @name EnableToken
2331
+ * @operationId QueryTokenAccessController_EnableToken
2332
+ * @request POST:/accessToken/{token}/enable
2302
2333
  * @secure
2303
2334
  * @response `200` OK
2304
2335
  */
2305
- getExternalWmsLayers(query) {
2306
- return this.http.get(`/import/wms`, query).json();
2336
+ enableToken(token) {
2337
+ return this.http.post(`/accessToken/${token}/enable`, null).then(() => { });
2307
2338
  }
2308
2339
  /**
2309
2340
  * No description
2310
2341
  *
2311
- * @tags ImportService
2312
- * @name GetExternalPbfLayers
2313
- * @operationId ImportServiceController_GetExternalPbfLayers
2314
- * @summary Get list of external PBF layers.
2315
- * @request GET:/import/pbf
2342
+ * @tags QueryTokenAccess
2343
+ * @name RevokeToken
2344
+ * @operationId QueryTokenAccessController_RevokeToken
2345
+ * @request DELETE:/accessToken/{token}
2316
2346
  * @secure
2317
2347
  * @response `200` OK
2318
2348
  */
2319
- getExternalPbfLayers(query) {
2320
- return this.http.get(`/import/pbf`, query).json();
2349
+ revokeToken(token) {
2350
+ return this.http.delete(`/accessToken/${token}`, null).then(() => { });
2321
2351
  }
2352
+ }
2353
+
2354
+ /* eslint-disable */
2355
+ /* tslint:disable */
2356
+ /*
2357
+ * ---------------------------------------------------------------
2358
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
2359
+ * ## ##
2360
+ * ## AUTHOR: acacode ##
2361
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
2362
+ * ---------------------------------------------------------------
2363
+ */
2364
+ // @ts-nocheck
2365
+ /**
2366
+ * @title Spatial Processing Core API
2367
+ * @version 1.5.1.0
2368
+ * @baseUrl /sp
2369
+ */
2370
+ class SpatialReferencesService extends Service {
2322
2371
  /**
2323
2372
  * No description
2324
2373
  *
2325
- * @tags ImportService
2326
- * @name GetExternalPbfFeatures
2327
- * @operationId ImportServiceController_GetExternalPbfFeatures
2328
- * @summary Get features list in external PBF layer.
2329
- * @request GET:/import/pbf/features
2374
+ * @tags SpatialReferences
2375
+ * @name GetAvailiableCs
2376
+ * @operationId SpatialReferencesController_GetAvailiableCsAsync
2377
+ * @summary Returns list of available spatial references.
2378
+ * @request GET:/srs/list
2330
2379
  * @secure
2331
2380
  * @response `200` OK
2332
2381
  */
2333
- getExternalPbfFeatures(query) {
2334
- return this.http.get(`/import/pbf/features`, query).json();
2382
+ getAvailiableCs() {
2383
+ return this.http.get(`/srs/list`).json();
2335
2384
  }
2336
2385
  /**
2337
2386
  * No description
2338
2387
  *
2339
- * @tags ImportService
2340
- * @name GetExternalArcgisFsLayers
2341
- * @operationId ImportServiceController_GetExternalArcgisFSLayers
2342
- * @summary Get list of external ArcGis FeatureServer layers.
2343
- * @request GET:/import/arcgisfeatureservice
2388
+ * @tags SpatialReferences
2389
+ * @name GetProj4Representation
2390
+ * @operationId SpatialReferencesController_GetProj4RepresentationAsync
2391
+ * @summary Returns a WKT representation of spatial reference.
2392
+ * @request GET:/srs/{name}/proj4
2344
2393
  * @secure
2345
2394
  * @response `200` OK
2346
2395
  */
2347
- getExternalArcgisFsLayers(query) {
2348
- return this.http.get(`/import/arcgisfeatureservice`, query).json();
2396
+ getProj4Representation(name) {
2397
+ return this.http.get(`/srs/${name}/proj4`).text();
2349
2398
  }
2350
2399
  /**
2351
2400
  * No description
2352
2401
  *
2353
- * @tags ImportService
2354
- * @name GetExternalArcGisLayers
2355
- * @operationId ImportServiceController_GetExternalArcGisLayers
2356
- * @summary Get list of external ArcGis MapServer layers.
2357
- * @request GET:/import/arcgismapservice
2358
- * @secure
2359
- * @response `200` OK
2360
- */
2361
- getExternalArcGisLayers(query) {
2362
- return this.http.get(`/import/arcgismapservice`, query).json();
2363
- }
2364
- /**
2365
- * No description
2366
- *
2367
- * @tags ImportService
2368
- * @name GetRasterAttributes
2369
- * @operationId ImportServiceController_GetRasterAttributes
2370
- * @summary Parse raster attributes from file name.
2371
- * @request GET:/import/rasterAttributes
2372
- * @secure
2373
- * @response `200` OK
2374
- */
2375
- getRasterAttributes(query) {
2376
- return this.http.get(`/import/rasterAttributes`, query).json();
2377
- }
2378
- /**
2379
- * No description
2380
- *
2381
- * @tags ImportService
2382
- * @name GetRasterMeta
2383
- * @operationId ImportServiceController_GetRasterMeta
2384
- * @summary Get raster meta data.
2385
- * @request GET:/import/rasterMeta
2402
+ * @tags SpatialReferences
2403
+ * @name GetWktRepresentation
2404
+ * @operationId SpatialReferencesController_GetWktRepresentationAsync
2405
+ * @summary Returns a WKT representation of spatial reference.
2406
+ * @request GET:/srs/{name}/wkt
2386
2407
  * @secure
2387
2408
  * @response `200` OK
2388
2409
  */
2389
- getRasterMeta(query) {
2390
- return this.http.get(`/import/rasterMeta`, query).json();
2410
+ getWktRepresentation(name) {
2411
+ return this.http.get(`/srs/${name}/wkt`).text();
2391
2412
  }
2392
2413
  }
2393
2414
 
2394
- class Import extends ImportService {
2415
+ var ApiEvent;
2416
+ (function (ApiEvent) {
2417
+ ApiEvent["ConnectionLost"] = "ConnectionLost";
2418
+ ApiEvent["Unauthorized"] = "Unauthorized";
2419
+ ApiEvent["SessionClosed"] = "SessionClosed";
2420
+ })(ApiEvent || (ApiEvent = {}));
2421
+
2422
+ class EventEmitter {
2423
+ handlers = {
2424
+ "*": [],
2425
+ };
2426
+ on(type, handler) {
2427
+ if (!this.handlers[type]) {
2428
+ this.handlers[type] = [];
2429
+ }
2430
+ this.handlers[type].push(handler);
2431
+ }
2432
+ off(type, handler) {
2433
+ if (!this.handlers[type])
2434
+ return;
2435
+ const index = this.handlers[type].indexOf(handler);
2436
+ if (index === -1)
2437
+ return;
2438
+ this.handlers[type].splice(index, 1);
2439
+ }
2440
+ emit(type, event) {
2441
+ this.handlers[type] && this.handlers[type].map(handler => handler(event));
2442
+ this.handlers["*"].map(handler => handler(type, event));
2443
+ }
2444
+ once(type, handler) {
2445
+ const onceHandler = event => {
2446
+ this.off(type, onceHandler);
2447
+ handler(event);
2448
+ };
2449
+ this.on(type, onceHandler);
2450
+ }
2395
2451
  }
2396
2452
 
2397
- var ErrorReason;
2398
- (function (ErrorReason) {
2399
- /** When request has status code less than 400 */
2400
- ErrorReason["HTTP_OTHER"] = "other";
2401
- /** When request has status code in range 400 - 499 */
2402
- ErrorReason["HTTP_CLIENT"] = "client";
2403
- /** When request has status code 500 or more */
2404
- ErrorReason["HTTP_SERVER"] = "server";
2405
- /** When it's not a http bad response */
2406
- ErrorReason["UNKNOWN"] = "unknown";
2407
- })(ErrorReason || (ErrorReason = {}));
2408
- const handleBaseError = (e) => ({
2409
- type: "base",
2410
- reason: ErrorReason.UNKNOWN,
2411
- origin: e,
2412
- });
2413
- const handleHTTPError = (e) => {
2414
- const status = e.response.status;
2415
- let reason = ErrorReason.HTTP_OTHER;
2416
- if (status >= 400 && status < 500) {
2417
- reason = ErrorReason.HTTP_CLIENT;
2453
+ var UrlPath;
2454
+ (function (UrlPath) {
2455
+ UrlPath["Base"] = "/map";
2456
+ UrlPath["Shared"] = "/shared";
2457
+ UrlPath["Presentation"] = "/presentation";
2458
+ UrlPath["Portal"] = "/portal";
2459
+ })(UrlPath || (UrlPath = {}));
2460
+ const apiEventsByResponseStatus = {
2461
+ 401: ApiEvent.Unauthorized,
2462
+ };
2463
+ const SHARED_PORT = "8082";
2464
+ const URL_PATHS = Object.values(UrlPath);
2465
+ const DEFAULT_URL_PATH = URL_PATHS[0];
2466
+ class Api extends EventEmitter {
2467
+ http;
2468
+ wsUrl;
2469
+ urlPath;
2470
+ url;
2471
+ layers;
2472
+ tables;
2473
+ projects;
2474
+ security;
2475
+ notification;
2476
+ file;
2477
+ filters;
2478
+ import;
2479
+ resources;
2480
+ geocode;
2481
+ tools;
2482
+ account;
2483
+ accountPreview;
2484
+ clientSettings;
2485
+ portalSettings;
2486
+ names;
2487
+ bulk;
2488
+ statistic;
2489
+ feedback;
2490
+ snappingHub;
2491
+ vectorTiles;
2492
+ spatialReference;
2493
+ eql;
2494
+ catalog;
2495
+ queryToken;
2496
+ dataSource;
2497
+ remoteTaskManager;
2498
+ cameras;
2499
+ constructor({ url, wsUrl, wsKeepAlive, snappingHubUrl, http, urlPath, httpOptions, }) {
2500
+ super();
2501
+ const { hooks } = httpOptions || {};
2502
+ this.http =
2503
+ http ||
2504
+ new HttpClient({
2505
+ prefixUrl: url,
2506
+ timeout: false,
2507
+ retry: {
2508
+ methods: ["get", "post", "delete"],
2509
+ limit: 5,
2510
+ statusCodes: [401],
2511
+ },
2512
+ ...(httpOptions || {}),
2513
+ hooks: {
2514
+ ...(hooks || {}),
2515
+ beforeRequest: [
2516
+ request => {
2517
+ const token = window.localStorage.getItem(STORAGE_TOKEN_KEY);
2518
+ if (token) {
2519
+ request.headers?.set("Authorization", `Bearer ${token || ""}`);
2520
+ }
2521
+ },
2522
+ ...(hooks?.beforeRequest ?? []),
2523
+ ],
2524
+ beforeRetry: [
2525
+ async ({ request, error, retryCount }) => {
2526
+ if (error instanceof HTTPError &&
2527
+ error.response.status === 401 &&
2528
+ retryCount === 1) {
2529
+ try {
2530
+ const refreshToken = window.localStorage.getItem(STORAGE_REFRESH_TOKEN_KEY);
2531
+ if (refreshToken) {
2532
+ const refreshTokenResponse = await this.account.refreshToken({
2533
+ refreshToken,
2534
+ });
2535
+ if (refreshTokenResponse) {
2536
+ window.localStorage.setItem(STORAGE_TOKEN_KEY, refreshTokenResponse.token);
2537
+ window.localStorage.setItem(STORAGE_REFRESH_TOKEN_KEY, refreshTokenResponse.refreshToken);
2538
+ }
2539
+ request.headers?.set("Authorization", `Bearer ${refreshTokenResponse.token || ""}`);
2540
+ }
2541
+ }
2542
+ catch (error) {
2543
+ throw new Error("Failed to refresh token");
2544
+ }
2545
+ }
2546
+ },
2547
+ ],
2548
+ afterResponse: [
2549
+ (request, options, response) => {
2550
+ const apiEvent = apiEventsByResponseStatus[response?.status];
2551
+ if (apiEvent) {
2552
+ this.emit(apiEvent, errorHandler(new HTTPError(response, request, options)));
2553
+ }
2554
+ return response;
2555
+ },
2556
+ ...(hooks?.afterResponse || []),
2557
+ ],
2558
+ },
2559
+ });
2560
+ this.url = url;
2561
+ this.wsUrl = wsUrl || url;
2562
+ this.urlPath = urlPath || this.defineUrlPath();
2563
+ this.layers = new Layers(this.http);
2564
+ this.tables = new Tables(this.http);
2565
+ this.projects = new Projects(this.http);
2566
+ this.resources = new Resources(this.projects, this.layers, this.tables);
2567
+ this.account = new Account(this.http);
2568
+ this.accountPreview = new AccountPreview(this.http);
2569
+ this.bulk = new BulkOperations(this.http);
2570
+ this.security = new Security(this.http, this.account);
2571
+ this.notification = new Notification(this.http, this, wsKeepAlive);
2572
+ this.file = new FileUpload(this.http);
2573
+ this.filters = new Filters(this.http);
2574
+ this.import = new Import(this.http);
2575
+ this.geocode = new Geocode(this.http);
2576
+ this.tools = new Tools(this.http);
2577
+ this.clientSettings = new ClientSettings(this.http);
2578
+ this.portalSettings = new PortalSettings(this.http);
2579
+ this.statistic = new Statistic(this.http);
2580
+ this.feedback = new Feedback(this.http);
2581
+ this.vectorTiles = new VectorTiles(this.http);
2582
+ this.spatialReference = new SpatialReferencesService(this.http);
2583
+ this.eql = new Eql(this.http);
2584
+ this.catalog = new CatalogService(this.http);
2585
+ this.queryToken = new QueryTokenAccessService(this.http);
2586
+ this.dataSource = new DataSourceService(this.http);
2587
+ this.remoteTaskManager = new RemoteTaskManager(this.http);
2588
+ this.cameras = new Cameras(this.http);
2589
+ this.names = new Names({
2590
+ account: this.account,
2591
+ });
2592
+ this.snappingHub = snappingHubUrl
2593
+ ? new HubConnectionBuilder()
2594
+ .withUrl(snappingHubUrl, {
2595
+ withCredentials: true,
2596
+ skipNegotiation: true,
2597
+ transport: HttpTransportType.WebSockets,
2598
+ })
2599
+ .withAutomaticReconnect()
2600
+ .build()
2601
+ : null;
2602
+ }
2603
+ async init({ authParams, authQueryParams, connectWs, fetchSettings, fetchUser, useJwt, }) {
2604
+ try {
2605
+ await this.account.login(authParams, authQueryParams, useJwt);
2606
+ if (fetchUser) {
2607
+ await this.account.fetchCurrentUser();
2608
+ }
2609
+ if (connectWs) {
2610
+ await this.connectWs();
2611
+ }
2612
+ if (fetchSettings) {
2613
+ await this.clientSettings.fetchClientSettings({
2614
+ urlPath: getFetchingUrlPath(this.urlPath),
2615
+ });
2616
+ }
2617
+ await this.notification.subscribe("service_update" /* SubscriptionTag.ServiceUpdate */);
2618
+ }
2619
+ catch (e) {
2620
+ throw errorHandler(e);
2621
+ }
2622
+ }
2623
+ isAcceptedNetwork(network) {
2624
+ return ["vk", "google", "facebook"].includes(network);
2625
+ }
2626
+ async socAuthLogin(network) {
2627
+ if (!this.isAcceptedNetwork(network))
2628
+ return;
2629
+ try {
2630
+ await this.clientSettings.fetchClientSettings({ urlPath: UrlPath.Base });
2631
+ }
2632
+ catch (e) {
2633
+ throw errorHandler(e);
2634
+ }
2635
+ }
2636
+ async connectWs() {
2637
+ if (this.account.isAuth) {
2638
+ this.notification.connectWs(this.wsUrl);
2639
+ this.notification.on("ConnectionStatus" /* NotificationTag.ConnectionStatus */, connection => {
2640
+ if (connection.data === ConnectionStatus.Lost) {
2641
+ this.emit(ApiEvent.ConnectionLost, connection.data);
2642
+ }
2643
+ else if (connection.data === ConnectionStatus.SessionClosed) {
2644
+ this.emit(ApiEvent.SessionClosed, connection.data);
2645
+ }
2646
+ });
2647
+ }
2648
+ }
2649
+ async connectSignalR() {
2650
+ if (this.account.isAuth &&
2651
+ this.snappingHub &&
2652
+ this.snappingHub.state !== HubConnectionState.Connected) {
2653
+ await this.snappingHub.start();
2654
+ }
2655
+ }
2656
+ async logout() {
2657
+ await this.account.logout();
2658
+ await this.security.reset();
2659
+ this.emit(ApiEvent.Unauthorized, null);
2660
+ }
2661
+ defineUrlPath() {
2662
+ const firstPath = (window.location.href.split(window.location.hostname)[1] || "")
2663
+ .split("/")
2664
+ .filter(Boolean)[0];
2665
+ const urlPath = firstPath ? `/${firstPath}` : void 0;
2666
+ return urlPath && URL_PATHS.includes(urlPath) ? urlPath : DEFAULT_URL_PATH;
2418
2667
  }
2419
- if (status >= 500) {
2420
- reason = ErrorReason.HTTP_SERVER;
2668
+ get isShared() {
2669
+ return this.urlPath === UrlPath.Shared;
2670
+ }
2671
+ get isPresentation() {
2672
+ return this.urlPath === UrlPath.Presentation || window.location.port === SHARED_PORT;
2421
2673
  }
2422
- return {
2423
- type: "http",
2424
- reason,
2425
- status,
2426
- origin: e,
2427
- };
2428
- };
2429
- const errorHandler = (e) => {
2430
- if (e instanceof HTTPError)
2431
- return handleHTTPError(e);
2432
- return handleBaseError(e);
2433
- };
2434
- const isHandledError = (e) => e && e.type && e.reason;
2435
- const isHTTPError = (e) => isHandledError(e) && e.type === "http";
2436
-
2437
- function formDataFromFile(file) {
2438
- const data = new FormData();
2439
- data.append("file", file);
2440
- return data;
2441
- }
2442
-
2443
- function isString(v) {
2444
- return typeof v === "string";
2445
2674
  }
2446
2675
 
2447
2676
  const addSubDomainToLocation = (subDomain) => `${window.location.protocol}//${subDomain}.${window.location.host}`;
@@ -4781,229 +5010,6 @@ class VectorTileService extends Service {
4781
5010
  class VectorTiles extends VectorTileService {
4782
5011
  }
4783
5012
 
4784
- var UrlPath;
4785
- (function (UrlPath) {
4786
- UrlPath["Base"] = "/map";
4787
- UrlPath["Shared"] = "/shared";
4788
- UrlPath["Presentation"] = "/presentation";
4789
- UrlPath["Portal"] = "/portal";
4790
- })(UrlPath || (UrlPath = {}));
4791
- const apiEventsByResponseStatus = {
4792
- 401: ApiEvent.Unauthorized,
4793
- };
4794
- const SHARED_PORT = "8082";
4795
- const URL_PATHS = Object.values(UrlPath);
4796
- const DEFAULT_URL_PATH = URL_PATHS[0];
4797
- class Api extends EventEmitter {
4798
- http;
4799
- wsUrl;
4800
- urlPath;
4801
- url;
4802
- layers;
4803
- tables;
4804
- projects;
4805
- security;
4806
- notification;
4807
- file;
4808
- filters;
4809
- import;
4810
- resources;
4811
- geocode;
4812
- tools;
4813
- account;
4814
- accountPreview;
4815
- clientSettings;
4816
- portalSettings;
4817
- names;
4818
- bulk;
4819
- statistic;
4820
- feedback;
4821
- snappingHub;
4822
- vectorTiles;
4823
- spatialReference;
4824
- eql;
4825
- catalog;
4826
- queryToken;
4827
- dataSource;
4828
- remoteTaskManager;
4829
- cameras;
4830
- constructor({ url, wsUrl, wsKeepAlive, snappingHubUrl, http, urlPath, httpOptions, }) {
4831
- super();
4832
- const { hooks } = httpOptions || {};
4833
- this.http =
4834
- http ||
4835
- new HttpClient({
4836
- prefixUrl: url,
4837
- timeout: false,
4838
- retry: {
4839
- methods: ["get", "post", "delete"],
4840
- limit: 5,
4841
- statusCodes: [401],
4842
- },
4843
- ...(httpOptions || {}),
4844
- hooks: {
4845
- ...(hooks || {}),
4846
- beforeRequest: [
4847
- request => {
4848
- const token = window.localStorage.getItem(STORAGE_TOKEN_KEY);
4849
- if (token) {
4850
- request.headers?.set("Authorization", `Bearer ${token || ""}`);
4851
- }
4852
- },
4853
- ...(hooks?.beforeRequest ?? []),
4854
- ],
4855
- beforeRetry: [
4856
- async ({ request, error, retryCount }) => {
4857
- if (error instanceof HTTPError &&
4858
- error.response.status === 401 &&
4859
- retryCount === 1) {
4860
- try {
4861
- const refreshToken = window.localStorage.getItem(STORAGE_REFRESH_TOKEN_KEY);
4862
- if (refreshToken) {
4863
- const refreshTokenResponse = await this.account.refreshToken({
4864
- refreshToken,
4865
- });
4866
- if (refreshTokenResponse) {
4867
- window.localStorage.setItem(STORAGE_TOKEN_KEY, refreshTokenResponse.token);
4868
- window.localStorage.setItem(STORAGE_REFRESH_TOKEN_KEY, refreshTokenResponse.refreshToken);
4869
- }
4870
- request.headers?.set("Authorization", `Bearer ${refreshTokenResponse.token || ""}`);
4871
- }
4872
- }
4873
- catch (error) {
4874
- throw new Error("Failed to refresh token");
4875
- }
4876
- }
4877
- },
4878
- ],
4879
- afterResponse: [
4880
- (request, options, response) => {
4881
- const apiEvent = apiEventsByResponseStatus[response?.status];
4882
- if (apiEvent) {
4883
- this.emit(apiEvent, errorHandler(new HTTPError(response, request, options)));
4884
- }
4885
- return response;
4886
- },
4887
- ...(hooks?.afterResponse || []),
4888
- ],
4889
- },
4890
- });
4891
- this.url = url;
4892
- this.wsUrl = wsUrl || url;
4893
- this.urlPath = urlPath || this.defineUrlPath();
4894
- this.layers = new Layers(this.http);
4895
- this.tables = new Tables(this.http);
4896
- this.projects = new Projects(this.http);
4897
- this.resources = new Resources(this.projects, this.layers, this.tables);
4898
- this.account = new Account(this.http);
4899
- this.accountPreview = new AccountPreview(this.http);
4900
- this.bulk = new BulkOperations(this.http);
4901
- this.security = new Security(this.http, this.account);
4902
- this.notification = new Notification(this.http, this, wsKeepAlive);
4903
- this.file = new FileUpload(this.http);
4904
- this.filters = new Filters(this.http);
4905
- this.import = new Import(this.http);
4906
- this.geocode = new Geocode(this.http);
4907
- this.tools = new Tools(this.http);
4908
- this.clientSettings = new ClientSettings(this.http);
4909
- this.portalSettings = new PortalSettings(this.http);
4910
- this.statistic = new Statistic(this.http);
4911
- this.feedback = new Feedback(this.http);
4912
- this.vectorTiles = new VectorTiles(this.http);
4913
- this.spatialReference = new SpatialReferencesService(this.http);
4914
- this.eql = new Eql(this.http);
4915
- this.catalog = new CatalogService(this.http);
4916
- this.queryToken = new QueryTokenAccessService(this.http);
4917
- this.dataSource = new DataSourceService(this.http);
4918
- this.remoteTaskManager = new RemoteTaskManager(this.http);
4919
- this.cameras = new Cameras(this.http);
4920
- this.names = new Names({
4921
- account: this.account,
4922
- });
4923
- this.snappingHub = snappingHubUrl
4924
- ? new HubConnectionBuilder()
4925
- .withUrl(snappingHubUrl, {
4926
- withCredentials: true,
4927
- skipNegotiation: true,
4928
- transport: HttpTransportType.WebSockets,
4929
- })
4930
- .withAutomaticReconnect()
4931
- .build()
4932
- : null;
4933
- }
4934
- async init({ authParams, authQueryParams, connectWs, fetchSettings, fetchUser, useJwt, }) {
4935
- try {
4936
- await this.account.login(authParams, authQueryParams, useJwt);
4937
- if (fetchUser) {
4938
- await this.account.fetchCurrentUser();
4939
- }
4940
- if (connectWs) {
4941
- await this.connectWs();
4942
- }
4943
- if (fetchSettings) {
4944
- await this.clientSettings.fetchClientSettings({
4945
- urlPath: getFetchingUrlPath(this.urlPath),
4946
- });
4947
- }
4948
- await this.notification.subscribe("service_update" /* SubscriptionTag.ServiceUpdate */);
4949
- }
4950
- catch (e) {
4951
- throw errorHandler(e);
4952
- }
4953
- }
4954
- isAcceptedNetwork(network) {
4955
- return ["vk", "google", "facebook"].includes(network);
4956
- }
4957
- async socAuthLogin(network) {
4958
- if (!this.isAcceptedNetwork(network))
4959
- return;
4960
- try {
4961
- await this.clientSettings.fetchClientSettings({ urlPath: UrlPath.Base });
4962
- }
4963
- catch (e) {
4964
- throw errorHandler(e);
4965
- }
4966
- }
4967
- async connectWs() {
4968
- if (this.account.isAuth) {
4969
- this.notification.connectWs(this.wsUrl);
4970
- this.notification.on("ConnectionStatus" /* NotificationTag.ConnectionStatus */, connection => {
4971
- if (connection.data === ConnectionStatus.Lost) {
4972
- this.emit(ApiEvent.ConnectionLost, connection.data);
4973
- }
4974
- else if (connection.data === ConnectionStatus.SessionClosed) {
4975
- this.emit(ApiEvent.SessionClosed, connection.data);
4976
- }
4977
- });
4978
- }
4979
- }
4980
- async connectSignalR() {
4981
- if (this.account.isAuth &&
4982
- this.snappingHub &&
4983
- this.snappingHub.state !== HubConnectionState.Connected) {
4984
- await this.snappingHub.start();
4985
- }
4986
- }
4987
- async logout() {
4988
- await this.account.logout();
4989
- await this.security.reset();
4990
- this.emit(ApiEvent.Unauthorized, null);
4991
- }
4992
- defineUrlPath() {
4993
- const firstPath = (window.location.href.split(window.location.hostname)[1] || "")
4994
- .split("/")
4995
- .filter(Boolean)[0];
4996
- const urlPath = firstPath ? `/${firstPath}` : void 0;
4997
- return urlPath && URL_PATHS.includes(urlPath) ? urlPath : DEFAULT_URL_PATH;
4998
- }
4999
- get isShared() {
5000
- return this.urlPath === UrlPath.Shared;
5001
- }
5002
- get isPresentation() {
5003
- return this.urlPath === UrlPath.Presentation || window.location.port === SHARED_PORT;
5004
- }
5005
- }
5006
-
5007
5013
  // @ts-nocheck
5008
5014
  /**
5009
5015
  *
@@ -5831,5 +5837,5 @@ var WorkerSettingsFieldType;
5831
5837
  WorkerSettingsFieldType["AttributeArray"] = "AttributeArray";
5832
5838
  })(WorkerSettingsFieldType || (WorkerSettingsFieldType = {}));
5833
5839
 
5834
- export { AccessMode, Account, AccountPreview, AggregationFunction, Api, ApiEvent, AttributeIconType, AttributeSelectorType, AttributeType, AuthorizationGrant, BulkOperations, Cameras, CatalogResourceType, ClassificationType, ClassifyAttributeType, ClientSettings, ConfigurationErrorEnum, ConfigurationType, ConnectionStatus, DataSourceConnectionType, DataSourceType, DependencyType, Eql, ErrorDetailsType, ErrorReason, ErrorType, Feedback, FileUpload, Filters, GEOCODE_PROVIDER, Geocode, GeometryType, Group, HttpClient, Import, Layers, Names, Notification, NotificationEvent, PbfSchema, Permissions, PolicyType, PortalSettings, Projects, Quality, RemoteTaskManager, RemoteTaskStatus, ResourceSeparator, ResourceSubTypeFilter, ResourceType, ResourceTypeFilter, ResourceTypeLink, Resources, ResponseType, STORAGE_REFRESH_TOKEN_KEY, STORAGE_TOKEN_KEY, Security, SimplifyType, Statistic, StringSubType, Tables, TaskResourceSubType, Tools, UrlPath, VectorTiles, WorkerMethodType, WorkerSettingsFieldType, addSubDomainToLocation, errorHandler, formDataFromFile, generateId, getFetchingUrlPath, isHTTPError, isHandledError, isProjectContentItems, isString, isTileLayerService, parseJwt, promiseAllIgnoreErrors, stripUselessSlashes, toFormData, unique };
5840
+ export { AccessMode, Account, AccountPreview, AggregationFunction, Api, ApiEvent, AttributeIconType, AttributeSelectorType, AttributeType, AuthorizationGrant, BulkOperations, Cameras, CatalogResourceType, ClassificationType, ClassifyAttributeType, ClientSettings, ConfigurationErrorEnum, ConfigurationType, ConnectionStatus, DataSourceConnectionType, DataSourceType, DependencyType, Eql, ErrorDetailsType, ErrorReason, ErrorType, Feedback, FileUpload, Filters, GEOCODE_PROVIDER, Geocode, GeometryType, Group, HttpClient, Import, Layers, Names, Notification, NotificationEvent, PbfSchema, Permissions, PolicyType, PortalSettings, Projects, Quality, RemoteTaskManager, RemoteTaskStatus, ResourceSeparator, ResourceSubTypeFilter, ResourceType, ResourceTypeFilter, ResourceTypeLink, Resources, ResponseType, STORAGE_REFRESH_TOKEN_KEY, STORAGE_TOKEN_KEY, Security, SimplifyType, Statistic, StringSubType, Tables, TaskResourceSubType, Tools, UrlPath, VectorTiles, WorkerMethodType, WorkerSettingsFieldType, addSubDomainToLocation, errorHandler, formDataFromFile, generateId, getFetchingUrlPath, isHTTPError, isHandledError, isProjectContentItems, isString, isTileLayerService, parseJwt, promiseAllIgnoreErrors, stripUselessSlashes, toFormData, unique, useToken };
5835
5841
  //# sourceMappingURL=api.esm.js.map