bruce-models 7.1.66 → 7.1.68

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.
@@ -8770,12 +8770,12 @@
8770
8770
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
8771
8771
  return cache.data;
8772
8772
  }
8773
+ // Hack: API isn't returning the right file so we're adding to page size and filtering again on client. Patch ASAP.
8773
8774
  const prom = (() => __awaiter(this, void 0, void 0, function* () {
8774
- var _a;
8775
8775
  const res = yield GetList({
8776
8776
  api,
8777
8777
  filter: {
8778
- PageSize: 1,
8778
+ PageSize: 300,
8779
8779
  PageIndex: 0,
8780
8780
  Purpose: "Polygon Texture",
8781
8781
  FilterRows: [
@@ -8801,7 +8801,13 @@
8801
8801
  },
8802
8802
  req: reqParams
8803
8803
  });
8804
- return ((_a = res.clientFiles) === null || _a === void 0 ? void 0 : _a[0]) || null;
8804
+ const match = (res.clientFiles || []).find((file) => {
8805
+ var _a;
8806
+ const generation = (_a = file === null || file === void 0 ? void 0 : file.Data) === null || _a === void 0 ? void 0 : _a.generation;
8807
+ return ((generation === null || generation === void 0 ? void 0 : generation["EntityType.Source.ID"]) === entityTypeSourceId &&
8808
+ (generation === null || generation === void 0 ? void 0 : generation.Attribute) === attribute);
8809
+ });
8810
+ return match || null;
8805
8811
  }))();
8806
8812
  api.SetCacheItem({
8807
8813
  key,
@@ -10666,6 +10672,30 @@
10666
10672
  });
10667
10673
  }
10668
10674
  DataSource.Analyze = Analyze;
10675
+ /**
10676
+ * Retrieves the available datasets from an ERDDAP instance.
10677
+ * This calls: GET sources/erddap/getCapabilities?url={erddapUrl}
10678
+ * @param params
10679
+ */
10680
+ function GetERDDAPCapabilities(params) {
10681
+ var _a;
10682
+ return __awaiter(this, void 0, void 0, function* () {
10683
+ let { url, api, req: reqParams } = params;
10684
+ if (!url) {
10685
+ throw ("ERDDAP URL is required.");
10686
+ }
10687
+ if (!api) {
10688
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
10689
+ }
10690
+ const query = new URLSearchParams();
10691
+ query.append("url", url);
10692
+ const res = yield api.GET(`sources/erddap/getCapabilities?${query.toString()}`, exports.Api.PrepReqParams(reqParams));
10693
+ return {
10694
+ datasets: (_a = res === null || res === void 0 ? void 0 : res.Datasets) !== null && _a !== void 0 ? _a : []
10695
+ };
10696
+ });
10697
+ }
10698
+ DataSource.GetERDDAPCapabilities = GetERDDAPCapabilities;
10669
10699
  /**
10670
10700
  * Makes a diagnostic sample request to a registered data source.
10671
10701
  * This calls: POST source/{source_id}/requestSample
@@ -19228,7 +19258,7 @@
19228
19258
  })(exports.UrlUtils || (exports.UrlUtils = {}));
19229
19259
 
19230
19260
  // This is updated with the package.json version on build.
19231
- const VERSION = "7.1.66";
19261
+ const VERSION = "7.1.68";
19232
19262
 
19233
19263
  exports.VERSION = VERSION;
19234
19264
  exports.AbstractApi = AbstractApi;