bruce-models 6.6.9 → 6.7.1

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
  /**
@@ -11240,7 +11218,8 @@ var ProjectView;
11240
11218
  if (params.expand) {
11241
11219
  queryParams.set("expand", "true");
11242
11220
  }
11243
- const data = yield api.GET("ui.view/list", Api.PrepReqParams(reqParams));
11221
+ const url = `ui.view/list?${queryParams.toString()}`;
11222
+ const data = yield api.GET(url, Api.PrepReqParams(reqParams));
11244
11223
  res({
11245
11224
  views: data.Items,
11246
11225
  totalCount: data.TotalCount
@@ -16437,7 +16416,7 @@ var Tracking;
16437
16416
  })(Tracking || (Tracking = {}));
16438
16417
 
16439
16418
  // This is updated with the package.json version on build.
16440
- const VERSION = "6.6.9";
16419
+ const VERSION = "6.7.1";
16441
16420
 
16442
16421
  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 };
16443
16422
  //# sourceMappingURL=bruce-models.es5.js.map