bruce-models 6.7.0 → 6.7.2

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.
@@ -11018,7 +11018,6 @@ var ProjectViewBookmark;
11018
11018
  }
11019
11019
  yield api.DELETE(`ui.view/${viewId}/slide/${bookmarkId}`, Api.PrepReqParams(reqParams));
11020
11020
  api.Cache.Remove(GetCacheKey(viewId, bookmarkId));
11021
- api.Cache.Remove(GetListCacheKey(viewId));
11022
11021
  });
11023
11022
  }
11024
11023
  ProjectViewBookmark.Delete = Delete;
@@ -11029,23 +11028,23 @@ var ProjectViewBookmark;
11029
11028
  */
11030
11029
  function GetList(params) {
11031
11030
  return __awaiter(this, void 0, void 0, function* () {
11032
- let { api, viewId, req: reqParams } = params;
11031
+ let { api, viewId, req: reqParams, drafts } = params;
11033
11032
  if (!viewId) {
11034
11033
  throw ("View ID is required.");
11035
11034
  }
11036
11035
  if (!api) {
11037
11036
  api = ENVIRONMENT.Api().GetBruceApi();
11038
11037
  }
11039
- const cache = api.GetCacheItem(GetListCacheKey(viewId), reqParams);
11040
- if (cache === null || cache === void 0 ? void 0 : cache.found) {
11041
- return cache.data;
11042
- }
11043
11038
  const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
11044
11039
  try {
11045
- const data = yield api.GET(`ui.view/${viewId}/slides`, Api.PrepReqParams(reqParams));
11040
+ const query = new URLSearchParams();
11041
+ if (drafts) {
11042
+ query.set("Drafts", "true");
11043
+ }
11044
+ const url = `ui.view/${viewId}/slides?${query.toString()}`;
11045
+ const data = yield api.GET(url, Api.PrepReqParams(reqParams));
11046
11046
  const items = data.Items ? data.Items : [];
11047
11047
  // Cache individual items.
11048
- // Maybe better to load list cache when getting 1 slide and seeing if it's in there.
11049
11048
  // WARNING: Right now the data matches, in the future the list may contain a shortened result.
11050
11049
  for (let i = 0; i < items.length; i++) {
11051
11050
  const item = items[i];
@@ -11068,11 +11067,6 @@ var ProjectViewBookmark;
11068
11067
  rej(e);
11069
11068
  }
11070
11069
  }));
11071
- api.SetCacheItem({
11072
- key: GetListCacheKey(viewId),
11073
- value: req,
11074
- req: reqParams
11075
- });
11076
11070
  return req;
11077
11071
  });
11078
11072
  }
@@ -11093,7 +11087,6 @@ var ProjectViewBookmark;
11093
11087
  }
11094
11088
  const res = yield api.POST(`ui.view/${viewId}/slide/${data.ID ? data.ID : ""}`, data, Api.PrepReqParams(reqParams));
11095
11089
  api.Cache.Remove(GetCacheKey(viewId, data.ID));
11096
- api.Cache.Remove(GetListCacheKey(viewId));
11097
11090
  return {
11098
11091
  bookmark: res
11099
11092
  };
@@ -11115,7 +11108,6 @@ var ProjectViewBookmark;
11115
11108
  "DisplayOrder.Start": 0
11116
11109
  };
11117
11110
  yield api.POST(`ui.view/${viewId}/slides/setOrder`, reqData, Api.PrepReqParams(reqParams));
11118
- api.Cache.RemoveByStartsWith(GetListCacheKey(viewId));
11119
11111
  });
11120
11112
  }
11121
11113
  ProjectViewBookmark.SetOrder = SetOrder;
@@ -11134,20 +11126,6 @@ var ProjectViewBookmark;
11134
11126
  return `${Api.ECacheKey.ProjectViewBookmark}${Api.ECacheKey.Id}${viewId}${Api.ECacheKey.Id}${bookmarkId}`;
11135
11127
  }
11136
11128
  ProjectViewBookmark.GetCacheKey = GetCacheKey;
11137
- /**
11138
- * Returns cache identifier for a list of bookmarks.
11139
- * Example: {
11140
- * const api: BruceApi.Api = ...;
11141
- * const key = GetListCacheKey("abc");
11142
- * api.Cache.Remove(key);
11143
- * }
11144
- * @param viewId
11145
- * @returns
11146
- */
11147
- function GetListCacheKey(viewId) {
11148
- return `${Api.ECacheKey.ProjectViewBookmark}${Api.ECacheKey.Id}${viewId}`;
11149
- }
11150
- ProjectViewBookmark.GetListCacheKey = GetListCacheKey;
11151
11129
  })(ProjectViewBookmark || (ProjectViewBookmark = {}));
11152
11130
 
11153
11131
  /**
@@ -13025,21 +13003,21 @@ var User;
13025
13003
  */
13026
13004
  function GetSettings(params) {
13027
13005
  return __awaiter(this, void 0, void 0, function* () {
13028
- let { api, userId, appId, req } = params;
13006
+ let { api, userId, appId, req, accountId } = params;
13029
13007
  if (!userId || !appId) {
13030
13008
  throw ("UserId and appId are required.");
13031
13009
  }
13032
13010
  if (!api) {
13033
13011
  api = ENVIRONMENT.Api().GetGuardianApi();
13034
13012
  }
13035
- const cacheKey = GetSettingsCacheKey(api.GetSessionId(), userId, appId);
13013
+ const cacheKey = GetSettingsCacheKey(api.GetSessionId(), userId, appId, accountId);
13036
13014
  const cache = api.GetCacheItem(cacheKey, req);
13037
13015
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
13038
13016
  return cache.data;
13039
13017
  }
13040
13018
  const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
13041
13019
  try {
13042
- const data = yield api.GET(`user/${userId}/application/${appId}/settings`);
13020
+ const data = yield api.GET(`user/${userId}/application/${appId}/settings${accountId ? "?Account=" + accountId : ""}`);
13043
13021
  const settings = (data === null || data === void 0 ? void 0 : data.Settings) ? data.Settings : {};
13044
13022
  res({
13045
13023
  settings: settings
@@ -13076,21 +13054,24 @@ var User;
13076
13054
  */
13077
13055
  function UpdateSettings(params) {
13078
13056
  return __awaiter(this, void 0, void 0, function* () {
13079
- let { api, accId, userId, appId, settings, req, override } = params;
13057
+ let { api, accId, accountId, userId, appId, settings, req, override } = params;
13080
13058
  if (!userId || !appId) {
13081
13059
  throw ("UserId and appId are required.");
13082
13060
  }
13083
13061
  if (!api) {
13084
13062
  api = ENVIRONMENT.Api().GetGuardianApi();
13085
13063
  }
13064
+ if (!accountId) {
13065
+ accountId = accId;
13066
+ }
13086
13067
  const postBody = {
13087
13068
  Settings: settings == null ? {} : settings,
13088
13069
  Application: appId,
13089
- ClientAccountID: accId,
13070
+ ClientAccountID: accountId,
13090
13071
  UserID: userId
13091
13072
  };
13092
13073
  const prom = api.POST(`user/${userId}/application/${appId}/settings?Override=${override ? "true" : "false"}`, postBody, req);
13093
- api.Cache.Remove(GetSettingsCacheKey(api.GetSessionId(), userId, appId));
13074
+ api.Cache.Remove(GetSettingsCacheKey(api.GetSessionId(), userId, appId, accountId));
13094
13075
  return prom;
13095
13076
  });
13096
13077
  }
@@ -13582,11 +13563,11 @@ var User;
13582
13563
  * @param appId
13583
13564
  * @returns
13584
13565
  */
13585
- function GetSettingsCacheKey(sessionId, userId, appId) {
13566
+ function GetSettingsCacheKey(sessionId, userId, appId, accountId) {
13586
13567
  if (!sessionId) {
13587
13568
  sessionId = "anonymous";
13588
13569
  }
13589
- return Api.ECacheKey.User + Api.ECacheKey.UserSettings + userId + Api.ECacheKey.Id + appId;
13570
+ return Api.ECacheKey.User + Api.ECacheKey.UserSettings + userId + Api.ECacheKey.Id + appId + (accountId ? Api.ECacheKey.Id + accountId : "");
13590
13571
  }
13591
13572
  User$$1.GetSettingsCacheKey = GetSettingsCacheKey;
13592
13573
  })(User || (User = {}));
@@ -16438,7 +16419,7 @@ var Tracking;
16438
16419
  })(Tracking || (Tracking = {}));
16439
16420
 
16440
16421
  // This is updated with the package.json version on build.
16441
- const VERSION = "6.7.0";
16422
+ const VERSION = "6.7.2";
16442
16423
 
16443
16424
  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 };
16444
16425
  //# sourceMappingURL=bruce-models.es5.js.map