bruce-models 6.7.1 → 6.7.2

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.
@@ -12757,21 +12757,21 @@
12757
12757
  */
12758
12758
  function GetSettings(params) {
12759
12759
  return __awaiter(this, void 0, void 0, function* () {
12760
- let { api, userId, appId, req } = params;
12760
+ let { api, userId, appId, req, accountId } = params;
12761
12761
  if (!userId || !appId) {
12762
12762
  throw ("UserId and appId are required.");
12763
12763
  }
12764
12764
  if (!api) {
12765
12765
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
12766
12766
  }
12767
- const cacheKey = GetSettingsCacheKey(api.GetSessionId(), userId, appId);
12767
+ const cacheKey = GetSettingsCacheKey(api.GetSessionId(), userId, appId, accountId);
12768
12768
  const cache = api.GetCacheItem(cacheKey, req);
12769
12769
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
12770
12770
  return cache.data;
12771
12771
  }
12772
12772
  const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
12773
12773
  try {
12774
- const data = yield api.GET(`user/${userId}/application/${appId}/settings`);
12774
+ const data = yield api.GET(`user/${userId}/application/${appId}/settings${accountId ? "?Account=" + accountId : ""}`);
12775
12775
  const settings = (data === null || data === void 0 ? void 0 : data.Settings) ? data.Settings : {};
12776
12776
  res({
12777
12777
  settings: settings
@@ -12808,21 +12808,24 @@
12808
12808
  */
12809
12809
  function UpdateSettings(params) {
12810
12810
  return __awaiter(this, void 0, void 0, function* () {
12811
- let { api, accId, userId, appId, settings, req, override } = params;
12811
+ let { api, accId, accountId, userId, appId, settings, req, override } = params;
12812
12812
  if (!userId || !appId) {
12813
12813
  throw ("UserId and appId are required.");
12814
12814
  }
12815
12815
  if (!api) {
12816
12816
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
12817
12817
  }
12818
+ if (!accountId) {
12819
+ accountId = accId;
12820
+ }
12818
12821
  const postBody = {
12819
12822
  Settings: settings == null ? {} : settings,
12820
12823
  Application: appId,
12821
- ClientAccountID: accId,
12824
+ ClientAccountID: accountId,
12822
12825
  UserID: userId
12823
12826
  };
12824
12827
  const prom = api.POST(`user/${userId}/application/${appId}/settings?Override=${override ? "true" : "false"}`, postBody, req);
12825
- api.Cache.Remove(GetSettingsCacheKey(api.GetSessionId(), userId, appId));
12828
+ api.Cache.Remove(GetSettingsCacheKey(api.GetSessionId(), userId, appId, accountId));
12826
12829
  return prom;
12827
12830
  });
12828
12831
  }
@@ -13314,11 +13317,11 @@
13314
13317
  * @param appId
13315
13318
  * @returns
13316
13319
  */
13317
- function GetSettingsCacheKey(sessionId, userId, appId) {
13320
+ function GetSettingsCacheKey(sessionId, userId, appId, accountId) {
13318
13321
  if (!sessionId) {
13319
13322
  sessionId = "anonymous";
13320
13323
  }
13321
- return exports.Api.ECacheKey.User + exports.Api.ECacheKey.UserSettings + userId + exports.Api.ECacheKey.Id + appId;
13324
+ return exports.Api.ECacheKey.User + exports.Api.ECacheKey.UserSettings + userId + exports.Api.ECacheKey.Id + appId + (accountId ? exports.Api.ECacheKey.Id + accountId : "");
13322
13325
  }
13323
13326
  User.GetSettingsCacheKey = GetSettingsCacheKey;
13324
13327
  })(exports.User || (exports.User = {}));
@@ -16101,7 +16104,7 @@
16101
16104
  })(exports.Tracking || (exports.Tracking = {}));
16102
16105
 
16103
16106
  // This is updated with the package.json version on build.
16104
- const VERSION = "6.7.1";
16107
+ const VERSION = "6.7.2";
16105
16108
 
16106
16109
  exports.VERSION = VERSION;
16107
16110
  exports.AbstractApi = AbstractApi;