@nextgis/geocoder 2.3.0 → 2.4.1

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.
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/geocoder; version: 2.3.0; author: NextGIS */
1
+ /** Bundle of @nextgis/geocoder; version: 2.4.1; author: NextGIS */
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/geocoder; version: 2.3.0; author: NextGIS */
1
+ /** Bundle of @nextgis/geocoder; version: 2.4.1; author: NextGIS */
2
2
  var __defProp$g = Object.defineProperty;
3
3
  var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField$e = (obj, key, value) => __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -1355,7 +1355,10 @@ class ResourcesControl {
1355
1355
  }
1356
1356
  return CancelablePromise.resolve(void 0);
1357
1357
  };
1358
- return cache.addFull("resource", makeRequest, forCache);
1358
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
1359
+ return cache.addFull("resource", makeRequest, forCache);
1360
+ }
1361
+ return makeRequest();
1359
1362
  }
1360
1363
  getOneOrFail(resource, requestOptions) {
1361
1364
  return this.getOne(resource, requestOptions).then((res) => {
@@ -1516,14 +1519,17 @@ class ResourcesControl {
1516
1519
  }
1517
1520
  _fetchResourceById(id, requestOptions) {
1518
1521
  const promise = () => this.connector.get("resource.item", requestOptions, { id });
1519
- return this.cache.add("resource.item", promise, {
1520
- id
1521
- }).catch((er) => {
1522
- if (!(er instanceof ResourceNotFoundError)) {
1523
- throw er;
1524
- }
1525
- return void 0;
1526
- });
1522
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
1523
+ return this.cache.add("resource.item", promise, {
1524
+ id
1525
+ }).catch((er) => {
1526
+ if (!(er instanceof ResourceNotFoundError)) {
1527
+ throw er;
1528
+ }
1529
+ return void 0;
1530
+ });
1531
+ }
1532
+ return promise();
1527
1533
  }
1528
1534
  _fetchResourceBy(resource, requestOptions) {
1529
1535
  return this.getMany(resource, requestOptions).then((resources) => {
@@ -1603,7 +1609,7 @@ function template(str, data) {
1603
1609
  function apiRequest(opt) {
1604
1610
  const params = opt.params;
1605
1611
  return new CancelablePromise((resolve, reject) => {
1606
- opt.connector.connect().then((apiItems) => {
1612
+ return opt.connector.connect().then((apiItems) => {
1607
1613
  let apiItem = apiItems && apiItems[opt.name];
1608
1614
  if (apiItem) {
1609
1615
  apiItem = [...apiItem];
@@ -2381,7 +2387,9 @@ function createParam(pf) {
2381
2387
  return [`${isFldStr}${field_}__${operation}`, v];
2382
2388
  }
2383
2389
  function getQueries(opt, _queries = [], _parentAllParams = []) {
2390
+ var _a;
2384
2391
  const { filters } = opt;
2392
+ const paramList = (_a = opt.paramList) != null ? _a : [];
2385
2393
  const logic = typeof filters[0] === "string" ? filters[0] : "all";
2386
2394
  const filters_ = filters.filter((x) => Array.isArray(x));
2387
2395
  if (logic === "any") {
@@ -2389,7 +2397,7 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
2389
2397
  if (isPropertyFilter(f)) {
2390
2398
  _queries.push(
2391
2399
  fetchNgwLayerItemsRequest(__spreadProps$1(__spreadValues$2({}, opt), {
2392
- paramList: [..._parentAllParams, createParam(f)]
2400
+ paramList: [..._parentAllParams, ...paramList, createParam(f)]
2393
2401
  }))
2394
2402
  );
2395
2403
  } else {
@@ -2425,7 +2433,7 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
2425
2433
  } else {
2426
2434
  _queries.push(
2427
2435
  fetchNgwLayerItemsRequest(__spreadProps$1(__spreadValues$2({}, opt), {
2428
- paramList: [..._parentAllParams, ...filters2]
2436
+ paramList: [..._parentAllParams, ...paramList, ...filters2]
2429
2437
  }))
2430
2438
  );
2431
2439
  }