bruce-models 2.9.2 → 2.9.4

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.
@@ -8639,28 +8639,38 @@
8639
8639
  if (!programId) {
8640
8640
  throw ("Program ID is required.");
8641
8641
  }
8642
- const key = GetCacheKey(programId);
8643
- const cache = yield api.GetCacheItem(key, reqParams);
8644
- if (cache === null || cache === void 0 ? void 0 : cache.found) {
8645
- return cache.data;
8646
- }
8647
- const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
8648
- try {
8649
- const data = yield api.GET(`programkey/${programId}`, exports.Api.PrepReqParams(reqParams));
8650
- res({
8651
- programKey: data
8652
- });
8653
- }
8654
- catch (e) {
8655
- rej(e);
8656
- }
8657
- }));
8658
- yield api.SetCacheItem({
8659
- key,
8660
- value: prom,
8642
+ // Our API throws an error when a key is not set which is a bit annoying.
8643
+ // Since we only use these keys for a few specific things we'll just request the list and avoid the error.
8644
+ // If this becomes useful for more things we'll make requesting a key that doesn't exist just return empty JSON.
8645
+ const prom = yield GetList({
8646
+ api,
8661
8647
  req: reqParams
8662
8648
  });
8663
- return prom;
8649
+ const key = prom.programKeys.find(k => k.ProgramId === programId);
8650
+ // const key = GetCacheKey(programId);
8651
+ // const cache = await api.GetCacheItem(key, reqParams);
8652
+ // if (cache?.found) {
8653
+ // return cache.data;
8654
+ // }
8655
+ // const prom: Promise<any> = new Promise(async (res, rej) => {
8656
+ // try {
8657
+ // const data = await api.GET(`programkey/${programId}`, Api.PrepReqParams(reqParams));
8658
+ // res({
8659
+ // programKey: data
8660
+ // });
8661
+ // }
8662
+ // catch (e) {
8663
+ // rej(e);
8664
+ // }
8665
+ // });
8666
+ // await api.SetCacheItem({
8667
+ // key,
8668
+ // value: prom,
8669
+ // req: reqParams
8670
+ // });
8671
+ return {
8672
+ programKey: key
8673
+ };
8664
8674
  });
8665
8675
  }
8666
8676
  ProgramKey.Get = Get;
@@ -10068,9 +10078,6 @@
10068
10078
  if (!api) {
10069
10079
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
10070
10080
  }
10071
- if (!sessionId) {
10072
- throw ("Session ID is required.");
10073
- }
10074
10081
  const key = GetCacheKey(sessionId);
10075
10082
  const cache = yield api.GetCacheItem(key, reqParams);
10076
10083
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
@@ -11761,7 +11768,7 @@
11761
11768
  DataSource.GetList = GetList;
11762
11769
  })(exports.DataSource || (exports.DataSource = {}));
11763
11770
 
11764
- const VERSION$1 = "2.9.2";
11771
+ const VERSION$1 = "2.9.4";
11765
11772
 
11766
11773
  exports.VERSION = VERSION$1;
11767
11774
  exports.AbstractApi = AbstractApi;