bruce-models 3.3.0 → 3.3.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.
@@ -2770,7 +2770,7 @@ var Entity;
2770
2770
  */
2771
2771
  function GetListByIds(params) {
2772
2772
  return __awaiter(this, void 0, void 0, function* () {
2773
- let { api, entityIds, req: reqParams, expandRelations } = params;
2773
+ let { api, entityIds, req: reqParams, expandRelations, expandLocation } = params;
2774
2774
  if (!entityIds.length) {
2775
2775
  throw ("Entity IDs are required.");
2776
2776
  }
@@ -2781,7 +2781,7 @@ var Entity;
2781
2781
  const reqIds = [];
2782
2782
  for (let i = 0; i < entityIds.length; i++) {
2783
2783
  const entityId = entityIds[i];
2784
- const key = GetCacheKey({ entityId, expandRelations });
2784
+ const key = GetCacheKey({ entityId, expandRelations, expandLocation });
2785
2785
  const cache = api.GetCacheItem(key, reqParams);
2786
2786
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
2787
2787
  reqs.push(cache.data);
@@ -2798,15 +2798,17 @@ var Entity;
2798
2798
  },
2799
2799
  PageSize: reqIds.length
2800
2800
  };
2801
+ if (expandRelations) {
2802
+ reqData["Expand"] = "relation";
2803
+ }
2804
+ else if (expandLocation) {
2805
+ reqData["Expand"] = "location";
2806
+ }
2801
2807
  if (reqIds.length > 0) {
2802
- const urlParams = new URLSearchParams();
2803
- if (expandRelations) {
2804
- urlParams.append("$expand", "relation");
2805
- }
2806
- const req = api.POST("entities?" + urlParams.toString(), reqData, Api.PrepReqParams(reqParams));
2808
+ const req = api.POST("entities", reqData, Api.PrepReqParams(reqParams));
2807
2809
  for (let i = 0; i < reqIds.length; i++) {
2808
2810
  const entityId = reqIds[i];
2809
- const key = GetCacheKey({ entityId });
2811
+ const key = GetCacheKey({ entityId, expandLocation, expandRelations });
2810
2812
  const prom = new Promise((res) => __awaiter(this, void 0, void 0, function* () {
2811
2813
  try {
2812
2814
  const data = yield req;
@@ -10622,7 +10624,7 @@ var DataSource;
10622
10624
  DataSource.GetList = GetList;
10623
10625
  })(DataSource || (DataSource = {}));
10624
10626
 
10625
- const VERSION = "3.3.0";
10627
+ const VERSION = "3.3.2";
10626
10628
 
10627
10629
  export { VERSION, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityTypeVisualSettings, EntityAttribute, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, ImportCad, ImportCsv, ImportJson, ImportKml, ImportedFile, Markup, Uploader, Plugin, ENVIRONMENT, DataSource };
10628
10630
  //# sourceMappingURL=bruce-models.es5.js.map