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.
@@ -8785,28 +8785,38 @@ var ProgramKey;
8785
8785
  if (!programId) {
8786
8786
  throw ("Program ID is required.");
8787
8787
  }
8788
- const key = GetCacheKey(programId);
8789
- const cache = yield api.GetCacheItem(key, reqParams);
8790
- if (cache === null || cache === void 0 ? void 0 : cache.found) {
8791
- return cache.data;
8792
- }
8793
- const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
8794
- try {
8795
- const data = yield api.GET(`programkey/${programId}`, Api.PrepReqParams(reqParams));
8796
- res({
8797
- programKey: data
8798
- });
8799
- }
8800
- catch (e) {
8801
- rej(e);
8802
- }
8803
- }));
8804
- yield api.SetCacheItem({
8805
- key,
8806
- value: prom,
8788
+ // Our API throws an error when a key is not set which is a bit annoying.
8789
+ // Since we only use these keys for a few specific things we'll just request the list and avoid the error.
8790
+ // If this becomes useful for more things we'll make requesting a key that doesn't exist just return empty JSON.
8791
+ const prom = yield GetList({
8792
+ api,
8807
8793
  req: reqParams
8808
8794
  });
8809
- return prom;
8795
+ const key = prom.programKeys.find(k => k.ProgramId === programId);
8796
+ // const key = GetCacheKey(programId);
8797
+ // const cache = await api.GetCacheItem(key, reqParams);
8798
+ // if (cache?.found) {
8799
+ // return cache.data;
8800
+ // }
8801
+ // const prom: Promise<any> = new Promise(async (res, rej) => {
8802
+ // try {
8803
+ // const data = await api.GET(`programkey/${programId}`, Api.PrepReqParams(reqParams));
8804
+ // res({
8805
+ // programKey: data
8806
+ // });
8807
+ // }
8808
+ // catch (e) {
8809
+ // rej(e);
8810
+ // }
8811
+ // });
8812
+ // await api.SetCacheItem({
8813
+ // key,
8814
+ // value: prom,
8815
+ // req: reqParams
8816
+ // });
8817
+ return {
8818
+ programKey: key
8819
+ };
8810
8820
  });
8811
8821
  }
8812
8822
  ProgramKey.Get = Get;
@@ -10273,9 +10283,6 @@ var Session;
10273
10283
  if (!api) {
10274
10284
  api = ENVIRONMENT.Api().GetGuardianApi();
10275
10285
  }
10276
- if (!sessionId) {
10277
- throw ("Session ID is required.");
10278
- }
10279
10286
  const key = GetCacheKey(sessionId);
10280
10287
  const cache = yield api.GetCacheItem(key, reqParams);
10281
10288
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
@@ -11995,7 +12002,7 @@ var DataSource;
11995
12002
  DataSource.GetList = GetList;
11996
12003
  })(DataSource || (DataSource = {}));
11997
12004
 
11998
- const VERSION$1 = "2.9.2";
12005
+ const VERSION$1 = "2.9.4";
11999
12006
 
12000
12007
  export { VERSION$1 as VERSION, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, CamApi, IdmApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityGlobe, EntityFilterGetter, BatchedDataGetter, EntityCoords, EntityTypeVisualSettings, EntityAttribute, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, ImportCad, ImportCsv, ImportJson, ImportKml, ImportedFile, Markup, Uploader, Plugin, ENVIRONMENT, DataSource };
12001
12008
  //# sourceMappingURL=bruce-models.es5.js.map