bruce-models 4.6.2 → 4.6.4

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.
@@ -641,8 +641,21 @@ var MessageBroker;
641
641
  }
642
642
  }
643
643
  formatApiUri(uri) {
644
- const ws = !window.document || window.document.location.protocol === "https:" ? "wss" : "ws";
645
- return uri.replace(/^(https|http)/, ws) + "websocket";
644
+ const wsProtocol = window.document.location.protocol === "https:" ? "wss" : "ws";
645
+ const currentUrl = new URL(uri);
646
+ let full = wsProtocol + "://" + currentUrl.host + currentUrl.pathname + "websocket";
647
+ // Check if we have a queryParam for accountId.
648
+ const accountId = currentUrl.searchParams.get("accountId");
649
+ if (accountId) {
650
+ if (full.includes("?")) {
651
+ full += "&";
652
+ }
653
+ else {
654
+ full += "?";
655
+ }
656
+ full += "accountId=" + accountId;
657
+ }
658
+ return full;
646
659
  }
647
660
  onOpen(ev) {
648
661
  if (this.env === Api.EEnv.DEV) {
@@ -3966,16 +3979,18 @@ var Entity;
3966
3979
  // All properties.
3967
3980
  if (includeUserData != false) {
3968
3981
  properties = cloneObj(entity);
3969
- // We exclude geometry since the geojson is supposed to represent that attribute.
3970
- delete properties.geometry;
3982
+ // The GeoJSON is supposed to represent the geometry attribute.
3983
+ delete properties.Bruce.VectorGeometry;
3984
+ delete properties.Bruce.Boundaries;
3971
3985
  }
3972
3986
  // Only specific internal properties.
3973
3987
  else {
3988
+ const bClone = cloneObj(entity.Bruce);
3989
+ // The GeoJSON is supposed to represent the geometry attribute.
3990
+ delete bClone.VectorGeometry;
3991
+ delete bClone.Boundaries;
3974
3992
  properties = {
3975
- Bruce: entity.Bruce ? cloneObj(entity.Bruce) : null,
3976
- location: entity.location ? cloneObj(entity.location) : null,
3977
- transform: entity.transform ? cloneObj(entity.transform) : null,
3978
- boundaries: entity.boundaries ? cloneObj(entity.boundaries) : null,
3993
+ Bruce: bClone
3979
3994
  };
3980
3995
  }
3981
3996
  feature.properties = properties;
@@ -4041,10 +4056,10 @@ var Entity;
4041
4056
  if (!((_a = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID)) {
4042
4057
  return;
4043
4058
  }
4044
- let geometry = entity.geometry;
4045
- if (!geometry && (((_b = entity.location) === null || _b === void 0 ? void 0 : _b.longitude) && ((_c = entity.location) === null || _c === void 0 ? void 0 : _c.latitude))) {
4059
+ let geometry = entity.Bruce.VectorGeometry;
4060
+ if (!geometry && (((_b = entity.Bruce.Location) === null || _b === void 0 ? void 0 : _b.longitude) && ((_c = entity.Bruce.Location) === null || _c === void 0 ? void 0 : _c.latitude))) {
4046
4061
  geometry = {
4047
- Point: `${entity.location.longitude},${entity.location.latitude}` + (entity.location.altitude != null ? `,${entity.location.altitude}` : ""),
4062
+ Point: `${entity.Bruce.Location.longitude},${entity.Bruce.Location.latitude}` + (entity.Bruce.Location.altitude != null ? `,${entity.Bruce.Location.altitude}` : ""),
4048
4063
  };
4049
4064
  }
4050
4065
  if (geometry) {
@@ -13781,7 +13796,7 @@ var DataSource;
13781
13796
  })(DataSource || (DataSource = {}));
13782
13797
 
13783
13798
  // This is updated with the package.json version on build.
13784
- const VERSION = "4.6.2";
13799
+ const VERSION = "4.6.4";
13785
13800
 
13786
13801
  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, EntityTableView, 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 };
13787
13802
  //# sourceMappingURL=bruce-models.es5.js.map