@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
  import CancelablePromise from '@nextgis/cancelable-promise';
3
3
  import { objectAssign, fixUrlStr } from '@nextgis/utils';
4
4
  import NgwConnector from '@nextgis/ngw-connector';
@@ -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 Geocoder = (function (exports) {
3
3
  'use strict';
4
4
 
@@ -1358,7 +1358,10 @@ var Geocoder = (function (exports) {
1358
1358
  }
1359
1359
  return CancelablePromise.resolve(void 0);
1360
1360
  };
1361
- return cache.addFull("resource", makeRequest, forCache);
1361
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
1362
+ return cache.addFull("resource", makeRequest, forCache);
1363
+ }
1364
+ return makeRequest();
1362
1365
  }
1363
1366
  getOneOrFail(resource, requestOptions) {
1364
1367
  return this.getOne(resource, requestOptions).then((res) => {
@@ -1519,14 +1522,17 @@ var Geocoder = (function (exports) {
1519
1522
  }
1520
1523
  _fetchResourceById(id, requestOptions) {
1521
1524
  const promise = () => this.connector.get("resource.item", requestOptions, { id });
1522
- return this.cache.add("resource.item", promise, {
1523
- id
1524
- }).catch((er) => {
1525
- if (!(er instanceof ResourceNotFoundError)) {
1526
- throw er;
1527
- }
1528
- return void 0;
1529
- });
1525
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
1526
+ return this.cache.add("resource.item", promise, {
1527
+ id
1528
+ }).catch((er) => {
1529
+ if (!(er instanceof ResourceNotFoundError)) {
1530
+ throw er;
1531
+ }
1532
+ return void 0;
1533
+ });
1534
+ }
1535
+ return promise();
1530
1536
  }
1531
1537
  _fetchResourceBy(resource, requestOptions) {
1532
1538
  return this.getMany(resource, requestOptions).then((resources) => {
@@ -1606,7 +1612,7 @@ var Geocoder = (function (exports) {
1606
1612
  function apiRequest(opt) {
1607
1613
  const params = opt.params;
1608
1614
  return new CancelablePromise((resolve, reject) => {
1609
- opt.connector.connect().then((apiItems) => {
1615
+ return opt.connector.connect().then((apiItems) => {
1610
1616
  let apiItem = apiItems && apiItems[opt.name];
1611
1617
  if (apiItem) {
1612
1618
  apiItem = [...apiItem];
@@ -2384,7 +2390,9 @@ var Geocoder = (function (exports) {
2384
2390
  return [`${isFldStr}${field_}__${operation}`, v];
2385
2391
  }
2386
2392
  function getQueries(opt, _queries = [], _parentAllParams = []) {
2393
+ var _a;
2387
2394
  const { filters } = opt;
2395
+ const paramList = (_a = opt.paramList) != null ? _a : [];
2388
2396
  const logic = typeof filters[0] === "string" ? filters[0] : "all";
2389
2397
  const filters_ = filters.filter((x) => Array.isArray(x));
2390
2398
  if (logic === "any") {
@@ -2392,7 +2400,7 @@ var Geocoder = (function (exports) {
2392
2400
  if (isPropertyFilter(f)) {
2393
2401
  _queries.push(
2394
2402
  fetchNgwLayerItemsRequest(__spreadProps$1(__spreadValues$2({}, opt), {
2395
- paramList: [..._parentAllParams, createParam(f)]
2403
+ paramList: [..._parentAllParams, ...paramList, createParam(f)]
2396
2404
  }))
2397
2405
  );
2398
2406
  } else {
@@ -2428,7 +2436,7 @@ var Geocoder = (function (exports) {
2428
2436
  } else {
2429
2437
  _queries.push(
2430
2438
  fetchNgwLayerItemsRequest(__spreadProps$1(__spreadValues$2({}, opt), {
2431
- paramList: [..._parentAllParams, ...filters2]
2439
+ paramList: [..._parentAllParams, ...paramList, ...filters2]
2432
2440
  }))
2433
2441
  );
2434
2442
  }