bruce-models 5.1.6 → 5.1.8

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.
@@ -2984,9 +2984,9 @@
2984
2984
  */
2985
2985
  function GetStats(params) {
2986
2986
  return __awaiter(this, void 0, void 0, function* () {
2987
- let { entityIds, api, req } = params;
2988
- // Save time and just return a none response if no entity IDs are provided.
2989
- if (!(entityIds === null || entityIds === void 0 ? void 0 : entityIds.length)) {
2987
+ let { entityIds, entityTypeId, api, req } = params;
2988
+ // Save time and just return a none response if no entity IDs or type ID are provided.
2989
+ if (!(entityIds === null || entityIds === void 0 ? void 0 : entityIds.length) && !entityTypeId) {
2990
2990
  return {
2991
2991
  stats: []
2992
2992
  };
@@ -2995,13 +2995,14 @@
2995
2995
  api = exports.ENVIRONMENT.Api().GetBruceApi();
2996
2996
  }
2997
2997
  req = exports.Api.PrepReqParams(req);
2998
- const cacheKey = GetStatsCacheKey(entityIds);
2998
+ const cacheKey = GetStatsCacheKey(entityIds, entityTypeId);
2999
2999
  const cached = api.GetCacheItem(cacheKey, req);
3000
3000
  if (cached === null || cached === void 0 ? void 0 : cached.found) {
3001
3001
  return cached.data;
3002
3002
  }
3003
3003
  const prom = yield api.POST("v1/entity/historicData/stats", {
3004
- entityIds: entityIds
3004
+ entityIds: entityIds,
3005
+ entityTypeId: entityTypeId
3005
3006
  }, req);
3006
3007
  api.SetCacheItem({
3007
3008
  key: cacheKey,
@@ -3091,7 +3092,13 @@
3091
3092
  return exports.Api.ECacheKey.EntityHistoricDataRec + exports.Api.ECacheKey.Id + entityIds.join(",") + exports.Api.ECacheKey.Id + attrKey + exports.Api.ECacheKey.Id + dateTimeFrom + exports.Api.ECacheKey.Id + dateTimeTo;
3092
3093
  }
3093
3094
  EntityHistoricData.GetListCacheKey = GetListCacheKey;
3094
- function GetStatsCacheKey(entityIds) {
3095
+ function GetStatsCacheKey(entityIds, typeId) {
3096
+ if (!(entityIds === null || entityIds === void 0 ? void 0 : entityIds.length)) {
3097
+ entityIds = [];
3098
+ }
3099
+ if (!typeId) {
3100
+ typeId = "";
3101
+ }
3095
3102
  return exports.Api.ECacheKey.EntityHistoricDataStats + exports.Api.ECacheKey.Id + entityIds.join(",");
3096
3103
  }
3097
3104
  EntityHistoricData.GetStatsCacheKey = GetStatsCacheKey;
@@ -14219,7 +14226,7 @@
14219
14226
  })(exports.DataSource || (exports.DataSource = {}));
14220
14227
 
14221
14228
  // This is updated with the package.json version on build.
14222
- const VERSION = "5.1.6";
14229
+ const VERSION = "5.1.8";
14223
14230
 
14224
14231
  exports.VERSION = VERSION;
14225
14232
  exports.AbstractApi = AbstractApi;