bruce-models 7.1.69 → 7.1.71

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.
@@ -5367,13 +5367,18 @@ var EntityType;
5367
5367
  }
5368
5368
  const data = yield Promise.all(reqs);
5369
5369
  // Populate array, while checking for already added types.
5370
+ // Batched ID requests can overlap.
5370
5371
  const types = [];
5372
+ const seenIds = new Set();
5371
5373
  for (const item of data) {
5372
5374
  for (const type of item.Items) {
5373
- appendInternalAttrSchema(type);
5374
- if (!types.find(x => x.ID == type.ID)) {
5375
- types.push(type);
5375
+ const key = String(type.ID);
5376
+ if (seenIds.has(key)) {
5377
+ continue;
5376
5378
  }
5379
+ seenIds.add(key);
5380
+ appendInternalAttrSchema(type);
5381
+ types.push(type);
5377
5382
  }
5378
5383
  }
5379
5384
  res({
@@ -6370,13 +6375,22 @@ var Entity;
6370
6375
  const reqs = [];
6371
6376
  if (reqIds.length > 0) {
6372
6377
  const req = api.POST(url, reqData, Api.PrepReqParams(reqParams));
6378
+ const itemsById = req.then(data => {
6379
+ const map = new Map();
6380
+ for (const item of data.Items) {
6381
+ const id = String(item.Bruce.ID);
6382
+ if (!map.has(id)) {
6383
+ map.set(id, item);
6384
+ }
6385
+ }
6386
+ return map;
6387
+ });
6373
6388
  for (let i = 0; i < reqIds.length; i++) {
6374
6389
  const entityId = reqIds[i];
6375
6390
  const key = GetCacheKey(Object.assign(Object.assign({}, cacheKeyData), { entityId }));
6376
6391
  const prom = new Promise((res) => __awaiter(this, void 0, void 0, function* () {
6377
6392
  try {
6378
- const data = yield req;
6379
- const item = data.Items.find(x => x.Bruce.ID == entityId);
6393
+ const item = (yield itemsById).get(String(entityId));
6380
6394
  res({
6381
6395
  entity: item
6382
6396
  });
@@ -11191,6 +11205,15 @@ var Style;
11191
11205
  (function (ETextureColorMaskType) {
11192
11206
  ETextureColorMaskType["BlackWhite"] = "BLACK_WHITE";
11193
11207
  })(ETextureColorMaskType = Style.ETextureColorMaskType || (Style.ETextureColorMaskType = {}));
11208
+ /**
11209
+ * Dictates where a polygon's extrusion height comes from.
11210
+ * Default is "PATH".
11211
+ */
11212
+ let EPolygonExtrusionType;
11213
+ (function (EPolygonExtrusionType) {
11214
+ EPolygonExtrusionType["Path"] = "PATH";
11215
+ EPolygonExtrusionType["Texture"] = "TEXTURE";
11216
+ })(EPolygonExtrusionType = Style.EPolygonExtrusionType || (Style.EPolygonExtrusionType = {}));
11194
11217
  /**
11195
11218
  * Returns a list of styles.
11196
11219
  * @param params
@@ -13397,11 +13420,19 @@ var EntitySource;
13397
13420
  rej(e);
13398
13421
  }
13399
13422
  }));
13423
+ const sourcesByKey = prom.then((sources) => {
13424
+ const map = new Map();
13425
+ for (const s of sources) {
13426
+ if (!map.has(s["SourceRecord.Key"])) {
13427
+ map.set(s["SourceRecord.Key"], s);
13428
+ }
13429
+ }
13430
+ return map;
13431
+ });
13400
13432
  for (let i = 0; i < reqKeys.length; i++) {
13401
13433
  const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
13402
13434
  try {
13403
- const sources = yield prom;
13404
- res(sources.find((s) => s["SourceRecord.Key"] === reqKeys[i]));
13435
+ res((yield sourcesByKey).get(reqKeys[i]));
13405
13436
  }
13406
13437
  catch (e) {
13407
13438
  rej(e);
@@ -13672,12 +13703,20 @@ var EntityTag;
13672
13703
  rej(e);
13673
13704
  }
13674
13705
  }));
13706
+ const tagsById = prom.then((tags) => {
13707
+ const map = new Map();
13708
+ for (const t of tags) {
13709
+ if (!map.has(t.ID)) {
13710
+ map.set(t.ID, t);
13711
+ }
13712
+ }
13713
+ return map;
13714
+ });
13675
13715
  for (let i = 0; i < reqIds.length; i++) {
13676
13716
  const id = reqIds[i];
13677
13717
  const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
13678
13718
  try {
13679
- const tags = yield prom;
13680
- const tag = tags.find((t) => t.ID === id);
13719
+ const tag = (yield tagsById).get(id);
13681
13720
  res({
13682
13721
  tag: tag
13683
13722
  });
@@ -16044,8 +16083,9 @@ var Tileset;
16044
16083
  }
16045
16084
  else if (tilesetIds.length > 1) {
16046
16085
  const tilesets = yield api.GET("ui.tilesets", Api.PrepReqParams(reqParams));
16086
+ const tilesetIdsSet = new Set(tilesetIds);
16047
16087
  for (const tileset of tilesets) {
16048
- if (tilesetIds.indexOf(tileset.ID) >= 0) {
16088
+ if (tilesetIdsSet.has(tileset.ID)) {
16049
16089
  mapping[tileset.ID] = tileset.Type;
16050
16090
  }
16051
16091
  }
@@ -19757,7 +19797,7 @@ var UrlUtils;
19757
19797
  })(UrlUtils || (UrlUtils = {}));
19758
19798
 
19759
19799
  // This is updated with the package.json version on build.
19760
- const VERSION = "7.1.69";
19800
+ const VERSION = "7.1.71";
19761
19801
 
19762
19802
  export { VERSION, Account, AccountAudit, AccountConcept, AccountFeatures, AccountInvite, AccountLimits, AccountTemplate, AccountType, AnnDocument, AbstractApi, Api, ApiGetters, BruceApi, GlobalApi, GuardianApi, Assembly, Calculator, ChangeSet, ClientFile, Bounds, BruceEvent, BruceVariable, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, GeoJson, Geometry, LRUCache, UTC, CustomForm, DashboardView, DataFeed, DataLab, DataLabGroup, DataSource, DataTransform, Comment, Entity, EntityAttachment, EntityAttachmentType, EntityAttribute, EntityComment, EntityCoords, EntityHistoricData, EntityLink, EntityLod, EntityLodCategory, EntityRelation, EntityRelationType, EntitySource, EntityTableView, EntityTag, EntityType, EntityTypeTrigger, Ontology, ENVIRONMENT, ExportBrz, ExportUsd, ImportAssembly, ImportCad, ImportCsv, ImportGeoJson, ImportJson, ImportKml, ImportLcc, ImportedFile, Uploader, Markup, UIMarkup, NAVIGATOR_CHAT_EVENT_ENTITY_HIGHLIGHT_APPLIED, NAVIGATOR_CHAT_EVENT_SCENE_CONTEXT_PREFETCHED, NavigatorChatClient, NavigatorMcpWebSocketClient, Plugin, ProgramKey, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewBookmarkGroup, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewLegacyTile, ProjectViewTile, ZoomControl, Scenario, HostingLocation, MessageBroker, PendingAction, RecordChangeFeed, Style, Tileset, Tracking, Permission, Session, User, UserGroup, UserMfaMethod, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils };
19763
19803
  //# sourceMappingURL=bruce-models.es5.js.map