@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
  import { EventEmitter } from 'events';
3
3
  import CancelablePromise from '@nextgis/cancelable-promise';
4
4
  import { getIcon } from '@nextgis/icons';
@@ -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 NgwMap = (function (exports) {
3
3
  'use strict';
4
4
 
@@ -1406,7 +1406,10 @@ var NgwMap = (function (exports) {
1406
1406
  }
1407
1407
  return CancelablePromise.resolve(void 0);
1408
1408
  };
1409
- return cache.addFull("resource", makeRequest, forCache);
1409
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
1410
+ return cache.addFull("resource", makeRequest, forCache);
1411
+ }
1412
+ return makeRequest();
1410
1413
  }
1411
1414
  getOneOrFail(resource, requestOptions) {
1412
1415
  return this.getOne(resource, requestOptions).then((res) => {
@@ -1567,14 +1570,17 @@ var NgwMap = (function (exports) {
1567
1570
  }
1568
1571
  _fetchResourceById(id, requestOptions) {
1569
1572
  const promise = () => this.connector.get("resource.item", requestOptions, { id });
1570
- return this.cache.add("resource.item", promise, {
1571
- id
1572
- }).catch((er) => {
1573
- if (!(er instanceof ResourceNotFoundError)) {
1574
- throw er;
1575
- }
1576
- return void 0;
1577
- });
1573
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
1574
+ return this.cache.add("resource.item", promise, {
1575
+ id
1576
+ }).catch((er) => {
1577
+ if (!(er instanceof ResourceNotFoundError)) {
1578
+ throw er;
1579
+ }
1580
+ return void 0;
1581
+ });
1582
+ }
1583
+ return promise();
1578
1584
  }
1579
1585
  _fetchResourceBy(resource, requestOptions) {
1580
1586
  return this.getMany(resource, requestOptions).then((resources) => {
@@ -1654,7 +1660,7 @@ var NgwMap = (function (exports) {
1654
1660
  function apiRequest(opt) {
1655
1661
  const params = opt.params;
1656
1662
  return new CancelablePromise((resolve, reject) => {
1657
- opt.connector.connect().then((apiItems) => {
1663
+ return opt.connector.connect().then((apiItems) => {
1658
1664
  let apiItem = apiItems && apiItems[opt.name];
1659
1665
  if (apiItem) {
1660
1666
  apiItem = [...apiItem];