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

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 +59 -41
  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,46 @@ 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
- const FILE_REPLACE_URL = `${url}${val}?app_token=${_session.app_token}`;
6182
+ let FILE_REPLACE_URL = `${url}${val}`;
6170
6183
 
6171
- let match = `drv_${_app.app_replicate || _session.app_id
6172
- }_[0-9a-f\\-]+\\.[a-zA-Z0-9]+`;
6184
+ if (!_app.is_deployment) {
6185
+ // the deployment server will handle the app_token
6186
+ FILE_REPLACE_URL += `?app_token=${_session.app_token}`;
6187
+ }
6188
+
6189
+ let match = `drv_${
6190
+ _app.app_replicate || _session.app_id
6191
+ }_[0-9a-f\\-]+\\.[a-zA-Z0-9]+`;
6173
6192
 
6174
6193
  let pat = new RegExp(match, "g");
6175
6194
  let URLString = fileString.replace(pat, function (match, idx) {
@@ -6312,7 +6331,8 @@ func.utils.request_error = function (SESSION_ID, type, e) {
6312
6331
  func.utils.debug_report(SESSION_ID, type, e, "E");
6313
6332
  setTimeout(function () {
6314
6333
  if (!glb.debug_js) {
6315
- location.reload();
6334
+ // location.reload();
6335
+ console.warn("** reload request");
6316
6336
  }
6317
6337
  }, 2000);
6318
6338
  } else {
@@ -6547,8 +6567,8 @@ func.utils.alerts.execute = function (
6547
6567
  alert_type === "success"
6548
6568
  ? "log"
6549
6569
  : alert_type === "warning"
6550
- ? "warn"
6551
- : alert_type
6570
+ ? "warn"
6571
+ : alert_type
6552
6572
  ](alert_type, title, message);
6553
6573
  ALERT_IS_ACTIVE = false;
6554
6574
  break;
@@ -8273,7 +8293,6 @@ func.events.execute = async function (
8273
8293
  },
8274
8294
 
8275
8295
  call_native_javascript: async function () {
8276
- // const module = await import("./modules/xuda-event-javascript-module.mjs");
8277
8296
  const module = await func.common.get_module(
8278
8297
  SESSION_ID,
8279
8298
  "xuda-event-javascript-module.mjs"
@@ -8286,7 +8305,6 @@ func.events.execute = async function (
8286
8305
  );
8287
8306
  },
8288
8307
  call_evaluate_javascript: async function () {
8289
- // const module = await import("./modules/xuda-event-javascript-module.mjs");
8290
8308
  const module = await func.common.get_module(
8291
8309
  SESSION_ID,
8292
8310
  "xuda-event-javascript-module.mjs"
@@ -8300,7 +8318,6 @@ func.events.execute = async function (
8300
8318
  );
8301
8319
  },
8302
8320
  execute_native_javascript: async function () {
8303
- // const module = await import("./modules/xuda-event-javascript-module.mjs");
8304
8321
  const module = await func.common.get_module(
8305
8322
  SESSION_ID,
8306
8323
  "xuda-event-javascript-module.mjs"
@@ -8308,7 +8325,6 @@ func.events.execute = async function (
8308
8325
  return await module.run_javascript(SESSION_ID, jobNoP, refIdP, dsSession);
8309
8326
  },
8310
8327
  execute_evaluate_javascript: async function () {
8311
- // const module = await import("./modules/xuda-event-javascript-module.mjs");
8312
8328
  const module = await func.common.get_module(
8313
8329
  SESSION_ID,
8314
8330
  "xuda-event-javascript-module.mjs"
@@ -8940,6 +8956,8 @@ func.expression.get = async function (
8940
8956
  }
8941
8957
 
8942
8958
  ret = ret.replace(/\&/g, "&");
8959
+ ret = func.utils.replace_studio_drive_url(SESSION_ID, ret);
8960
+
8943
8961
  const end_results = function () {
8944
8962
  const replace_quotes = function (ret) {
8945
8963
  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.680",
4
4
  "description": "xuda framework min",
5
5
  "main": "index.js",
6
6
  "scripts": {