bruce-models 6.7.6 → 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.
@@ -985,7 +985,7 @@ var BruceApi;
985
985
  // Indicates if the init process has finished loading.
986
986
  // While this is not resolved requests will be in a pending state.
987
987
  this.loadProm = Promise.resolve();
988
- let { accountId, env, guardian, loadRegionalBaseUrl, loadConfig, loadWebSocket, dummy } = params;
988
+ let { accountId, env, guardian, loadRegionalBaseUrl, loadConfig, loadWebSocket, dummy, account } = params;
989
989
  this.accountId = accountId;
990
990
  this.env = env !== null && env !== void 0 ? env : Api.EEnv.PROD;
991
991
  if (!dummy) {
@@ -997,16 +997,20 @@ var BruceApi;
997
997
  // Mark it as attempted right away because we don't want any external calls while it gets to that async point.
998
998
  this.configLoadAttempted = true;
999
999
  }
1000
- this.loadProm = this.init(guardian, loadConfig, loadWebSocket);
1000
+ this.loadProm = this.init(guardian, loadConfig, loadWebSocket, account);
1001
1001
  }
1002
1002
  }
1003
1003
  /**
1004
1004
  * Loads regional base url and sets up message broker.
1005
1005
  * @param guardian Required for loading regional base url.
1006
1006
  * @param loadConfig
1007
+ * @param loadWebSocket
1008
+ * @param account
1007
1009
  * @returns
1008
1010
  */
1009
- init(guardian, loadConfig, loadWebSocket) {
1011
+ init(guardian, loadConfig, loadWebSocket,
1012
+ // Preloaded account to save doing an API call.
1013
+ account) {
1010
1014
  return __awaiter(this, void 0, void 0, function* () {
1011
1015
  if (!this.accountId) {
1012
1016
  throw ("accountId is required.");
@@ -1020,7 +1024,8 @@ var BruceApi;
1020
1024
  guardian: guardian,
1021
1025
  // We marked it as attempted to load outside this method to fight any external calls.
1022
1026
  // So we'll force load it now.
1023
- forceLoad: true
1027
+ forceLoad: true,
1028
+ account: account
1024
1029
  });
1025
1030
  }
1026
1031
  // Get the version.
@@ -1075,7 +1080,7 @@ var BruceApi;
1075
1080
  */
1076
1081
  LoadConfig(params) {
1077
1082
  return __awaiter(this, void 0, void 0, function* () {
1078
- let { guardian, forceLoad } = (params !== null && params !== void 0 ? params : {});
1083
+ let { guardian, forceLoad, account } = (params !== null && params !== void 0 ? params : {});
1079
1084
  if (this.configLoadAttempted && forceLoad != true) {
1080
1085
  return;
1081
1086
  }
@@ -1086,10 +1091,12 @@ var BruceApi;
1086
1091
  env: this.env
1087
1092
  });
1088
1093
  }
1089
- const { account } = yield Account.GetBySubdomain({
1090
- subdomain: this.accountId,
1091
- api: guardian
1092
- });
1094
+ if (!account) {
1095
+ account = (yield Account.GetBySubdomain({
1096
+ subdomain: this.accountId,
1097
+ api: guardian
1098
+ })).account;
1099
+ }
1093
1100
  if (!this.loadCancelled) {
1094
1101
  // Set the calculated base url.
1095
1102
  // If this is not available then this is considered a critical failure.
@@ -16452,7 +16459,7 @@ var Tracking;
16452
16459
  })(Tracking || (Tracking = {}));
16453
16460
 
16454
16461
  // This is updated with the package.json version on build.
16455
- const VERSION = "6.7.6";
16462
+ const VERSION = "6.7.7";
16456
16463
 
16457
16464
  export { VERSION, Assembly, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, GeoJson, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityAttribute, EntityHistoricData, EntityTableView, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewBookmarkGroup, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, UserMfaMethod, Account, AccountInvite, AccountFeatures, AccountLimits, AccountTemplate, AccountType, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, DataLabGroup, ImportAssembly, ImportCad, ImportCsv, ImportJson, ImportGeoJson, ImportKml, ImportedFile, ExportBrz, ExportUsd, Markup, Uploader, Plugin, ENVIRONMENT, DataSource, Scenario, Tracking };
16458
16465
  //# sourceMappingURL=bruce-models.es5.js.map