@nextgis/ngw-map 2.3.0 → 2.4.0

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/ngw-map; version: 2.3.0; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-map; version: 2.4.0; author: NextGIS */
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-map; version: 2.3.0; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-map; version: 2.4.0; author: NextGIS */
2
2
  var domain;
3
3
 
4
4
  // This constructor is used to store event handlers. Instantiating this is
@@ -1403,7 +1403,10 @@ class ResourcesControl {
1403
1403
  }
1404
1404
  return CancelablePromise.resolve(void 0);
1405
1405
  };
1406
- return cache.addFull("resource", makeRequest, forCache);
1406
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
1407
+ return cache.addFull("resource", makeRequest, forCache);
1408
+ }
1409
+ return makeRequest();
1407
1410
  }
1408
1411
  getOneOrFail(resource, requestOptions) {
1409
1412
  return this.getOne(resource, requestOptions).then((res) => {
@@ -1564,14 +1567,17 @@ class ResourcesControl {
1564
1567
  }
1565
1568
  _fetchResourceById(id, requestOptions) {
1566
1569
  const promise = () => this.connector.get("resource.item", requestOptions, { id });
1567
- return this.cache.add("resource.item", promise, {
1568
- id
1569
- }).catch((er) => {
1570
- if (!(er instanceof ResourceNotFoundError)) {
1571
- throw er;
1572
- }
1573
- return void 0;
1574
- });
1570
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
1571
+ return this.cache.add("resource.item", promise, {
1572
+ id
1573
+ }).catch((er) => {
1574
+ if (!(er instanceof ResourceNotFoundError)) {
1575
+ throw er;
1576
+ }
1577
+ return void 0;
1578
+ });
1579
+ }
1580
+ return promise();
1575
1581
  }
1576
1582
  _fetchResourceBy(resource, requestOptions) {
1577
1583
  return this.getMany(resource, requestOptions).then((resources) => {
@@ -1651,7 +1657,7 @@ function template(str, data) {
1651
1657
  function apiRequest(opt) {
1652
1658
  const params = opt.params;
1653
1659
  return new CancelablePromise((resolve, reject) => {
1654
- opt.connector.connect().then((apiItems) => {
1660
+ return opt.connector.connect().then((apiItems) => {
1655
1661
  let apiItem = apiItems && apiItems[opt.name];
1656
1662
  if (apiItem) {
1657
1663
  apiItem = [...apiItem];