bruce-models 6.7.5 → 6.7.7

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.
@@ -976,7 +976,7 @@
976
976
  // Indicates if the init process has finished loading.
977
977
  // While this is not resolved requests will be in a pending state.
978
978
  this.loadProm = Promise.resolve();
979
- let { accountId, env, guardian, loadRegionalBaseUrl, loadConfig, loadWebSocket, dummy } = params;
979
+ let { accountId, env, guardian, loadRegionalBaseUrl, loadConfig, loadWebSocket, dummy, account } = params;
980
980
  this.accountId = accountId;
981
981
  this.env = env !== null && env !== void 0 ? env : exports.Api.EEnv.PROD;
982
982
  if (!dummy) {
@@ -988,16 +988,20 @@
988
988
  // Mark it as attempted right away because we don't want any external calls while it gets to that async point.
989
989
  this.configLoadAttempted = true;
990
990
  }
991
- this.loadProm = this.init(guardian, loadConfig, loadWebSocket);
991
+ this.loadProm = this.init(guardian, loadConfig, loadWebSocket, account);
992
992
  }
993
993
  }
994
994
  /**
995
995
  * Loads regional base url and sets up message broker.
996
996
  * @param guardian Required for loading regional base url.
997
997
  * @param loadConfig
998
+ * @param loadWebSocket
999
+ * @param account
998
1000
  * @returns
999
1001
  */
1000
- init(guardian, loadConfig, loadWebSocket) {
1002
+ init(guardian, loadConfig, loadWebSocket,
1003
+ // Preloaded account to save doing an API call.
1004
+ account) {
1001
1005
  return __awaiter(this, void 0, void 0, function* () {
1002
1006
  if (!this.accountId) {
1003
1007
  throw ("accountId is required.");
@@ -1011,7 +1015,8 @@
1011
1015
  guardian: guardian,
1012
1016
  // We marked it as attempted to load outside this method to fight any external calls.
1013
1017
  // So we'll force load it now.
1014
- forceLoad: true
1018
+ forceLoad: true,
1019
+ account: account
1015
1020
  });
1016
1021
  }
1017
1022
  // Get the version.
@@ -1066,7 +1071,7 @@
1066
1071
  */
1067
1072
  LoadConfig(params) {
1068
1073
  return __awaiter(this, void 0, void 0, function* () {
1069
- let { guardian, forceLoad } = (params !== null && params !== void 0 ? params : {});
1074
+ let { guardian, forceLoad, account } = (params !== null && params !== void 0 ? params : {});
1070
1075
  if (this.configLoadAttempted && forceLoad != true) {
1071
1076
  return;
1072
1077
  }
@@ -1077,10 +1082,12 @@
1077
1082
  env: this.env
1078
1083
  });
1079
1084
  }
1080
- const { account } = yield exports.Account.GetBySubdomain({
1081
- subdomain: this.accountId,
1082
- api: guardian
1083
- });
1085
+ if (!account) {
1086
+ account = (yield exports.Account.GetBySubdomain({
1087
+ subdomain: this.accountId,
1088
+ api: guardian
1089
+ })).account;
1090
+ }
1084
1091
  if (!this.loadCancelled) {
1085
1092
  // Set the calculated base url.
1086
1093
  // If this is not available then this is considered a critical failure.
@@ -10972,6 +10979,10 @@
10972
10979
  if (!api) {
10973
10980
  api = exports.ENVIRONMENT.Api().GetBruceApi();
10974
10981
  }
10982
+ // Same thing but keeps cache keys consistent.
10983
+ if (expand === true) {
10984
+ expand = "*";
10985
+ }
10975
10986
  const key = GetCacheKey(viewId, bookmarkId, expand);
10976
10987
  const cache = api.GetCacheItem(key, reqParams);
10977
10988
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
@@ -10983,8 +10994,14 @@
10983
10994
  if (viewId) {
10984
10995
  url += viewId;
10985
10996
  }
10986
- else if (bookmarkId) {
10997
+ let added = false;
10998
+ if (bookmarkId) {
10987
10999
  url += "?SlideID=" + encodeURIComponent(bookmarkId);
11000
+ added = true;
11001
+ }
11002
+ if (expand) {
11003
+ url += (added ? "&" : "?") + "Expand=" + encodeURIComponent(expand);
11004
+ added = true;
10988
11005
  }
10989
11006
  const data = yield api.GET(url, exports.Api.PrepReqParams(reqParams));
10990
11007
  res({
@@ -16127,7 +16144,7 @@
16127
16144
  })(exports.Tracking || (exports.Tracking = {}));
16128
16145
 
16129
16146
  // This is updated with the package.json version on build.
16130
- const VERSION = "6.7.5";
16147
+ const VERSION = "6.7.7";
16131
16148
 
16132
16149
  exports.VERSION = VERSION;
16133
16150
  exports.AbstractApi = AbstractApi;