bruce-models 6.5.2 → 6.5.4

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.
@@ -12576,14 +12576,14 @@
12576
12576
  */
12577
12577
  function Get(params) {
12578
12578
  return __awaiter(this, void 0, void 0, function* () {
12579
- let { api, userId: id, accountId, req: reqParams } = params;
12579
+ let { api, userId: id, accountId, req: reqParams, expand } = params;
12580
12580
  if (!id) {
12581
- throw ("ID is required.");
12581
+ id = "anonymous";
12582
12582
  }
12583
12583
  if (!api) {
12584
12584
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
12585
12585
  }
12586
- const cacheKey = GetCacheKey(api.GetSessionId(), id, accountId);
12586
+ const cacheKey = GetCacheKey(api.GetSessionId(), id, accountId, expand);
12587
12587
  const cache = api.GetCacheItem(cacheKey, reqParams);
12588
12588
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
12589
12589
  return cache.data;
@@ -12594,6 +12594,9 @@
12594
12594
  if (accountId) {
12595
12595
  urlParams.append("clientAccountID", accountId);
12596
12596
  }
12597
+ if (expand) {
12598
+ urlParams.append("expand", expand);
12599
+ }
12597
12600
  let url = `user/${id}`;
12598
12601
  if (urlParams.toString().length) {
12599
12602
  url += "?" + urlParams.toString();
@@ -12776,6 +12779,11 @@
12776
12779
  if (!username) {
12777
12780
  throw ("Username is required.");
12778
12781
  }
12782
+ else if (typeof username == "string" && username.toLowerCase() === "anonymous") {
12783
+ return {
12784
+ isAvailable: false
12785
+ };
12786
+ }
12779
12787
  if (!api) {
12780
12788
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
12781
12789
  }
@@ -13192,16 +13200,23 @@
13192
13200
  * @param sessionId
13193
13201
  * @param userId
13194
13202
  * @param accountId
13203
+ * @param expand
13195
13204
  * @returns
13196
13205
  */
13197
- function GetCacheKey(sessionId, userId, accountId) {
13206
+ function GetCacheKey(sessionId, userId, accountId, expand) {
13198
13207
  if (!accountId) {
13199
13208
  accountId = "";
13200
13209
  }
13201
13210
  if (!sessionId) {
13202
13211
  sessionId = "anonymous";
13203
13212
  }
13204
- return exports.Api.ECacheKey.User + exports.Api.ECacheKey.Id + userId + exports.Api.ECacheKey.Id + accountId + exports.Api.ECacheKey.Session + exports.Api.ECacheKey.Id + sessionId;
13213
+ if (!userId) {
13214
+ userId = "anonymous";
13215
+ }
13216
+ if (!expand) {
13217
+ expand = "";
13218
+ }
13219
+ return exports.Api.ECacheKey.User + exports.Api.ECacheKey.Id + userId + exports.Api.ECacheKey.Id + accountId + exports.Api.ECacheKey.Session + exports.Api.ECacheKey.Id + sessionId + exports.Api.ECacheKey.Id + expand;
13205
13220
  }
13206
13221
  User.GetCacheKey = GetCacheKey;
13207
13222
  /**
@@ -15849,7 +15864,7 @@
15849
15864
  })(exports.Tracking || (exports.Tracking = {}));
15850
15865
 
15851
15866
  // This is updated with the package.json version on build.
15852
- const VERSION = "6.5.2";
15867
+ const VERSION = "6.5.4";
15853
15868
 
15854
15869
  exports.VERSION = VERSION;
15855
15870
  exports.AbstractApi = AbstractApi;