ws-process 0.3.56 → 0.3.57

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.
Files changed (2) hide show
  1. package/index.js +6 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -603,6 +603,8 @@ function asyncSend(msg) {
603
603
 
604
604
  if (!msg.action) {
605
605
  let url;
606
+ const user = getState().user.currentUser;
607
+
606
608
  if (/^https{0,1}:\/\//.test(msg.url)) {
607
609
  url = msg.url;
608
610
  } else {
@@ -624,10 +626,12 @@ function asyncSend(msg) {
624
626
  if (altDomain) {
625
627
  url = [altDomain, msg.url.replace(/^\/{0,}/, '')].join('/');
626
628
  } else {
627
- url = ['https://api2.bsg.support', msg.url.replace(/^\/{0,}/, '')].join('/');
629
+ url = [
630
+ user.system?.useApi2 === true ? 'https://api2.bsg.support' : 'https://api.bsg.support',
631
+ msg.url.replace(/^\/{0,}/, ''),
632
+ ].join('/');
628
633
  }
629
634
  }
630
- const user = getState().user.currentUser;
631
635
  const headers = {};
632
636
  headers['bsg-support-process-id'] = msg.processID;
633
637
  headers['bsg-support-api-key'] = user.apiKey || undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ws-process",
3
- "version": "0.3.56",
3
+ "version": "0.3.57",
4
4
  "description": "Process Management for Web Socket Client",
5
5
  "main": "index.js",
6
6
  "type": "module",