@xuda.io/xuda-worker-bundle-min 1.3.678 → 1.3.679

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 +53 -40
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -5133,9 +5133,9 @@ func.utils.job_worker = function (session_id) {
5133
5133
  if (
5134
5134
  !_session.WORKER_OBJ.jobs[_session.WORKER_OBJ.stat] ||
5135
5135
  _session.WORKER_OBJ.jobs[_session.WORKER_OBJ.stat].typeP ===
5136
- "system_interval" ||
5136
+ "system_interval" ||
5137
5137
  _session.WORKER_OBJ.jobs[_session.WORKER_OBJ.stat].typeP ===
5138
- "system event"
5138
+ "system event"
5139
5139
  ) {
5140
5140
  return;
5141
5141
  }
@@ -5501,10 +5501,10 @@ func.utils.ws_worker.functions = {
5501
5501
  if (show_log)
5502
5502
  console.log(
5503
5503
  "DATASOURCE EXECUTION DONE " +
5504
- ret.dsSessionP +
5505
- " " +
5506
- _session.DS_GLB[ret.dsSessionP]?.tree_obj?.menuName ||
5507
- "" + " SESSION_ID: " + SESSION_ID,
5504
+ ret.dsSessionP +
5505
+ " " +
5506
+ _session.DS_GLB[ret.dsSessionP]?.tree_obj?.menuName ||
5507
+ "" + " SESSION_ID: " + SESSION_ID,
5508
5508
  APP_OBJ[_session.app_id].app_name
5509
5509
  );
5510
5510
  var obj = func.utils.clean_returned_datasource(SESSION_ID, ret.dsSessionP);
@@ -5856,9 +5856,9 @@ func.utils.ws_worker.functions = {
5856
5856
  if (show_log)
5857
5857
  console.log(
5858
5858
  "DATASOURCE RETURN TO DATASOURCE " +
5859
- params.dssession +
5860
- " SESSION_ID: " +
5861
- SESSION_ID,
5859
+ params.dssession +
5860
+ " SESSION_ID: " +
5861
+ SESSION_ID,
5862
5862
  APP_OBJ[_session.app_id].app_name
5863
5863
  );
5864
5864
  _session.DS_GLB[params.dssession].v.onscreen_events_active =
@@ -5871,9 +5871,9 @@ func.utils.ws_worker.functions = {
5871
5871
  if (show_log)
5872
5872
  console.log(
5873
5873
  "DATASOURCE RETURN TO DATASOURCE DONE " +
5874
- DS +
5875
- " SESSION_ID: " +
5876
- SESSION_ID,
5874
+ DS +
5875
+ " SESSION_ID: " +
5876
+ SESSION_ID,
5877
5877
  APP_OBJ[_session.app_id].app_name
5878
5878
  );
5879
5879
  var obj = func.utils.clean_returned_datasource(SESSION_ID, DS);
@@ -5901,9 +5901,9 @@ func.utils.ws_worker.functions = {
5901
5901
  if (show_log)
5902
5902
  console.log(
5903
5903
  "UPDATE CHANGE EVENT DONE TO DATASOURCE " +
5904
- params.dssession +
5905
- " SESSION_ID: " +
5906
- SESSION_ID,
5904
+ params.dssession +
5905
+ " SESSION_ID: " +
5906
+ SESSION_ID,
5907
5907
  APP_OBJ[_session.app_id].app_name
5908
5908
  );
5909
5909
  ds.eventChangesResults_done = true;
@@ -5915,9 +5915,9 @@ func.utils.ws_worker.functions = {
5915
5915
  if (show_log)
5916
5916
  console.log(
5917
5917
  "RETURN FROM DB_QUERY " +
5918
- params.dssession +
5919
- " SESSION_ID: " +
5920
- SESSION_ID,
5918
+ params.dssession +
5919
+ " SESSION_ID: " +
5920
+ SESSION_ID,
5921
5921
  APP_OBJ[_session.app_id].app_name
5922
5922
  );
5923
5923
  debugger;
@@ -5934,9 +5934,9 @@ func.utils.ws_worker.functions = {
5934
5934
  if (show_log)
5935
5935
  console.log(
5936
5936
  "RETURN FROM SAVE_DATA " +
5937
- params.dssession +
5938
- " SESSION_ID: " +
5939
- SESSION_ID,
5937
+ params.dssession +
5938
+ " SESSION_ID: " +
5939
+ SESSION_ID,
5940
5940
  APP_OBJ[_session.app_id].app_name
5941
5941
  );
5942
5942
  func.utils.get_callback_queue(SESSION_ID, params.callback_id)();
@@ -6038,7 +6038,7 @@ func.utils.ws_worker.functions = {
6038
6038
  const couch = await __.rpi.get_app_couch(req.body.app_id);
6039
6039
  const session_doc = await couch.get(req.body.app_token);
6040
6040
  ret.session_stat = session_doc.stat;
6041
- } catch (error) { }
6041
+ } catch (error) {}
6042
6042
  }
6043
6043
  } catch (error) {
6044
6044
  debugger;
@@ -6149,27 +6149,41 @@ func.utils.remove_js_css_file = function (filename, filetype) {
6149
6149
  }
6150
6150
  };
6151
6151
 
6152
+ func.utils.replace_studio_drive_url = function (SESSION_ID, val) {
6153
+ var _session = SESSION_OBJ[SESSION_ID];
6154
+ if (!_session.is_deployment) return val;
6155
+
6156
+ return val.replaceAll(
6157
+ `https://xuda.io/studio-drive/${APP_OBJ[_session.app_id].app_replicate}`,
6158
+ `https://${_session.domain}/studio-drive/${
6159
+ APP_OBJ[_session.app_id].app_replicate
6160
+ }`
6161
+ );
6162
+ };
6163
+
6152
6164
  func.utils.get_drive_url = function (SESSION_ID, val, wrap) {
6153
6165
  // wrap = false; // tbd bypass
6154
6166
 
6155
6167
  var _session = SESSION_OBJ[SESSION_ID];
6156
6168
  function replaceFiletoURL(fileString) {
6157
6169
  const _app = APP_OBJ[_session.app_id];
6158
- let _domain = _session.domain;
6159
- if (_session.is_deployment) {
6160
- _domain =
6161
- _session.opt.regional_server === "dev.xuda.io"
6162
- ? "dev.xuda.io"
6163
- : "xuda.io";
6164
- }
6170
+ // let _domain = _session.domain;
6171
+ // if (_session.is_deployment) {
6172
+ // _domain =
6173
+ // _session.opt.regional_server === "dev.xuda.io"
6174
+ // ? "dev.xuda.io"
6175
+ // : "xuda.io";
6176
+ // }
6165
6177
 
6166
- let url = `https://${_domain}/workspace-drive/${_app.is_deployment ? _app.app_datacenter_id : _app.app_id_reference
6167
- }/`;
6178
+ let url = `https://${_session.domain}/workspace-drive/${
6179
+ _app.is_deployment ? _app.app_datacenter_id : _app.app_id_reference
6180
+ }/`;
6168
6181
 
6169
6182
  const FILE_REPLACE_URL = `${url}${val}?app_token=${_session.app_token}`;
6170
6183
 
6171
- let match = `drv_${_app.app_replicate || _session.app_id
6172
- }_[0-9a-f\\-]+\\.[a-zA-Z0-9]+`;
6184
+ let match = `drv_${
6185
+ _app.app_replicate || _session.app_id
6186
+ }_[0-9a-f\\-]+\\.[a-zA-Z0-9]+`;
6173
6187
 
6174
6188
  let pat = new RegExp(match, "g");
6175
6189
  let URLString = fileString.replace(pat, function (match, idx) {
@@ -6312,7 +6326,8 @@ func.utils.request_error = function (SESSION_ID, type, e) {
6312
6326
  func.utils.debug_report(SESSION_ID, type, e, "E");
6313
6327
  setTimeout(function () {
6314
6328
  if (!glb.debug_js) {
6315
- location.reload();
6329
+ // location.reload();
6330
+ console.warn("** reload request");
6316
6331
  }
6317
6332
  }, 2000);
6318
6333
  } else {
@@ -6547,8 +6562,8 @@ func.utils.alerts.execute = function (
6547
6562
  alert_type === "success"
6548
6563
  ? "log"
6549
6564
  : alert_type === "warning"
6550
- ? "warn"
6551
- : alert_type
6565
+ ? "warn"
6566
+ : alert_type
6552
6567
  ](alert_type, title, message);
6553
6568
  ALERT_IS_ACTIVE = false;
6554
6569
  break;
@@ -8273,7 +8288,6 @@ func.events.execute = async function (
8273
8288
  },
8274
8289
 
8275
8290
  call_native_javascript: async function () {
8276
- // const module = await import("./modules/xuda-event-javascript-module.mjs");
8277
8291
  const module = await func.common.get_module(
8278
8292
  SESSION_ID,
8279
8293
  "xuda-event-javascript-module.mjs"
@@ -8286,7 +8300,6 @@ func.events.execute = async function (
8286
8300
  );
8287
8301
  },
8288
8302
  call_evaluate_javascript: async function () {
8289
- // const module = await import("./modules/xuda-event-javascript-module.mjs");
8290
8303
  const module = await func.common.get_module(
8291
8304
  SESSION_ID,
8292
8305
  "xuda-event-javascript-module.mjs"
@@ -8300,7 +8313,6 @@ func.events.execute = async function (
8300
8313
  );
8301
8314
  },
8302
8315
  execute_native_javascript: async function () {
8303
- // const module = await import("./modules/xuda-event-javascript-module.mjs");
8304
8316
  const module = await func.common.get_module(
8305
8317
  SESSION_ID,
8306
8318
  "xuda-event-javascript-module.mjs"
@@ -8308,7 +8320,6 @@ func.events.execute = async function (
8308
8320
  return await module.run_javascript(SESSION_ID, jobNoP, refIdP, dsSession);
8309
8321
  },
8310
8322
  execute_evaluate_javascript: async function () {
8311
- // const module = await import("./modules/xuda-event-javascript-module.mjs");
8312
8323
  const module = await func.common.get_module(
8313
8324
  SESSION_ID,
8314
8325
  "xuda-event-javascript-module.mjs"
@@ -8940,6 +8951,8 @@ func.expression.get = async function (
8940
8951
  }
8941
8952
 
8942
8953
  ret = ret.replace(/\&/g, "&");
8954
+ ret = func.utils.replace_studio_drive_url(SESSION_ID, ret);
8955
+
8943
8956
  const end_results = function () {
8944
8957
  const replace_quotes = function (ret) {
8945
8958
  for (const [key, val] of Object.entries(fields)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-worker-bundle-min",
3
- "version": "1.3.678",
3
+ "version": "1.3.679",
4
4
  "description": "xuda framework min",
5
5
  "main": "index.js",
6
6
  "scripts": {