@nextgis/ngw-connector 1.11.10 → 1.13.2

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/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./lib/ngw-connector.cjs.prod.js');
5
- } else {
3
+ if (process.env.NODE_ENV === 'development') {
6
4
  module.exports = require('./lib/ngw-connector.cjs.js');
5
+ } else {
6
+ module.exports = require('./lib/ngw-connector.cjs.prod.js');
7
7
  }
package/lib/index.d.ts CHANGED
@@ -128,6 +128,10 @@ export declare interface FileUploadResp {
128
128
 
129
129
  export declare type GeometryType = 'POINT' | 'LINESTRING' | 'POLYGON' | 'MULTIPOINT' | 'MULTILINESTRING' | 'MULTIPOLYGON' | 'POINTZ' | 'LINESTRINGZ' | 'POLYGONZ' | 'MULTIPOINTZ' | 'MULTILINESTRINGZ' | 'MULTIPOLYGONZ';
130
130
 
131
+ export declare interface GetChildrenOfOptions extends Pick<RequestOptions, 'cache'> {
132
+ recursive?: boolean;
133
+ }
134
+
131
135
  export declare interface GetRequestItemsResponseMap extends RequestItemKeys {
132
136
  'pyramid.route': PyramidRoute;
133
137
  'pyramid.settings': PyramidSettings;
@@ -307,7 +311,7 @@ declare class NgwConnector {
307
311
  /**
308
312
  * {@inheritDoc ResourcesControl.getOneOrFail}
309
313
  */
310
- getResourceOrFail(resource: ResourceDefinition, requestOptions?: Pick<RequestOptions, 'cache'>): CancelablePromise<ResourceItem>;
314
+ getResourceOrFail(resource: ResourceDefinition, requestOptions?: Pick<RequestOptions, 'cache' | 'signal'>): CancelablePromise<ResourceItem>;
311
315
  /**
312
316
  * @deprecated - use {@link NgwConnector.getResource}
313
317
  */
@@ -339,7 +343,7 @@ declare class NgwConnector {
339
343
  /**
340
344
  * {@inheritDoc ResourcesControl.getChildrenOf}
341
345
  */
342
- getResourceChildren(resource: ResourceDefinition, requestOptions?: Pick<RequestOptions, 'cache'>): CancelablePromise<ResourceItem[]>;
346
+ getResourceChildren(resource: ResourceDefinition, requestOptions?: GetChildrenOfOptions): CancelablePromise<ResourceItem[]>;
343
347
  /**
344
348
  * {@inheritDoc ResourcesControl.update}
345
349
  */
@@ -379,7 +383,7 @@ declare class NgwError extends Error {
379
383
  status_code: number | 404 | 500;
380
384
  data?: Record<string, any>;
381
385
  guru_meditation: string;
382
- constructor(er?: NgwError);
386
+ constructor(er?: Partial<NgwError>);
383
387
  }
384
388
 
385
389
  export declare type NgwExceptions = 'nextgisweb.resource.exception.ResourceNotFound' | 'nextgisweb.core.exception.InsufficientPermissions';
@@ -681,6 +685,7 @@ export declare interface RequestOptions<M = RequestMethods> {
681
685
  withCredentials?: boolean;
682
686
  responseType?: 'json' | 'blob';
683
687
  cache?: boolean;
688
+ signal?: AbortSignal;
684
689
  onProgress?: (percentComplete: number, event: ProgressEvent) => void;
685
690
  }
686
691
 
@@ -787,7 +792,8 @@ declare class ResourcesControl {
787
792
  getIdOrFail(resource: ResourceDefinition, requestOptions?: Pick<RequestOptions, 'cache'>): CancelablePromise<number>;
788
793
  getMany(resource: DeepPartial<Resource>, requestOptions?: RequestOptions): CancelablePromise<ResourceItem[]>;
789
794
  getParent(resource: ResourceDefinition, requestOptions?: Pick<RequestOptions, 'cache'>): CancelablePromise<ResourceItem | undefined>;
790
- getChildrenOf(resource: ResourceDefinition, requestOptions?: Pick<RequestOptions, 'cache'>): CancelablePromise<ResourceItem[]>;
795
+ getChildrenOf(resource: ResourceDefinition, requestOptions?: GetChildrenOfOptions): CancelablePromise<ResourceItem[]>;
796
+ private _getChildrenOf;
791
797
  update(resource: ResourceDefinition, data: DeepPartial<ResourceItem>): CancelablePromise<ResourceItem | undefined>;
792
798
  /**
793
799
  * Fast way to delete resource from NGW and clean cache.
@@ -800,7 +806,9 @@ declare class ResourcesControl {
800
806
  private _resourceCacheFilter;
801
807
  }
802
808
 
803
- export declare type ResourceStoreItem<P extends ResourceStoreItemProperties = ResourceStoreItemProperties> = ResourceStoreItemDefault & P;
809
+ export declare type ResourceStoreItem<P extends ResourceStoreItemProperties = ResourceStoreItemProperties> = ResourceStoreItemDefault & {
810
+ data?: string;
811
+ } & P;
804
812
 
805
813
  export declare interface ResourceStoreItemDefault {
806
814
  [field: string]: string | number | boolean | null | Date;
@@ -846,6 +854,7 @@ export declare interface TreeLayer extends TreeItem {
846
854
  layer_max_scale_denom?: number;
847
855
  layer_min_scale_denom?: number;
848
856
  layer_style_id: number;
857
+ style_parent_id: number;
849
858
  layer_transparency: number;
850
859
  }
851
860