@opengeoweb/webmap-react 20.2.0-nightly-20261027 → 20.2.0-nightly-20261029

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.
Files changed (2) hide show
  1. package/dist/index.esm.js +38 -6
  2. package/package.json +4 -4
package/dist/index.esm.js CHANGED
@@ -9591,6 +9591,7 @@ var fetchStacItemsWithPagination = /*#__PURE__*/function () {
9591
9591
  return _ref7.apply(this, arguments);
9592
9592
  };
9593
9593
  }();
9594
+ var MAX_STAC_COLLECTION_PAGES = 1000;
9594
9595
  var fetchStacCatalogRoot = /*#__PURE__*/function () {
9595
9596
  var _ref9 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(url) {
9596
9597
  var requestUrl;
@@ -9612,21 +9613,52 @@ var fetchStacCatalogRoot = /*#__PURE__*/function () {
9612
9613
  }();
9613
9614
  var fetchStacCatalogCollections = /*#__PURE__*/function () {
9614
9615
  var _ref0 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(baseUrl) {
9615
- var _data$collections;
9616
- var normalizedUrl, data;
9616
+ var normalizedUrl, collections, visitedUrls, nextUrl, _data$collections, _data$links, currentUrl, data, nextLink;
9617
9617
  return _regenerator().w(function (_context0) {
9618
9618
  while (1) switch (_context0.n) {
9619
9619
  case 0:
9620
9620
  normalizedUrl = baseUrl.trim().replace(/\/+$/, '');
9621
- _context0.n = 1;
9622
- return fetchStacJson("".concat(normalizedUrl, "/collections"), {
9621
+ collections = [];
9622
+ visitedUrls = new Set();
9623
+ nextUrl = "".concat(normalizedUrl, "/collections"); // Each page provides the URL for the next page, so requests must be sequential.
9624
+ /* eslint-disable no-await-in-loop */
9625
+ case 1:
9626
+ if (!nextUrl) {
9627
+ _context0.n = 5;
9628
+ break;
9629
+ }
9630
+ currentUrl = nextUrl;
9631
+ if (!visitedUrls.has(currentUrl)) {
9632
+ _context0.n = 2;
9633
+ break;
9634
+ }
9635
+ nextUrl = undefined;
9636
+ return _context0.a(3, 5);
9637
+ case 2:
9638
+ if (!(visitedUrls.size >= MAX_STAC_COLLECTION_PAGES)) {
9639
+ _context0.n = 3;
9640
+ break;
9641
+ }
9642
+ throw new Error("STAC collections pagination exceeded the maximum of ".concat(MAX_STAC_COLLECTION_PAGES, " pages"));
9643
+ case 3:
9644
+ visitedUrls.add(currentUrl);
9645
+ _context0.n = 4;
9646
+ return fetchStacJson(currentUrl, {
9623
9647
  headers: {
9624
9648
  Accept: 'application/json'
9625
9649
  }
9626
9650
  });
9627
- case 1:
9651
+ case 4:
9628
9652
  data = _context0.v;
9629
- return _context0.a(2, (_data$collections = data.collections) !== null && _data$collections !== void 0 ? _data$collections : []);
9653
+ collections.push.apply(collections, _toConsumableArray((_data$collections = data.collections) !== null && _data$collections !== void 0 ? _data$collections : []));
9654
+ nextLink = (_data$links = data.links) === null || _data$links === void 0 ? void 0 : _data$links.find(function (link) {
9655
+ return link.rel === 'next';
9656
+ });
9657
+ nextUrl = nextLink ? new URL(nextLink.href, currentUrl).toString() : undefined;
9658
+ _context0.n = 1;
9659
+ break;
9660
+ case 5:
9661
+ return _context0.a(2, collections);
9630
9662
  }
9631
9663
  }, _callee0);
9632
9664
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/webmap-react",
3
- "version": "20.2.0-nightly-20261027",
3
+ "version": "20.2.0-nightly-20261029",
4
4
  "description": "GeoWeb react wrapper for webmap",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -20,9 +20,9 @@
20
20
  }
21
21
  },
22
22
  "dependencies": {
23
- "@opengeoweb/webmap": "20.2.0-nightly-20261027",
24
- "@opengeoweb/theme": "20.2.0-nightly-20261027",
25
- "@opengeoweb/shared": "20.2.0-nightly-20261027",
23
+ "@opengeoweb/webmap": "20.2.0-nightly-20261029",
24
+ "@opengeoweb/theme": "20.2.0-nightly-20261029",
25
+ "@opengeoweb/shared": "20.2.0-nightly-20261029",
26
26
  "lodash": "^4.18.1",
27
27
  "ol": "^10.4.0",
28
28
  "proj4": "^2.9.2",