bruce-models 4.3.2 → 4.3.3

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.
@@ -2836,7 +2836,7 @@ var EntityType;
2836
2836
  }
2837
2837
  yield api.DELETE(`entitytype/${typeId}`, Api.PrepReqParams(reqParams));
2838
2838
  api.Cache.Remove(GetCacheKey(typeId));
2839
- api.Cache.Remove(GetListCacheKey());
2839
+ api.Cache.RemoveByStartsWith(GetListCacheKey());
2840
2840
  });
2841
2841
  }
2842
2842
  EntityType.Delete = Delete;
@@ -2847,11 +2847,11 @@ var EntityType;
2847
2847
  */
2848
2848
  function GetList(params) {
2849
2849
  return __awaiter(this, void 0, void 0, function* () {
2850
- let { api, req: reqParams, parentTypeId } = params;
2850
+ let { entityTypeIds, api, req: reqParams, parentTypeId } = params;
2851
2851
  if (!api) {
2852
2852
  api = ENVIRONMENT.Api().GetBruceApi();
2853
2853
  }
2854
- const cache = parentTypeId ? null : yield api.GetCacheItem(GetListCacheKey(), reqParams);
2854
+ const cache = parentTypeId ? null : yield api.GetCacheItem(GetListCacheKey(entityTypeIds), reqParams);
2855
2855
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
2856
2856
  return cache.data;
2857
2857
  }
@@ -2861,6 +2861,11 @@ var EntityType;
2861
2861
  if (parentTypeId) {
2862
2862
  urlParams.append("parentEntityTypeID", parentTypeId);
2863
2863
  }
2864
+ if (entityTypeIds) {
2865
+ for (const id of entityTypeIds) {
2866
+ urlParams.append("typeId", id);
2867
+ }
2868
+ }
2864
2869
  const data = yield api.GET("entitytypes?" + urlParams.toString(), Api.PrepReqParams(reqParams));
2865
2870
  res({
2866
2871
  entityTypes: data.Items
@@ -2872,7 +2877,7 @@ var EntityType;
2872
2877
  }));
2873
2878
  if (!parentTypeId) {
2874
2879
  yield api.SetCacheItem({
2875
- key: GetListCacheKey(),
2880
+ key: GetListCacheKey(entityTypeIds),
2876
2881
  value: req,
2877
2882
  req: reqParams,
2878
2883
  duration: 60 * 5 // 5 minutes.
@@ -2904,7 +2909,7 @@ var EntityType;
2904
2909
  }
2905
2910
  const res = yield api.POST(`entitytype/${data.ID}`, data, Api.PrepReqParams(reqParams));
2906
2911
  api.Cache.Remove(GetCacheKey(data.ID));
2907
- api.Cache.Remove(GetListCacheKey());
2912
+ api.Cache.RemoveByStartsWith(GetListCacheKey());
2908
2913
  return {
2909
2914
  entityType: res
2910
2915
  };
@@ -2979,10 +2984,14 @@ var EntityType;
2979
2984
  * const key = GetListCacheKey();
2980
2985
  * api.Cache.Remove(key);
2981
2986
  * }
2987
+ * @param typeIds
2982
2988
  * @returns
2983
2989
  */
2984
- function GetListCacheKey() {
2985
- return Api.ECacheKey.EntityType;
2990
+ function GetListCacheKey(typeIds) {
2991
+ if (!typeIds) {
2992
+ typeIds = [];
2993
+ }
2994
+ return Api.ECacheKey.EntityType + (typeIds.length ? Api.ECacheKey.Id : "") + typeIds.join(",");
2986
2995
  }
2987
2996
  EntityType.GetListCacheKey = GetListCacheKey;
2988
2997
  })(EntityType || (EntityType = {}));
@@ -13341,7 +13350,7 @@ var DataSource;
13341
13350
  })(DataSource || (DataSource = {}));
13342
13351
 
13343
13352
  // This is updated with the package.json version on build.
13344
- const VERSION = "4.3.2";
13353
+ const VERSION = "4.3.3";
13345
13354
 
13346
13355
  export { VERSION, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, 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, EntityCoords, EntityTypeVisualSettings, EntityAttribute, EntityHistoricData, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, AccountFeatures, AccountLimits, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, ImportCad, ImportCsv, ImportJson, ImportKml, ImportedFile, Markup, Uploader, Plugin, ENVIRONMENT, DataSource };
13347
13356
  //# sourceMappingURL=bruce-models.es5.js.map