bruce-cesium 6.7.0 → 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.
@@ -16067,18 +16067,15 @@
16067
16067
  // Already exists, no need to re-initialize.
16068
16068
  return;
16069
16069
  }
16070
- const ionCheckApi = this.getters.GetBruceApi({});
16071
- await ionCheckApi.Loading;
16072
- const { programKeys: ionCheckKeys } = await BModels.ProgramKey.GetList({ api: ionCheckApi });
16073
- const ionKey = ionCheckKeys.find(k => k.ProgramId === BModels.ProgramKey.EProgramId.CesiumIon);
16074
- // Use if marked as available.
16075
16070
  let validToken;
16076
- if (ionCheckApi.IsVersionAtLeast(BModels.BruceApi.VERSION_WITH_PROXIES)) {
16077
- validToken = (ionKey === null || ionKey === void 0 ? void 0 : ionKey.Available) === true;
16071
+ if (Cesium.Ion.defaultServer) {
16072
+ // Proxy server was set after verifying Ion availability upstream
16073
+ // (including template account fallback) — trust that check.
16074
+ validToken = true;
16078
16075
  }
16079
- // Legacy route, to be killed off.
16080
16076
  else {
16081
- validToken = (ionKey === null || ionKey === void 0 ? void 0 : ionKey.Key) ? await exports.ViewerUtils.AssertIonToken(ionKey.Key) : false;
16077
+ // No proxy; validate the legacy access token directly.
16078
+ validToken = await exports.ViewerUtils.AssertIonToken(Cesium.Ion.defaultAccessToken);
16082
16079
  }
16083
16080
  if (!validToken) {
16084
16081
  console.warn("'tileset-osm-render-manager.ts' could not locate a valid Cesium Ion token.");
@@ -17355,7 +17352,7 @@
17355
17352
  tileset.loadUrl = loadUrlOverride;
17356
17353
  }
17357
17354
  // LCC Tileset to load through XGrids libs if they're available.
17358
- if (tileset.type === BModels.Tileset.EType.LegacyStatic && tileset.rootFileName && (tileset.rootFileName.toLowerCase()).endsWith(".lcc")) {
17355
+ if ((tileset === null || tileset === void 0 ? void 0 : tileset.type) === BModels.Tileset.EType.LegacyStatic && tileset.rootFileName && (tileset.rootFileName.toLowerCase()).endsWith(".lcc")) {
17359
17356
  this.renderType = ERenderType.XGridsLCC;
17360
17357
  this.renderTypeChanged.Trigger(this.renderType);
17361
17358
  const api = this.getters.GetBruceApi({
@@ -23009,17 +23006,13 @@
23009
23006
  // If we need a cesium token, and we don't have one, then we can't render this.
23010
23007
  let shouldCreate = true;
23011
23008
  if (NEEDS_CESIUM_TOKEN.includes(defaultImg.id)) {
23012
- const ionCheckApi = apiGetter.getApi(apiGetter.accountId);
23013
- await ionCheckApi.Loading;
23014
- const { programKeys: ionCheckKeys } = await BModels.ProgramKey.GetList({ api: ionCheckApi });
23015
- const ionKey = ionCheckKeys.find(k => k.ProgramId === BModels.ProgramKey.EProgramId.CesiumIon);
23016
- // Use if marked as available.
23017
- if (ionCheckApi.IsVersionAtLeast(BModels.BruceApi.VERSION_WITH_PROXIES)) {
23018
- shouldCreate = (ionKey === null || ionKey === void 0 ? void 0 : ionKey.Available) === true;
23009
+ // Proxy server was set after verifying Ion availability upstream.
23010
+ if (Cesium.Ion.defaultServer) {
23011
+ shouldCreate = true;
23019
23012
  }
23020
23013
  // Legacy route, to be killed off.
23021
23014
  else {
23022
- shouldCreate = (ionKey === null || ionKey === void 0 ? void 0 : ionKey.Key) ? await exports.ViewerUtils.AssertIonToken(ionKey.Key) : false;
23015
+ shouldCreate = await exports.ViewerUtils.AssertIonToken(Cesium.Ion.defaultAccessToken);
23023
23016
  }
23024
23017
  }
23025
23018
  if (shouldCreate) {
@@ -23463,17 +23456,13 @@
23463
23456
  // Cesium token is required for Cesium World Terrain.
23464
23457
  let shouldCreate = true;
23465
23458
  if (defaultTerr.id == BModels.ProjectViewTile.EDefaultTerrain.CesiumWorldTerrain) {
23466
- const ionCheckApi = params.apiGetter.getApi(params.apiGetter.accountId);
23467
- await ionCheckApi.Loading;
23468
- const { programKeys: ionCheckKeys } = await BModels.ProgramKey.GetList({ api: ionCheckApi });
23469
- const ionKey = ionCheckKeys.find(k => k.ProgramId === BModels.ProgramKey.EProgramId.CesiumIon);
23470
- // Use if marked as available.
23471
- if (ionCheckApi.IsVersionAtLeast(BModels.BruceApi.VERSION_WITH_PROXIES)) {
23472
- shouldCreate = (ionKey === null || ionKey === void 0 ? void 0 : ionKey.Available) === true;
23459
+ // Proxy server was set after verifying Ion availability upstream
23460
+ if (Cesium.Ion.defaultServer) {
23461
+ shouldCreate = true;
23473
23462
  }
23474
23463
  // Legacy route, to be killed off.
23475
23464
  else {
23476
- shouldCreate = (ionKey === null || ionKey === void 0 ? void 0 : ionKey.Key) ? await exports.ViewerUtils.AssertIonToken(ionKey.Key) : false;
23465
+ shouldCreate = await exports.ViewerUtils.AssertIonToken(Cesium.Ion.defaultAccessToken);
23477
23466
  }
23478
23467
  }
23479
23468
  if (shouldCreate) {
@@ -36229,7 +36218,7 @@
36229
36218
  }
36230
36219
  }
36231
36220
 
36232
- const VERSION = "6.7.0";
36221
+ const VERSION = "6.7.2";
36233
36222
  /**
36234
36223
  * Updates the environment instance used by bruce-cesium to one specified.
36235
36224
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.