bruce-models 4.2.8 → 4.3.0

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.
@@ -3601,7 +3601,13 @@ var Entity;
3601
3601
  * @param params
3602
3602
  */
3603
3603
  function SetValue(params) {
3604
- const { entity: data, path, value } = params;
3604
+ let { entity: data, path, value } = params;
3605
+ if (!path || !path.length) {
3606
+ return;
3607
+ }
3608
+ if (typeof path == "string") {
3609
+ path = PathUtils.Parse(path);
3610
+ }
3605
3611
  let curData = data;
3606
3612
  for (let i = 0; i < path.length; i++) {
3607
3613
  const step = path[i];
@@ -3627,6 +3633,12 @@ var Entity;
3627
3633
  if (checkAgainstLegacy == null) {
3628
3634
  checkAgainstLegacy = true;
3629
3635
  }
3636
+ if (!path || !path.length) {
3637
+ return null;
3638
+ }
3639
+ if (typeof path == "string") {
3640
+ path = PathUtils.Parse(path);
3641
+ }
3630
3642
  // Backwards compatibility for incredibly old data.
3631
3643
  if (checkAgainstLegacy && path.length == 1 && path[0] == "ID") {
3632
3644
  return (_a = data.Bruce) === null || _a === void 0 ? void 0 : _a.ID;
@@ -3654,60 +3666,66 @@ var Entity;
3654
3666
  // So we'll check against both locations until migration is complete.
3655
3667
  // First we'll check against properties that could be found inside the internal section.
3656
3668
  if (path[0] == "location") {
3657
- value = checkForValue(["Bruce"].concat(path));
3669
+ value = checkForValue(["Bruce", "Location"].concat(path.slice(1)));
3658
3670
  }
3659
3671
  else if (path[0] == "transform") {
3660
- value = checkForValue(["Bruce"].concat(path));
3672
+ value = checkForValue(["Bruce", "Transform"].concat(path.slice(1)));
3661
3673
  }
3662
3674
  else if (path[0] == "geometry") {
3663
- value = checkForValue(["Bruce"].concat(path));
3675
+ value = checkForValue(["Bruce", "VectorGeometry"].concat(path.slice(1)));
3664
3676
  }
3665
3677
  else if (path[0] == "boundaries") {
3666
- value = checkForValue(["Bruce"].concat(path));
3678
+ value = checkForValue(["Bruce", "Boundaries"].concat(path.slice(1)));
3667
3679
  }
3668
3680
  else if (path[0] == "geometryPivot") {
3669
- value = checkForValue(["Bruce"].concat(path));
3681
+ value = checkForValue(["Bruce", "GeometryPivot"].concat(path.slice(1)));
3670
3682
  }
3671
3683
  else if (path[0] == "worldPivot") {
3672
- value = checkForValue(["Bruce"].concat(path));
3684
+ value = checkForValue(["Bruce", "GeometryWorldPivot"].concat(path.slice(1)));
3673
3685
  }
3674
3686
  else if (path[0] == "worldPosition") {
3675
- value = checkForValue(["Bruce"].concat(path));
3687
+ value = checkForValue(["Bruce", "AssemblyWorldPosition"].concat(path.slice(1)));
3676
3688
  }
3677
3689
  else if (path[0] == "tilesetID") {
3678
- value = checkForValue(["Bruce"].concat(path));
3690
+ value = checkForValue(["Bruce", "TilesetIDs"].concat(path.slice(1)));
3679
3691
  }
3680
3692
  else if (path[0] == "geometryRadius") {
3681
- value = checkForValue(["Bruce"].concat(path));
3693
+ value = checkForValue(["Bruce", "GeometryRadius"].concat(path.slice(1)));
3682
3694
  }
3683
3695
  // Now we'll check against properties that could still be in the top-level and haven't been migrated yet.
3684
3696
  if (path[0] == "Bruce" && path.length > 1) {
3685
- if (path[1] == "location") {
3686
- value = checkForValue(path.slice(1));
3697
+ if (path[1] == "Location") {
3698
+ value = checkForValue(["location"].concat(path.slice(2)));
3687
3699
  }
3688
- else if (path[1] == "transform") {
3689
- value = checkForValue(path.slice(1));
3700
+ else if (path[1] == "Transform") {
3701
+ value = checkForValue(["transform"].concat(path.slice(2)));
3690
3702
  }
3691
- else if (path[1] == "geometry") {
3692
- value = checkForValue(path.slice(1));
3703
+ else if (path[1] == "VectorGeometry") {
3704
+ value = checkForValue(["geometry"].concat(path.slice(2)));
3693
3705
  }
3694
- else if (path[1] == "boundaries") {
3695
- value = checkForValue(path.slice(1));
3706
+ else if (path[1] == "Boundaries") {
3707
+ value = checkForValue(["boundaries"].concat(path.slice(2)));
3696
3708
  }
3697
- else if (path[1] == "geometryPivot") {
3698
- value = checkForValue(path.slice(1));
3709
+ else if (path[1] == "GeometryPivot") {
3710
+ value = checkForValue(["geometryPivot"].concat(path.slice(2)));
3699
3711
  }
3700
- else if (path[1] == "worldPivot") {
3701
- value = checkForValue(path.slice(1));
3712
+ else if (path[1] == "GeometryWorldPivot") {
3713
+ value = checkForValue(["worldPivot"].concat(path.slice(2)));
3702
3714
  }
3703
- else if (path[1] == "worldPosition") {
3704
- value = checkForValue(path.slice(1));
3715
+ else if (path[1] == "AssemblyWorldPosition") {
3716
+ value = checkForValue(["worldPosition"].concat(path.slice(2)));
3705
3717
  }
3706
- else if (path[1] == "tilesetID") {
3707
- value = checkForValue(path.slice(1));
3718
+ else if (path[1] == "TilesetIDs") {
3719
+ value = checkForValue(["tilesetID"].concat(path.slice(2)));
3708
3720
  }
3709
- else if (path[1] == "geometryRadius") {
3710
- value = checkForValue(path.slice(1));
3721
+ else if (path[1] == "GeometryRadius") {
3722
+ value = checkForValue(["geometryRadius"].concat(path.slice(2)));
3723
+ }
3724
+ else if (path[1] == "relations") {
3725
+ value = checkForValue(["Bruce", "Relations"].concat(path.slice(2)));
3726
+ }
3727
+ else if (path[1] == "Relations") {
3728
+ value = checkForValue(["Bruce", "relations"].concat(path.slice(2)));
3711
3729
  }
3712
3730
  }
3713
3731
  }
@@ -3721,7 +3739,13 @@ var Entity;
3721
3739
  * @param params
3722
3740
  */
3723
3741
  function RemoveValue(params) {
3724
- const { entity: data, path } = params;
3742
+ let { entity: data, path } = params;
3743
+ if (!path || !path.length) {
3744
+ return;
3745
+ }
3746
+ if (typeof path == "string") {
3747
+ path = PathUtils.Parse(path);
3748
+ }
3725
3749
  let curData = data;
3726
3750
  for (let i = 0; i < path.length; i++) {
3727
3751
  const step = path[i];
@@ -4730,14 +4754,14 @@ var Bounds;
4730
4754
  const points = [];
4731
4755
  const location = Entity.GetValue({
4732
4756
  entity: entity,
4733
- path: ["location"]
4757
+ path: ["Bruce", "Location"]
4734
4758
  });
4735
4759
  if (location) {
4736
4760
  points.push(location);
4737
4761
  }
4738
4762
  const geometry = Entity.GetValue({
4739
4763
  entity: entity,
4740
- path: ["geometry"]
4764
+ path: ["Bruce", "VectorGeometry"]
4741
4765
  });
4742
4766
  const processGeometry = (geometry, depth = 0) => {
4743
4767
  if (!geometry || depth > 5) {
@@ -13308,7 +13332,7 @@ var DataSource;
13308
13332
  })(DataSource || (DataSource = {}));
13309
13333
 
13310
13334
  // This is updated with the package.json version on build.
13311
- const VERSION = "4.2.8";
13335
+ const VERSION = "4.3.0";
13312
13336
 
13313
13337
  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, EntityHistoricData, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, AccountFeatures, AccountLimits, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, ImportCad, ImportCsv, ImportJson, ImportKml, ImportedFile, Markup, Uploader, Plugin, ENVIRONMENT, DataSource };
13314
13338
  //# sourceMappingURL=bruce-models.es5.js.map