bruce-models 6.7.3 → 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.
@@ -10782,8 +10782,8 @@
10782
10782
  function Get(params) {
10783
10783
  return __awaiter(this, void 0, void 0, function* () {
10784
10784
  let { api, viewId, bookmarkId, req: reqParams } = params;
10785
- if (!viewId || !bookmarkId) {
10786
- throw ("View ID and Bookmark ID are required.");
10785
+ if (!bookmarkId) {
10786
+ throw ("Bookmark ID is required.");
10787
10787
  }
10788
10788
  if (!api) {
10789
10789
  api = exports.ENVIRONMENT.Api().GetBruceApi();
@@ -10795,7 +10795,14 @@
10795
10795
  }
10796
10796
  const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
10797
10797
  try {
10798
- const data = yield api.GET(`ui.view/${viewId}/slide/${bookmarkId}`, exports.Api.PrepReqParams(reqParams));
10798
+ let url;
10799
+ if (viewId) {
10800
+ url = `ui.view/${viewId}/slide/${bookmarkId}`;
10801
+ }
10802
+ else {
10803
+ url = `slide/${bookmarkId}`;
10804
+ }
10805
+ const data = yield api.GET(url, exports.Api.PrepReqParams(reqParams));
10799
10806
  res({
10800
10807
  bookmark: data
10801
10808
  });
@@ -10933,7 +10940,10 @@
10933
10940
  * @returns
10934
10941
  */
10935
10942
  function GetCacheKey(viewId, bookmarkId) {
10936
- return `${exports.Api.ECacheKey.ProjectViewBookmark}${exports.Api.ECacheKey.Id}${viewId}${exports.Api.ECacheKey.Id}${bookmarkId}`;
10943
+ if (viewId) {
10944
+ return `${exports.Api.ECacheKey.ProjectViewBookmark}${exports.Api.ECacheKey.Id}${viewId}${exports.Api.ECacheKey.Id}${bookmarkId}`;
10945
+ }
10946
+ return `${exports.Api.ECacheKey.ProjectViewBookmark}${exports.Api.ECacheKey.Id}${bookmarkId}`;
10937
10947
  }
10938
10948
  ProjectViewBookmark.GetCacheKey = GetCacheKey;
10939
10949
  })(exports.ProjectViewBookmark || (exports.ProjectViewBookmark = {}));
@@ -10955,21 +10965,28 @@
10955
10965
  */
10956
10966
  function Get(params) {
10957
10967
  return __awaiter(this, void 0, void 0, function* () {
10958
- let { api, viewId, req: reqParams } = params;
10959
- if (!viewId) {
10960
- 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.");
10961
10971
  }
10962
10972
  if (!api) {
10963
10973
  api = exports.ENVIRONMENT.Api().GetBruceApi();
10964
10974
  }
10965
- const key = GetCacheKey(viewId);
10975
+ const key = GetCacheKey(viewId, bookmarkId, expand);
10966
10976
  const cache = api.GetCacheItem(key, reqParams);
10967
10977
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
10968
10978
  return cache.data;
10969
10979
  }
10970
10980
  const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
10971
10981
  try {
10972
- 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));
10973
10990
  res({
10974
10991
  view: data
10975
10992
  });
@@ -11051,7 +11068,7 @@
11051
11068
  api = exports.ENVIRONMENT.Api().GetBruceApi();
11052
11069
  }
11053
11070
  yield api.DELETE(`ui.view/${viewId}`, exports.Api.PrepReqParams(reqParams));
11054
- api.Cache.Remove(GetCacheKey(viewId));
11071
+ api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.ProjectView);
11055
11072
  });
11056
11073
  }
11057
11074
  ProjectView.Delete = Delete;
@@ -11087,7 +11104,7 @@
11087
11104
  else {
11088
11105
  data = yield api.PUT(`ui.view/${data.ID}`, data, exports.Api.PrepReqParams(reqParams));
11089
11106
  }
11090
- api.Cache.Remove(GetCacheKey(data.ID));
11107
+ api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.ProjectView);
11091
11108
  return {
11092
11109
  view: data
11093
11110
  };
@@ -11101,11 +11118,13 @@
11101
11118
  * const key = GetCacheKey("abc");
11102
11119
  * api.Cache.Remove(key);
11103
11120
  * }
11104
- * @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.
11105
11124
  * @returns
11106
11125
  */
11107
- function GetCacheKey(viewId) {
11108
- 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"}`;
11109
11128
  }
11110
11129
  ProjectView.GetCacheKey = GetCacheKey;
11111
11130
  })(exports.ProjectView || (exports.ProjectView = {}));
@@ -16108,7 +16127,7 @@
16108
16127
  })(exports.Tracking || (exports.Tracking = {}));
16109
16128
 
16110
16129
  // This is updated with the package.json version on build.
16111
- const VERSION = "6.7.3";
16130
+ const VERSION = "6.7.5";
16112
16131
 
16113
16132
  exports.VERSION = VERSION;
16114
16133
  exports.AbstractApi = AbstractApi;