bruce-models 4.6.2 → 4.6.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.
@@ -642,8 +642,21 @@
642
642
  }
643
643
  }
644
644
  formatApiUri(uri) {
645
- const ws = !window.document || window.document.location.protocol === "https:" ? "wss" : "ws";
646
- return uri.replace(/^(https|http)/, ws) + "websocket";
645
+ const wsProtocol = window.document.location.protocol === "https:" ? "wss" : "ws";
646
+ const currentUrl = new URL(uri);
647
+ let full = wsProtocol + "://" + currentUrl.host + currentUrl.pathname + "websocket";
648
+ // Check if we have a queryParam for accountId.
649
+ const accountId = currentUrl.searchParams.get("accountId");
650
+ if (accountId) {
651
+ if (full.includes("?")) {
652
+ full += "&";
653
+ }
654
+ else {
655
+ full += "?";
656
+ }
657
+ full += "accountId=" + accountId;
658
+ }
659
+ return full;
647
660
  }
648
661
  onOpen(ev) {
649
662
  if (this.env === exports.Api.EEnv.DEV) {
@@ -13510,7 +13523,7 @@
13510
13523
  })(exports.DataSource || (exports.DataSource = {}));
13511
13524
 
13512
13525
  // This is updated with the package.json version on build.
13513
- const VERSION = "4.6.2";
13526
+ const VERSION = "4.6.3";
13514
13527
 
13515
13528
  exports.VERSION = VERSION;
13516
13529
  exports.AbstractApi = AbstractApi;