bruce-models 6.7.2 → 6.7.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.
@@ -4239,6 +4239,7 @@ var Entity;
4239
4239
  * @returns
4240
4240
  */
4241
4241
  function CalculateName(params) {
4242
+ var _a, _b;
4242
4243
  const { entity, type, defaultToId = true } = params;
4243
4244
  const attrStr = type.DisplayNameAttributePath;
4244
4245
  if (attrStr) {
@@ -4247,7 +4248,7 @@ var Entity;
4247
4248
  const pathStr = attrPaths[i];
4248
4249
  const path = PathUtils.Parse(pathStr);
4249
4250
  const name = Entity.GetValue({
4250
- entity: entity,
4251
+ entity: entity || {},
4251
4252
  path
4252
4253
  });
4253
4254
  if (name && typeof name != "object") {
@@ -4255,6 +4256,9 @@ var Entity;
4255
4256
  }
4256
4257
  }
4257
4258
  }
4259
+ if (((_a = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _a === void 0 ? void 0 : _a.Name) && ((_b = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _b === void 0 ? void 0 : _b.Name) !== "Unnamed Entity") {
4260
+ return entity.Bruce.Name;
4261
+ }
4258
4262
  return defaultToId ? entity.Bruce.ID : null;
4259
4263
  }
4260
4264
  Entity.CalculateName = CalculateName;
@@ -10972,8 +10976,8 @@ var ProjectViewBookmark;
10972
10976
  function Get(params) {
10973
10977
  return __awaiter(this, void 0, void 0, function* () {
10974
10978
  let { api, viewId, bookmarkId, req: reqParams } = params;
10975
- if (!viewId || !bookmarkId) {
10976
- throw ("View ID and Bookmark ID are required.");
10979
+ if (!bookmarkId) {
10980
+ throw ("Bookmark ID is required.");
10977
10981
  }
10978
10982
  if (!api) {
10979
10983
  api = ENVIRONMENT.Api().GetBruceApi();
@@ -10985,7 +10989,14 @@ var ProjectViewBookmark;
10985
10989
  }
10986
10990
  const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
10987
10991
  try {
10988
- const data = yield api.GET(`ui.view/${viewId}/slide/${bookmarkId}`, Api.PrepReqParams(reqParams));
10992
+ let url;
10993
+ if (viewId) {
10994
+ url = `ui.view/${viewId}/slide/${bookmarkId}`;
10995
+ }
10996
+ else {
10997
+ url = `slide/${bookmarkId}`;
10998
+ }
10999
+ const data = yield api.GET(url, Api.PrepReqParams(reqParams));
10989
11000
  res({
10990
11001
  bookmark: data
10991
11002
  });
@@ -11123,7 +11134,10 @@ var ProjectViewBookmark;
11123
11134
  * @returns
11124
11135
  */
11125
11136
  function GetCacheKey(viewId, bookmarkId) {
11126
- return `${Api.ECacheKey.ProjectViewBookmark}${Api.ECacheKey.Id}${viewId}${Api.ECacheKey.Id}${bookmarkId}`;
11137
+ if (viewId) {
11138
+ return `${Api.ECacheKey.ProjectViewBookmark}${Api.ECacheKey.Id}${viewId}${Api.ECacheKey.Id}${bookmarkId}`;
11139
+ }
11140
+ return `${Api.ECacheKey.ProjectViewBookmark}${Api.ECacheKey.Id}${bookmarkId}`;
11127
11141
  }
11128
11142
  ProjectViewBookmark.GetCacheKey = GetCacheKey;
11129
11143
  })(ProjectViewBookmark || (ProjectViewBookmark = {}));
@@ -16419,7 +16433,7 @@ var Tracking;
16419
16433
  })(Tracking || (Tracking = {}));
16420
16434
 
16421
16435
  // This is updated with the package.json version on build.
16422
- const VERSION = "6.7.2";
16436
+ const VERSION = "6.7.4";
16423
16437
 
16424
16438
  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, UserMfaMethod, 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 };
16425
16439
  //# sourceMappingURL=bruce-models.es5.js.map