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.
@@ -2719,7 +2719,7 @@
2719
2719
  */
2720
2720
  function GetListByIds(params) {
2721
2721
  return __awaiter(this, void 0, void 0, function* () {
2722
- let { api, entityIds, req: reqParams, expandRelations } = params;
2722
+ let { api, entityIds, req: reqParams, expandRelations, expandLocation } = params;
2723
2723
  if (!entityIds.length) {
2724
2724
  throw ("Entity IDs are required.");
2725
2725
  }
@@ -2730,7 +2730,7 @@
2730
2730
  const reqIds = [];
2731
2731
  for (let i = 0; i < entityIds.length; i++) {
2732
2732
  const entityId = entityIds[i];
2733
- const key = GetCacheKey({ entityId, expandRelations });
2733
+ const key = GetCacheKey({ entityId, expandRelations, expandLocation });
2734
2734
  const cache = api.GetCacheItem(key, reqParams);
2735
2735
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
2736
2736
  reqs.push(cache.data);
@@ -2747,15 +2747,17 @@
2747
2747
  },
2748
2748
  PageSize: reqIds.length
2749
2749
  };
2750
+ if (expandRelations) {
2751
+ reqData["Expand"] = "relation";
2752
+ }
2753
+ else if (expandLocation) {
2754
+ reqData["Expand"] = "location";
2755
+ }
2750
2756
  if (reqIds.length > 0) {
2751
- const urlParams = new URLSearchParams();
2752
- if (expandRelations) {
2753
- urlParams.append("$expand", "relation");
2754
- }
2755
- const req = api.POST("entities?" + urlParams.toString(), reqData, exports.Api.PrepReqParams(reqParams));
2757
+ const req = api.POST("entities", reqData, exports.Api.PrepReqParams(reqParams));
2756
2758
  for (let i = 0; i < reqIds.length; i++) {
2757
2759
  const entityId = reqIds[i];
2758
- const key = GetCacheKey({ entityId });
2760
+ const key = GetCacheKey({ entityId, expandLocation, expandRelations });
2759
2761
  const prom = new Promise((res) => __awaiter(this, void 0, void 0, function* () {
2760
2762
  try {
2761
2763
  const data = yield req;
@@ -10369,7 +10371,7 @@
10369
10371
  DataSource.GetList = GetList;
10370
10372
  })(exports.DataSource || (exports.DataSource = {}));
10371
10373
 
10372
- const VERSION = "3.3.0";
10374
+ const VERSION = "3.3.2";
10373
10375
 
10374
10376
  exports.VERSION = VERSION;
10375
10377
  exports.AbstractApi = AbstractApi;