bruce-models 6.9.8 → 6.9.9

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.
@@ -2163,14 +2163,14 @@
2163
2163
  */
2164
2164
  function GetList(params) {
2165
2165
  return __awaiter(this, void 0, void 0, function* () {
2166
- let { api, docType: type, req: reqParams, entityId, expandSettings } = params;
2166
+ let { api, docType: type, req: reqParams, entityId, expandSettings, pageIndex, pageSize } = params;
2167
2167
  if (!api) {
2168
2168
  api = exports.ENVIRONMENT.Api().GetBruceApi();
2169
2169
  }
2170
2170
  if (!type) {
2171
2171
  type = "";
2172
2172
  }
2173
- const cache = api.GetCacheItem(GetListCacheKey(type, entityId, expandSettings), reqParams);
2173
+ const cache = api.GetCacheItem(GetListCacheKey(type, entityId, expandSettings, pageIndex, pageSize), reqParams);
2174
2174
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
2175
2175
  return cache.data;
2176
2176
  }
@@ -2186,6 +2186,10 @@
2186
2186
  if (expandSettings) {
2187
2187
  urlParams.append("expandSettings", "true");
2188
2188
  }
2189
+ if (pageIndex !== undefined || pageSize !== undefined) {
2190
+ urlParams.append("PageIndex", String(pageIndex || 0));
2191
+ urlParams.append("PageSize", String(pageSize || 0));
2192
+ }
2189
2193
  const url = "documentViews" + `?${urlParams.toString()}`;
2190
2194
  const data = yield api.GET(url, exports.Api.PrepReqParams(reqParams));
2191
2195
  res({
@@ -2197,7 +2201,7 @@
2197
2201
  }
2198
2202
  }));
2199
2203
  api.SetCacheItem({
2200
- key: GetListCacheKey(type, entityId, expandSettings),
2204
+ key: GetListCacheKey(type, entityId, expandSettings, pageIndex, pageSize),
2201
2205
  value: req,
2202
2206
  req: reqParams
2203
2207
  });
@@ -2229,16 +2233,24 @@
2229
2233
  * @param type
2230
2234
  * @param entityId
2231
2235
  * @param expandSettings
2236
+ * @param pageIndex
2237
+ * @param pageSize
2232
2238
  * @returns
2233
2239
  */
2234
- function GetListCacheKey(type, entityId, expandSettings) {
2240
+ function GetListCacheKey(type, entityId, expandSettings, pageIndex, pageSize) {
2235
2241
  if (!expandSettings) {
2236
2242
  expandSettings = false;
2237
2243
  }
2238
2244
  if (!entityId) {
2239
2245
  entityId = "";
2240
2246
  }
2241
- return exports.Api.ECacheKey.AnnDocument + type + entityId + expandSettings;
2247
+ if (!pageIndex) {
2248
+ pageIndex = 0;
2249
+ }
2250
+ if (!pageSize) {
2251
+ pageSize = 0;
2252
+ }
2253
+ return exports.Api.ECacheKey.AnnDocument + type + entityId + expandSettings + pageIndex + "_" + pageSize;
2242
2254
  }
2243
2255
  AnnDocument.GetListCacheKey = GetListCacheKey;
2244
2256
  })(exports.AnnDocument || (exports.AnnDocument = {}));
@@ -8429,17 +8441,23 @@
8429
8441
  */
8430
8442
  function GetList(params) {
8431
8443
  return __awaiter(this, void 0, void 0, function* () {
8432
- let { api, req: reqParams } = params;
8444
+ let { api, req: reqParams, pageIndex, pageSize } = params;
8433
8445
  if (!api) {
8434
8446
  api = exports.ENVIRONMENT.Api().GetBruceApi();
8435
8447
  }
8436
- const cache = api.GetCacheItem(GetListCacheKey(), reqParams);
8448
+ const cache = api.GetCacheItem(GetListCacheKey(pageIndex, pageSize), reqParams);
8437
8449
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
8438
8450
  return cache.data;
8439
8451
  }
8440
8452
  const res = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
8441
8453
  try {
8442
- const data = yield api.GET("ui.entityDisplaySettings", exports.Api.PrepReqParams(reqParams));
8454
+ const urlParams = new URLSearchParams();
8455
+ if (pageIndex !== undefined || pageSize !== undefined) {
8456
+ urlParams.append("PageIndex", String(pageIndex || 0));
8457
+ urlParams.append("PageSize", String(pageSize || 0));
8458
+ }
8459
+ const url = "ui.entityDisplaySettings" + `?${urlParams.toString()}`;
8460
+ const data = yield api.GET(url, exports.Api.PrepReqParams(reqParams));
8443
8461
  res({
8444
8462
  styles: data.Items
8445
8463
  });
@@ -8449,7 +8467,7 @@
8449
8467
  }
8450
8468
  }));
8451
8469
  api.SetCacheItem({
8452
- key: GetListCacheKey(),
8470
+ key: GetListCacheKey(pageIndex, pageSize),
8453
8471
  value: res,
8454
8472
  req: reqParams
8455
8473
  });
@@ -8563,8 +8581,8 @@
8563
8581
  * }
8564
8582
  * @returns
8565
8583
  */
8566
- function GetListCacheKey() {
8567
- return exports.Api.ECacheKey.Style;
8584
+ function GetListCacheKey(pageSize, pageIndex) {
8585
+ return exports.Api.ECacheKey.Style + (pageIndex || 0) + "_" + (pageSize || 0);
8568
8586
  }
8569
8587
  Style.GetListCacheKey = GetListCacheKey;
8570
8588
  })(exports.Style || (exports.Style = {}));
@@ -16672,7 +16690,7 @@
16672
16690
  }
16673
16691
 
16674
16692
  // This is updated with the package.json version on build.
16675
- const VERSION = "6.9.8";
16693
+ const VERSION = "6.9.9";
16676
16694
 
16677
16695
  exports.VERSION = VERSION;
16678
16696
  exports.AbstractApi = AbstractApi;