bruce-models 7.1.47 → 7.1.48

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.
@@ -1580,6 +1580,16 @@ var BruceApi;
1580
1580
  this.version = "UNKNOWN";
1581
1581
  }
1582
1582
  }
1583
+ // Same version as the proxy-update we started supporting an accountId/subdomain prefix.
1584
+ // We can upgrade URLs automatically so anything using them for proxies doesn't have to manage query params.
1585
+ // Eg: "/v3/entity/abc?accountId=template" would become "/A:template/v3/entity/abc".
1586
+ if (this.IsVersionAtLeast(BruceApi$$1.VERSION_WITH_PROXIES)) {
1587
+ this.baseUrl = Api$$1.rewriteAccountIdToPath(this.baseUrl);
1588
+ this.cdnBaseUrl = Api$$1.rewriteAccountIdToPath(this.cdnBaseUrl);
1589
+ this.EntityCdnUrl = Api$$1.rewriteAccountIdToPath(this.EntityCdnUrl);
1590
+ this.TilesetCdnUrl = Api$$1.rewriteAccountIdToPath(this.TilesetCdnUrl);
1591
+ this.LegacyTilesetCdnUrl = Api$$1.rewriteAccountIdToPath(this.LegacyTilesetCdnUrl);
1592
+ }
1583
1593
  // Start web socket connection.
1584
1594
  if (loadWebSocket == true) {
1585
1595
  try {
@@ -1593,6 +1603,34 @@ var BruceApi;
1593
1603
  }
1594
1604
  });
1595
1605
  }
1606
+ /**
1607
+ * Moves query param specified accountId/subdomain to be a prefix segment in the URL path.
1608
+ * Eg: "/v3/entity/abc?accountId=template" would become "/A:template/v3/entity/abc".
1609
+ * If no accountId param is present or the URL is invalid, returns the URL unchanged.
1610
+ */
1611
+ static rewriteAccountIdToPath(url) {
1612
+ if (!url) {
1613
+ return url;
1614
+ }
1615
+ try {
1616
+ const parsed = new URL(url);
1617
+ const accountId = parsed.searchParams.get("accountId");
1618
+ if (!accountId) {
1619
+ return url;
1620
+ }
1621
+ parsed.searchParams.delete("accountId");
1622
+ // Prepend A:<id>/ to the existing pathname.
1623
+ let path = parsed.pathname;
1624
+ if (!path.endsWith("/")) {
1625
+ path += "/";
1626
+ }
1627
+ parsed.pathname = path + `A:${accountId}/`;
1628
+ return parsed.toString();
1629
+ }
1630
+ catch (e) {
1631
+ return url;
1632
+ }
1633
+ }
1596
1634
  getDomain() {
1597
1635
  const env = this.env.toUpperCase();
1598
1636
  let domain = "nextspace.host";
@@ -18951,7 +18989,7 @@ var UrlUtils;
18951
18989
  })(UrlUtils || (UrlUtils = {}));
18952
18990
 
18953
18991
  // This is updated with the package.json version on build.
18954
- const VERSION = "7.1.47";
18992
+ const VERSION = "7.1.48";
18955
18993
 
18956
18994
  export { VERSION, Account, AccountConcept, AccountFeatures, AccountInvite, AccountLimits, AccountTemplate, AccountType, AnnDocument, AbstractApi, Api, ApiGetters, BruceApi, GlobalApi, GuardianApi, Assembly, Calculator, ChangeSet, ClientFile, Bounds, BruceEvent, BruceVariable, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, GeoJson, Geometry, LRUCache, UTC, CustomForm, DashboardView, DataFeed, DataLab, DataLabGroup, DataSource, DataTransform, Comment, Entity, EntityAttachment, EntityAttachmentType, EntityAttribute, EntityComment, EntityCoords, EntityHistoricData, EntityLink, EntityLod, EntityLodCategory, EntityRelation, EntityRelationType, EntitySource, EntityTableView, EntityTag, EntityType, EntityTypeTrigger, ENVIRONMENT, ExportBrz, ExportUsd, ImportAssembly, ImportCad, ImportCsv, ImportGeoJson, ImportJson, ImportKml, ImportLcc, ImportedFile, Uploader, Markup, NAVIGATOR_CHAT_EVENT_ENTITY_HIGHLIGHT_APPLIED, NAVIGATOR_CHAT_EVENT_SCENE_CONTEXT_PREFETCHED, NavigatorChatClient, NavigatorMcpWebSocketClient, Plugin, ProgramKey, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewBookmarkGroup, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewLegacyTile, ProjectViewTile, ZoomControl, Scenario, HostingLocation, MessageBroker, PendingAction, RecordChangeFeed, Style, Tileset, Tracking, Permission, Session, User, UserGroup, UserMfaMethod, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils };
18957
18995
  //# sourceMappingURL=bruce-models.es5.js.map