bruce-models 3.5.5 → 3.5.7

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.
@@ -3000,14 +3000,14 @@ var Entity;
3000
3000
  if (!api) {
3001
3001
  api = ENVIRONMENT.Api().GetBruceApi();
3002
3002
  }
3003
- const reqs = [];
3003
+ const crashRiskReqs = [];
3004
3004
  const reqIds = [];
3005
3005
  for (let i = 0; i < entityIds.length; i++) {
3006
3006
  const entityId = entityIds[i];
3007
3007
  const key = GetCacheKey({ entityId, expandRelations, expandLocation });
3008
3008
  const cache = api.GetCacheItem(key, reqParams);
3009
3009
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
3010
- reqs.push(cache.data);
3010
+ crashRiskReqs.push(cache.data);
3011
3011
  }
3012
3012
  else {
3013
3013
  reqIds.push(entityId);
@@ -3027,6 +3027,7 @@ var Entity;
3027
3027
  else if (expandLocation) {
3028
3028
  reqData["Expand"] = "location";
3029
3029
  }
3030
+ const reqs = [];
3030
3031
  if (reqIds.length > 0) {
3031
3032
  const req = api.POST("entities", reqData, Api.PrepReqParams(reqParams));
3032
3033
  for (let i = 0; i < reqIds.length; i++) {
@@ -3053,8 +3054,22 @@ var Entity;
3053
3054
  reqs.push(prom);
3054
3055
  }
3055
3056
  }
3057
+ const entities = (yield Promise.all(reqs)).map(x => x === null || x === void 0 ? void 0 : x.entity).filter(x => !!x);
3058
+ // We'll try/catch the crash-risk ones and append the results.
3059
+ for (let i = 0; i < crashRiskReqs.length; i++) {
3060
+ const req = crashRiskReqs[i];
3061
+ try {
3062
+ const data = yield req;
3063
+ if (data === null || data === void 0 ? void 0 : data.entity) {
3064
+ entities.push(data.entity);
3065
+ }
3066
+ }
3067
+ catch (e) {
3068
+ // No showing error as we don't want to see it 2000 times.
3069
+ }
3070
+ }
3056
3071
  return {
3057
- entities: (yield Promise.all(reqs)).map(x => x === null || x === void 0 ? void 0 : x.entity).filter(x => !!x)
3072
+ entities: entities
3058
3073
  };
3059
3074
  });
3060
3075
  }
@@ -9864,10 +9879,13 @@ var AccountInvite;
9864
9879
  */
9865
9880
  function Create(params) {
9866
9881
  return __awaiter(this, void 0, void 0, function* () {
9867
- let { api, accountId, login, userId, email, mobile, emailTemplateKey, groupIds, req } = params;
9882
+ let { api, accountId, login, userId, email, mobile, emailTemplateKey, groupIds, req, inviteMethod } = params;
9868
9883
  if (!api) {
9869
9884
  api = ENVIRONMENT.Api().GetGuardianApi();
9870
9885
  }
9886
+ if (!(groupIds === null || groupIds === void 0 ? void 0 : groupIds.length)) {
9887
+ throw new Error("At least one User Group ID must be provided.");
9888
+ }
9871
9889
  const res = yield api.POST("invite/new", {
9872
9890
  accountId,
9873
9891
  login,
@@ -9875,7 +9893,8 @@ var AccountInvite;
9875
9893
  mobile,
9876
9894
  userId,
9877
9895
  groupIds,
9878
- emailTemplateKey
9896
+ emailTemplateKey,
9897
+ inviteMethod
9879
9898
  }, Api.PrepReqParams(req));
9880
9899
  return res;
9881
9900
  });
@@ -10868,7 +10887,7 @@ var DataSource;
10868
10887
  })(DataSource || (DataSource = {}));
10869
10888
 
10870
10889
  // This is updated with the package.json version on build.
10871
- const VERSION = "3.5.5";
10890
+ const VERSION = "3.5.7";
10872
10891
 
10873
10892
  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 };
10874
10893
  //# sourceMappingURL=bruce-models.es5.js.map