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.
@@ -10965,21 +10965,28 @@
10965
10965
  */
10966
10966
  function Get(params) {
10967
10967
  return __awaiter(this, void 0, void 0, function* () {
10968
- let { api, viewId, req: reqParams } = params;
10969
- if (!viewId) {
10970
- throw ("View ID is required.");
10968
+ let { api, viewId, bookmarkId, expand, req: reqParams } = params;
10969
+ if (!viewId && !bookmarkId) {
10970
+ throw ("View ID or Bookmark ID is required.");
10971
10971
  }
10972
10972
  if (!api) {
10973
10973
  api = exports.ENVIRONMENT.Api().GetBruceApi();
10974
10974
  }
10975
- const key = GetCacheKey(viewId);
10975
+ const key = GetCacheKey(viewId, bookmarkId, expand);
10976
10976
  const cache = api.GetCacheItem(key, reqParams);
10977
10977
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
10978
10978
  return cache.data;
10979
10979
  }
10980
10980
  const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
10981
10981
  try {
10982
- const data = yield api.GET(`ui.view/${viewId}`, exports.Api.PrepReqParams(reqParams));
10982
+ let url = "ui.view/";
10983
+ if (viewId) {
10984
+ url += viewId;
10985
+ }
10986
+ else if (bookmarkId) {
10987
+ url += "?SlideID=" + encodeURIComponent(bookmarkId);
10988
+ }
10989
+ const data = yield api.GET(url, exports.Api.PrepReqParams(reqParams));
10983
10990
  res({
10984
10991
  view: data
10985
10992
  });
@@ -11061,7 +11068,7 @@
11061
11068
  api = exports.ENVIRONMENT.Api().GetBruceApi();
11062
11069
  }
11063
11070
  yield api.DELETE(`ui.view/${viewId}`, exports.Api.PrepReqParams(reqParams));
11064
- api.Cache.Remove(GetCacheKey(viewId));
11071
+ api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.ProjectView);
11065
11072
  });
11066
11073
  }
11067
11074
  ProjectView.Delete = Delete;
@@ -11097,7 +11104,7 @@
11097
11104
  else {
11098
11105
  data = yield api.PUT(`ui.view/${data.ID}`, data, exports.Api.PrepReqParams(reqParams));
11099
11106
  }
11100
- api.Cache.Remove(GetCacheKey(data.ID));
11107
+ api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.ProjectView);
11101
11108
  return {
11102
11109
  view: data
11103
11110
  };
@@ -11111,11 +11118,13 @@
11111
11118
  * const key = GetCacheKey("abc");
11112
11119
  * api.Cache.Remove(key);
11113
11120
  * }
11114
- * @param viewId
11121
+ * @param viewId ID of the project view to get.
11122
+ * @param bookmarkId Optional bookmark ID related to the view we want to find.
11123
+ * @param expand Optional expand parameter.
11115
11124
  * @returns
11116
11125
  */
11117
- function GetCacheKey(viewId) {
11118
- return `${exports.Api.ECacheKey.ProjectView}${exports.Api.ECacheKey.Id}${viewId}`;
11126
+ function GetCacheKey(viewId, bookmarkId, expand) {
11127
+ return `${exports.Api.ECacheKey.ProjectView}${exports.Api.ECacheKey.Id}${viewId || ""}${exports.Api.ECacheKey.ProjectViewBookmark}${bookmarkId || ""}${exports.Api.ECacheKey.Id}${expand ? (expand === true ? "true" : expand) : "false"}`;
11119
11128
  }
11120
11129
  ProjectView.GetCacheKey = GetCacheKey;
11121
11130
  })(exports.ProjectView || (exports.ProjectView = {}));
@@ -16118,7 +16127,7 @@
16118
16127
  })(exports.Tracking || (exports.Tracking = {}));
16119
16128
 
16120
16129
  // This is updated with the package.json version on build.
16121
- const VERSION = "6.7.4";
16130
+ const VERSION = "6.7.5";
16122
16131
 
16123
16132
  exports.VERSION = VERSION;
16124
16133
  exports.AbstractApi = AbstractApi;