bruce-models 6.2.1 → 6.2.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.
@@ -2746,21 +2746,26 @@ var EntityType;
2746
2746
  */
2747
2747
  function Get(params) {
2748
2748
  return __awaiter(this, void 0, void 0, function* () {
2749
- let { api, entityTypeId: typeId, req: reqParams } = params;
2749
+ let { api, entityTypeId: typeId, req: reqParams, expandLODs } = params;
2750
2750
  if (!typeId) {
2751
2751
  throw ("Type ID is required.");
2752
2752
  }
2753
2753
  if (!api) {
2754
2754
  api = ENVIRONMENT.Api().GetBruceApi();
2755
2755
  }
2756
- const key = GetCacheKey(typeId);
2756
+ const key = GetCacheKey(typeId, expandLODs);
2757
2757
  const cache = api.GetCacheItem(key, reqParams);
2758
2758
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
2759
2759
  return cache.data;
2760
2760
  }
2761
2761
  const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
2762
2762
  try {
2763
- const data = yield api.GET(`entitytype/${typeId}`, Api.PrepReqParams(reqParams));
2763
+ const urlParams = new URLSearchParams();
2764
+ if (expandLODs) {
2765
+ urlParams.append("Expand", "LOD");
2766
+ }
2767
+ const url = `entitytype/${typeId}?${urlParams.toString()}`;
2768
+ const data = yield api.GET(url, Api.PrepReqParams(reqParams));
2764
2769
  appendInternalAttrSchema(data);
2765
2770
  res({
2766
2771
  entityType: data
@@ -2793,7 +2798,7 @@ var EntityType;
2793
2798
  api = ENVIRONMENT.Api().GetBruceApi();
2794
2799
  }
2795
2800
  yield api.DELETE(`entitytype/${typeId}`, Api.PrepReqParams(reqParams));
2796
- api.Cache.Remove(GetCacheKey(typeId));
2801
+ api.Cache.RemoveByStartsWith(GetCacheKey(typeId));
2797
2802
  api.Cache.RemoveByStartsWith(GetListCacheKey());
2798
2803
  });
2799
2804
  }
@@ -2805,13 +2810,14 @@ var EntityType;
2805
2810
  */
2806
2811
  function GetList(params) {
2807
2812
  return __awaiter(this, void 0, void 0, function* () {
2808
- let { entityTypeIds, api, req: reqParams, parentTypeId, expandSettings, search } = params;
2813
+ let { entityTypeIds, api, req: reqParams, parentTypeId, expandSettings, search, expandLODs } = params;
2809
2814
  if (!api) {
2810
2815
  api = ENVIRONMENT.Api().GetBruceApi();
2811
2816
  }
2812
2817
  const cache = api.GetCacheItem(GetListCacheKey({
2813
2818
  typeIds: entityTypeIds,
2814
2819
  parentTypeId,
2820
+ expandLODs,
2815
2821
  expandSettings,
2816
2822
  search
2817
2823
  }), reqParams);
@@ -2828,16 +2834,22 @@ var EntityType;
2828
2834
  const batch = entityTypeIds.slice(i, i + BATCH_SIZE);
2829
2835
  const urlParams = new URLSearchParams();
2830
2836
  for (const id of batch) {
2831
- urlParams.append("typeId", id);
2837
+ urlParams.append("ID", id);
2832
2838
  }
2833
2839
  if (parentTypeId) {
2834
- urlParams.append("parentEntityTypeID", parentTypeId);
2840
+ urlParams.append("ParentTypeID", parentTypeId);
2841
+ }
2842
+ if (expandSettings && expandLODs) {
2843
+ urlParams.append("Expand", "true");
2835
2844
  }
2836
- if (expandSettings) {
2837
- urlParams.append("expandSettings", "true");
2845
+ else if (expandSettings) {
2846
+ urlParams.append("Expand", "Schema");
2847
+ }
2848
+ else if (expandLODs) {
2849
+ urlParams.append("Expand", "LOD");
2838
2850
  }
2839
2851
  if (search) {
2840
- urlParams.append("search", search);
2852
+ urlParams.append("Search", search);
2841
2853
  }
2842
2854
  reqs.push(api.GET("entitytypes?" + urlParams.toString(), Api.PrepReqParams(reqParams)));
2843
2855
  }
@@ -2845,13 +2857,19 @@ var EntityType;
2845
2857
  else {
2846
2858
  const urlParams = new URLSearchParams();
2847
2859
  if (parentTypeId) {
2848
- urlParams.append("parentEntityTypeID", parentTypeId);
2860
+ urlParams.append("ParentTypeID", parentTypeId);
2861
+ }
2862
+ if (expandSettings && expandLODs) {
2863
+ urlParams.append("Expand", "true");
2864
+ }
2865
+ else if (expandSettings) {
2866
+ urlParams.append("Expand", "Schema");
2849
2867
  }
2850
- if (expandSettings) {
2851
- urlParams.append("expandSettings", "true");
2868
+ else if (expandLODs) {
2869
+ urlParams.append("Expand", "LOD");
2852
2870
  }
2853
2871
  if (search) {
2854
- urlParams.append("search", search);
2872
+ urlParams.append("Search", search);
2855
2873
  }
2856
2874
  reqs.push(api.GET("entitytypes?" + urlParams.toString(), Api.PrepReqParams(reqParams)));
2857
2875
  }
@@ -2880,6 +2898,7 @@ var EntityType;
2880
2898
  typeIds: entityTypeIds,
2881
2899
  parentTypeId,
2882
2900
  expandSettings,
2901
+ expandLODs,
2883
2902
  search
2884
2903
  }),
2885
2904
  value: req,
@@ -2913,7 +2932,7 @@ var EntityType;
2913
2932
  }
2914
2933
  appendInternalAttrSchema(data);
2915
2934
  const res = yield api.POST(`entitytype/${data.ID}`, data, Api.PrepReqParams(reqParams));
2916
- api.Cache.Remove(GetCacheKey(data.ID));
2935
+ api.Cache.RemoveByStartsWith(GetCacheKey(data.ID));
2917
2936
  api.Cache.RemoveByStartsWith(GetListCacheKey());
2918
2937
  return {
2919
2938
  entityType: res
@@ -2979,10 +2998,15 @@ var EntityType;
2979
2998
  * api.Cache.Remove(key);
2980
2999
  * }
2981
3000
  * @param typeId
3001
+ * @param expandLODs
2982
3002
  * @returns
2983
3003
  */
2984
- function GetCacheKey(typeId) {
2985
- return `${Api.ECacheKey.EntityType}${Api.ECacheKey.Id}${typeId}`;
3004
+ function GetCacheKey(typeId, expandLODs) {
3005
+ let key = `${Api.ECacheKey.EntityType}${Api.ECacheKey.Id}${typeId}`;
3006
+ if (expandLODs) {
3007
+ key += "_LOD_" + expandLODs;
3008
+ }
3009
+ return key;
2986
3010
  }
2987
3011
  EntityType.GetCacheKey = GetCacheKey;
2988
3012
  /**
@@ -2999,7 +3023,7 @@ var EntityType;
2999
3023
  if (!params) {
3000
3024
  params = {};
3001
3025
  }
3002
- let { typeIds, expandSettings, parentTypeId, search } = params;
3026
+ let { typeIds, expandSettings, parentTypeId, expandLODs, search } = params;
3003
3027
  let key = Api.ECacheKey.EntityType;
3004
3028
  if (!typeIds) {
3005
3029
  typeIds = [];
@@ -3011,7 +3035,14 @@ var EntityType;
3011
3035
  if (!expandSettings) {
3012
3036
  expandSettings = false;
3013
3037
  }
3014
- key += "_EXPAND_" + expandSettings;
3038
+ if (!expandLODs) {
3039
+ expandLODs = false;
3040
+ }
3041
+ key += "_SCHEMA_" + expandSettings;
3042
+ key += "_LOD_" + expandLODs;
3043
+ if (search) {
3044
+ key += "_SEARCH_" + search;
3045
+ }
3015
3046
  return key;
3016
3047
  }
3017
3048
  EntityType.GetListCacheKey = GetListCacheKey;
@@ -15907,7 +15938,7 @@ var Tracking;
15907
15938
  })(Tracking || (Tracking = {}));
15908
15939
 
15909
15940
  // This is updated with the package.json version on build.
15910
- const VERSION = "6.2.1";
15941
+ const VERSION = "6.2.3";
15911
15942
 
15912
15943
  export { VERSION, Assembly, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, GeoJson, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityAttribute, EntityHistoricData, EntityTableView, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewBookmarkGroup, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, AccountFeatures, AccountLimits, AccountTemplate, AccountType, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, DataLabGroup, ImportAssembly, ImportCad, ImportCsv, ImportJson, ImportGeoJson, ImportKml, ImportedFile, ExportBrz, ExportUsd, Markup, Uploader, Plugin, ENVIRONMENT, DataSource, Scenario, Tracking };
15913
15944
  //# sourceMappingURL=bruce-models.es5.js.map