bruce-models 6.7.8 → 6.7.9

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.
@@ -1083,9 +1083,11 @@
1083
1083
  });
1084
1084
  }
1085
1085
  if (!account) {
1086
- account = (yield exports.Account.GetBySubdomain({
1087
- subdomain: this.accountId,
1088
- api: guardian
1086
+ account = (yield exports.Account.Get({
1087
+ accountId: this.accountId,
1088
+ api: guardian,
1089
+ appId: exports.ENVIRONMENT.PARAMS.appId,
1090
+ expand: ["limit"]
1089
1091
  })).account;
1090
1092
  }
1091
1093
  if (!this.loadCancelled) {
@@ -1778,7 +1780,9 @@
1778
1780
  // Default environment.
1779
1781
  env: exports.Api.EEnv.PROD,
1780
1782
  // Default session ID.
1781
- sessionId: ENVIRONMENT.GetPageLoadSessionId()
1783
+ sessionId: ENVIRONMENT.GetPageLoadSessionId(),
1784
+ // Default app ID to use when loading account data.
1785
+ appId: null
1782
1786
  };
1783
1787
  // Subscribe to get notified when someone calls Reset.
1784
1788
  // If you are manually updating params, call OnParamsChange.Trigger() to notify others.
@@ -1811,6 +1815,12 @@
1811
1815
  if (ENVIRONMENT.IS_SELF_MANAGED) {
1812
1816
  throw ("Self managed mode ON. You are getting this error because you didn't pass an Api instance to a function.");
1813
1817
  }
1818
+ if (params.appId) {
1819
+ ENVIRONMENT.PARAMS.appId = params.appId;
1820
+ }
1821
+ if (params.env) {
1822
+ ENVIRONMENT.PARAMS.env = params.env;
1823
+ }
1814
1824
  if (_getters) {
1815
1825
  _getters.ClearCache();
1816
1826
  if (params.accountId) {
@@ -13975,28 +13985,16 @@
13975
13985
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
13976
13986
  }
13977
13987
  req = exports.Api.PrepReqParams(req);
13978
- const cacheData = api.GetCacheItem(GetLimitsCacheKey(accountId));
13979
- if (cacheData === null || cacheData === void 0 ? void 0 : cacheData.found) {
13980
- return cacheData.data;
13981
- }
13982
- const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
13983
- try {
13984
- const data = yield api.GET(`account/${accountId}?WithLimits=true`);
13985
- const limits = data.Limits ? data.Limits : {};
13986
- res({
13987
- limits: limits
13988
- });
13989
- }
13990
- catch (e) {
13991
- rej(e);
13992
- }
13993
- }));
13994
- api.SetCacheItem({
13995
- key: GetLimitsCacheKey(accountId),
13996
- value: prom,
13997
- req: req
13988
+ const { account } = yield exports.Account.Get({
13989
+ accountId: accountId,
13990
+ api: api,
13991
+ expand: ["limit"],
13992
+ appId: exports.ENVIRONMENT.PARAMS.appId
13998
13993
  });
13999
- return prom;
13994
+ const limits = account["Limits"] || {};
13995
+ return {
13996
+ limits: limits
13997
+ };
14000
13998
  });
14001
13999
  }
14002
14000
  AccountLimits.GetLimits = GetLimits;
@@ -14586,14 +14584,6 @@
14586
14584
  }
14587
14585
  Assert.GetDenyPublicAccess = GetDenyPublicAccess;
14588
14586
  })(Assert = AccountLimits.Assert || (AccountLimits.Assert = {}));
14589
- /**
14590
- * Cache key for requesting account limits for a specific account.
14591
- * @param accountId
14592
- */
14593
- function GetLimitsCacheKey(accountId) {
14594
- return exports.Api.ECacheKey.AccountLimits + exports.Api.ECacheKey.Id + accountId;
14595
- }
14596
- AccountLimits.GetLimitsCacheKey = GetLimitsCacheKey;
14597
14587
  })(exports.AccountLimits || (exports.AccountLimits = {}));
14598
14588
 
14599
14589
  (function (AccountTemplate) {
@@ -16162,7 +16152,7 @@
16162
16152
  })(exports.Tracking || (exports.Tracking = {}));
16163
16153
 
16164
16154
  // This is updated with the package.json version on build.
16165
- const VERSION = "6.7.8";
16155
+ const VERSION = "6.7.9";
16166
16156
 
16167
16157
  exports.VERSION = VERSION;
16168
16158
  exports.AbstractApi = AbstractApi;