bruce-models 6.7.8 → 6.8.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.
@@ -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) {
@@ -8087,6 +8097,9 @@
8087
8097
  "SRID": "EPSG:" + epsg,
8088
8098
  "Entity.ID": entityId
8089
8099
  }
8100
+ },
8101
+ "transform": {
8102
+ "scale": params.scale || 1
8090
8103
  }
8091
8104
  },
8092
8105
  "test": params.test
@@ -13975,28 +13988,16 @@
13975
13988
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
13976
13989
  }
13977
13990
  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
13991
+ const { account } = yield exports.Account.Get({
13992
+ accountId: accountId,
13993
+ api: api,
13994
+ expand: ["limit"],
13995
+ appId: exports.ENVIRONMENT.PARAMS.appId
13998
13996
  });
13999
- return prom;
13997
+ const limits = account["Limits"] || {};
13998
+ return {
13999
+ limits: limits
14000
+ };
14000
14001
  });
14001
14002
  }
14002
14003
  AccountLimits.GetLimits = GetLimits;
@@ -14586,14 +14587,6 @@
14586
14587
  }
14587
14588
  Assert.GetDenyPublicAccess = GetDenyPublicAccess;
14588
14589
  })(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
14590
  })(exports.AccountLimits || (exports.AccountLimits = {}));
14598
14591
 
14599
14592
  (function (AccountTemplate) {
@@ -16162,7 +16155,7 @@
16162
16155
  })(exports.Tracking || (exports.Tracking = {}));
16163
16156
 
16164
16157
  // This is updated with the package.json version on build.
16165
- const VERSION = "6.7.8";
16158
+ const VERSION = "6.8.0";
16166
16159
 
16167
16160
  exports.VERSION = VERSION;
16168
16161
  exports.AbstractApi = AbstractApi;