ws-process 0.3.44 → 0.3.46
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 +12 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import axios from 'axios';
|
|
4
4
|
import * as Sentry from '@sentry/react';
|
|
5
5
|
import {
|
|
6
|
-
defined, clone, makeid, tryit,
|
|
6
|
+
defined, clone, makeid, tryit, wait,
|
|
7
7
|
} from '@bsgp/lib-core';
|
|
8
8
|
import { ref, Loading, getRef } from './Loading-esm';
|
|
9
9
|
import {
|
|
@@ -536,6 +536,7 @@ function handleResponseHandler(res, getState, isLast = true, isFirst = true) {
|
|
|
536
536
|
local.dispatch(
|
|
537
537
|
updateWSProcess(res.processID, {
|
|
538
538
|
jsonResponse: res,
|
|
539
|
+
cbData,
|
|
539
540
|
}),
|
|
540
541
|
);
|
|
541
542
|
|
|
@@ -628,6 +629,9 @@ function asyncSend(msg) {
|
|
|
628
629
|
headers['bsg-support-stage'] = isPreviewMode() ? 'dev' : local.stage;
|
|
629
630
|
headers['bsg-support-token'] = user.token;
|
|
630
631
|
headers['bsg-support-session'] = user.session;
|
|
632
|
+
headers['bsg-support-ui-version'] = process.env.REACT_APP_RELEASE_VERSION
|
|
633
|
+
|| process.env.REACT_APP_STAGING_VERSION
|
|
634
|
+
|| '';
|
|
631
635
|
headers['bsg-support-user-id'] = user.id;
|
|
632
636
|
headers['bsg-support-system-external-id'] = user.pid;
|
|
633
637
|
// headers['bsg-support-partner-id'] = user.partnerID;
|
|
@@ -758,6 +762,9 @@ function asyncSend(msg) {
|
|
|
758
762
|
|
|
759
763
|
jsonMSG.headers['bsg-support-token'] = user.token;
|
|
760
764
|
jsonMSG.headers['bsg-support-session'] = user.session;
|
|
765
|
+
jsonMSG.headers['bsg-support-ui-version'] = process.env.REACT_APP_RELEASE_VERSION
|
|
766
|
+
|| process.env.REACT_APP_STAGING_VERSION
|
|
767
|
+
|| '';
|
|
761
768
|
jsonMSG.headers['bsg-support-user-id'] = user.id;
|
|
762
769
|
jsonMSG.headers['bsg-support-userID'] = user.id;
|
|
763
770
|
jsonMSG.headers['bsg-support-system-external-id'] = user.pid;
|
|
@@ -1164,7 +1171,7 @@ function runProcess(processID, data) {
|
|
|
1164
1171
|
: prcItem.reqParameters;
|
|
1165
1172
|
if (!reqParameters) {
|
|
1166
1173
|
local.afterEachProcess(prc, local.wsProcess.processes);
|
|
1167
|
-
prc.reject({ requestIsFalsy: true, message: 'No request to send, process is stopped' });
|
|
1174
|
+
prc.reject({ requestIsFalsy: true, message: 'No request to send, process is stopped', cbData: prevPrcItem.cbData });
|
|
1168
1175
|
wrapClearWSProcess(processID);
|
|
1169
1176
|
return;
|
|
1170
1177
|
}
|
|
@@ -1206,12 +1213,13 @@ function runProcess(processID, data) {
|
|
|
1206
1213
|
}),
|
|
1207
1214
|
);
|
|
1208
1215
|
|
|
1209
|
-
|
|
1216
|
+
const delaySeconds = prcItem.delaySeconds || 0;
|
|
1217
|
+
wait(delaySeconds).then(() => dispatch(
|
|
1210
1218
|
asyncSend({
|
|
1211
1219
|
...(reqParameters || prcItem.reqParameters),
|
|
1212
1220
|
processID,
|
|
1213
1221
|
}),
|
|
1214
|
-
)
|
|
1222
|
+
))
|
|
1215
1223
|
.then((dataInner) => {
|
|
1216
1224
|
const prcInner = local.wsProcess.processes[dataInner.processID];
|
|
1217
1225
|
const promise = dispatch(
|