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.
@@ -1341,7 +1341,7 @@
1341
1341
  // Attribute filter.
1342
1342
  (!requestFilter ? "" : "&Filter=" + exports.Api.Encode(JSON.stringify(requestFilter))) +
1343
1343
  // Order by attribute + sort order.
1344
- (!filter.orderBy ? "" : "&OrderBy=" + JSON.stringify(filter.orderBy)) +
1344
+ (!filter.orderBy ? "" : "&OrderBy=" + filter.orderBy) +
1345
1345
  (filter.sortOrder ? "&SortOrder=" + (filter.sortOrder == exports.Api.ESortOrder.Asc ? "ASC" : "DESC") : "");
1346
1346
  return [4 /*yield*/, api.GET(url, exports.Api.PrepReqParams())];
1347
1347
  case 1:
@@ -2602,8 +2602,12 @@
2602
2602
  return exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.Entity + exports.Api.ECacheKey.Id + entityId;
2603
2603
  }
2604
2604
  EntityRelation.GetEntityCacheKey = GetEntityCacheKey;
2605
- function GetListCacheKey(params) {
2606
- return exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.RelationType + exports.Api.ECacheKey.Id + params.typeId + exports.Api.ECacheKey.Id + params.oneWayOnly + exports.Api.ECacheKey.Id + params.loadEntityData;
2605
+ function GetListCacheKey(entityId, params) {
2606
+ return exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.RelationType +
2607
+ exports.Api.ECacheKey.Id + params.typeId +
2608
+ exports.Api.ECacheKey.Id + params.oneWayOnly +
2609
+ exports.Api.ECacheKey.Id + params.loadEntityData +
2610
+ exports.Api.ECacheKey.Entity + exports.Api.ECacheKey.Id + entityId;
2607
2611
  }
2608
2612
  EntityRelation.GetListCacheKey = GetListCacheKey;
2609
2613
  function Create(api, data) {
@@ -2668,7 +2672,7 @@
2668
2672
  throw ("Entity ID is required.");
2669
2673
  }
2670
2674
  params = __assign({ typeId: "", oneWayOnly: false, loadEntityData: false }, params);
2671
- cacheData = api.Cache.Get(GetListCacheKey(params));
2675
+ cacheData = api.Cache.Get(GetListCacheKey(entityId, params));
2672
2676
  if (cacheData) {
2673
2677
  return [2 /*return*/, cacheData];
2674
2678
  }
@@ -2696,7 +2700,7 @@
2696
2700
  }
2697
2701
  });
2698
2702
  }); });
2699
- api.Cache.Set(GetListCacheKey(params), req);
2703
+ api.Cache.Set(GetListCacheKey(entityId, params), req);
2700
2704
  return [2 /*return*/, req];
2701
2705
  });
2702
2706
  });
@@ -5156,10 +5160,16 @@
5156
5160
 
5157
5161
  (function (User) {
5158
5162
  function GetCacheKey(userId, accountId) {
5163
+ if (!accountId) {
5164
+ accountId = "";
5165
+ }
5159
5166
  return exports.Api.ECacheKey.User + exports.Api.ECacheKey.Id + userId + exports.Api.ECacheKey.Id + accountId;
5160
5167
  }
5161
5168
  User.GetCacheKey = GetCacheKey;
5162
5169
  function GetEmailCacheKey(email, accountId) {
5170
+ if (!accountId) {
5171
+ accountId = "";
5172
+ }
5163
5173
  return exports.Api.ECacheKey.User + exports.Api.ECacheKey.UserEmail + email + exports.Api.ECacheKey.Id + accountId;
5164
5174
  }
5165
5175
  User.GetEmailCacheKey = GetEmailCacheKey;