bruce-cesium 2.6.8 → 2.6.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.
@@ -8193,19 +8193,53 @@
8193
8193
  return [2 /*return*/];
8194
8194
  }
8195
8195
  (function () { return __awaiter(_this, void 0, void 0, function () {
8196
- var api, tileset, cTileset, _a;
8196
+ var canAccess, e_1, accountId, api, tileset, cTileset, _a;
8197
8197
  var _this = this;
8198
- var _b, _c;
8199
- return __generator(this, function (_d) {
8200
- switch (_d.label) {
8198
+ var _b, _c, _d;
8199
+ return __generator(this, function (_e) {
8200
+ switch (_e.label) {
8201
8201
  case 0:
8202
- api = this.getters.GetBruceApi();
8202
+ if (!tilesetId) return [3 /*break*/, 5];
8203
+ canAccess = false;
8204
+ _e.label = 1;
8205
+ case 1:
8206
+ _e.trys.push([1, 3, , 4]);
8207
+ return [4 /*yield*/, bruceModels.Tileset.Publish.IsAccessAllowed({
8208
+ sourceAccountId: (_b = this.item.tileset) === null || _b === void 0 ? void 0 : _b.ClientAccountID,
8209
+ tilesetId: tilesetId,
8210
+ forAccountId: this.getters.GetAccountId(),
8211
+ api: this.getters.GetGlobalApi()
8212
+ })];
8213
+ case 2:
8214
+ canAccess = _e.sent();
8215
+ return [3 /*break*/, 4];
8216
+ case 3:
8217
+ e_1 = _e.sent();
8218
+ console.error(e_1);
8219
+ return [3 /*break*/, 4];
8220
+ case 4:
8221
+ if (!canAccess) {
8222
+ console.warn("Cannot access tileset: ".concat(tilesetId, ", from account: ").concat((_c = this.item.tileset) === null || _c === void 0 ? void 0 : _c.ClientAccountID, "."));
8223
+ return [2 /*return*/];
8224
+ }
8225
+ return [3 /*break*/, 6];
8226
+ case 5:
8227
+ console.warn("No tileset id found. Skipping access check.");
8228
+ _e.label = 6;
8229
+ case 6:
8230
+ accountId = (_d = this.item.tileset) === null || _d === void 0 ? void 0 : _d.ClientAccountID;
8231
+ if (!accountId) {
8232
+ accountId = this.getters.GetAccountId();
8233
+ }
8234
+ api = this.getters.GetBruceApi({
8235
+ accountId: accountId
8236
+ });
8203
8237
  return [4 /*yield*/, bruceModels.Tileset.Get({
8204
8238
  api: api,
8205
8239
  tilesetId: tilesetId
8206
8240
  })];
8207
- case 1:
8208
- tileset = (_d.sent()).tileset;
8241
+ case 7:
8242
+ tileset = (_e.sent()).tileset;
8209
8243
  if (!tileset || this.disposed) {
8210
8244
  return [2 /*return*/];
8211
8245
  }
@@ -8215,11 +8249,11 @@
8215
8249
  apiGetter: this.getters.GetBruceGetter(),
8216
8250
  tileset: tileset,
8217
8251
  viewer: this.viewer,
8218
- accountId: (_c = (_b = this.item.tileset) === null || _b === void 0 ? void 0 : _b.ClientAccountID) !== null && _c !== void 0 ? _c : this.getters.GetAccountId(),
8252
+ accountId: accountId,
8219
8253
  viaCdn: this.item.cdnEnabled
8220
8254
  })];
8221
- case 2:
8222
- cTileset = _a.cTileset = _d.sent();
8255
+ case 8:
8256
+ cTileset = _a.cTileset = _e.sent();
8223
8257
  if (this.disposed) {
8224
8258
  this.doDispose();
8225
8259
  return [2 /*return*/];
@@ -15128,7 +15162,7 @@
15128
15162
  ViewerUtils.CreateWidgets = CreateWidgets;
15129
15163
  })(exports.ViewerUtils || (exports.ViewerUtils = {}));
15130
15164
 
15131
- var VERSION$1 = "2.6.8";
15165
+ var VERSION$1 = "2.6.9";
15132
15166
 
15133
15167
  exports.VERSION = VERSION$1;
15134
15168
  exports.CesiumViewMonitor = CesiumViewMonitor;