bruce-models 0.4.8 → 0.5.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.
@@ -1363,7 +1363,7 @@ var Entity;
1363
1363
  // Attribute filter.
1364
1364
  (!requestFilter ? "" : "&Filter=" + Api.Encode(JSON.stringify(requestFilter))) +
1365
1365
  // Order by attribute + sort order.
1366
- (!filter.orderBy ? "" : "&OrderBy=" + JSON.stringify(filter.orderBy)) +
1366
+ (!filter.orderBy ? "" : "&OrderBy=" + filter.orderBy) +
1367
1367
  (filter.sortOrder ? "&SortOrder=" + (filter.sortOrder == Api.ESortOrder.Asc ? "ASC" : "DESC") : "");
1368
1368
  return [4 /*yield*/, api.GET(url, Api.PrepReqParams())];
1369
1369
  case 1:
@@ -2673,8 +2673,12 @@ var EntityRelation;
2673
2673
  return Api.ECacheKey.Relation + Api.ECacheKey.Entity + Api.ECacheKey.Id + entityId;
2674
2674
  }
2675
2675
  EntityRelation.GetEntityCacheKey = GetEntityCacheKey;
2676
- function GetListCacheKey(params) {
2677
- return Api.ECacheKey.Relation + Api.ECacheKey.RelationType + Api.ECacheKey.Id + params.typeId + Api.ECacheKey.Id + params.oneWayOnly + Api.ECacheKey.Id + params.loadEntityData;
2676
+ function GetListCacheKey(entityId, params) {
2677
+ return Api.ECacheKey.Relation + Api.ECacheKey.RelationType +
2678
+ Api.ECacheKey.Id + params.typeId +
2679
+ Api.ECacheKey.Id + params.oneWayOnly +
2680
+ Api.ECacheKey.Id + params.loadEntityData +
2681
+ Api.ECacheKey.Entity + Api.ECacheKey.Id + entityId;
2678
2682
  }
2679
2683
  EntityRelation.GetListCacheKey = GetListCacheKey;
2680
2684
  function Create(api, data) {
@@ -2739,7 +2743,7 @@ var EntityRelation;
2739
2743
  throw ("Entity ID is required.");
2740
2744
  }
2741
2745
  params = __assign({ typeId: "", oneWayOnly: false, loadEntityData: false }, params);
2742
- cacheData = api.Cache.Get(GetListCacheKey(params));
2746
+ cacheData = api.Cache.Get(GetListCacheKey(entityId, params));
2743
2747
  if (cacheData) {
2744
2748
  return [2 /*return*/, cacheData];
2745
2749
  }
@@ -2767,7 +2771,7 @@ var EntityRelation;
2767
2771
  }
2768
2772
  });
2769
2773
  }); });
2770
- api.Cache.Set(GetListCacheKey(params), req);
2774
+ api.Cache.Set(GetListCacheKey(entityId, params), req);
2771
2775
  return [2 /*return*/, req];
2772
2776
  });
2773
2777
  });
@@ -5351,10 +5355,16 @@ var UserGroup;
5351
5355
  var User;
5352
5356
  (function (User) {
5353
5357
  function GetCacheKey(userId, accountId) {
5358
+ if (!accountId) {
5359
+ accountId = "";
5360
+ }
5354
5361
  return Api.ECacheKey.User + Api.ECacheKey.Id + userId + Api.ECacheKey.Id + accountId;
5355
5362
  }
5356
5363
  User.GetCacheKey = GetCacheKey;
5357
5364
  function GetEmailCacheKey(email, accountId) {
5365
+ if (!accountId) {
5366
+ accountId = "";
5367
+ }
5358
5368
  return Api.ECacheKey.User + Api.ECacheKey.UserEmail + email + Api.ECacheKey.Id + accountId;
5359
5369
  }
5360
5370
  User.GetEmailCacheKey = GetEmailCacheKey;