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