bruce-models 4.2.2 → 4.2.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.
- package/dist/bruce-models.es5.js +59 -13
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +59 -13
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/entity/entity.js +58 -12
- package/dist/lib/entity/entity.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/entity/entity.d.ts +43 -18
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -3568,6 +3568,7 @@ var Entity;
|
|
|
3568
3568
|
Entity.Update = Update;
|
|
3569
3569
|
/**
|
|
3570
3570
|
* Util to remove a tag from an entity.
|
|
3571
|
+
* @warning This does not save the entity record.
|
|
3571
3572
|
* @param params
|
|
3572
3573
|
*/
|
|
3573
3574
|
function RemoveTag(params) {
|
|
@@ -3583,6 +3584,7 @@ var Entity;
|
|
|
3583
3584
|
Entity.RemoveTag = RemoveTag;
|
|
3584
3585
|
/**
|
|
3585
3586
|
* Util to add a tag to an entity.
|
|
3587
|
+
* @warning This does not save the entity record.
|
|
3586
3588
|
* @param params
|
|
3587
3589
|
*/
|
|
3588
3590
|
function AddTag(params) {
|
|
@@ -3597,6 +3599,7 @@ var Entity;
|
|
|
3597
3599
|
Entity.AddTag = AddTag;
|
|
3598
3600
|
/**
|
|
3599
3601
|
* Util to set a value on an entity.
|
|
3602
|
+
* @warning This does not save the entity record.
|
|
3600
3603
|
* @param params
|
|
3601
3604
|
*/
|
|
3602
3605
|
function SetValue(params) {
|
|
@@ -3622,28 +3625,71 @@ var Entity;
|
|
|
3622
3625
|
*/
|
|
3623
3626
|
function GetValue(params) {
|
|
3624
3627
|
var _a;
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
+
let { entity: data, path, handleLegacy: checkAgainstLegacy } = params;
|
|
3629
|
+
if (checkAgainstLegacy == null) {
|
|
3630
|
+
checkAgainstLegacy = true;
|
|
3631
|
+
}
|
|
3632
|
+
// Backwards compatibility for incredibly old data.
|
|
3633
|
+
if (checkAgainstLegacy && path.length == 1 && path[0] == "ID") {
|
|
3628
3634
|
return (_a = data.Bruce) === null || _a === void 0 ? void 0 : _a.ID;
|
|
3629
3635
|
}
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3636
|
+
const checkForValue = (path) => {
|
|
3637
|
+
let curData = data;
|
|
3638
|
+
for (let i = 0; i < path.length; i++) {
|
|
3639
|
+
const step = path[i];
|
|
3640
|
+
if (!curData[step]) {
|
|
3641
|
+
return null;
|
|
3642
|
+
}
|
|
3643
|
+
if (i >= path.length - 1) {
|
|
3644
|
+
return curData[step];
|
|
3645
|
+
}
|
|
3646
|
+
curData = curData[step];
|
|
3635
3647
|
}
|
|
3636
|
-
|
|
3637
|
-
|
|
3648
|
+
return null;
|
|
3649
|
+
};
|
|
3650
|
+
// Check using the path provided.
|
|
3651
|
+
let value = checkForValue(path);
|
|
3652
|
+
// Check for the same path but in both top-level and internal data.
|
|
3653
|
+
// This is done for specific paths we're migrating.
|
|
3654
|
+
if (value == null && checkAgainstLegacy) {
|
|
3655
|
+
// We're migrating 2D vector data into the internal data.
|
|
3656
|
+
// So we'll check against both locations until migration is complete.
|
|
3657
|
+
// First we'll check against properties that could be found inside the internal section.
|
|
3658
|
+
if (path[0] == "location") {
|
|
3659
|
+
value = checkForValue(["Bruce"].concat(path));
|
|
3660
|
+
}
|
|
3661
|
+
else if (path[0] == "transform") {
|
|
3662
|
+
value = checkForValue(["Bruce"].concat(path));
|
|
3663
|
+
}
|
|
3664
|
+
else if (path[0] == "geometry") {
|
|
3665
|
+
value = checkForValue(["Bruce"].concat(path));
|
|
3666
|
+
}
|
|
3667
|
+
else if (path[0] == "boundaries") {
|
|
3668
|
+
value = checkForValue(["Bruce"].concat(path));
|
|
3669
|
+
}
|
|
3670
|
+
// Now we'll check against properties that could still be in the top-level and haven't been migrated yet.
|
|
3671
|
+
if (path[0] == "Bruce" && path.length > 1) {
|
|
3672
|
+
if (path[1] == "location") {
|
|
3673
|
+
value = checkForValue(path.slice(1));
|
|
3674
|
+
}
|
|
3675
|
+
else if (path[1] == "transform") {
|
|
3676
|
+
value = checkForValue(path.slice(1));
|
|
3677
|
+
}
|
|
3678
|
+
else if (path[1] == "geometry") {
|
|
3679
|
+
value = checkForValue(path.slice(1));
|
|
3680
|
+
}
|
|
3681
|
+
else if (path[1] == "boundaries") {
|
|
3682
|
+
value = checkForValue(path.slice(1));
|
|
3683
|
+
}
|
|
3638
3684
|
}
|
|
3639
|
-
curData = curData[step];
|
|
3640
3685
|
}
|
|
3641
|
-
return
|
|
3686
|
+
return value;
|
|
3642
3687
|
}
|
|
3643
3688
|
Entity.GetValue = GetValue;
|
|
3644
3689
|
/**
|
|
3645
3690
|
* Removes a value from an entity.
|
|
3646
3691
|
* This will mutate the entity record and run "delete" on the object property.
|
|
3692
|
+
* @warning This does not save the entity record.
|
|
3647
3693
|
* @param params
|
|
3648
3694
|
*/
|
|
3649
3695
|
function RemoveValue(params) {
|
|
@@ -13179,7 +13225,7 @@ var DataSource;
|
|
|
13179
13225
|
})(DataSource || (DataSource = {}));
|
|
13180
13226
|
|
|
13181
13227
|
// This is updated with the package.json version on build.
|
|
13182
|
-
const VERSION = "4.2.
|
|
13228
|
+
const VERSION = "4.2.3";
|
|
13183
13229
|
|
|
13184
13230
|
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 };
|
|
13185
13231
|
//# sourceMappingURL=bruce-models.es5.js.map
|