bruce-models 6.1.3 → 6.1.5

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.
@@ -6960,26 +6960,22 @@ var EntityLodCategory;
6960
6960
  if (!api) {
6961
6961
  api = ENVIRONMENT.Api().GetBruceApi();
6962
6962
  }
6963
- const cache = api.GetCacheItem(GetCacheKey(id), reqParams);
6964
- if (cache === null || cache === void 0 ? void 0 : cache.found) {
6965
- return cache.data;
6966
- }
6967
6963
  const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
6968
6964
  try {
6969
- const data = yield api.GET(`lodCategory/${id}`, Api.PrepReqParams(reqParams));
6965
+ // No singular?
6966
+ const data = yield GetList({
6967
+ api,
6968
+ req: reqParams
6969
+ });
6970
+ const category = data.categories.find((c) => c.Key.toLowerCase() === id.toLowerCase());
6970
6971
  res({
6971
- category: data
6972
+ category: category
6972
6973
  });
6973
6974
  }
6974
6975
  catch (e) {
6975
6976
  rej(e);
6976
6977
  }
6977
6978
  }));
6978
- api.SetCacheItem({
6979
- key: GetCacheKey(id),
6980
- value: req,
6981
- req: reqParams
6982
- });
6983
6979
  return req;
6984
6980
  });
6985
6981
  }
@@ -6998,7 +6994,6 @@ var EntityLodCategory;
6998
6994
  api = ENVIRONMENT.Api().GetBruceApi();
6999
6995
  }
7000
6996
  yield api.DELETE(`lodCategory/${id}`, Api.PrepReqParams(reqParams));
7001
- api.Cache.Remove(GetCacheKey(id));
7002
6997
  api.Cache.Remove(GetListCacheKey());
7003
6998
  });
7004
6999
  }
@@ -7018,7 +7013,6 @@ var EntityLodCategory;
7018
7013
  api = ENVIRONMENT.Api().GetBruceApi();
7019
7014
  }
7020
7015
  const res = yield api.POST(`lodCategory/${data.Key}`, data, Api.PrepReqParams(reqParams));
7021
- api.Cache.Remove(GetCacheKey(data.Key));
7022
7016
  api.Cache.Remove(GetListCacheKey());
7023
7017
  return {
7024
7018
  category: res
@@ -7026,20 +7020,6 @@ var EntityLodCategory;
7026
7020
  });
7027
7021
  }
7028
7022
  EntityLodCategory.Update = Update;
7029
- /**
7030
- * Returns cache identifier for an entity lod category record.
7031
- * Example: {
7032
- * const api: BruceApi.Api = ...;
7033
- * const key = GetCacheKey("abc");
7034
- * api.Cache.Remove(key);
7035
- * }
7036
- * @param id
7037
- * @returns
7038
- */
7039
- function GetCacheKey(id) {
7040
- return Api.ECacheKey.LodCategory + Api.ECacheKey.Id + id;
7041
- }
7042
- EntityLodCategory.GetCacheKey = GetCacheKey;
7043
7023
  /**
7044
7024
  * Returns cache identifier for a list of entity lod categories.
7045
7025
  * Example: {
@@ -9062,7 +9042,7 @@ var ClientFile;
9062
9042
  });
9063
9043
  // TODO: Check if we can add it to the request like the small file upload.
9064
9044
  if ((clientFile === null || clientFile === void 0 ? void 0 : clientFile.ID) && purpose) {
9065
- yield UpdatePurpose({
9045
+ yield ClientFile.UpdatePurpose({
9066
9046
  api,
9067
9047
  fileId: clientFile.ID,
9068
9048
  purpose,
@@ -9099,23 +9079,30 @@ var ClientFile;
9099
9079
  * Updates the purpose of a client file.
9100
9080
  * @param params
9101
9081
  */
9102
- function UpdatePurpose(params) {
9082
+ function Update(params) {
9103
9083
  return __awaiter(this, void 0, void 0, function* () {
9104
- let { api, fileId, purpose, req: reqParams } = params;
9084
+ let { api, fileId, purpose, layerIds, req: reqParams, dataEntityId } = params;
9105
9085
  if (!api) {
9106
9086
  api = ENVIRONMENT.Api().GetBruceApi();
9107
9087
  }
9108
- if (!purpose) {
9109
- purpose = "";
9088
+ const data = {};
9089
+ if (layerIds != null) {
9090
+ data["Layer.ID"] = layerIds;
9110
9091
  }
9111
- yield api.POST("file/updatepurpose/" + fileId + "/?Purpose=" + purpose, {
9112
- Purpose: purpose
9113
- }, Api.PrepReqParams(reqParams));
9092
+ if (purpose != null) {
9093
+ data.Purpose = purpose ? purpose : "";
9094
+ }
9095
+ if (dataEntityId != null) {
9096
+ data["Data.Entity.ID"] = dataEntityId ? dataEntityId : "";
9097
+ }
9098
+ yield api.POST(`file/${fileId}/details`, data, Api.PrepReqParams(reqParams));
9114
9099
  const cacheKey = GetCacheKey(fileId);
9115
9100
  api.Cache.RemoveByContains(cacheKey);
9116
9101
  });
9117
9102
  }
9118
- ClientFile.UpdatePurpose = UpdatePurpose;
9103
+ ClientFile.Update = Update;
9104
+ // @deprecated. Use Update instead.
9105
+ ClientFile.UpdatePurpose = Update;
9119
9106
  /**
9120
9107
  * Uploads a temp file.
9121
9108
  * This will return a temp file ID.
@@ -15875,7 +15862,7 @@ var Tracking;
15875
15862
  })(Tracking || (Tracking = {}));
15876
15863
 
15877
15864
  // This is updated with the package.json version on build.
15878
- const VERSION = "6.1.3";
15865
+ const VERSION = "6.1.5";
15879
15866
 
15880
15867
  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 };
15881
15868
  //# sourceMappingURL=bruce-models.es5.js.map