@nextgis/ngw-connector 3.0.0-alpha.4 → 3.0.0-alpha.5

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/lib/index.d.ts CHANGED
@@ -1,1234 +1,1734 @@
1
- import { EventEmitter } from 'events';
2
- import Cache from '@nextgis/cache';
3
- import { FeatureProperties, DeepPartial } from '@nextgis/utils';
4
- import { GeoJsonObject, Geometry } from 'geojson';
1
+ /// <reference types="./global.d.ts" />
2
+
3
+ import type Cache from '@nextgis/cache';
4
+ import type { DeepPartial, FeatureProperties } from '@nextgis/utils';
5
+ import type { Routes } from '@nextgisweb/pyramid/type/route';
6
+ import type { EventEmitter } from 'events';
7
+ import type { GeoJsonObject, Geometry } from 'geojson';
8
+
9
+ declare class LunkwillParam {
10
+ static VALUES: (string | null)[];
11
+ private value;
12
+ constructor();
13
+ update(value: string | null, cond?: boolean): void;
14
+ suggest(cond?: boolean): void;
15
+ require(cond?: boolean): void;
16
+ toHeaders(headers: Record<string, string>): void;
17
+ }
18
+
19
+ type RouteParameters = {
20
+ [K in keyof Routes]: Routes[K]['pathArr'] | [Routes[K]['pathObj']];
21
+ };
22
+ type RouteName = keyof Routes;
23
+ type RequestMethod = keyof RouteMethods<RouteName>;
24
+ type Method = RequestMethod | Uppercase<RequestMethod>;
25
+ type ResponseType = 'blob' | 'json';
26
+ interface RequestOptions$1<
27
+ RT extends ResponseType = 'json',
28
+ ReturnUrl extends boolean = false,
29
+ Q = any,
30
+ B = string | null | boolean | Record<string, any> | any[],
31
+ > extends Omit<RequestInit, 'cache'> {
32
+ headers?: Record<string, string>;
33
+ cache?: boolean;
34
+ query?: Q;
35
+ json?: B;
36
+ /** Has lower priority than the json */
37
+ body?: string;
38
+ /**
39
+ * The type of data that the server will respond with.
40
+ * Can be either 'json' or 'blob'.
41
+ */
42
+ responseType?: RT;
43
+ /**
44
+ * @deprecated use {@link RequestInit.credential}
45
+ * Indicates whether to include credentials such as cookies, authentication headers,
46
+ * or TLS client certificates in cross-site Access-Control requests.
47
+ */
48
+ withCredentials?: boolean;
49
+ /**
50
+ * Name to use for caching the request.
51
+ */
52
+ cacheName?: string;
53
+ /**
54
+ * Properties to override default cache behavior.
55
+ */
56
+ cacheProps?: Record<string, unknown>;
57
+ lunkwill?: LunkwillParam;
58
+ lunkwillReturnUrl?: ReturnUrl;
59
+ }
60
+ interface GetRequestOptions<
61
+ Q = any,
62
+ RT extends ResponseType = 'json',
63
+ ReturnUrl extends boolean = false,
64
+ > extends Omit<RequestOptions$1<RT, ReturnUrl, Q>, 'json' | 'body'> {
65
+ method?: 'GET';
66
+ }
67
+ interface RequestOptionsJSON<
68
+ Q = any,
69
+ B = string | null | boolean | Record<string, any> | any[],
70
+ RT extends ResponseType = 'json',
71
+ M extends Method = Method,
72
+ > extends Omit<RequestOptions$1<RT, false, Q, B>, 'json' | 'body'> {
73
+ json: B;
74
+ method?: M;
75
+ }
76
+ interface RequestOptionsBody<
77
+ Q = any,
78
+ RT extends ResponseType = 'json',
79
+ M extends Method = Method,
80
+ > extends Omit<RequestOptions$1<RT, false, Q>, 'json' | 'body'> {
81
+ body: string;
82
+ method?: M;
83
+ }
84
+ type PutRequestOptions<Q = any, B = any, RT extends ResponseType = 'json'> =
85
+ | RequestOptionsJSON<Q, B, RT, 'PUT'>
86
+ | RequestOptionsBody<Q, RT, 'PUT'>;
87
+ type PostRequestOptions<Q = any, B = any, RT extends ResponseType = 'json'> =
88
+ | RequestOptionsJSON<Q, B, RT, 'POST'>
89
+ | RequestOptionsBody<Q, RT, 'POST'>;
90
+ type PatchRequestOptions<Q = any, B = any, RT extends ResponseType = 'json'> =
91
+ | RequestOptionsJSON<Q, B, RT, 'PATCH'>
92
+ | RequestOptionsBody<Q, RT, 'PATCH'>;
93
+ type DeleteRequestOptions<
94
+ Q = any,
95
+ RT extends ResponseType = 'json',
96
+ > = RequestOptions$1<RT, false, Q>;
97
+ interface RouteRequestOptions<
98
+ Q = any,
99
+ B = any,
100
+ RT extends ResponseType = 'json',
101
+ ReturnUrl extends boolean = false,
102
+ > {
103
+ get: GetRequestOptions<Q, RT, ReturnUrl>;
104
+ post: PostRequestOptions<Q, B, RT>;
105
+ put: PutRequestOptions<Q, B, RT>;
106
+ patch: PatchRequestOptions<Q, RT>;
107
+ delete: DeleteRequestOptions<Q, RT>;
108
+ }
109
+ type RequestOptionsByMethod<
110
+ M extends RequestMethod,
111
+ Q = any,
112
+ B = any,
113
+ RT extends ResponseType = 'json',
114
+ ReturnUrl extends boolean = false,
115
+ > = M extends keyof RouteRequestOptions
116
+ ? RouteRequestOptions<Q, B, RT, ReturnUrl>[M]
117
+ : never;
118
+ type RouteResp<
119
+ N extends RouteName,
120
+ M extends RequestMethod,
121
+ > = N extends keyof Routes
122
+ ? M extends keyof Routes[N]
123
+ ? 'response' extends keyof Routes[N][M]
124
+ ? Routes[N][M]['response']
125
+ : never
126
+ : never
127
+ : never;
128
+ type RouteQuery<
129
+ N extends RouteName,
130
+ M extends RequestMethod,
131
+ > = N extends keyof Routes
132
+ ? M extends keyof Routes[N]
133
+ ? 'query' extends keyof Routes[N][M]
134
+ ? Routes[N][M]['query']
135
+ : any
136
+ : never
137
+ : never;
138
+ type RouteBody<
139
+ N extends RouteName,
140
+ M extends RequestMethod,
141
+ > = N extends keyof Routes
142
+ ? M extends keyof Routes[N]
143
+ ? 'body' extends keyof Routes[N][M]
144
+ ? Routes[N][M]['body']
145
+ : any
146
+ : never
147
+ : never;
148
+ type ToReturn<
149
+ T = unknown,
150
+ RT extends ResponseType = 'json',
151
+ ReturnUrl extends boolean = false,
152
+ > = ReturnUrl extends true ? string : RT extends 'blob' ? Blob : T;
153
+ type HasRequiredKeys<T> = {
154
+ [P in keyof T]-?: object extends Pick<T, P> ? never : P;
155
+ }[keyof T] extends never
156
+ ? false
157
+ : true;
158
+ interface RouteMethods<N extends RouteName> {
159
+ url: HasRequiredKeys<RouteQuery<N, 'get'>> extends true
160
+ ? (
161
+ options: Pick<
162
+ RequestOptionsByMethod<'get', RouteQuery<N, 'get'>>,
163
+ 'query'
164
+ >,
165
+ ) => Promise<string>
166
+ : (
167
+ options?: Pick<
168
+ RequestOptionsByMethod<'get', RouteQuery<N, 'get'>>,
169
+ 'query'
170
+ >,
171
+ ) => Promise<string>;
172
+ get: HasRequiredKeys<RouteQuery<N, 'get'>> extends true
173
+ ? <
174
+ T = RouteResp<N, 'get'>,
175
+ RT extends ResponseType = 'json',
176
+ B extends boolean = false,
177
+ >(
178
+ options: RequestOptionsByMethod<
179
+ 'get',
180
+ RouteQuery<N, 'get'>,
181
+ any,
182
+ RT,
183
+ B
184
+ >,
185
+ ) => Promise<ToReturn<T, RT, B>>
186
+ : <
187
+ T = RouteResp<N, 'get'>,
188
+ B extends boolean = false,
189
+ RT extends ResponseType = 'json',
190
+ >(
191
+ options?: RequestOptionsByMethod<
192
+ 'get',
193
+ RouteQuery<N, 'get'>,
194
+ any,
195
+ RT,
196
+ B
197
+ >,
198
+ ) => Promise<ToReturn<T, RT, B>>;
199
+ post: <T = RouteResp<N, 'post'>, RT extends ResponseType = 'json'>(
200
+ options: RequestOptionsByMethod<
201
+ 'post',
202
+ RouteQuery<N, 'post'>,
203
+ RouteBody<N, 'post'>,
204
+ RT
205
+ >,
206
+ ) => Promise<ToReturn<T, RT>>;
207
+ put: <T = RouteResp<N, 'put'>, RT extends ResponseType = 'json'>(
208
+ options: RequestOptionsByMethod<
209
+ 'put',
210
+ RouteQuery<N, 'put'>,
211
+ RouteBody<N, 'put'>,
212
+ RT
213
+ >,
214
+ ) => Promise<ToReturn<T, RT>>;
215
+ patch: <T = RouteResp<N, 'patch'>, RT extends ResponseType = 'json'>(
216
+ options: RequestOptionsByMethod<
217
+ 'patch',
218
+ RouteQuery<N, 'patch'>,
219
+ RouteBody<N, 'patch'>,
220
+ RT
221
+ >,
222
+ ) => Promise<ToReturn<T, RT>>;
223
+ delete: HasRequiredKeys<RouteQuery<N, 'delete'>> extends true
224
+ ? <T = RouteResp<N, 'delete'>>(
225
+ options: RequestOptionsByMethod<'delete', RouteQuery<N, 'delete'>>,
226
+ ) => Promise<ToReturn<T>>
227
+ : <T = RouteResp<N, 'delete'>>(
228
+ options?: RequestOptionsByMethod<'delete', RouteQuery<N, 'delete'>>,
229
+ ) => Promise<ToReturn<T>>;
230
+ }
231
+ type MethodAvailable<
232
+ N extends RouteName,
233
+ M extends RequestMethod,
234
+ > = M extends 'url'
235
+ ? RouteMethods<N>['url']
236
+ : M extends keyof Routes[N]
237
+ ? RouteMethods<N>[M]
238
+ : never;
239
+ type RouteResults<N extends RouteName> = {
240
+ [M in keyof RouteMethods<any>]: MethodAvailable<N, M>;
241
+ };
5
242
 
6
243
  interface NgwLayerIdentifyError {
7
- error: 'Not implemented';
244
+ error: 'Not implemented';
8
245
  }
9
246
  interface LayerFeature {
10
- id: number;
11
- label: string;
12
- layerId: number;
13
- parent: string;
14
- fields: FeatureProperties;
15
- geom?: GeoJsonObject;
247
+ id: number;
248
+ label: string;
249
+ layerId: number;
250
+ parent: string;
251
+ fields: FeatureProperties;
252
+ geom?: GeoJsonObject;
16
253
  }
17
254
  interface FeatureLayersIdentifyItems {
18
- featureCount: number;
19
- features: LayerFeature[];
255
+ featureCount: number;
256
+ features: LayerFeature[];
20
257
  }
21
258
  interface FeatureLayersIdentify {
22
- [layerId: number]: FeatureLayersIdentifyItems | NgwLayerIdentifyError;
23
- featureCount: number;
259
+ [layerId: number]: FeatureLayersIdentifyItems | NgwLayerIdentifyError;
260
+ featureCount: number;
24
261
  }
25
262
  interface FeatureItemAttachment {
26
- id: number;
27
- name: string;
28
- size: number;
29
- mime_type: string;
30
- description: null;
31
- is_image: boolean;
263
+ id: number;
264
+ name: string;
265
+ size: number;
266
+ mime_type: string;
267
+ description: null;
268
+ is_image: boolean;
32
269
  }
33
270
  interface FeatureItemExtensions {
34
- description?: string;
35
- attachment?: FeatureItemAttachment[];
36
- }
37
- interface FeatureItem<F = FeatureProperties, G extends Geometry | string = Geometry> {
38
- id: number;
39
- geom: G;
40
- fields: F;
41
- extensions: FeatureItemExtensions;
42
- }
43
- type FeatureItemToNgw<F = FeatureProperties, G extends Geometry | string = Geometry> = FeatureItem<F, G>;
271
+ description?: string;
272
+ attachment?: FeatureItemAttachment[];
273
+ }
274
+ interface FeatureItem<
275
+ F = FeatureProperties,
276
+ G extends Geometry | string = Geometry,
277
+ > {
278
+ id: number;
279
+ geom: G;
280
+ fields: F;
281
+ extensions: FeatureItemExtensions;
282
+ }
283
+ type FeatureItemToNgw<
284
+ F = FeatureProperties,
285
+ G extends Geometry | string = Geometry,
286
+ > = FeatureItem<F, G>;
44
287
 
45
288
  /**
46
289
  * Represents an item in a legend, with additional rendering and indexing information.
47
290
  */
48
291
  interface LegendItem {
49
- /**
50
- * The index of the legend item.
51
- */
52
- index: number;
53
- /**
54
- * A flag indicating whether this legend item should be rendered.
55
- */
56
- render: boolean | null;
57
- /**
58
- * The display name of the legend item.
59
- */
60
- display_name: string;
61
- /**
62
- * The symbol associated with this legend item.
63
- */
64
- icon: LegendItemSymbol;
292
+ /**
293
+ * The index of the legend item.
294
+ */
295
+ index: number;
296
+ /**
297
+ * A flag indicating whether this legend item should be rendered.
298
+ */
299
+ render: boolean | null;
300
+ /**
301
+ * The display name of the legend item.
302
+ */
303
+ display_name: string;
304
+ /**
305
+ * The symbol associated with this legend item.
306
+ */
307
+ icon: LegendItemSymbol;
65
308
  }
66
309
  /**
67
310
  * Represents a symbol in a legend item.
68
311
  */
69
312
  interface LegendItemSymbol {
70
- /**
71
- * The format of the symbol, e.g., 'svg', 'png'.
72
- */
73
- format: string;
74
- /**
75
- * The actual data of the symbol in a specified format.
76
- * This could be a base64 encoded string, SVG path, etc.
77
- */
78
- data: string;
313
+ /**
314
+ * The format of the symbol, e.g., 'svg', 'png'.
315
+ */
316
+ format: string;
317
+ /**
318
+ * The actual data of the symbol in a specified format.
319
+ * This could be a base64 encoded string, SVG path, etc.
320
+ */
321
+ data: string;
79
322
  }
80
323
  /**
81
324
  * Represents a legend for a specific layer.
82
325
  */
83
326
  interface LayerLegend {
84
- layerId: string;
85
- legend: LegendItem[];
327
+ layerId: string;
328
+ legend: LegendItem[];
86
329
  }
87
330
 
88
331
  interface RequestItemsParamsMap {
89
- 'pyramid.static': {
90
- skey: number;
91
- };
92
- 'pyramid.openapi_json': null;
93
- 'pyramid.openapi_json_test': null;
94
- 'pyramid.swagger': null;
95
- 'pyramid.control_panel': null;
96
- 'pyramid.control_panel.sysinfo': null;
97
- 'pyramid.control_panel.storage': null;
98
- 'pyramid.control_panel.backup.browse': null;
99
- 'pyramid.control_panel.backup.download': {
100
- filename: number;
101
- };
102
- 'pyramid.control_panel.cors': null;
103
- 'pyramid.control_panel.custom_css': null;
104
- 'pyramid.control_panel.logo': null;
105
- 'pyramid.control_panel.system_name': null;
106
- 'pyramid.control_panel.home_path': null;
107
- 'pyramid.locale': {
108
- locale: number;
109
- };
110
- 'pyramid.test_request': null;
111
- 'pyramid.test_exception_handled': null;
112
- 'pyramid.test_exception_unhandled': null;
113
- 'pyramid.test_exception_transaction': null;
114
- 'pyramid.test_timeout': null;
115
- 'pyramid.cors': null;
116
- 'pyramid.system_name': null;
117
- 'pyramid.settings': null;
118
- 'pyramid.route': null;
119
- 'pyramid.pkg_version': null;
120
- 'pyramid.healthcheck': null;
121
- 'pyramid.statistics': null;
122
- 'pyramid.estimate_storage': null;
123
- 'pyramid.storage_status': null;
124
- 'pyramid.storage': null;
125
- 'pyramid.kind_of_data': null;
126
- 'pyramid.custom_css': null;
127
- 'pyramid.logo': null;
128
- 'pyramid.company_logo': null;
129
- 'pyramid.home_path': null;
130
- 'pyramid.uacompat': null;
131
- 'lunkwill.summary': null;
132
- 'lunkwill.response': null;
133
- 'jsrealm.testentry': null;
134
- 'auth.login': null;
135
- 'auth.session_invite': null;
136
- 'auth.alink': {
137
- token: number;
138
- };
139
- 'auth.logout': null;
140
- 'auth.oauth': null;
141
- 'auth.settings': null;
142
- 'auth.user.browse': null;
143
- 'auth.user.create': null;
144
- 'auth.user.edit': {
145
- id: number;
146
- };
147
- 'auth.group.browse': null;
148
- 'auth.group.create': null;
149
- 'auth.group.edit': {
150
- id: number;
151
- };
152
- 'auth.user.collection': null;
153
- 'auth.user.item': {
154
- id: number;
155
- };
156
- 'auth.profile': null;
157
- 'auth.group.collection': null;
158
- 'auth.group.item': {
159
- id: number;
160
- };
161
- 'auth.current_user': null;
162
- 'auth.register': null;
163
- 'auth.login_cookies': null;
164
- 'auth.logout_cookies': null;
165
- 'resource.schema': null;
166
- 'resource.root': null;
167
- 'resource.show': {
168
- id: number;
169
- };
170
- 'resource.json': {
171
- id: number;
172
- };
173
- 'resource.effective_permissions': {
174
- id: number;
175
- };
176
- 'resource.export.page': {
177
- id: number;
178
- };
179
- 'resource.widget': null;
180
- 'resource.create': {
181
- id: number;
182
- };
183
- 'resource.update': {
184
- id: number;
185
- };
186
- 'resource.delete': {
187
- id: number;
188
- };
189
- 'resource.control_panel.resource_export': null;
190
- 'resource.blueprint': null;
191
- 'resource.item': {
192
- id: number;
193
- };
194
- 'resource.collection': null;
195
- 'resource.permission': {
196
- id: number;
197
- };
198
- 'resource.permission.explain': {
199
- id: number;
200
- };
201
- 'resource.volume': {
202
- id: number;
203
- };
204
- 'resource.quota': null;
205
- 'resource.search': null;
206
- 'resource.quota_check': null;
207
- 'resource.resource_export': null;
208
- 'resource.export': {
209
- id: number;
210
- };
211
- 'resource.file_download': {
212
- id: number;
213
- name: number;
214
- };
215
- 'resource.preview': {
216
- id: number;
217
- };
218
- 'srs.browse': null;
219
- 'srs.create': null;
220
- 'srs.edit': {
221
- id: number;
222
- };
223
- 'srs.catalog': null;
224
- 'srs.catalog.import': {
225
- id: number;
226
- };
227
- 'spatial_ref_sys.collection': null;
228
- 'spatial_ref_sys.convert': null;
229
- 'spatial_ref_sys.geom_transform.batch': null;
230
- 'spatial_ref_sys.geom_transform': {
231
- id: number;
232
- };
233
- 'spatial_ref_sys.geom_length': {
234
- id: number;
235
- };
236
- 'spatial_ref_sys.geom_area': {
237
- id: number;
238
- };
239
- 'spatial_ref_sys.item': {
240
- id: number;
241
- };
242
- 'spatial_ref_sys.catalog.collection': null;
243
- 'spatial_ref_sys.catalog.item': {
244
- id: number;
245
- };
246
- 'spatial_ref_sys.catalog.import': null;
247
- 'layer.extent': {
248
- id: number;
249
- };
250
- 'layer_preview.map': {
251
- id: number;
252
- };
253
- 'feature_layer.export_multiple': null;
254
- 'feature_layer.feature.browse': {
255
- id: number;
256
- };
257
- 'feature_layer.feature.show': {
258
- id: number;
259
- feature_id: number;
260
- };
261
- 'feature_layer.feature.update': {
262
- id: number;
263
- feature_id: number;
264
- };
265
- 'feature_layer.field': {
266
- id: number;
267
- };
268
- 'feature_layer.test_mvt': null;
269
- 'feature_layer.geojson': {
270
- id: number;
271
- };
272
- 'feature_layer.export': null;
273
- 'feature_layer.mvt': null;
274
- 'feature_layer.feature.item': {
275
- id: number;
276
- fid: number;
277
- };
278
- 'feature_layer.feature.item_extent': {
279
- id: number;
280
- fid: number;
281
- };
282
- 'feature_layer.feature.geometry_info': {
283
- id: number;
284
- fid: number;
285
- };
286
- 'feature_layer.feature.collection': {
287
- id: number;
288
- };
289
- 'feature_layer.feature.count': {
290
- id: number;
291
- };
292
- 'feature_layer.feature.extent': {
293
- id: number;
294
- };
295
- 'feature_layer.store': {
296
- id: number;
297
- };
298
- 'feature_layer.identify': null;
299
- 'feature_description.export': {
300
- id: number;
301
- };
302
- 'feature_attachment.download': {
303
- id: number;
304
- fid: number;
305
- aid: number;
306
- };
307
- 'feature_attachment.image': {
308
- id: number;
309
- fid: number;
310
- aid: number;
311
- };
312
- 'feature_attachment.item': {
313
- id: number;
314
- fid: number;
315
- aid: number;
316
- };
317
- 'feature_attachment.collection': {
318
- id: number;
319
- fid: number;
320
- };
321
- 'feature_attachment.export': {
322
- id: number;
323
- };
324
- 'feature_attachment.import': {
325
- id: number;
326
- };
327
- 'feature_attachment.page': {
328
- id: number;
329
- };
330
- 'render.tile': null;
331
- 'render.image': null;
332
- 'render.tile_cache.seed_status': {
333
- id: number;
334
- };
335
- 'render.legend': {
336
- id: number;
337
- };
338
- 'render.legend_symbols': {
339
- id: number;
340
- };
341
- 'webmap.annotation.collection': {
342
- id: number;
343
- };
344
- 'webmap.annotation.item': {
345
- id: number;
346
- annotation_id: number;
347
- };
348
- 'webmap.print': null;
349
- 'webmap.settings': null;
350
- 'webmap.extent': {
351
- id: number;
352
- };
353
- 'webmap.display': {
354
- id: number;
355
- };
356
- 'webmap.display.tiny': {
357
- id: number;
358
- };
359
- 'webmap.preview_embedded': null;
360
- 'webmap.clone': {
361
- id: number;
362
- };
363
- 'webmap.control_panel.settings': null;
364
- 'vector_layer.dataset': null;
365
- 'postgis.connection.inspect': {
366
- id: number;
367
- };
368
- 'postgis.connection.inspect.table': {
369
- id: number;
370
- table_name: number;
371
- };
372
- 'postgis.diagnostics': null;
373
- 'postgis.diagnostics_page': {
374
- id: number;
375
- };
376
- 'raster_layer.cog': {
377
- id: number;
378
- };
379
- 'raster_layer.download': {
380
- id: number;
381
- };
382
- 'wfsserver.wfs': {
383
- id: number;
384
- };
385
- 'wmsserver.wms': {
386
- id: number;
387
- };
388
- 'ogcfserver.landing_page': {
389
- id: number;
390
- };
391
- 'ogcfserver.openapi': {
392
- id: number;
393
- };
394
- 'ogcfserver.conformance': {
395
- id: number;
396
- };
397
- 'ogcfserver.collections': {
398
- id: number;
399
- };
400
- 'ogcfserver.collection': {
401
- id: number;
402
- collection_id: number;
403
- };
404
- 'ogcfserver.items': {
405
- id: number;
406
- collection_id: number;
407
- };
408
- 'ogcfserver.item': {
409
- id: number;
410
- collection_id: number;
411
- item_id: number;
412
- };
413
- 'tmsclient.connection.layers': {
414
- id: number;
415
- };
416
- 'file_upload.upload': null;
417
- 'file_upload.collection': null;
418
- 'file_upload.item': {
419
- id: number;
420
- };
421
- 'cadaster.settings': null;
422
- 'cadaster.enabled': null;
423
- 'cadaster.pkk_by_position': null;
424
- 'cadaster.pkk_by_id': null;
425
- 'pyramid.control_panel.cadaster': null;
426
- 'collector.user.browse': null;
427
- 'collector.user.create': null;
428
- 'collector.user.edit': {
429
- id: number;
430
- };
431
- 'collector.resource.users': {
432
- id: number;
433
- };
434
- 'collector.resource.read': {
435
- id: number;
436
- };
437
- 'collector.settings': null;
438
- 'collector.user.collection': null;
439
- 'collector.user.item': {
440
- user_id: number;
441
- };
442
- 'collector.user.limit': null;
443
- 'old.collector.user': {
444
- user_id: number;
445
- };
446
- 'collector.settings.users': null;
447
- 'demo.project': null;
448
- 'demo.project.preview': {
449
- identity: number;
450
- lang: number;
451
- };
452
- 'demo.select': null;
453
- 'demo.redirect': {
454
- project: number;
455
- };
456
- 'formbuilder.formbuilder_form_ngfp': {
457
- id: number;
458
- };
459
- 'nimbo.config': null;
460
- 'ngwcluster.schema': null;
461
- 'ngwcluster.config': null;
462
- 'ngwcluster.usage': null;
463
- 'ngwcluster.qgis_banner': null;
464
- 'ngwcluster.plan_and_features': null;
465
- 'qgis.style_qml': {
466
- id: number;
467
- };
468
- 'pyramid.control_panel.tracker': null;
469
- 'tracker.reports': null;
470
- 'tracker.reports.build': null;
471
- 'tracker.settings': null;
472
- 'tracker.receive_packet': {
473
- unique_id: number;
474
- };
475
- 'tracker.get_trackers': null;
476
- 'tracker.get_tracker_points': null;
477
- 'tracker.get_short_tracks': null;
478
- 'tracker.get_full_tracks': null;
479
- 'tracker.get_tracker_last_points': null;
480
- 'tracker.get_tracker_lines': null;
481
- 'tracker.get_last_activity_tracker': null;
482
- 'tracker.get_stops': null;
483
- 'tracker.get_device_types': null;
484
- 'tracker.export_to_gpx': null;
332
+ 'pyramid.static': {
333
+ skey: number;
334
+ };
335
+ 'pyramid.openapi_json': null;
336
+ 'pyramid.openapi_json_test': null;
337
+ 'pyramid.swagger': null;
338
+ 'pyramid.control_panel': null;
339
+ 'pyramid.control_panel.sysinfo': null;
340
+ 'pyramid.control_panel.storage': null;
341
+ 'pyramid.control_panel.backup.browse': null;
342
+ 'pyramid.control_panel.backup.download': {
343
+ filename: number;
344
+ };
345
+ 'pyramid.control_panel.cors': null;
346
+ 'pyramid.control_panel.custom_css': null;
347
+ 'pyramid.control_panel.logo': null;
348
+ 'pyramid.control_panel.system_name': null;
349
+ 'pyramid.control_panel.home_path': null;
350
+ 'pyramid.locale': {
351
+ locale: number;
352
+ };
353
+ 'pyramid.test_request': null;
354
+ 'pyramid.test_exception_handled': null;
355
+ 'pyramid.test_exception_unhandled': null;
356
+ 'pyramid.test_exception_transaction': null;
357
+ 'pyramid.test_timeout': null;
358
+ 'pyramid.cors': null;
359
+ 'pyramid.system_name': null;
360
+ 'pyramid.settings': null;
361
+ 'pyramid.route': null;
362
+ 'pyramid.pkg_version': null;
363
+ 'pyramid.healthcheck': null;
364
+ 'pyramid.statistics': null;
365
+ 'pyramid.estimate_storage': null;
366
+ 'pyramid.storage_status': null;
367
+ 'pyramid.storage': null;
368
+ 'pyramid.kind_of_data': null;
369
+ 'pyramid.custom_css': null;
370
+ 'pyramid.logo': null;
371
+ 'pyramid.company_logo': null;
372
+ 'pyramid.home_path': null;
373
+ 'pyramid.uacompat': null;
374
+ 'lunkwill.summary': null;
375
+ 'lunkwill.response': null;
376
+ 'jsrealm.testentry': null;
377
+ 'auth.login': null;
378
+ 'auth.session_invite': null;
379
+ 'auth.alink': {
380
+ token: number;
381
+ };
382
+ 'auth.logout': null;
383
+ 'auth.oauth': null;
384
+ 'auth.settings': null;
385
+ 'auth.user.browse': null;
386
+ 'auth.user.create': null;
387
+ 'auth.user.edit': {
388
+ id: number;
389
+ };
390
+ 'auth.group.browse': null;
391
+ 'auth.group.create': null;
392
+ 'auth.group.edit': {
393
+ id: number;
394
+ };
395
+ 'auth.user.collection': null;
396
+ 'auth.user.item': {
397
+ id: number;
398
+ };
399
+ 'auth.profile': null;
400
+ 'auth.group.collection': null;
401
+ 'auth.group.item': {
402
+ id: number;
403
+ };
404
+ 'auth.current_user': null;
405
+ 'auth.register': null;
406
+ 'auth.login_cookies': null;
407
+ 'auth.logout_cookies': null;
408
+ 'resource.schema': null;
409
+ 'resource.root': null;
410
+ 'resource.show': {
411
+ id: number;
412
+ };
413
+ 'resource.json': {
414
+ id: number;
415
+ };
416
+ 'resource.effective_permissions': {
417
+ id: number;
418
+ };
419
+ 'resource.export.page': {
420
+ id: number;
421
+ };
422
+ 'resource.widget': null;
423
+ 'resource.create': {
424
+ id: number;
425
+ };
426
+ 'resource.update': {
427
+ id: number;
428
+ };
429
+ 'resource.delete': {
430
+ id: number;
431
+ };
432
+ 'resource.control_panel.resource_export': null;
433
+ 'resource.blueprint': null;
434
+ 'resource.item': {
435
+ id: number;
436
+ };
437
+ 'resource.collection': null;
438
+ 'resource.permission': {
439
+ id: number;
440
+ };
441
+ 'resource.permission.explain': {
442
+ id: number;
443
+ };
444
+ 'resource.volume': {
445
+ id: number;
446
+ };
447
+ 'resource.quota': null;
448
+ 'resource.search': null;
449
+ 'resource.quota_check': null;
450
+ 'resource.resource_export': null;
451
+ 'resource.export': {
452
+ id: number;
453
+ };
454
+ 'resource.file_download': {
455
+ id: number;
456
+ name: number;
457
+ };
458
+ 'resource.preview': {
459
+ id: number;
460
+ };
461
+ 'srs.browse': null;
462
+ 'srs.create': null;
463
+ 'srs.edit': {
464
+ id: number;
465
+ };
466
+ 'srs.catalog': null;
467
+ 'srs.catalog.import': {
468
+ id: number;
469
+ };
470
+ 'spatial_ref_sys.collection': null;
471
+ 'spatial_ref_sys.convert': null;
472
+ 'spatial_ref_sys.geom_transform.batch': null;
473
+ 'spatial_ref_sys.geom_transform': {
474
+ id: number;
475
+ };
476
+ 'spatial_ref_sys.geom_length': {
477
+ id: number;
478
+ };
479
+ 'spatial_ref_sys.geom_area': {
480
+ id: number;
481
+ };
482
+ 'spatial_ref_sys.item': {
483
+ id: number;
484
+ };
485
+ 'spatial_ref_sys.catalog.collection': null;
486
+ 'spatial_ref_sys.catalog.item': {
487
+ id: number;
488
+ };
489
+ 'spatial_ref_sys.catalog.import': null;
490
+ 'layer.extent': {
491
+ id: number;
492
+ };
493
+ 'layer_preview.map': {
494
+ id: number;
495
+ };
496
+ 'feature_layer.export_multiple': null;
497
+ 'feature_layer.feature.browse': {
498
+ id: number;
499
+ };
500
+ 'feature_layer.feature.show': {
501
+ id: number;
502
+ feature_id: number;
503
+ };
504
+ 'feature_layer.feature.update': {
505
+ id: number;
506
+ feature_id: number;
507
+ };
508
+ 'feature_layer.field': {
509
+ id: number;
510
+ };
511
+ 'feature_layer.test_mvt': null;
512
+ 'feature_layer.geojson': {
513
+ id: number;
514
+ };
515
+ 'feature_layer.export': null;
516
+ 'feature_layer.mvt': null;
517
+ 'feature_layer.feature.item': {
518
+ id: number;
519
+ fid: number;
520
+ };
521
+ 'feature_layer.feature.item_extent': {
522
+ id: number;
523
+ fid: number;
524
+ };
525
+ 'feature_layer.feature.geometry_info': {
526
+ id: number;
527
+ fid: number;
528
+ };
529
+ 'feature_layer.feature.collection': {
530
+ id: number;
531
+ };
532
+ 'feature_layer.feature.count': {
533
+ id: number;
534
+ };
535
+ 'feature_layer.feature.extent': {
536
+ id: number;
537
+ };
538
+ 'feature_layer.store': {
539
+ id: number;
540
+ };
541
+ 'feature_layer.identify': null;
542
+ 'feature_description.export': {
543
+ id: number;
544
+ };
545
+ 'feature_attachment.download': {
546
+ id: number;
547
+ fid: number;
548
+ aid: number;
549
+ };
550
+ 'feature_attachment.image': {
551
+ id: number;
552
+ fid: number;
553
+ aid: number;
554
+ };
555
+ 'feature_attachment.item': {
556
+ id: number;
557
+ fid: number;
558
+ aid: number;
559
+ };
560
+ 'feature_attachment.collection': {
561
+ id: number;
562
+ fid: number;
563
+ };
564
+ 'feature_attachment.export': {
565
+ id: number;
566
+ };
567
+ 'feature_attachment.import': {
568
+ id: number;
569
+ };
570
+ 'feature_attachment.page': {
571
+ id: number;
572
+ };
573
+ 'render.tile': null;
574
+ 'render.image': null;
575
+ 'render.tile_cache.seed_status': {
576
+ id: number;
577
+ };
578
+ 'render.legend': {
579
+ id: number;
580
+ };
581
+ 'render.legend_symbols': {
582
+ id: number;
583
+ };
584
+ 'webmap.annotation.collection': {
585
+ id: number;
586
+ };
587
+ 'webmap.annotation.item': {
588
+ id: number;
589
+ annotation_id: number;
590
+ };
591
+ 'webmap.print': null;
592
+ 'webmap.settings': null;
593
+ 'webmap.extent': {
594
+ id: number;
595
+ };
596
+ 'webmap.display': {
597
+ id: number;
598
+ };
599
+ 'webmap.display.tiny': {
600
+ id: number;
601
+ };
602
+ 'webmap.preview_embedded': null;
603
+ 'webmap.clone': {
604
+ id: number;
605
+ };
606
+ 'webmap.control_panel.settings': null;
607
+ 'vector_layer.dataset': null;
608
+ 'postgis.connection.inspect': {
609
+ id: number;
610
+ };
611
+ 'postgis.connection.inspect.table': {
612
+ id: number;
613
+ table_name: number;
614
+ };
615
+ 'postgis.diagnostics': null;
616
+ 'postgis.diagnostics_page': {
617
+ id: number;
618
+ };
619
+ 'raster_layer.cog': {
620
+ id: number;
621
+ };
622
+ 'raster_layer.download': {
623
+ id: number;
624
+ };
625
+ 'wfsserver.wfs': {
626
+ id: number;
627
+ };
628
+ 'wmsserver.wms': {
629
+ id: number;
630
+ };
631
+ 'ogcfserver.landing_page': {
632
+ id: number;
633
+ };
634
+ 'ogcfserver.openapi': {
635
+ id: number;
636
+ };
637
+ 'ogcfserver.conformance': {
638
+ id: number;
639
+ };
640
+ 'ogcfserver.collections': {
641
+ id: number;
642
+ };
643
+ 'ogcfserver.collection': {
644
+ id: number;
645
+ collection_id: number;
646
+ };
647
+ 'ogcfserver.items': {
648
+ id: number;
649
+ collection_id: number;
650
+ };
651
+ 'ogcfserver.item': {
652
+ id: number;
653
+ collection_id: number;
654
+ item_id: number;
655
+ };
656
+ 'tmsclient.connection.layers': {
657
+ id: number;
658
+ };
659
+ 'file_upload.upload': null;
660
+ 'file_upload.collection': null;
661
+ 'file_upload.item': {
662
+ id: number;
663
+ };
664
+ 'cadaster.settings': null;
665
+ 'cadaster.enabled': null;
666
+ 'cadaster.pkk_by_position': null;
667
+ 'cadaster.pkk_by_id': null;
668
+ 'pyramid.control_panel.cadaster': null;
669
+ 'collector.user.browse': null;
670
+ 'collector.user.create': null;
671
+ 'collector.user.edit': {
672
+ id: number;
673
+ };
674
+ 'collector.resource.users': {
675
+ id: number;
676
+ };
677
+ 'collector.resource.read': {
678
+ id: number;
679
+ };
680
+ 'collector.settings': null;
681
+ 'collector.user.collection': null;
682
+ 'collector.user.item': {
683
+ user_id: number;
684
+ };
685
+ 'collector.user.limit': null;
686
+ 'old.collector.user': {
687
+ user_id: number;
688
+ };
689
+ 'collector.settings.users': null;
690
+ 'demo.project': null;
691
+ 'demo.project.preview': {
692
+ identity: number;
693
+ lang: number;
694
+ };
695
+ 'demo.select': null;
696
+ 'demo.redirect': {
697
+ project: number;
698
+ };
699
+ 'formbuilder.formbuilder_form_ngfp': {
700
+ id: number;
701
+ };
702
+ 'nimbo.config': null;
703
+ 'ngwcluster.schema': null;
704
+ 'ngwcluster.config': null;
705
+ 'ngwcluster.usage': null;
706
+ 'ngwcluster.qgis_banner': null;
707
+ 'ngwcluster.plan_and_features': null;
708
+ 'qgis.style_qml': {
709
+ id: number;
710
+ };
711
+ 'pyramid.control_panel.tracker': null;
712
+ 'tracker.reports': null;
713
+ 'tracker.reports.build': null;
714
+ 'tracker.settings': null;
715
+ 'tracker.receive_packet': {
716
+ unique_id: number;
717
+ };
718
+ 'tracker.get_trackers': null;
719
+ 'tracker.get_tracker_points': null;
720
+ 'tracker.get_short_tracks': null;
721
+ 'tracker.get_full_tracks': null;
722
+ 'tracker.get_tracker_last_points': null;
723
+ 'tracker.get_tracker_lines': null;
724
+ 'tracker.get_last_activity_tracker': null;
725
+ 'tracker.get_stops': null;
726
+ 'tracker.get_device_types': null;
727
+ 'tracker.export_to_gpx': null;
485
728
  }
486
729
 
487
730
  interface TreeItem {
488
- item_type: 'root' | 'group' | 'layer';
489
- display_name?: string;
490
- id?: number;
491
- _layer?: any;
492
- _parent?: TreeGroup;
731
+ item_type: 'root' | 'group' | 'layer';
732
+ display_name?: string;
733
+ id?: number;
734
+ _layer?: any;
735
+ _parent?: TreeGroup;
493
736
  }
494
737
  interface TreeGroup extends TreeItem {
495
- item_type: 'root' | 'group';
496
- group_expanded?: boolean;
497
- children: Array<TreeLayer | TreeGroup>;
738
+ item_type: 'root' | 'group';
739
+ group_expanded?: boolean;
740
+ children: Array<TreeLayer | TreeGroup>;
498
741
  }
499
742
  interface TreeLayer extends TreeItem {
500
- item_type: 'layer';
501
- layer_adapter: string;
502
- layer_enabled: boolean;
503
- draw_order_position: number;
504
- layer_max_scale_denom?: number;
505
- layer_min_scale_denom?: number;
506
- layer_style_id: number;
507
- style_parent_id: number;
508
- layer_transparency: number;
509
- layer_identifiable: boolean;
743
+ item_type: 'layer';
744
+ layer_adapter: string;
745
+ layer_enabled: boolean;
746
+ draw_order_position: number;
747
+ layer_max_scale_denom?: number;
748
+ layer_min_scale_denom?: number;
749
+ layer_style_id: number;
750
+ style_parent_id: number;
751
+ layer_transparency: number;
752
+ layer_identifiable: boolean;
510
753
  }
511
754
  interface Permission {
512
- action: string;
513
- principal: {
514
- id: number;
515
- };
516
- identity: string;
517
- scope: string;
518
- permission: string;
519
- propagate: boolean;
520
- }
521
- type ResourceCls = 'resource_group' | 'postgis_layer' | 'wmsserver_service' | 'basemap_layer' | 'postgis_connection' | 'webmap' | 'wfsserver_service' | 'vector_layer' | 'raster_layer' | 'mapserver_style' | 'qgis_vector_style' | 'qgis_raster_style' | 'raster_style' | 'file_bucket' | 'lookup_table' | 'wmsclient_layer' | 'wmsclient_connection' | 'formbuilder_form' | 'file_bucket' | 'svg_marker_library' | 'ogcfserver_service' | 'tmsclient_connection' | 'tileset' | 'collector_project' | 'demo_project' | 'trackers_group' | 'tracker' | 'terrain_provider' | 'model_3d' | 'tmsclient_layer';
522
- interface ResourceHierarchy {
755
+ action: string;
756
+ principal: {
523
757
  id: number;
524
- parent: {
525
- id: any;
526
- };
758
+ };
759
+ identity: string;
760
+ scope: string;
761
+ permission: string;
762
+ propagate: boolean;
763
+ }
764
+ type ResourceCls =
765
+ | 'resource_group'
766
+ | 'postgis_layer'
767
+ | 'wmsserver_service'
768
+ | 'basemap_layer'
769
+ | 'postgis_connection'
770
+ | 'webmap'
771
+ | 'wfsserver_service'
772
+ | 'vector_layer'
773
+ | 'raster_layer'
774
+ | 'mapserver_style'
775
+ | 'qgis_vector_style'
776
+ | 'qgis_raster_style'
777
+ | 'raster_style'
778
+ | 'file_bucket'
779
+ | 'lookup_table'
780
+ | 'wmsclient_layer'
781
+ | 'wmsclient_connection'
782
+ | 'formbuilder_form'
783
+ | 'file_bucket'
784
+ | 'svg_marker_library'
785
+ | 'ogcfserver_service'
786
+ | 'tmsclient_connection'
787
+ | 'tileset'
788
+ | 'collector_project'
789
+ | 'demo_project'
790
+ | 'trackers_group'
791
+ | 'tracker'
792
+ | 'terrain_provider'
793
+ | 'model_3d'
794
+ | 'tmsclient_layer';
795
+ interface ResourceHierarchy {
796
+ id: number;
797
+ parent: {
798
+ id: any;
799
+ };
527
800
  }
528
801
  interface Resource {
529
- cls: ResourceCls;
530
- id: number;
531
- parent: {
532
- id: number;
533
- };
534
- owner_user: {
535
- id: number;
536
- };
537
- permissions: Permission[];
538
- keyname?: string | null;
539
- display_name: string;
540
- description?: string | null;
541
- children: boolean;
542
- interfaces: any[];
543
- scopes: string[];
802
+ cls: ResourceCls;
803
+ id: number;
804
+ parent: {
805
+ id: number;
806
+ };
807
+ owner_user: {
808
+ id: number;
809
+ };
810
+ permissions: Permission[];
811
+ keyname?: string | null;
812
+ display_name: string;
813
+ description?: string | null;
814
+ children: boolean;
815
+ interfaces: any[];
816
+ scopes: string[];
544
817
  }
545
818
  interface BookmarkProperties {
546
- name: string;
547
- place: string;
819
+ name: string;
820
+ place: string;
548
821
  }
549
822
  interface NgwDateFormat {
550
- year: number;
551
- month: number;
552
- day: number;
823
+ year: number;
824
+ month: number;
825
+ day: number;
553
826
  }
554
827
  interface NgwTimeFormat {
555
- hour: number;
556
- minute: number;
557
- second: number;
828
+ hour: number;
829
+ minute: number;
830
+ second: number;
558
831
  }
559
832
  type NgwDateTimeFormat = NgwDateFormat & NgwTimeFormat;
560
833
  interface WebmapResource {
561
- extent_left: number;
562
- extent_right: number;
563
- extent_bottom: number;
564
- extent_top: number;
565
- extent_constrained: boolean;
566
- draw_order_enabled: boolean;
567
- bookmark_resource: ResourceHierarchy;
568
- root_item: TreeGroup;
834
+ extent_left: number;
835
+ extent_right: number;
836
+ extent_bottom: number;
837
+ extent_top: number;
838
+ extent_constrained: boolean;
839
+ draw_order_enabled: boolean;
840
+ bookmark_resource: ResourceHierarchy;
841
+ root_item: TreeGroup;
569
842
  }
570
843
  interface BasemapResource {
571
- url: string;
572
- /**
573
- * Parse to qms-kit.BasemapQms
574
- */
575
- qms: string;
844
+ url: string;
845
+ /**
846
+ * Parse to qms-kit.BasemapQms
847
+ */
848
+ qms: string;
576
849
  }
577
850
  interface BasemapWebmapItem {
578
- resource_id: number;
579
- display_name: string;
580
- position?: number;
581
- enabled?: boolean;
582
- opacity?: number;
851
+ resource_id: number;
852
+ display_name: string;
853
+ position?: number;
854
+ enabled?: boolean;
855
+ opacity?: number;
583
856
  }
584
857
  interface BasemapWebmap {
585
- basemaps: BasemapWebmapItem[];
858
+ basemaps: BasemapWebmapItem[];
586
859
  }
587
860
  interface LookupTableResource {
588
- items: Record<string, string>;
589
- }
590
- type VectorFieldDatatype = 'STRING' | 'REAL' | 'DATE' | 'TIME' | 'DATETIME' | 'BIGINT' | 'INTEGER' | 'BOOLEAN';
861
+ items: Record<string, string>;
862
+ }
863
+ type VectorFieldDatatype =
864
+ | 'STRING'
865
+ | 'REAL'
866
+ | 'DATE'
867
+ | 'TIME'
868
+ | 'DATETIME'
869
+ | 'BIGINT'
870
+ | 'INTEGER'
871
+ | 'BOOLEAN';
591
872
  /** @deprecated - use {@link VectorFieldDatatype} instead */
592
873
  type ResourceItemDatatype = VectorFieldDatatype;
593
874
  interface FeatureLayerField {
594
- datatype: VectorFieldDatatype;
595
- display_name: string;
596
- grid_visibility: boolean;
597
- id: number;
598
- keyname: string;
599
- label_field: boolean;
600
- typemod?: unknown;
875
+ datatype: VectorFieldDatatype;
876
+ display_name: string;
877
+ grid_visibility: boolean;
878
+ id: number;
879
+ keyname: string;
880
+ label_field: boolean;
881
+ typemod?: unknown;
601
882
  }
602
883
  interface FeatureResource {
603
- fields: FeatureLayerField[];
604
- }
605
- type GeometryType = 'POINT' | 'LINESTRING' | 'POLYGON' | 'MULTIPOINT' | 'MULTILINESTRING' | 'MULTIPOLYGON' | 'POINTZ' | 'LINESTRINGZ' | 'POLYGONZ' | 'MULTIPOINTZ' | 'MULTILINESTRINGZ' | 'MULTIPOLYGONZ';
884
+ fields: FeatureLayerField[];
885
+ }
886
+ type GeometryType =
887
+ | 'POINT'
888
+ | 'LINESTRING'
889
+ | 'POLYGON'
890
+ | 'MULTIPOINT'
891
+ | 'MULTILINESTRING'
892
+ | 'MULTIPOLYGON'
893
+ | 'POINTZ'
894
+ | 'LINESTRINGZ'
895
+ | 'POLYGONZ'
896
+ | 'MULTIPOINTZ'
897
+ | 'MULTILINESTRINGZ'
898
+ | 'MULTIPOLYGONZ';
606
899
  interface VectorLayer {
607
- srs: {
608
- id: number;
609
- };
610
- geometry_type: GeometryType;
900
+ srs: {
901
+ id: number;
902
+ };
903
+ geometry_type: GeometryType;
611
904
  }
612
905
  interface FileBucket {
613
- files: NgwFile[];
614
- tstamp?: any;
615
- main_tileset?: string;
906
+ files: NgwFile[];
907
+ tstamp?: any;
908
+ main_tileset?: string;
616
909
  }
617
910
  interface WmsServerService {
618
- /**
619
- * Array or WMS service layers. keyname, display_name and resource_id are mandatory.
620
- */
621
- layers: WmsServerServiceLayer[];
911
+ /**
912
+ * Array or WMS service layers. keyname, display_name and resource_id are mandatory.
913
+ */
914
+ layers: WmsServerServiceLayer[];
622
915
  }
623
916
  interface WmsClientLayer {
624
- /** WMS connection. */
625
- connection: {
626
- id: number;
627
- };
628
- srs: {
629
- id: number;
630
- };
631
- /**
632
- * Image format. Available values can fetched from WMS connection ('image/png').
633
- */
634
- imgformat: string;
635
- /**
636
- * String with layer identifiers separated with comma. Available layers can fetched from WMS connection.
637
- */
638
- wmslayers: string;
639
- /** Additional parameters added to each request. This is key and value list. */
640
- vendor_params: Record<string, string>;
917
+ /** WMS connection. */
918
+ connection: {
919
+ id: number;
920
+ };
921
+ srs: {
922
+ id: number;
923
+ };
924
+ /**
925
+ * Image format. Available values can fetched from WMS connection ('image/png').
926
+ */
927
+ imgformat: string;
928
+ /**
929
+ * String with layer identifiers separated with comma. Available layers can fetched from WMS connection.
930
+ */
931
+ wmslayers: string;
932
+ /** Additional parameters added to each request. This is key and value list. */
933
+ vendor_params: Record<string, string>;
641
934
  }
642
935
  interface WmsClientConnection {
643
- /** WMS service url */
644
- url: string;
645
- /** User name to connect to service */
646
- username?: string;
647
- /** Password to connect to service */
648
- password?: string;
649
- /** WMS version */
650
- version?: string;
651
- /** If equal query - query capabilities from service */
652
- capcache?: string;
936
+ /** WMS service url */
937
+ url: string;
938
+ /** User name to connect to service */
939
+ username?: string;
940
+ /** Password to connect to service */
941
+ password?: string;
942
+ /** WMS version */
943
+ version?: string;
944
+ /** If equal query - query capabilities from service */
945
+ capcache?: string;
653
946
  }
654
947
  interface WmsServerServiceLayer {
655
- /**
656
- * Key name for WMS service item. Name may be only ASCII symbols without spaces.
657
- * */
658
- keyname: string;
659
- /**
660
- * Service item name.
661
- * */
662
- display_name: string;
663
- /**
664
- * Resource identifier which will be WMS layer datasource. Supported types are: vector layer style, raster style, WMS layer.
665
- * */
666
- resource_id: number;
667
- /**
668
- * Minimum scale to show WMS layer. String in form of `1 : 100000`.
669
- */
670
- min_scale_denom?: string | null;
671
- /**
672
- * Maximum scale to show WMS layer. String in form of `1 : 100000`.
673
- */
674
- max_scale_denom?: string | null;
948
+ /**
949
+ * Key name for WMS service item. Name may be only ASCII symbols without spaces.
950
+ * */
951
+ keyname: string;
952
+ /**
953
+ * Service item name.
954
+ * */
955
+ display_name: string;
956
+ /**
957
+ * Resource identifier which will be WMS layer datasource. Supported types are: vector layer style, raster style, WMS layer.
958
+ * */
959
+ resource_id: number;
960
+ /**
961
+ * Minimum scale to show WMS layer. String in form of `1 : 100000`.
962
+ */
963
+ min_scale_denom?: string | null;
964
+ /**
965
+ * Maximum scale to show WMS layer. String in form of `1 : 100000`.
966
+ */
967
+ max_scale_denom?: string | null;
675
968
  }
676
969
  interface NgwFile {
677
- name: string;
678
- mime_type: string;
679
- size: number;
970
+ name: string;
971
+ mime_type: string;
972
+ size: number;
680
973
  }
681
974
  interface Resmeta {
682
- items: Record<string, any>;
975
+ items: Record<string, any>;
683
976
  }
684
977
  interface ResourceItemMain {
685
- resource: Resource;
686
- resmeta: Resmeta;
978
+ resource: Resource;
979
+ resmeta: Resmeta;
687
980
  }
688
981
  interface ResourceItem extends ResourceItemMain {
689
- [cls: string]: any;
690
- webmap?: WebmapResource;
691
- feature_layer?: FeatureResource;
692
- vector_layer?: VectorLayer;
693
- basemap_layer?: BasemapResource;
694
- basemap_webmap?: BasemapWebmap;
695
- lookup_table?: LookupTableResource;
696
- file_bucket?: FileBucket;
697
- wmsserver_service?: WmsServerService;
698
- wmsclient_layer?: WmsClientLayer;
699
- wmsclient_connection?: WmsClientConnection;
982
+ [cls: string]: any;
983
+ webmap?: WebmapResource;
984
+ feature_layer?: FeatureResource;
985
+ vector_layer?: VectorLayer;
986
+ basemap_layer?: BasemapResource;
987
+ basemap_webmap?: BasemapWebmap;
988
+ lookup_table?: LookupTableResource;
989
+ file_bucket?: FileBucket;
990
+ wmsserver_service?: WmsServerService;
991
+ wmsclient_layer?: WmsClientLayer;
992
+ wmsclient_connection?: WmsClientConnection;
700
993
  }
701
994
  interface VectorLayerResourceItem extends ResourceItemMain {
702
- vector_layer: VectorLayer;
703
- feature_layer: FeatureResource;
995
+ vector_layer: VectorLayer;
996
+ feature_layer: FeatureResource;
704
997
  }
705
998
 
706
999
  type ResourceStoreItemProperties = {
707
- [name: string]: any;
1000
+ [name: string]: any;
708
1001
  } | null;
709
- type ResourceStoreItem<P extends ResourceStoreItemProperties = ResourceStoreItemProperties> = ResourceStoreItemDefault & {
710
- data?: string;
1002
+ type ResourceStoreItem<
1003
+ P extends ResourceStoreItemProperties = ResourceStoreItemProperties,
1004
+ > = ResourceStoreItemDefault & {
1005
+ data?: string;
711
1006
  } & P;
712
1007
  interface ResourceStoreItemDefault {
713
- [field: string]: string | number | boolean | null | Date;
714
- id: number;
715
- label: string;
1008
+ [field: string]: string | number | boolean | null | Date;
1009
+ id: number;
1010
+ label: string;
716
1011
  }
717
1012
 
718
1013
  interface FileMeta {
719
- id: string;
720
- mime_type: string;
721
- name: string;
722
- size: number;
1014
+ id: string;
1015
+ mime_type: string;
1016
+ name: string;
1017
+ size: number;
723
1018
  }
724
1019
  interface NgwExtent {
725
- extent: {
726
- minLon: number;
727
- minLat: number;
728
- maxLon: number;
729
- maxLat: number;
730
- };
1020
+ extent: {
1021
+ minLon: number;
1022
+ minLat: number;
1023
+ maxLon: number;
1024
+ maxLat: number;
1025
+ };
731
1026
  }
732
1027
  interface SrsItem {
733
- auth_name: string;
734
- auth_srid: number;
735
- display_name: string;
736
- id: number;
737
- wkt: string;
1028
+ auth_name: string;
1029
+ auth_srid: number;
1030
+ display_name: string;
1031
+ id: number;
1032
+ wkt: string;
738
1033
  }
739
1034
  interface FeatureLayerCount {
740
- total_count: number;
1035
+ total_count: number;
741
1036
  }
742
1037
  type ResourceIdKeynameDef = string | number;
743
1038
  type ResourceDefinition = ResourceIdKeynameDef | DeepPartial<Resource>;
744
1039
  interface FileUploadResp {
745
- upload_meta: FileMeta[];
1040
+ upload_meta: FileMeta[];
746
1041
  }
747
1042
  interface PyramidSettingsPyramidCompanyLogo {
748
- link?: 'string';
749
- enabled: boolean;
1043
+ link?: 'string';
1044
+ enabled: boolean;
750
1045
  }
751
1046
  interface PyramidSettingsPyramid {
752
- support_url?: string;
753
- units: 'metric';
754
- degree_format: 'dd';
755
- measurement_srid: 4326;
756
- company_logo?: PyramidSettingsPyramidCompanyLogo;
1047
+ support_url?: string;
1048
+ units: 'metric';
1049
+ degree_format: 'dd';
1050
+ measurement_srid: 4326;
1051
+ company_logo?: PyramidSettingsPyramidCompanyLogo;
757
1052
  }
758
1053
  type PyramidSettings = PyramidSettingsPyramid | Record<string, any>;
759
1054
  interface PyramidRoute {
760
- [requestItemName: string]: [url: string, ...params: string[]];
1055
+ [requestItemName: string]: [url: string, ...params: string[]];
761
1056
  }
762
1057
  type Router = PyramidRoute;
763
1058
  type simple = string | number | boolean;
764
1059
  type cbParams = (params: Params) => simple;
765
1060
  interface Params {
766
- [name: string]: simple | cbParams;
1061
+ [name: string]: simple | cbParams;
767
1062
  }
768
1063
  type RequestItemKeys = {
769
- readonly [T in keyof RequestItemsParamsMap]?: any;
1064
+ readonly [T in keyof RequestItemsParamsMap]?: any;
770
1065
  };
771
1066
  interface RequestItemsResponseMap {
772
- GET: GetRequestItemsResponseMap;
773
- POST: PostRequestItemsResponseMap;
1067
+ GET: GetRequestItemsResponseMap;
1068
+ POST: PostRequestItemsResponseMap;
774
1069
  }
775
1070
  interface GetRequestItemsResponseMap extends RequestItemKeys {
776
- 'pyramid.route': PyramidRoute;
777
- 'pyramid.settings': PyramidSettings;
778
- 'resource.item': ResourceItem;
779
- 'resource.search': ResourceItem[];
780
- 'resource.child': any;
781
- 'resource.collection': ResourceItem[];
782
- 'file_upload.upload': FileUploadResp;
783
- 'layer.extent': NgwExtent;
784
- 'feature_layer.feature.item': FeatureItem;
785
- 'feature_layer.feature.collection': FeatureItem[];
786
- 'feature_layer.store': ResourceStoreItem[];
787
- 'feature_layer.field': FeatureLayerField[];
788
- 'feature_layer.feature.item_extent': NgwExtent;
789
- 'feature_layer.feature.count': FeatureLayerCount;
790
- 'pyramid.company_logo': string;
791
- 'spatial_ref_sys.collection': SrsItem[];
792
- 'render.legend_symbols': LegendItem[];
1071
+ 'pyramid.route': PyramidRoute;
1072
+ 'pyramid.settings': PyramidSettings;
1073
+ 'resource.item': ResourceItem;
1074
+ 'resource.search': ResourceItem[];
1075
+ 'resource.child': any;
1076
+ 'resource.collection': ResourceItem[];
1077
+ 'file_upload.upload': FileUploadResp;
1078
+ 'layer.extent': NgwExtent;
1079
+ 'feature_layer.feature.item': FeatureItem;
1080
+ 'feature_layer.feature.collection': FeatureItem[];
1081
+ 'feature_layer.store': ResourceStoreItem[];
1082
+ 'feature_layer.field': FeatureLayerField[];
1083
+ 'feature_layer.feature.item_extent': NgwExtent;
1084
+ 'feature_layer.feature.count': FeatureLayerCount;
1085
+ 'pyramid.company_logo': string;
1086
+ 'spatial_ref_sys.collection': SrsItem[];
1087
+ 'render.legend_symbols': LegendItem[];
793
1088
  }
794
1089
  interface IdOnly {
795
- id: number;
1090
+ id: number;
796
1091
  }
797
1092
  interface CreatedResource extends IdOnly {
798
- parent: IdOnly;
1093
+ parent: IdOnly;
799
1094
  }
800
1095
  interface PostRequestItemsResponseMap extends RequestItemKeys {
801
- 'resource.collection': CreatedResource;
802
- 'feature_layer.identify': FeatureLayersIdentify;
803
- 'file_upload.upload': FileUploadResp;
804
- 'feature_attachment.collection': IdOnly;
1096
+ 'resource.collection': CreatedResource;
1097
+ 'feature_layer.identify': FeatureLayersIdentify;
1098
+ 'file_upload.upload': FileUploadResp;
1099
+ 'feature_attachment.collection': IdOnly;
805
1100
  }
806
1101
  interface PatchRequestItemsResponseMap extends RequestItemKeys {
807
- 'feature_layer.feature.collection': IdOnly[];
1102
+ 'feature_layer.feature.collection': IdOnly[];
808
1103
  }
809
1104
  interface PutRequestItemsResponseMap extends RequestItemKeys {
810
- 'feature_layer.feature.item': IdOnly;
1105
+ 'feature_layer.feature.item': IdOnly;
811
1106
  }
812
1107
  interface DeleteRequestItemsResponseMap extends RequestItemKeys {
813
- 'feature_layer.feature.item': any;
1108
+ 'feature_layer.feature.item': any;
814
1109
  }
815
1110
  /**
816
1111
  * User credentials for authorization.
817
1112
  */
818
1113
  interface Credentials {
819
- /**
820
- * The login username for the user.
821
- */
822
- login: string;
823
- /**
824
- * The password for the user.
825
- */
826
- password: string;
827
- }
828
- type RequestTransformFunction = (url: string, options: RequestOptions) => [url: string, options: RequestOptions];
1114
+ /**
1115
+ * The login username for the user.
1116
+ */
1117
+ login: string;
1118
+ /**
1119
+ * The password for the user.
1120
+ */
1121
+ password: string;
1122
+ }
1123
+ type RequestTransformFunction = (
1124
+ url: string,
1125
+ options: RequestOptions,
1126
+ ) => [url: string, options: RequestOptions];
829
1127
  interface NgwConnectorOptions {
830
- /**
831
- * The base URL of the NextGIS Web (NGW) server.
832
- * Example: "https://demo.nextgis.com"
833
- */
834
- baseUrl?: string;
835
- /**
836
- * The API route path to use for requests.
837
- * If not specified, the default route "/api/component/pyramid/route" will be used.
838
- */
839
- route?: string;
840
- /**
841
- * User credentials for authorization in NGW.
842
- * These credentials will be used for authentication in NGW requests.
843
- */
844
- auth?: Credentials;
845
- /**
846
- * Indicates whether to include credentials such as cookies, authentication headers,
847
- * or TLS client certificates in cross-site Access-Control requests.
848
- * Setting this property ensures that cookies from another domain are used in the requests.
849
- * Note that setting this property has no effect on same-origin requests.
850
- */
851
- withCredentials?: boolean;
852
- /**
853
- * A function to transform the request before sending it.
854
- * This function can be used to modify the URL, headers, or other options.
855
- */
856
- requestTransform?: RequestTransformFunction;
857
- /**
858
- * Identifier for caching requests.
859
- * This can be used to segregate cached data for different connectors.
860
- */
861
- cacheId?: string;
1128
+ /**
1129
+ * The base URL of the NextGIS Web (NGW) server.
1130
+ * Example: "https://demo.nextgis.com"
1131
+ */
1132
+ baseUrl?: string;
1133
+ /**
1134
+ * The API route path to use for requests.
1135
+ * If not specified, the default route "/api/component/pyramid/route" will be used.
1136
+ */
1137
+ route?: string;
1138
+ /**
1139
+ * User credentials for authorization in NGW.
1140
+ * These credentials will be used for authentication in NGW requests.
1141
+ */
1142
+ auth?: Credentials;
1143
+ /**
1144
+ * Indicates whether to include credentials such as cookies, authentication headers,
1145
+ * or TLS client certificates in cross-site Access-Control requests.
1146
+ * Setting this property ensures that cookies from another domain are used in the requests.
1147
+ * Note that setting this property has no effect on same-origin requests.
1148
+ */
1149
+ withCredentials?: boolean;
1150
+ /**
1151
+ * A function to transform the request before sending it.
1152
+ * This function can be used to modify the URL, headers, or other options.
1153
+ */
1154
+ requestTransform?: RequestTransformFunction;
1155
+ /**
1156
+ * Identifier for caching requests.
1157
+ * This can be used to segregate cached data for different connectors.
1158
+ */
1159
+ cacheId?: string;
862
1160
  }
863
1161
  interface RequestHeaders {
864
- [header: string]: string | undefined;
865
- Authorization?: string;
866
- Accept?: string;
867
- 'Access-Control-Allow-Origin'?: string;
868
- 'Access-Control-Allow-Headers'?: string;
1162
+ [header: string]: string | undefined;
1163
+ Authorization?: string;
1164
+ Accept?: string;
1165
+ 'Access-Control-Allow-Origin'?: string;
1166
+ 'Access-Control-Allow-Headers'?: string;
869
1167
  }
870
1168
  type RequestMethods = 'POST' | 'GET' | 'PATCH' | 'DELETE' | 'PUT';
871
- type NgwExceptions = 'nextgisweb.resource.exception.ResourceNotFound' | 'nextgisweb.core.exception.InsufficientPermissions';
1169
+ type NgwExceptions =
1170
+ | 'nextgisweb.resource.exception.ResourceNotFound'
1171
+ | 'nextgisweb.core.exception.InsufficientPermissions';
872
1172
  interface BaseRequestOptions {
873
- cache?: boolean;
874
- signal?: AbortSignal;
1173
+ cache?: boolean;
1174
+ signal?: AbortSignal;
875
1175
  }
876
1176
  /**
877
1177
  * Options for configuring requests to NGW.
878
1178
  */
879
- interface RequestOptions<M extends RequestMethods = RequestMethods, K extends keyof RequestItemsParamsMap = keyof RequestItemsParamsMap> extends BaseRequestOptions {
880
- /**
881
- * Data to be sent as the request body.
882
- * Typically used with POST, PUT, or PATCH requests.
883
- */
884
- data?: any;
885
- /**
886
- * File to be sent in the request.
887
- */
888
- file?: File;
889
- /**
890
- * HTTP method to be used for the request.
891
- * Example: 'GET', 'POST', 'PUT', 'PATCH', 'DELETE'
892
- */
893
- method?: M;
894
- /**
895
- * HTTP headers to be included in the request.
896
- */
897
- headers?: RequestHeaders;
898
- /**
899
- * Indicates whether to include credentials such as cookies, authentication headers,
900
- * or TLS client certificates in cross-site Access-Control requests.
901
- */
902
- withCredentials?: boolean;
903
- /**
904
- * The type of data that the server will respond with.
905
- * Can be either 'json' or 'blob'.
906
- */
907
- responseType?: 'json' | 'blob';
908
- /**
909
- * Whether to cache the request.
910
- * When set to true, the response will be stored in the cache.
911
- */
912
- cache?: boolean;
913
- /**
914
- * Signal object that allows you to communicate with a DOM request (such as fetch) and abort it if desired via an AbortController.
915
- */
916
- signal?: AbortSignal;
917
- /**
918
- * Parameters to be included in the request URL.
919
- */
920
- params?: RequestItemsParams<K>;
921
- /**
922
- * A function to be called to monitor the progress of the request.
923
- * @param percentComplete - The percentage of the request that has been completed.
924
- * @param event - The progress event.
925
- */
926
- onProgress?: (percentComplete: number, event: ProgressEvent) => void;
927
- /**
928
- * Name to use for caching the request.
929
- */
930
- cacheName?: string;
931
- /**
932
- * Properties to override default cache behavior.
933
- */
934
- cacheProps?: Record<string, unknown>;
1179
+ interface RequestOptions<
1180
+ M extends RequestMethods = RequestMethods,
1181
+ K extends keyof RequestItemsParamsMap = keyof RequestItemsParamsMap,
1182
+ > extends BaseRequestOptions {
1183
+ /**
1184
+ * Data to be sent as the request body.
1185
+ * Typically used with POST, PUT, or PATCH requests.
1186
+ */
1187
+ data?: any;
1188
+ /**
1189
+ * File to be sent in the request.
1190
+ */
1191
+ file?: File;
1192
+ /**
1193
+ * HTTP method to be used for the request.
1194
+ * Example: 'GET', 'POST', 'PUT', 'PATCH', 'DELETE'
1195
+ */
1196
+ method?: M;
1197
+ /**
1198
+ * HTTP headers to be included in the request.
1199
+ */
1200
+ headers?: RequestHeaders;
1201
+ /**
1202
+ * Indicates whether to include credentials such as cookies, authentication headers,
1203
+ * or TLS client certificates in cross-site Access-Control requests.
1204
+ */
1205
+ withCredentials?: boolean;
1206
+ /**
1207
+ * The type of data that the server will respond with.
1208
+ * Can be either 'json' or 'blob'.
1209
+ */
1210
+ responseType?: 'json' | 'blob';
1211
+ /**
1212
+ * Whether to cache the request.
1213
+ * When set to true, the response will be stored in the cache.
1214
+ */
1215
+ cache?: boolean;
1216
+ /**
1217
+ * Signal object that allows you to communicate with a DOM request (such as fetch) and abort it if desired via an AbortController.
1218
+ */
1219
+ signal?: AbortSignal;
1220
+ /**
1221
+ * Parameters to be included in the request URL.
1222
+ */
1223
+ params?: RequestItemsParams<K>;
1224
+ /**
1225
+ * A function to be called to monitor the progress of the request.
1226
+ * @param percentComplete - The percentage of the request that has been completed.
1227
+ * @param event - The progress event.
1228
+ */
1229
+ onProgress?: (percentComplete: number, event: ProgressEvent) => void;
1230
+ /**
1231
+ * Name to use for caching the request.
1232
+ */
1233
+ cacheName?: string;
1234
+ /**
1235
+ * Properties to override default cache behavior.
1236
+ */
1237
+ cacheProps?: Record<string, unknown>;
935
1238
  }
936
1239
  type RequestItemAdditionalParams = {
937
- [name: string]: any;
1240
+ [name: string]: any;
938
1241
  } & {
939
- paramList?: [string, any][];
1242
+ paramList?: [string, any][];
940
1243
  };
941
- type RequestItemsParams<K extends keyof RequestItemsParamsMap> = (RequestItemsParamsMap[K] | Record<string, unknown>) & RequestItemAdditionalParams;
1244
+ type RequestItemsParams<K extends keyof RequestItemsParamsMap> = (
1245
+ | RequestItemsParamsMap[K]
1246
+ | Record<string, unknown>
1247
+ ) &
1248
+ RequestItemAdditionalParams;
942
1249
  interface LoadingQueue {
943
- name: string;
944
- waiting: Array<{
945
- resolve: (...args: any[]) => Promise<any>;
946
- reject: (...args: any[]) => Promise<Error>;
947
- timestamp: Date;
948
- }>;
1250
+ name: string;
1251
+ waiting: Array<{
1252
+ resolve: (...args: any[]) => Promise<any>;
1253
+ reject: (...args: any[]) => Promise<Error>;
1254
+ timestamp: Date;
1255
+ }>;
949
1256
  }
950
1257
  interface UserInfo {
951
- display_name: string;
952
- id: number;
953
- /** @defaultValue 'guest' */
954
- keyname: 'guest' | string;
955
- clientId?: string;
1258
+ display_name: string;
1259
+ id: number;
1260
+ /** @defaultValue 'guest' */
1261
+ keyname: 'guest' | string;
1262
+ clientId?: string;
956
1263
  }
957
1264
  interface GetChildrenOfOptions extends Pick<RequestOptions, 'cache'> {
958
- recursive?: boolean;
959
- }
960
-
961
- declare class ResourcesControl {
962
- cache: Cache<Promise<ResourceItem | undefined>, {
963
- id?: number | string;
964
- }>;
965
- connector: NgwConnector;
966
- constructor({ connector, cacheId, }: {
967
- connector: NgwConnector;
968
- cacheId?: string;
969
- });
970
- /**
971
- * Receive resource from NGW by id, keyname or search-object parameter.
972
- * @param resource - Resource id, keyname or search-object
973
- *
974
- * @remarks
975
- * Fetching resource would be cached to speed up next call
976
- */
977
- getOne(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem | undefined>;
978
- getOneOrFail(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem>;
979
- /**
980
- * A fast way to retrieve resource ID for any resource definition.
981
- * @param resource - Any available resource definition
982
- *
983
- * @remarks
984
- * There are situations when exactly the resource id is needed
985
- * (for example, to compose the correct request to the api)
986
- * then this method will come in handy to facilitate the extraction of the identifier
987
- * if the resource is specified through a keyname or other parameters.
988
- */
989
- getId(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<number | undefined>;
990
- /**
991
- * A fast way to retrieve resource ID for any resource definition.
992
- * @param resource - Any available resource definition
993
- *
994
- * @remarks
995
- * Similar with {@link NgwConnector.getResourceId | getResourceId} but rise error if resource is not exist.
996
- * To not make one more checks if the resource is definitely exists
997
- */
998
- getIdOrFail(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<number>;
999
- getMany(resource: DeepPartial<Resource>, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem[]>;
1000
- getParent(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem | undefined>;
1001
- getChildrenOf(resource: ResourceDefinition, requestOptions?: GetChildrenOfOptions): Promise<ResourceItem[]>;
1002
- update(resource: ResourceDefinition, data: DeepPartial<ResourceItem>): Promise<ResourceItem | undefined>;
1003
- /**
1004
- * Fast way to delete resource from NGW and clean cache.
1005
- * @param resource - Resource definition
1006
- */
1007
- delete(resource: ResourceDefinition): Promise<void>;
1008
- private _getChildrenOf;
1009
- private _cleanResourceItemCache;
1010
- private _fetchResourceById;
1011
- private _fetchResourceBy;
1012
- private _resourceCacheFilter;
1265
+ recursive?: boolean;
1013
1266
  }
1014
1267
 
1015
1268
  /**
1016
1269
  * Thrown when...
1017
1270
  */
1018
1271
  declare class NgwError extends Error {
1019
- name: string;
1020
- title: string;
1021
- message: string;
1022
- detail: string;
1023
- exception: NgwExceptions;
1024
- status_code: number | 404 | 500;
1025
- data?: Record<string, any>;
1026
- guru_meditation: string;
1027
- constructor(er?: Partial<NgwError>);
1272
+ name: string;
1273
+ title: string;
1274
+ message: string;
1275
+ detail: string;
1276
+ exception: NgwExceptions;
1277
+ status_code: number | 404 | 500;
1278
+ data?: Record<string, any>;
1279
+ guru_meditation: string;
1280
+ constructor(er?: Partial<NgwError>);
1028
1281
  }
1029
1282
 
1030
1283
  /**
1031
1284
  * Thrown when ...
1032
1285
  */
1033
1286
  declare class ResourceNotFoundError extends NgwError {
1034
- name: string;
1035
- exception: NgwExceptions;
1036
- constructor(obj?: ResourceNotFoundError);
1287
+ name: string;
1288
+ exception: NgwExceptions;
1289
+ constructor(obj?: ResourceNotFoundError);
1037
1290
  }
1038
1291
 
1039
1292
  declare class NgwConnector {
1040
- options: NgwConnectorOptions;
1041
- static errors: {
1042
- NgwError: typeof NgwError;
1043
- ResourceNotFoundError: typeof ResourceNotFoundError;
1044
- };
1045
- id: number;
1046
- emitter: EventEmitter<[never]>;
1047
- user?: UserInfo;
1048
- resources: ResourcesControl;
1049
- cache: Cache;
1050
- withCredentials?: boolean;
1051
- private client;
1052
- private routeStr;
1053
- private activeRequests;
1054
- private requestTransform?;
1055
- constructor(options: NgwConnectorOptions);
1056
- static create(options: NgwConnectorOptions): NgwConnector;
1057
- /**
1058
- * Clear the cache.
1059
- */
1060
- clearCache(): void;
1061
- setRequestTransform(requestTransform: RequestTransformFunction | undefined | null): void;
1062
- /**
1063
- * Fast way to specify the connection address to NextGIS Web.
1064
- * The current connection will be severed.
1065
- * @param baseUrl - NGW url
1066
- */
1067
- setNgw(baseUrl: string): void;
1068
- /**
1069
- * Establishing a connection with NextGIS Web to fulfill all other requests.
1070
- * @remarks
1071
- * This method need not be called manually as it is used when forming a request in {@link apiRequest | apiRequest}.
1072
- * Can be used to check connection.
1073
- * @example
1074
- * ```javascript
1075
- * const connector = new NgwConnector({baseUrl: 'https://demo.nextgis.com'});
1076
- * connector.connect()
1077
- * .then(() => console.log('Ok'))
1078
- * .catch((er) => console.log('Connection problem', er));
1079
- * ```
1080
- */
1081
- connect(): Promise<PyramidRoute>;
1082
- /**
1083
- * Quick way to change NextGIS Web user.
1084
- * @param credentials - New user credentials
1085
- */
1086
- login(credentials: Credentials, options?: RequestOptions): Promise<UserInfo>;
1087
- /**
1088
- * Disconnecting a user. Aborting all current requests
1089
- */
1090
- logout(): void;
1091
- getUserInfo(credentials?: Credentials, options?: RequestOptions): Promise<UserInfo>;
1092
- /**
1093
- * Obtaining the required Headers for authentication of requests in the NGW.
1094
- */
1095
- getAuthorizationHeaders(credentials?: Credentials): RequestHeaders | undefined;
1096
- makeClientId(credentials?: Credentials): string | undefined;
1097
- /** Stop all api requests */
1098
- abort(): void;
1099
- getActiveApiRequests(): {
1100
- [x: number]: AbortController;
1101
- };
1102
- /**
1103
- * Send request to NGW api router.
1104
- * @param name - NGW route name from {@link https://docs.nextgis.com/docs_ngweb_dev/doc/developer/resource.html#routes | routes}
1105
- * @param params - Request item params or query params
1106
- * @param requestOptions - Request options
1107
- *
1108
- * @example
1109
- * ```javascript
1110
- *
1111
- * // there is such an NGW route item
1112
- * // "feature_layer.feature.item": [
1113
- * // "/api/resource/{0}/feature/{1}",
1114
- * // "id",
1115
- * // "fid"
1116
- * // ],
1117
- *
1118
- * const connector = new NgwConnector({ baseUrl: 'https://example.nextgis.com' });
1119
- * connector.apiRequest('feature_layer.feature.item', {
1120
- * // request params for {0} and {1}
1121
- * 'id': 2011,
1122
- * 'fid': 101,
1123
- * // query params
1124
- * 'srs': 4326,
1125
- * 'geom_format': 'geojson',
1126
- * }, { method: 'GET' });
1127
- * // send get-request to 'https://example.nextgis.com/api/resource/2011/feature/101?srs=4326&geom_format=geojson'
1128
- *
1129
- * ```
1130
- */
1131
- apiRequest<K extends keyof RequestItemsParamsMap, P extends RequestItemKeys = RequestItemKeys>(name: K, params_?: RequestItemsParams<K>, requestOptions?: RequestOptions): Promise<P[K]>;
1132
- /**
1133
- * Shortcut method for send POST request to NGW.
1134
- * @param name - NGW route name from {@link https://docs.nextgis.com/docs_ngweb_dev/doc/developer/resource.html#routes | routes}
1135
- * @param options - Request options
1136
- * @param params - Request item params or query params
1137
- *
1138
- * @example
1139
- * ```javascript
1140
- * connector.post('resource.collection', { data: POST_PAYLOAD })
1141
- * .then((newResource) => console.log(newResource))
1142
- * .catch((error) => console.warn(error));
1143
- * ```
1144
- */
1145
- post<K extends keyof RequestItemsParamsMap>(name: K, options?: RequestOptions<'POST', K>, params?: RequestItemsParams<K>): Promise<PostRequestItemsResponseMap[K]>;
1146
- /**
1147
- * Shortcut method for send GET request to NGW.
1148
- * @param name - NGW route name from {@link https://docs.nextgis.com/docs_ngweb_dev/doc/developer/resource.html#routes | routes}
1149
- * @param options - Request options
1150
- * @param params - Request item params or query params
1151
- */
1152
- get<K extends keyof RequestItemsParamsMap>(name: K, options?: RequestOptions<'GET', K> | undefined | null, params?: RequestItemsParams<K>): Promise<GetRequestItemsResponseMap[K]>;
1153
- /**
1154
- * Shortcut method for send PATCH request to NGW.
1155
- * @param name - NGW route name from {@link https://docs.nextgis.com/docs_ngweb_dev/doc/developer/resource.html#routes | routes}
1156
- * @param options - Request options
1157
- * @param params - Request item params or query params
1158
- */
1159
- patch<K extends keyof RequestItemsParamsMap>(name: K, options?: RequestOptions<'PATCH', K>, params?: RequestItemsParams<K>): Promise<PatchRequestItemsResponseMap[K]>;
1160
- /**
1161
- * Shortcut method for send PUT request to NGW.
1162
- * @param name - NGW route name from {@link https://docs.nextgis.com/docs_ngweb_dev/doc/developer/resource.html#routes | routes}
1163
- * @param options - Request options
1164
- * @param params - Request item params or query params
1165
- */
1166
- put<K extends keyof RequestItemsParamsMap>(name: K, options?: RequestOptions<'PUT', K>, params?: RequestItemsParams<K>): Promise<PutRequestItemsResponseMap[K]>;
1167
- /**
1168
- * Shortcut method for send DELETE request to NGW.
1169
- * @param name - NGW route name from {@link https://docs.nextgis.com/docs_ngweb_dev/doc/developer/resource.html#routes | routes}
1170
- * @param options - Request options
1171
- * @param params - Request item params or query params
1172
- */
1173
- delete<K extends keyof RequestItemsParamsMap>(name: K, options?: RequestOptions<'DELETE', K> | undefined | null, params?: RequestItemsParams<K>): Promise<DeleteRequestItemsResponseMap[K]>;
1174
- /**
1175
- * Send request to NGW.
1176
- * @param url - URL address to NGW
1177
- * @param params - Query params
1178
- * @param options - Request options
1179
- */
1180
- makeQuery<R = unknown>(url: string, params?: Params | null, options?: RequestOptions): Promise<R>;
1181
- /**
1182
- * {@link ResourcesControl.getOne}
1183
- */
1184
- getResource(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem | undefined>;
1185
- /**
1186
- * {@link ResourcesControl.getOneOrFail}
1187
- */
1188
- getResourceOrFail(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem>;
1189
- /**
1190
- * @deprecated - use {@link getResource}
1191
- */
1192
- getResourceBy(resource: DeepPartial<Resource>): Promise<ResourceItem | undefined>;
1193
- /**
1194
- * @deprecated - use {@link getResource}
1195
- */
1196
- getResourceByKeyname(keyname: string): Promise<ResourceItem | undefined>;
1197
- /**
1198
- * @deprecated - use {@link getResource}
1199
- */
1200
- getResourceById(id: number): Promise<ResourceItem | undefined>;
1201
- /**
1202
- * {@link ResourcesControl.getId}
1203
- */
1204
- getResourceId(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<number | undefined>;
1205
- /**
1206
- * {@link ResourcesControl.getIdOrFail}
1207
- */
1208
- getResourceIdOrFail(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<number>;
1209
- /**
1210
- * {@link ResourcesControl.getMany}
1211
- */
1212
- getResourcesBy(resource: DeepPartial<Resource>, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem[]>;
1213
- /**
1214
- * {@link ResourcesControl.getParent}
1215
- */
1216
- getResourceParent(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem | undefined>;
1217
- /**
1218
- * {@link ResourcesControl.getChildrenOf}
1219
- */
1220
- getResourceChildren(resource: ResourceDefinition, requestOptions?: GetChildrenOfOptions): Promise<ResourceItem[]>;
1221
- /**
1222
- * {@link ResourcesControl.update}
1223
- */
1224
- updateResource(resource: ResourceIdKeynameDef, data: DeepPartial<ResourceItem>): Promise<ResourceItem | undefined>;
1225
- /**
1226
- * {@link ResourcesControl.delete}
1227
- */
1228
- deleteResource(resource: ResourceIdKeynameDef): Promise<void>;
1229
- private _login;
1230
- private _cleanActiveRequest;
1231
- private _handleHttpError;
1293
+ options: NgwConnectorOptions;
1294
+ static errors: {
1295
+ NgwError: typeof NgwError;
1296
+ ResourceNotFoundError: typeof ResourceNotFoundError;
1297
+ };
1298
+ id: number;
1299
+ emitter: EventEmitter<[never]>;
1300
+ user?: UserInfo;
1301
+ cache: Cache;
1302
+ withCredentials?: boolean;
1303
+ private client;
1304
+ private routeStr;
1305
+ private activeRequests;
1306
+ private requestTransform?;
1307
+ constructor(options: NgwConnectorOptions);
1308
+ static create(options: NgwConnectorOptions): NgwConnector;
1309
+ /**
1310
+ * Clear the cache.
1311
+ */
1312
+ clearCache(): void;
1313
+ setRequestTransform(
1314
+ requestTransform: RequestTransformFunction | undefined | null,
1315
+ ): void;
1316
+ /**
1317
+ * Fast way to specify the connection address to NextGIS Web.
1318
+ * The current connection will be severed.
1319
+ * @param baseUrl - NGW url
1320
+ */
1321
+ setNgw(baseUrl: string): void;
1322
+ /**
1323
+ * Establishing a connection with NextGIS Web to fulfill all other requests.
1324
+ * @remarks
1325
+ * This method need not be called manually as it is used when forming a request in {@link apiRequest | apiRequest}.
1326
+ * Can be used to check connection.
1327
+ * @example
1328
+ * ```javascript
1329
+ * const connector = new NgwConnector({ baseUrl: 'https://demo.nextgis.com' });
1330
+ * connector.connect()
1331
+ * .then(() => console.log('Ok'))
1332
+ * .catch((er) => console.log('Connection problem', er));
1333
+ * ```
1334
+ */
1335
+ connect(): Promise<PyramidRoute>;
1336
+ /**
1337
+ * Quick way to change NextGIS Web user.
1338
+ * @param credentials - New user credentials
1339
+ */
1340
+ login(credentials: Credentials, options?: RequestOptions): Promise<UserInfo>;
1341
+ /**
1342
+ * Disconnecting a user. Aborting all current requests
1343
+ */
1344
+ logout(): void;
1345
+ getUserInfo(
1346
+ credentials?: Credentials,
1347
+ options?: RequestOptions,
1348
+ ): Promise<UserInfo>;
1349
+ /**
1350
+ * Obtaining the required Headers for authentication of requests in the NGW.
1351
+ */
1352
+ getAuthorizationHeaders(credentials?: Credentials): RequestHeaders;
1353
+ makeClientId(credentials?: Credentials): string | undefined;
1354
+ /** Stop all api requests */
1355
+ abort(): void;
1356
+ getActiveApiRequests(): {
1357
+ [x: number]: AbortController;
1358
+ };
1359
+ route<N extends RouteName>(
1360
+ name: N,
1361
+ ...rest: RouteParameters[N]
1362
+ ): RouteResults<N>;
1363
+ /**
1364
+ * Send request to NGW.
1365
+ * @param url - URL address to NGW
1366
+ * @param params - Query params
1367
+ * @param options - Request options
1368
+ */
1369
+ makeQuery<R = unknown>(
1370
+ url: string,
1371
+ params?: Params | null,
1372
+ options?: RequestOptions,
1373
+ ): Promise<R>;
1374
+ protected _loadData<R = unknown>(
1375
+ url: string,
1376
+ options: RequestOptions,
1377
+ ): Promise<R>;
1378
+ private _login;
1379
+ private _cleanActiveRequest;
1380
+ private _handleHttpError;
1232
1381
  }
1233
1382
 
1234
- export { type BaseRequestOptions, type BasemapResource, type BasemapWebmap, type BasemapWebmapItem, type BookmarkProperties, type CreatedResource, type Credentials, type DeleteRequestItemsResponseMap, type FeatureItem, type FeatureItemAttachment, type FeatureItemExtensions, type FeatureItemToNgw, type FeatureLayerCount, type FeatureLayerField, type FeatureLayersIdentify, type FeatureLayersIdentifyItems, type FeatureResource, type FileBucket, type FileMeta, type FileUploadResp, type GeometryType, type GetChildrenOfOptions, type GetRequestItemsResponseMap, type IdOnly, type LayerFeature, type LayerLegend, type LegendItem, type LegendItemSymbol, type LoadingQueue, type LookupTableResource, type NgwConnectorOptions, type NgwDateFormat, type NgwDateTimeFormat, type NgwExceptions, type NgwExtent, type NgwFile, type NgwLayerIdentifyError, type NgwTimeFormat, type Params, type PatchRequestItemsResponseMap, type Permission, type PostRequestItemsResponseMap, type PutRequestItemsResponseMap, type PyramidRoute, type PyramidSettings, type PyramidSettingsPyramid, type PyramidSettingsPyramidCompanyLogo, type RequestHeaders, type RequestItemAdditionalParams, type RequestItemKeys, type RequestItemsParams, type RequestItemsParamsMap, type RequestItemsResponseMap, type RequestMethods, type RequestOptions, type RequestTransformFunction, type Resmeta, type Resource, type ResourceCls, type ResourceDefinition, type ResourceHierarchy, type ResourceIdKeynameDef, type ResourceItem, type ResourceItemDatatype, type ResourceItemMain, type ResourceStoreItem, type ResourceStoreItemDefault, type ResourceStoreItemProperties, type Router, type SrsItem, type TreeGroup, type TreeItem, type TreeLayer, type UserInfo, type VectorFieldDatatype, type VectorLayer, type VectorLayerResourceItem, type WebmapResource, type WmsClientConnection, type WmsClientLayer, type WmsServerService, type WmsServerServiceLayer, NgwConnector as default };
1383
+ declare class ResourcesControl {
1384
+ cache: Cache<
1385
+ Promise<ResourceItem | undefined>,
1386
+ {
1387
+ id?: number | string;
1388
+ }
1389
+ >;
1390
+ connector: NgwConnectorExtended;
1391
+ constructor({
1392
+ connector,
1393
+ cacheId,
1394
+ }: {
1395
+ connector: NgwConnectorExtended;
1396
+ cacheId?: string;
1397
+ });
1398
+ /**
1399
+ * Receive resource from NGW by id, keyname or search-object parameter.
1400
+ * @param resource - Resource id, keyname or search-object
1401
+ *
1402
+ * @remarks
1403
+ * Fetching resource would be cached to speed up next call
1404
+ */
1405
+ getOne(
1406
+ resource: ResourceDefinition,
1407
+ requestOptions?: RequestOptions<'GET'>,
1408
+ ): Promise<ResourceItem | undefined>;
1409
+ getOneOrFail(
1410
+ resource: ResourceDefinition,
1411
+ requestOptions?: RequestOptions<'GET'>,
1412
+ ): Promise<ResourceItem>;
1413
+ /**
1414
+ * A fast way to retrieve resource ID for any resource definition.
1415
+ * @param resource - Any available resource definition
1416
+ *
1417
+ * @remarks
1418
+ * There are situations when exactly the resource id is needed
1419
+ * (for example, to compose the correct request to the api)
1420
+ * then this method will come in handy to facilitate the extraction of the identifier
1421
+ * if the resource is specified through a keyname or other parameters.
1422
+ */
1423
+ getId(
1424
+ resource: ResourceDefinition,
1425
+ requestOptions?: RequestOptions<'GET'>,
1426
+ ): Promise<number | undefined>;
1427
+ /**
1428
+ * A fast way to retrieve resource ID for any resource definition.
1429
+ * @param resource - Any available resource definition
1430
+ *
1431
+ * @remarks
1432
+ * Similar with {@link NgwConnector.getResourceId | getResourceId} but rise error if resource is not exist.
1433
+ * To not make one more checks if the resource is definitely exists
1434
+ */
1435
+ getIdOrFail(
1436
+ resource: ResourceDefinition,
1437
+ requestOptions?: RequestOptions<'GET'>,
1438
+ ): Promise<number>;
1439
+ getMany(
1440
+ resource: DeepPartial<Resource>,
1441
+ requestOptions?: RequestOptions<'GET'>,
1442
+ ): Promise<ResourceItem[]>;
1443
+ getParent(
1444
+ resource: ResourceDefinition,
1445
+ requestOptions?: RequestOptions<'GET'>,
1446
+ ): Promise<ResourceItem | undefined>;
1447
+ getChildrenOf(
1448
+ resource: ResourceDefinition,
1449
+ requestOptions?: GetChildrenOfOptions,
1450
+ ): Promise<ResourceItem[]>;
1451
+ update(
1452
+ resource: ResourceDefinition,
1453
+ data: DeepPartial<ResourceItem>,
1454
+ ): Promise<ResourceItem | undefined>;
1455
+ /**
1456
+ * Fast way to delete resource from NGW and clean cache.
1457
+ * @param resource - Resource definition
1458
+ */
1459
+ delete(resource: ResourceDefinition): Promise<void>;
1460
+ private _getChildrenOf;
1461
+ private _cleanResourceItemCache;
1462
+ private _fetchResourceById;
1463
+ private _fetchResourceBy;
1464
+ private _resourceCacheFilter;
1465
+ }
1466
+
1467
+ declare class NgwConnectorExtended extends NgwConnector {
1468
+ options: NgwConnectorOptions;
1469
+ resources: ResourcesControl;
1470
+ constructor(options: NgwConnectorOptions);
1471
+ /**
1472
+ * Clear the cache.
1473
+ */
1474
+ clearCache(): void;
1475
+ /**
1476
+ * Send request to NGW api router.
1477
+ * @param name - NGW route name from {@link https://docs.nextgis.com/docs_ngweb_dev/doc/developer/resource.html#routes | routes}
1478
+ * @param params - Request item params or query params
1479
+ * @param requestOptions - Request options
1480
+ *
1481
+ * @example
1482
+ * ```javascript
1483
+ *
1484
+ * // there is such an NGW route item
1485
+ * // "feature_layer.feature.item": [
1486
+ * // "/api/resource/{0}/feature/{1}",
1487
+ * // "id",
1488
+ * // "fid"
1489
+ * // ],
1490
+ *
1491
+ * const connector = new NgwConnector({ baseUrl: 'https://example.nextgis.com' });
1492
+ * connector.apiRequest('feature_layer.feature.item', {
1493
+ * // request params for {0} and {1}
1494
+ * 'id': 2011,
1495
+ * 'fid': 101,
1496
+ * // query params
1497
+ * 'srs': 4326,
1498
+ * 'geom_format': 'geojson',
1499
+ * }, { method: 'GET' });
1500
+ * // send get-request to 'https://example.nextgis.com/api/resource/2011/feature/101?srs=4326&geom_format=geojson'
1501
+ *
1502
+ * ```
1503
+ */
1504
+ apiRequest<
1505
+ K extends keyof RequestItemsParamsMap,
1506
+ P extends RequestItemKeys = RequestItemKeys,
1507
+ >(
1508
+ name: K,
1509
+ params_?: RequestItemsParams<K>,
1510
+ requestOptions?: RequestOptions,
1511
+ ): Promise<P[K]>;
1512
+ /**
1513
+ * Shortcut method for send POST request to NGW.
1514
+ * @param name - NGW route name from {@link https://docs.nextgis.com/docs_ngweb_dev/doc/developer/resource.html#routes | routes}
1515
+ * @param options - Request options
1516
+ * @param params - Request item params or query params
1517
+ *
1518
+ * @example
1519
+ * ```javascript
1520
+ * connector.post('resource.collection', { data: POST_PAYLOAD })
1521
+ * .then((newResource) => console.log(newResource))
1522
+ * .catch((error) => console.warn(error));
1523
+ * ```
1524
+ */
1525
+ post<K extends keyof RequestItemsParamsMap>(
1526
+ name: K,
1527
+ options?: RequestOptions<'POST', K>,
1528
+ params?: RequestItemsParams<K>,
1529
+ ): Promise<PostRequestItemsResponseMap[K]>;
1530
+ /**
1531
+ * Shortcut method for send GET request to NGW.
1532
+ * @param name - NGW route name from {@link https://docs.nextgis.com/docs_ngweb_dev/doc/developer/resource.html#routes | routes}
1533
+ * @param options - Request options
1534
+ * @param params - Request item params or query params
1535
+ */
1536
+ get<K extends keyof RequestItemsParamsMap>(
1537
+ name: K,
1538
+ options?: RequestOptions<'GET', K> | undefined | null,
1539
+ params?: RequestItemsParams<K>,
1540
+ ): Promise<GetRequestItemsResponseMap[K]>;
1541
+ /**
1542
+ * Shortcut method for send PATCH request to NGW.
1543
+ * @param name - NGW route name from {@link https://docs.nextgis.com/docs_ngweb_dev/doc/developer/resource.html#routes | routes}
1544
+ * @param options - Request options
1545
+ * @param params - Request item params or query params
1546
+ */
1547
+ patch<K extends keyof RequestItemsParamsMap>(
1548
+ name: K,
1549
+ options?: RequestOptions<'PATCH', K>,
1550
+ params?: RequestItemsParams<K>,
1551
+ ): Promise<PatchRequestItemsResponseMap[K]>;
1552
+ /**
1553
+ * Shortcut method for send PUT request to NGW.
1554
+ * @param name - NGW route name from {@link https://docs.nextgis.com/docs_ngweb_dev/doc/developer/resource.html#routes | routes}
1555
+ * @param options - Request options
1556
+ * @param params - Request item params or query params
1557
+ */
1558
+ put<K extends keyof RequestItemsParamsMap>(
1559
+ name: K,
1560
+ options?: RequestOptions<'PUT', K>,
1561
+ params?: RequestItemsParams<K>,
1562
+ ): Promise<PutRequestItemsResponseMap[K]>;
1563
+ /**
1564
+ * Shortcut method for send DELETE request to NGW.
1565
+ * @param name - NGW route name from {@link https://docs.nextgis.com/docs_ngweb_dev/doc/developer/resource.html#routes | routes}
1566
+ * @param options - Request options
1567
+ * @param params - Request item params or query params
1568
+ */
1569
+ delete<K extends keyof RequestItemsParamsMap>(
1570
+ name: K,
1571
+ options?: RequestOptions<'DELETE', K> | undefined | null,
1572
+ params?: RequestItemsParams<K>,
1573
+ ): Promise<DeleteRequestItemsResponseMap[K]>;
1574
+ /**
1575
+ * {@link ResourcesControl.getOne}
1576
+ */
1577
+ getResource(
1578
+ resource: ResourceDefinition,
1579
+ requestOptions?: RequestOptions<'GET'>,
1580
+ ): Promise<ResourceItem | undefined>;
1581
+ /**
1582
+ * {@link ResourcesControl.getOneOrFail}
1583
+ */
1584
+ getResourceOrFail(
1585
+ resource: ResourceDefinition,
1586
+ requestOptions?: RequestOptions<'GET'>,
1587
+ ): Promise<ResourceItem>;
1588
+ /**
1589
+ * @deprecated - use {@link getResource}
1590
+ */
1591
+ getResourceBy(
1592
+ resource: DeepPartial<Resource>,
1593
+ ): Promise<ResourceItem | undefined>;
1594
+ /**
1595
+ * @deprecated - use {@link getResource}
1596
+ */
1597
+ getResourceByKeyname(keyname: string): Promise<ResourceItem | undefined>;
1598
+ /**
1599
+ * @deprecated - use {@link getResource}
1600
+ */
1601
+ getResourceById(id: number): Promise<ResourceItem | undefined>;
1602
+ /**
1603
+ * {@link ResourcesControl.getId}
1604
+ */
1605
+ getResourceId(
1606
+ resource: ResourceDefinition,
1607
+ requestOptions?: RequestOptions<'GET'>,
1608
+ ): Promise<number | undefined>;
1609
+ /**
1610
+ * {@link ResourcesControl.getIdOrFail}
1611
+ */
1612
+ getResourceIdOrFail(
1613
+ resource: ResourceDefinition,
1614
+ requestOptions?: RequestOptions<'GET'>,
1615
+ ): Promise<number>;
1616
+ /**
1617
+ * {@link ResourcesControl.getMany}
1618
+ */
1619
+ getResourcesBy(
1620
+ resource: DeepPartial<Resource>,
1621
+ requestOptions?: RequestOptions<'GET'>,
1622
+ ): Promise<ResourceItem[]>;
1623
+ /**
1624
+ * {@link ResourcesControl.getParent}
1625
+ */
1626
+ getResourceParent(
1627
+ resource: ResourceDefinition,
1628
+ requestOptions?: RequestOptions<'GET'>,
1629
+ ): Promise<ResourceItem | undefined>;
1630
+ /**
1631
+ * {@link ResourcesControl.getChildrenOf}
1632
+ */
1633
+ getResourceChildren(
1634
+ resource: ResourceDefinition,
1635
+ requestOptions?: GetChildrenOfOptions,
1636
+ ): Promise<ResourceItem[]>;
1637
+ /**
1638
+ * {@link ResourcesControl.update}
1639
+ */
1640
+ updateResource(
1641
+ resource: ResourceIdKeynameDef,
1642
+ data: DeepPartial<ResourceItem>,
1643
+ ): Promise<ResourceItem | undefined>;
1644
+ /**
1645
+ * {@link ResourcesControl.delete}
1646
+ */
1647
+ deleteResource(resource: ResourceIdKeynameDef): Promise<void>;
1648
+ }
1649
+
1650
+ export {
1651
+ type BaseRequestOptions,
1652
+ type BasemapResource,
1653
+ type BasemapWebmap,
1654
+ type BasemapWebmapItem,
1655
+ type BookmarkProperties,
1656
+ type CreatedResource,
1657
+ type Credentials,
1658
+ type DeleteRequestItemsResponseMap,
1659
+ type FeatureItem,
1660
+ type FeatureItemAttachment,
1661
+ type FeatureItemExtensions,
1662
+ type FeatureItemToNgw,
1663
+ type FeatureLayerCount,
1664
+ type FeatureLayerField,
1665
+ type FeatureLayersIdentify,
1666
+ type FeatureLayersIdentifyItems,
1667
+ type FeatureResource,
1668
+ type FileBucket,
1669
+ type FileMeta,
1670
+ type FileUploadResp,
1671
+ type GeometryType,
1672
+ type GetChildrenOfOptions,
1673
+ type GetRequestItemsResponseMap,
1674
+ type IdOnly,
1675
+ type LayerFeature,
1676
+ type LayerLegend,
1677
+ type LegendItem,
1678
+ type LegendItemSymbol,
1679
+ type LoadingQueue,
1680
+ type LookupTableResource,
1681
+ type NgwConnectorOptions,
1682
+ type NgwDateFormat,
1683
+ type NgwDateTimeFormat,
1684
+ type NgwExceptions,
1685
+ type NgwExtent,
1686
+ type NgwFile,
1687
+ type NgwLayerIdentifyError,
1688
+ type NgwTimeFormat,
1689
+ type Params,
1690
+ type PatchRequestItemsResponseMap,
1691
+ type Permission,
1692
+ type PostRequestItemsResponseMap,
1693
+ type PutRequestItemsResponseMap,
1694
+ type PyramidRoute,
1695
+ type PyramidSettings,
1696
+ type PyramidSettingsPyramid,
1697
+ type PyramidSettingsPyramidCompanyLogo,
1698
+ type RequestHeaders,
1699
+ type RequestItemAdditionalParams,
1700
+ type RequestItemKeys,
1701
+ type RequestItemsParams,
1702
+ type RequestItemsParamsMap,
1703
+ type RequestItemsResponseMap,
1704
+ type RequestMethods,
1705
+ type RequestOptions,
1706
+ type RequestTransformFunction,
1707
+ type Resmeta,
1708
+ type Resource,
1709
+ type ResourceCls,
1710
+ type ResourceDefinition,
1711
+ type ResourceHierarchy,
1712
+ type ResourceIdKeynameDef,
1713
+ type ResourceItem,
1714
+ type ResourceItemDatatype,
1715
+ type ResourceItemMain,
1716
+ type ResourceStoreItem,
1717
+ type ResourceStoreItemDefault,
1718
+ type ResourceStoreItemProperties,
1719
+ type Router,
1720
+ type SrsItem,
1721
+ type TreeGroup,
1722
+ type TreeItem,
1723
+ type TreeLayer,
1724
+ type UserInfo,
1725
+ type VectorFieldDatatype,
1726
+ type VectorLayer,
1727
+ type VectorLayerResourceItem,
1728
+ type WebmapResource,
1729
+ type WmsClientConnection,
1730
+ type WmsClientLayer,
1731
+ type WmsServerService,
1732
+ type WmsServerServiceLayer,
1733
+ NgwConnectorExtended as default,
1734
+ };