bruce-models 7.1.69 → 7.1.70

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
  });
@@ -13397,11 +13411,19 @@ var EntitySource;
13397
13411
  rej(e);
13398
13412
  }
13399
13413
  }));
13414
+ const sourcesByKey = prom.then((sources) => {
13415
+ const map = new Map();
13416
+ for (const s of sources) {
13417
+ if (!map.has(s["SourceRecord.Key"])) {
13418
+ map.set(s["SourceRecord.Key"], s);
13419
+ }
13420
+ }
13421
+ return map;
13422
+ });
13400
13423
  for (let i = 0; i < reqKeys.length; i++) {
13401
13424
  const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
13402
13425
  try {
13403
- const sources = yield prom;
13404
- res(sources.find((s) => s["SourceRecord.Key"] === reqKeys[i]));
13426
+ res((yield sourcesByKey).get(reqKeys[i]));
13405
13427
  }
13406
13428
  catch (e) {
13407
13429
  rej(e);
@@ -13672,12 +13694,20 @@ var EntityTag;
13672
13694
  rej(e);
13673
13695
  }
13674
13696
  }));
13697
+ const tagsById = prom.then((tags) => {
13698
+ const map = new Map();
13699
+ for (const t of tags) {
13700
+ if (!map.has(t.ID)) {
13701
+ map.set(t.ID, t);
13702
+ }
13703
+ }
13704
+ return map;
13705
+ });
13675
13706
  for (let i = 0; i < reqIds.length; i++) {
13676
13707
  const id = reqIds[i];
13677
13708
  const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
13678
13709
  try {
13679
- const tags = yield prom;
13680
- const tag = tags.find((t) => t.ID === id);
13710
+ const tag = (yield tagsById).get(id);
13681
13711
  res({
13682
13712
  tag: tag
13683
13713
  });
@@ -16044,8 +16074,9 @@ var Tileset;
16044
16074
  }
16045
16075
  else if (tilesetIds.length > 1) {
16046
16076
  const tilesets = yield api.GET("ui.tilesets", Api.PrepReqParams(reqParams));
16077
+ const tilesetIdsSet = new Set(tilesetIds);
16047
16078
  for (const tileset of tilesets) {
16048
- if (tilesetIds.indexOf(tileset.ID) >= 0) {
16079
+ if (tilesetIdsSet.has(tileset.ID)) {
16049
16080
  mapping[tileset.ID] = tileset.Type;
16050
16081
  }
16051
16082
  }
@@ -19757,7 +19788,7 @@ var UrlUtils;
19757
19788
  })(UrlUtils || (UrlUtils = {}));
19758
19789
 
19759
19790
  // This is updated with the package.json version on build.
19760
- const VERSION = "7.1.69";
19791
+ const VERSION = "7.1.70";
19761
19792
 
19762
19793
  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
19794
  //# sourceMappingURL=bruce-models.es5.js.map