bruce-models 6.6.8 → 6.7.0

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.
@@ -11016,26 +11016,41 @@
11016
11016
  if (!api) {
11017
11017
  api = exports.ENVIRONMENT.Api().GetBruceApi();
11018
11018
  }
11019
- const cache = api.GetCacheItem(GetListCacheKey(type), reqParams);
11020
- if (cache === null || cache === void 0 ? void 0 : cache.found) {
11021
- return cache.data;
11022
- }
11023
11019
  const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
11024
11020
  try {
11025
- const data = yield api.GET("ui.view/list", exports.Api.PrepReqParams(reqParams));
11021
+ const queryParams = new URLSearchParams();
11022
+ if (params.search) {
11023
+ queryParams.set("Search", params.search);
11024
+ }
11025
+ if (params.pageSize) {
11026
+ queryParams.set("PageSize", params.pageSize.toString());
11027
+ }
11028
+ if (params.pageIndex) {
11029
+ queryParams.set("PageIndex", params.pageIndex.toString());
11030
+ }
11031
+ if (params.orderBy) {
11032
+ queryParams.set("OrderBy", params.orderBy);
11033
+ }
11034
+ if (params.sortOrder) {
11035
+ queryParams.set("SortOrder", params.sortOrder);
11036
+ }
11037
+ if (type) {
11038
+ queryParams.set("type", type);
11039
+ }
11040
+ if (params.expand) {
11041
+ queryParams.set("expand", "true");
11042
+ }
11043
+ const url = `ui.view/list?${queryParams.toString()}`;
11044
+ const data = yield api.GET(url, exports.Api.PrepReqParams(reqParams));
11026
11045
  res({
11027
- views: data.Items
11046
+ views: data.Items,
11047
+ totalCount: data.TotalCount
11028
11048
  });
11029
11049
  }
11030
11050
  catch (e) {
11031
11051
  rej(e);
11032
11052
  }
11033
11053
  }));
11034
- api.SetCacheItem({
11035
- key: GetListCacheKey(type),
11036
- value: prom,
11037
- req: reqParams
11038
- });
11039
11054
  return prom;
11040
11055
  });
11041
11056
  }
@@ -11055,7 +11070,6 @@
11055
11070
  }
11056
11071
  yield api.DELETE(`ui.view/${viewId}`, exports.Api.PrepReqParams(reqParams));
11057
11072
  api.Cache.Remove(GetCacheKey(viewId));
11058
- api.Cache.RemoveByStartsWith(GetListCacheKey());
11059
11073
  });
11060
11074
  }
11061
11075
  ProjectView.Delete = Delete;
@@ -11092,7 +11106,6 @@
11092
11106
  data = yield api.PUT(`ui.view/${data.ID}`, data, exports.Api.PrepReqParams(reqParams));
11093
11107
  }
11094
11108
  api.Cache.Remove(GetCacheKey(data.ID));
11095
- api.Cache.RemoveByStartsWith(GetListCacheKey());
11096
11109
  return {
11097
11110
  view: data
11098
11111
  };
@@ -11113,23 +11126,6 @@
11113
11126
  return `${exports.Api.ECacheKey.ProjectView}${exports.Api.ECacheKey.Id}${viewId}`;
11114
11127
  }
11115
11128
  ProjectView.GetCacheKey = GetCacheKey;
11116
- /**
11117
- * Returns cache identifier for a list of project views.
11118
- * Example: {
11119
- * const api: BruceApi.Api = ...;
11120
- * const key = GetListCacheKey();
11121
- * api.Cache.Remove(key);
11122
- * }
11123
- * @param type optional filter for the type of project view.
11124
- * @returns
11125
- */
11126
- function GetListCacheKey(type) {
11127
- if (type) {
11128
- return `${exports.Api.ECacheKey.ProjectView}${exports.Api.ECacheKey.ListId}${type}`;
11129
- }
11130
- return `${exports.Api.ECacheKey.ProjectView}${exports.Api.ECacheKey.ListId}`;
11131
- }
11132
- ProjectView.GetListCacheKey = GetListCacheKey;
11133
11129
  })(exports.ProjectView || (exports.ProjectView = {}));
11134
11130
 
11135
11131
  function getTemplateSettings(apiGetter, reqParams) {
@@ -16127,7 +16123,7 @@
16127
16123
  })(exports.Tracking || (exports.Tracking = {}));
16128
16124
 
16129
16125
  // This is updated with the package.json version on build.
16130
- const VERSION = "6.6.8";
16126
+ const VERSION = "6.7.0";
16131
16127
 
16132
16128
  exports.VERSION = VERSION;
16133
16129
  exports.AbstractApi = AbstractApi;