ws-process 0.3.59 → 0.4.0
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/index.js +15 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable import/extensions */
|
|
1
2
|
/* eslint-disable import/no-unresolved */
|
|
2
3
|
// ws-process.js
|
|
3
4
|
import axios from 'axios';
|
|
@@ -599,9 +600,10 @@ function asyncSend(msg) {
|
|
|
599
600
|
}),
|
|
600
601
|
);
|
|
601
602
|
|
|
603
|
+
const cProcess = getCurrentProcess(getState, msg.processID);
|
|
602
604
|
const cProcessItemRoot = getCurrentProcessItem(getState, msg.processID);
|
|
603
605
|
|
|
604
|
-
if (!msg.action) {
|
|
606
|
+
if (!msg.action || (cProcess.useApi2 === true)) {
|
|
605
607
|
let url;
|
|
606
608
|
const user = getState().user.currentUser;
|
|
607
609
|
|
|
@@ -618,18 +620,27 @@ function asyncSend(msg) {
|
|
|
618
620
|
// return 'api-dev';
|
|
619
621
|
// }
|
|
620
622
|
// });
|
|
623
|
+
if (msg.action === 'manageadir') {
|
|
624
|
+
url = '/a';
|
|
625
|
+
} else if (msg.action === 'manageconfiguration') {
|
|
626
|
+
url = '/c';
|
|
627
|
+
} else if (msg.action === 'api-hub') {
|
|
628
|
+
url = '/h';
|
|
629
|
+
} else {
|
|
630
|
+
url = msg.url;
|
|
631
|
+
}
|
|
621
632
|
|
|
622
633
|
const currentState = getState();
|
|
623
634
|
const {
|
|
624
635
|
AltDomain: altDomain,
|
|
625
636
|
} = tryit(() => currentState['api-Configuration'].merged.ui.result) || {};
|
|
626
637
|
if (altDomain) {
|
|
627
|
-
url = [altDomain,
|
|
638
|
+
url = [altDomain, url.replace(/^\/{0,}/, '')].join('/');
|
|
628
639
|
} else {
|
|
629
640
|
const myDomain = [
|
|
630
641
|
'https://',
|
|
631
642
|
[
|
|
632
|
-
user.system?.useApi2 === true ? 'api2' : 'api',
|
|
643
|
+
(user.system?.useApi2 === true || cProcess.useApi2 === true) ? 'api2' : 'api',
|
|
633
644
|
['dev', 'staging'].find(
|
|
634
645
|
(each) => each === local.stage,
|
|
635
646
|
)
|
|
@@ -642,7 +653,7 @@ function asyncSend(msg) {
|
|
|
642
653
|
].join('');
|
|
643
654
|
url = [
|
|
644
655
|
myDomain,
|
|
645
|
-
|
|
656
|
+
url.replace(/^\/{0,}/, ''),
|
|
646
657
|
].join('/');
|
|
647
658
|
}
|
|
648
659
|
}
|