bruce-models 6.7.4 → 6.7.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.
@@ -11165,21 +11165,28 @@ var ProjectView;
11165
11165
  */
11166
11166
  function Get(params) {
11167
11167
  return __awaiter(this, void 0, void 0, function* () {
11168
- let { api, viewId, req: reqParams } = params;
11169
- if (!viewId) {
11170
- throw ("View ID is required.");
11168
+ let { api, viewId, bookmarkId, expand, req: reqParams } = params;
11169
+ if (!viewId && !bookmarkId) {
11170
+ throw ("View ID or Bookmark ID is required.");
11171
11171
  }
11172
11172
  if (!api) {
11173
11173
  api = ENVIRONMENT.Api().GetBruceApi();
11174
11174
  }
11175
- const key = GetCacheKey(viewId);
11175
+ const key = GetCacheKey(viewId, bookmarkId, expand);
11176
11176
  const cache = api.GetCacheItem(key, reqParams);
11177
11177
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
11178
11178
  return cache.data;
11179
11179
  }
11180
11180
  const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
11181
11181
  try {
11182
- const data = yield api.GET(`ui.view/${viewId}`, Api.PrepReqParams(reqParams));
11182
+ let url = "ui.view/";
11183
+ if (viewId) {
11184
+ url += viewId;
11185
+ }
11186
+ else if (bookmarkId) {
11187
+ url += "?SlideID=" + encodeURIComponent(bookmarkId);
11188
+ }
11189
+ const data = yield api.GET(url, Api.PrepReqParams(reqParams));
11183
11190
  res({
11184
11191
  view: data
11185
11192
  });
@@ -11261,7 +11268,7 @@ var ProjectView;
11261
11268
  api = ENVIRONMENT.Api().GetBruceApi();
11262
11269
  }
11263
11270
  yield api.DELETE(`ui.view/${viewId}`, Api.PrepReqParams(reqParams));
11264
- api.Cache.Remove(GetCacheKey(viewId));
11271
+ api.Cache.RemoveByStartsWith(Api.ECacheKey.ProjectView);
11265
11272
  });
11266
11273
  }
11267
11274
  ProjectView.Delete = Delete;
@@ -11297,7 +11304,7 @@ var ProjectView;
11297
11304
  else {
11298
11305
  data = yield api.PUT(`ui.view/${data.ID}`, data, Api.PrepReqParams(reqParams));
11299
11306
  }
11300
- api.Cache.Remove(GetCacheKey(data.ID));
11307
+ api.Cache.RemoveByStartsWith(Api.ECacheKey.ProjectView);
11301
11308
  return {
11302
11309
  view: data
11303
11310
  };
@@ -11311,11 +11318,13 @@ var ProjectView;
11311
11318
  * const key = GetCacheKey("abc");
11312
11319
  * api.Cache.Remove(key);
11313
11320
  * }
11314
- * @param viewId
11321
+ * @param viewId ID of the project view to get.
11322
+ * @param bookmarkId Optional bookmark ID related to the view we want to find.
11323
+ * @param expand Optional expand parameter.
11315
11324
  * @returns
11316
11325
  */
11317
- function GetCacheKey(viewId) {
11318
- return `${Api.ECacheKey.ProjectView}${Api.ECacheKey.Id}${viewId}`;
11326
+ function GetCacheKey(viewId, bookmarkId, expand) {
11327
+ return `${Api.ECacheKey.ProjectView}${Api.ECacheKey.Id}${viewId || ""}${Api.ECacheKey.ProjectViewBookmark}${bookmarkId || ""}${Api.ECacheKey.Id}${expand ? (expand === true ? "true" : expand) : "false"}`;
11319
11328
  }
11320
11329
  ProjectView.GetCacheKey = GetCacheKey;
11321
11330
  })(ProjectView || (ProjectView = {}));
@@ -16433,7 +16442,7 @@ var Tracking;
16433
16442
  })(Tracking || (Tracking = {}));
16434
16443
 
16435
16444
  // This is updated with the package.json version on build.
16436
- const VERSION = "6.7.4";
16445
+ const VERSION = "6.7.5";
16437
16446
 
16438
16447
  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 };
16439
16448
  //# sourceMappingURL=bruce-models.es5.js.map