bruce-models 3.0.1 → 3.0.3

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.
@@ -2066,10 +2066,10 @@ var Entity;
2066
2066
  return `${Api.ECacheKey.Entity}${Api.ECacheKey.Id}${entityId}${String(entityTypeId)}${String(Boolean(expandLocation))}`;
2067
2067
  }
2068
2068
  Entity.GetCacheKey = GetCacheKey;
2069
- function GetStartsWithKey(entityId) {
2069
+ function GetContainsKey(entityId) {
2070
2070
  return `${Api.ECacheKey.Entity}${Api.ECacheKey.Id}${entityId}`;
2071
2071
  }
2072
- Entity.GetStartsWithKey = GetStartsWithKey;
2072
+ Entity.GetContainsKey = GetContainsKey;
2073
2073
  function Get(params) {
2074
2074
  return __awaiter(this, void 0, void 0, function* () {
2075
2075
  let { api, entityId, req: reqParams, expandLocation, entityTypeId } = params;
@@ -2183,7 +2183,7 @@ var Entity;
2183
2183
  throw ("Entity ID is required.");
2184
2184
  }
2185
2185
  yield api.DELETE(`entity/${entityId}`, Api.PrepReqParams(reqParams));
2186
- api.Cache.RemoveByStartsWith(GetStartsWithKey(entityId));
2186
+ api.Cache.RemoveByContains(GetContainsKey(entityId));
2187
2187
  });
2188
2188
  }
2189
2189
  Entity.Delete = Delete;
@@ -2201,7 +2201,7 @@ var Entity;
2201
2201
  }, Api.PrepReqParams(reqParams));
2202
2202
  for (let i = 0; i < entityIds.length; i++) {
2203
2203
  const entityId = entityIds[i];
2204
- api.Cache.RemoveByStartsWith(GetStartsWithKey(entityId));
2204
+ api.Cache.RemoveByContains(GetContainsKey(entityId));
2205
2205
  }
2206
2206
  });
2207
2207
  }
@@ -2221,7 +2221,7 @@ var Entity;
2221
2221
  }
2222
2222
  const reqUrl = `entity/${data.Bruce.ID}/?dataoverride=${override}&BruceEntityType=${data.Bruce["EntityType.ID"]}`;
2223
2223
  const res = yield api.POST(reqUrl, data, Api.PrepReqParams(reqParams));
2224
- api.Cache.RemoveByStartsWith(GetStartsWithKey(data.Bruce.ID));
2224
+ api.Cache.RemoveByContains(GetContainsKey(data.Bruce.ID));
2225
2225
  return {
2226
2226
  entity: res
2227
2227
  };
@@ -2690,16 +2690,35 @@ var Calculator;
2690
2690
  let value;
2691
2691
  switch (field.type) {
2692
2692
  case EValueType.Gradient:
2693
- value = String(GetGradientValue(field.value, entity));
2693
+ {
2694
+ const tmp = GetGradientValue(field.value, entity);
2695
+ // This avoids null turning into "null".
2696
+ if (tmp) {
2697
+ value = String(tmp);
2698
+ }
2699
+ }
2694
2700
  break;
2695
2701
  case EValueType.Color:
2696
2702
  case EValueType.Input:
2697
- value = String(GetInputValue(field.value, entity));
2703
+ {
2704
+ const tmp = GetInputValue(field.value, entity);
2705
+ // This avoids null turning into "null".
2706
+ if (tmp) {
2707
+ value = String(tmp);
2708
+ }
2709
+ }
2698
2710
  break;
2699
2711
  case EValueType.Mapping:
2700
- value = String(GetMappingValue(field.value, entity));
2712
+ {
2713
+ const tmp = GetMappingValue(field.value, entity);
2714
+ // This avoids null turning into "null".
2715
+ if (tmp) {
2716
+ value = String(tmp);
2717
+ }
2718
+ }
2701
2719
  break;
2702
2720
  case EValueType.RandomColor:
2721
+ // Would be nice to randomize based on an attribute or entity ID instead of pure random.
2703
2722
  var color = Color.RandomColor();
2704
2723
  value = `rgba(${color.red},${color.green},${color.blue},${color.alpha})`;
2705
2724
  break;
@@ -9108,7 +9127,7 @@ var DataSource;
9108
9127
  DataSource.GetList = GetList;
9109
9128
  })(DataSource || (DataSource = {}));
9110
9129
 
9111
- const VERSION = "3.0.1";
9130
+ const VERSION = "3.0.3";
9112
9131
 
9113
9132
  export { VERSION, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, CamApi, IdmApi, 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, EntityGlobe, EntityFilterGetter, BatchedDataGetter, EntityCoords, EntityTypeVisualSettings, EntityAttribute, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, 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 };
9114
9133
  //# sourceMappingURL=bruce-models.es5.js.map