@xuda.io/xuda-worker-bundle-min 1.3.1263 → 1.3.1265

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 +726 -1097
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1576,7 +1576,7 @@ glb.lifecycle = {
1576
1576
  SESSION_OBJ,
1577
1577
  SESSION_ID,
1578
1578
  APP_OBJ,
1579
- dsSession: func.utils.get_last_datasource_no(),
1579
+ dsSession: func.utils.get_last_datasource_no(SESSION_ID),
1580
1580
  }
1581
1581
  );
1582
1582
 
@@ -5632,51 +5632,26 @@ func.datasource.get_args_property_value = async function (SESSION_ID, dsSession,
5632
5632
  func.utils = {};
5633
5633
 
5634
5634
  func.utils.debug = {};
5635
- func.utils.debug.watch = async function (
5636
- SESSION_ID,
5637
- key,
5638
- type,
5639
- info,
5640
- result,
5641
- condition,
5642
- not_executed
5643
- ) {
5635
+ func.utils.debug.watch = async function (SESSION_ID, key, type, info, result, condition, not_executed) {
5644
5636
  if (!glb.DEBUG_MODE) return;
5645
5637
 
5646
- const debug_utils = await func.common.get_module(
5647
- SESSION_ID,
5648
- "xuda-debug-utils-module.mjs"
5649
- );
5638
+ const debug_utils = await func.common.get_module(SESSION_ID, 'xuda-debug-utils-module.mjs');
5650
5639
 
5651
- debug_utils.watch(
5652
- SESSION_ID,
5653
- key,
5654
- type,
5655
- info,
5656
- result,
5657
- condition,
5658
- not_executed
5659
- );
5640
+ debug_utils.watch(SESSION_ID, key, type, info, result, condition, not_executed);
5660
5641
  };
5661
5642
  func.utils.debug.log = async function (SESSION_ID, node_idP, jsonP) {
5662
- if (typeof IS_PROCESS_SERVER !== "undefined") return;
5643
+ if (typeof IS_PROCESS_SERVER !== 'undefined') return;
5663
5644
 
5664
5645
  if (!glb.DEBUG_MODE && !glb.TRACE_ON) return;
5665
5646
 
5666
- const debug_utils = await func.common.get_module(
5667
- SESSION_ID,
5668
- "xuda-debug-utils-module.mjs"
5669
- );
5647
+ const debug_utils = await func.common.get_module(SESSION_ID, 'xuda-debug-utils-module.mjs');
5670
5648
 
5671
5649
  debug_utils.log(SESSION_ID, node_idP, jsonP);
5672
5650
  };
5673
5651
  func.utils.debug.write = async function (SESSION_ID, logP, callbackP) {
5674
5652
  if (!glb.DEBUG_MODE) return;
5675
5653
 
5676
- const debug_utils = await func.common.get_module(
5677
- SESSION_ID,
5678
- "xuda-debug-utils-module.mjs"
5679
- );
5654
+ const debug_utils = await func.common.get_module(SESSION_ID, 'xuda-debug-utils-module.mjs');
5680
5655
 
5681
5656
  debug_utils.write(SESSION_ID, logP, callbackP);
5682
5657
  };
@@ -5684,16 +5659,13 @@ func.utils.debug.write = async function (SESSION_ID, logP, callbackP) {
5684
5659
  func.utils.debug.read_command = async function (data) {
5685
5660
  if (!glb.DEBUG_MODE) return;
5686
5661
 
5687
- const debug_utils = await func.common.get_module(
5688
- SESSION_ID,
5689
- "xuda-debug-utils-module.mjs"
5690
- );
5662
+ const debug_utils = await func.common.get_module(SESSION_ID, 'xuda-debug-utils-module.mjs');
5691
5663
 
5692
5664
  debug_utils.read_command(data);
5693
5665
  };
5694
5666
  func.utils.DOCS_OBJ = {};
5695
5667
  func.utils.DOCS_OBJ.get = async function (SESSION_ID, idP) {
5696
- if (!idP || idP === "0") return;
5668
+ if (!idP || idP === '0') return;
5697
5669
 
5698
5670
  var _session = SESSION_OBJ[SESSION_ID];
5699
5671
  const _app_id = _session.app_id;
@@ -5706,7 +5678,7 @@ func.utils.DOCS_OBJ.get = async function (SESSION_ID, idP) {
5706
5678
  }
5707
5679
 
5708
5680
  if (_session.project_data) {
5709
- if (idP === "system") {
5681
+ if (idP === 'system') {
5710
5682
  if (_session.project_data.globals) {
5711
5683
  DOCS_OBJ[_app_id][idP] = _session.project_data.globals;
5712
5684
  } else {
@@ -5720,13 +5692,10 @@ func.utils.DOCS_OBJ.get = async function (SESSION_ID, idP) {
5720
5692
  }
5721
5693
  }
5722
5694
 
5723
- if (typeof _session.SLIM_BUNDLE === "undefined" || !_session.SLIM_BUNDLE) {
5724
- const module = await func.common.get_module(
5725
- SESSION_ID,
5726
- `xuda-progs-loader-module.mjs`
5727
- );
5695
+ if (typeof _session.SLIM_BUNDLE === 'undefined' || !_session.SLIM_BUNDLE) {
5696
+ const module = await func.common.get_module(SESSION_ID, `xuda-progs-loader-module.mjs`);
5728
5697
 
5729
- if (idP !== "system") {
5698
+ if (idP !== 'system') {
5730
5699
  DOCS_OBJ[_app_id][idP] = await module.DOCS_OBJ_get(SESSION_ID, idP);
5731
5700
  if (DOCS_OBJ[_app_id][idP] && _.isEmpty(DOCS_OBJ[_app_id][idP])) {
5732
5701
  await func.utils.remove_cached_objects(SESSION_ID);
@@ -5736,17 +5705,10 @@ func.utils.DOCS_OBJ.get = async function (SESSION_ID, idP) {
5736
5705
  return DOCS_OBJ[_app_id][idP];
5737
5706
  }
5738
5707
 
5739
- DOCS_OBJ[_app_id][idP] = await module.DOCS_OBJ_get(
5740
- SESSION_ID,
5741
- "global_" + (APP_OBJ[_app_id].app_replicate || _app_id)
5742
- );
5708
+ DOCS_OBJ[_app_id][idP] = await module.DOCS_OBJ_get(SESSION_ID, 'global_' + (APP_OBJ[_app_id].app_replicate || _app_id));
5743
5709
  if (APP_OBJ[_app_id].app_imported_projects) {
5744
- for await (const imported_app_id of APP_OBJ[_app_id]
5745
- .app_imported_projects) {
5746
- var view_ret = await module.DOCS_OBJ_get(
5747
- SESSION_ID,
5748
- "global_" + imported_app_id
5749
- );
5710
+ for await (const imported_app_id of APP_OBJ[_app_id].app_imported_projects) {
5711
+ var view_ret = await module.DOCS_OBJ_get(SESSION_ID, 'global_' + imported_app_id);
5750
5712
  DOCS_OBJ[_app_id][idP] = _.merge(DOCS_OBJ[_app_id][idP], view_ret);
5751
5713
  }
5752
5714
  }
@@ -5797,10 +5759,10 @@ func.utils.get_dateTime = async function (SESSION_ID, typeP, dateP) {
5797
5759
  var _session = SESSION_OBJ[SESSION_ID];
5798
5760
 
5799
5761
  const response = await fetch(`https://${_session.domain}/cpi/get_utc_ts`, {
5800
- method: "POST",
5762
+ method: 'POST',
5801
5763
  headers: {
5802
- Accept: "application/json",
5803
- "Content-Type": "application/json",
5764
+ Accept: 'application/json',
5765
+ 'Content-Type': 'application/json',
5804
5766
  },
5805
5767
  body: JSON.stringify({}),
5806
5768
  });
@@ -5829,47 +5791,32 @@ func.utils.get_dateTime = async function (SESSION_ID, typeP, dateP) {
5829
5791
  let ts = await get_server_ts();
5830
5792
  sysDate = new Date(ts);
5831
5793
  }
5832
- var day = _.padStart(sysDate.getDate(), 2, "0");
5833
- var month = _.padStart(sysDate.getMonth() + 1, 2, "0");
5794
+ var day = _.padStart(sysDate.getDate(), 2, '0');
5795
+ var month = _.padStart(sysDate.getMonth() + 1, 2, '0');
5834
5796
  var year = sysDate.getFullYear();
5835
- var week = _.padStart(getWeekNumber(sysDate), 2, "0");
5836
- var hour = _.padStart(sysDate.getHours(), 2, "0");
5837
- var minute = _.padStart(sysDate.getMinutes(), 2, "0");
5838
- var second = _.padStart(sysDate.getSeconds(), 2, "0");
5839
- if (typeP === "SYS_DATE") return year + "-" + month + "-" + day;
5840
- if (typeP === "SYS_DATE_TIME")
5841
- return year + "-" + month + "-" + day + "T" + hour + ":" + minute;
5842
- if (typeP === "SYS_DATE_VALUE") return sysDate.valueOf();
5843
- if (typeP === "SYS_DATE_WEEK_YEAR") return year + "W" + week;
5844
- if (typeP === "SYS_DATE_MONTH_YEAR") return year + "-" + month;
5845
- if (typeP === "SYS_TIME") return hour + ":" + minute + ":" + second;
5846
- if (typeP === "SYS_TIME_SHORT") return hour + ":" + minute;
5797
+ var week = _.padStart(getWeekNumber(sysDate), 2, '0');
5798
+ var hour = _.padStart(sysDate.getHours(), 2, '0');
5799
+ var minute = _.padStart(sysDate.getMinutes(), 2, '0');
5800
+ var second = _.padStart(sysDate.getSeconds(), 2, '0');
5801
+ if (typeP === 'SYS_DATE') return year + '-' + month + '-' + day;
5802
+ if (typeP === 'SYS_DATE_TIME') return year + '-' + month + '-' + day + 'T' + hour + ':' + minute;
5803
+ if (typeP === 'SYS_DATE_VALUE') return sysDate.valueOf();
5804
+ if (typeP === 'SYS_DATE_WEEK_YEAR') return year + 'W' + week;
5805
+ if (typeP === 'SYS_DATE_MONTH_YEAR') return year + '-' + month;
5806
+ if (typeP === 'SYS_TIME') return hour + ':' + minute + ':' + second;
5807
+ if (typeP === 'SYS_TIME_SHORT') return hour + ':' + minute;
5847
5808
  };
5848
5809
  func.utils.is_onscreen_event = function (functionP) {
5849
- const arr = [
5850
- "invoke_action",
5851
- "cache_refresh",
5852
- "call_popover",
5853
- "call_modal",
5854
- "call_page",
5855
- "loader_on",
5856
- "loader_off",
5857
- "emit_event",
5858
- ];
5810
+ const arr = ['invoke_action', 'cache_refresh', 'call_popover', 'call_modal', 'call_page', 'loader_on', 'loader_off', 'emit_event'];
5859
5811
 
5860
5812
  return arr.includes(functionP);
5861
5813
  };
5862
5814
 
5863
5815
  func.utils.get_screen_obj = async function (SESSION_ID, id) {
5864
5816
  const prog_obj = await func.utils.VIEWS_OBJ.get(SESSION_ID, id);
5865
- if (!prog_obj) return console.error("prog not found: " + id);
5817
+ if (!prog_obj) return console.error('prog not found: ' + id);
5866
5818
 
5867
- if (
5868
- prog_obj.properties.menuType === "screen" ||
5869
- prog_obj.properties.menuType === "api" ||
5870
- glb.FUNCTION_NODES_ARR.includes(prog_obj.properties.menuType) ||
5871
- glb.MOBILE_ARR.includes(prog_obj.properties.menuType)
5872
- ) {
5819
+ if (prog_obj.properties.menuType === 'screen' || prog_obj.properties.menuType === 'api' || glb.FUNCTION_NODES_ARR.includes(prog_obj.properties.menuType) || glb.MOBILE_ARR.includes(prog_obj.properties.menuType)) {
5873
5820
  return prog_obj;
5874
5821
  }
5875
5822
  return;
@@ -5878,7 +5825,7 @@ func.utils.get_screen_obj = async function (SESSION_ID, id) {
5878
5825
  func.utils.clean_returned_datasource = function (SESSION_ID, DS) {
5879
5826
  const clean_object_functions = function (obj) {
5880
5827
  for (const [key, val] of Object.entries(obj)) {
5881
- if (typeof val === "function") {
5828
+ if (typeof val === 'function') {
5882
5829
  delete obj[key];
5883
5830
  }
5884
5831
  }
@@ -5894,9 +5841,7 @@ func.utils.clean_returned_datasource = function (SESSION_ID, DS) {
5894
5841
  try {
5895
5842
  clean_object_functions(obj);
5896
5843
 
5897
- obj = JSON.parse(
5898
- JSON.stringify(obj, func.utils.clean_stringify_null, "\t")
5899
- );
5844
+ obj = JSON.parse(JSON.stringify(obj, func.utils.clean_stringify_null, '\t'));
5900
5845
  } catch (e) {
5901
5846
  console.error(e);
5902
5847
  }
@@ -5909,13 +5854,13 @@ func.utils.clean_returned_datasource = function (SESSION_ID, DS) {
5909
5854
 
5910
5855
  const clean_empty_objects = function () {
5911
5856
  for (const [key, val] of Object.entries(obj)) {
5912
- if (typeof val === "object" && !Array.isArray(val) && _.isEmpty(val)) {
5857
+ if (typeof val === 'object' && !Array.isArray(val) && _.isEmpty(val)) {
5913
5858
  delete obj[key];
5914
5859
  }
5915
5860
  }
5916
5861
 
5917
5862
  for (const [key, val] of Object.entries(obj)) {
5918
- if (typeof val === "object" && Array.isArray(val) && !val.length) {
5863
+ if (typeof val === 'object' && Array.isArray(val) && !val.length) {
5919
5864
  delete obj[key];
5920
5865
  }
5921
5866
  }
@@ -5933,7 +5878,7 @@ func.utils.clean_returned_datasource = function (SESSION_ID, DS) {
5933
5878
  return obj;
5934
5879
  };
5935
5880
  func.utils.post_back_to_client = function (SESSION_ID, service, id, data) {
5936
- if (typeof IS_PROCESS_SERVER !== "undefined") return;
5881
+ if (typeof IS_PROCESS_SERVER !== 'undefined') return;
5937
5882
  worker_post_message({
5938
5883
  fx_to_execute: service,
5939
5884
  params: data,
@@ -5951,35 +5896,24 @@ func.utils.job_worker = function (session_id) {
5951
5896
  var attempt = 0;
5952
5897
 
5953
5898
  const lock = function (dsP) {
5954
- if (
5955
- !_session.WORKER_OBJ.jobs[_session.WORKER_OBJ.stat] ||
5956
- _session.WORKER_OBJ.jobs[_session.WORKER_OBJ.stat].typeP ===
5957
- "system_interval" ||
5958
- _session.WORKER_OBJ.jobs[_session.WORKER_OBJ.stat].typeP ===
5959
- "system event"
5960
- ) {
5899
+ if (!_session.WORKER_OBJ.jobs[_session.WORKER_OBJ.stat] || _session.WORKER_OBJ.jobs[_session.WORKER_OBJ.stat].typeP === 'system_interval' || _session.WORKER_OBJ.jobs[_session.WORKER_OBJ.stat].typeP === 'system event') {
5961
5900
  return;
5962
5901
  }
5963
5902
  if (glb.IS_WORKER) {
5964
- func.utils.post_back_to_client(
5965
- SESSION_ID,
5966
- "screen_blocker_on",
5967
- _session.worker_id,
5968
- null
5969
- );
5903
+ func.utils.post_back_to_client(SESSION_ID, 'screen_blocker_on', _session.worker_id, null);
5970
5904
  } else {
5971
- func.UI.utils.screen_blocker(true, "Worker", dsP);
5905
+ func.UI.utils.screen_blocker(true, 'Worker', dsP);
5972
5906
  }
5973
5907
  };
5974
5908
  const unlock = function () {
5975
5909
  if (glb.IS_WORKER) {
5976
5910
  } else {
5977
- func.UI.utils.screen_blocker(false, "Worker");
5911
+ func.UI.utils.screen_blocker(false, 'Worker');
5978
5912
  }
5979
5913
  };
5980
5914
  const not_responding = function () {
5981
5915
  is_not_responding = true;
5982
- func.UI.utils.progressScreen.hide("Working, Please wait..");
5916
+ func.UI.utils.progressScreen.hide('Working, Please wait..');
5983
5917
  setTimeout(function () {
5984
5918
  if (!is_not_responding) return;
5985
5919
 
@@ -5993,7 +5927,7 @@ func.utils.job_worker = function (session_id) {
5993
5927
  is_progressScreen_on = false;
5994
5928
  is_not_responding = false;
5995
5929
 
5996
- func.UI.utils.progressScreen.hide("Working, Please wait..");
5930
+ func.UI.utils.progressScreen.hide('Working, Please wait..');
5997
5931
  } else if (attempt > 300 && is_not_responding) {
5998
5932
  is_not_responding = false;
5999
5933
  busy();
@@ -6007,29 +5941,15 @@ func.utils.job_worker = function (session_id) {
6007
5941
  };
6008
5942
  const busy = function () {
6009
5943
  if (glb.IS_WORKER) return;
6010
- func.utils.debug_report(
6011
- SESSION_ID,
6012
- "utils.worker.busy",
6013
- "worker processing more then 10 second",
6014
- "W",
6015
- "",
6016
- _session.WORKER_OBJ.jobs
6017
- );
5944
+ func.utils.debug_report(SESSION_ID, 'utils.worker.busy', 'worker processing more then 10 second', 'W', '', _session.WORKER_OBJ.jobs);
6018
5945
 
6019
5946
  is_progressScreen_on = true;
6020
5947
  };
6021
5948
  const reset = function () {
6022
- func.utils.debug_report(
6023
- SESSION_ID,
6024
- "utils.worker.reset",
6025
- "worker not responding",
6026
- "E",
6027
- "",
6028
- _session.WORKER_OBJ.jobs
6029
- );
5949
+ func.utils.debug_report(SESSION_ID, 'utils.worker.reset', 'worker not responding', 'E', '', _session.WORKER_OBJ.jobs);
6030
5950
  _session.WORKER_OBJ.jobs = [];
6031
5951
  _session.WORKER_OBJ.stat = null;
6032
- $(".screen_blocker").remove();
5952
+ $('.screen_blocker').remove();
6033
5953
  };
6034
5954
  return {
6035
5955
  _interval: null,
@@ -6039,11 +5959,7 @@ func.utils.job_worker = function (session_id) {
6039
5959
  this._interval = setInterval(async function () {
6040
5960
  var _session = SESSION_OBJ[SESSION_ID];
6041
5961
  if (!_session?.WORKER_OBJ) return;
6042
- if (
6043
- typeof _session.WORKER_OBJ.stat === "undefined" ||
6044
- _session.WORKER_OBJ.stat === "undefined" ||
6045
- _session.WORKER_OBJ.stat === null
6046
- ) {
5962
+ if (typeof _session.WORKER_OBJ.stat === 'undefined' || _session.WORKER_OBJ.stat === 'undefined' || _session.WORKER_OBJ.stat === null) {
6047
5963
  // idle
6048
5964
 
6049
5965
  // if (_this._was_busy) {
@@ -6061,17 +5977,12 @@ func.utils.job_worker = function (session_id) {
6061
5977
  // }
6062
5978
  unlock();
6063
5979
  if (_session.WORKER_OBJ.jobs.length) {
6064
- for await (const [key, val] of Object.entries(
6065
- _session.WORKER_OBJ.jobs
6066
- )) {
5980
+ for await (const [key, val] of Object.entries(_session.WORKER_OBJ.jobs)) {
6067
5981
  if (val.stat) {
6068
5982
  break;
6069
5983
  }
6070
5984
  // if (!_session.WORKER_OBJ.stat) {
6071
- if (
6072
- !_session.WORKER_OBJ.jobs[Number(key)] ||
6073
- val.job_num === 9999999
6074
- ) {
5985
+ if (!_session.WORKER_OBJ.jobs[Number(key)] || val.job_num === 9999999) {
6075
5986
  continue;
6076
5987
  }
6077
5988
  if (val.dsSessionP && !_session.DS_GLB[val.dsSessionP]) {
@@ -6106,8 +6017,8 @@ func.utils.job_worker = function (session_id) {
6106
6017
  val.prog_id,
6107
6018
  val.nodeId,
6108
6019
  val.parentDataSourceNo,
6109
- "", //dismissed val.$div creating bug in alter ui
6110
- val.$container
6020
+ '', //dismissed val.$div creating bug in alter ui
6021
+ val.$container,
6111
6022
  );
6112
6023
  }
6113
6024
  _this._was_busy = true;
@@ -6115,12 +6026,7 @@ func.utils.job_worker = function (session_id) {
6115
6026
  // idle
6116
6027
  if (_this._was_busy) {
6117
6028
  if (glb.IS_WORKER) {
6118
- func.utils.post_back_to_client(
6119
- SESSION_ID,
6120
- "worker_busy_off",
6121
- _session.worker_id,
6122
- null
6123
- );
6029
+ func.utils.post_back_to_client(SESSION_ID, 'worker_busy_off', _session.worker_id, null);
6124
6030
  } else {
6125
6031
  func.UI.utils.indicator.worker.normal();
6126
6032
  }
@@ -6134,27 +6040,18 @@ func.utils.job_worker = function (session_id) {
6134
6040
  //busy
6135
6041
  _this._was_busy = true;
6136
6042
  if (glb.IS_WORKER) {
6137
- func.utils.post_back_to_client(
6138
- SESSION_ID,
6139
- "worker_busy_on",
6140
- _session.worker_id,
6141
- null
6142
- );
6043
+ func.utils.post_back_to_client(SESSION_ID, 'worker_busy_on', _session.worker_id, null);
6143
6044
  } else {
6144
6045
  func.UI.utils.indicator.worker.busy();
6145
6046
  }
6146
6047
  if (glb.WORKER_PAUSE) return;
6147
6048
  attempt++;
6148
6049
  if (!is_progressScreen_on && attempt > glb.WORKER_TIMEOUT) busy();
6149
- if (
6150
- !is_not_responding &&
6151
- attempt >= glb.WORKER_ATTEMPTS_NOT_RESPONDING
6152
- ) {
6050
+ if (!is_not_responding && attempt >= glb.WORKER_ATTEMPTS_NOT_RESPONDING) {
6153
6051
  not_responding();
6154
6052
  }
6155
6053
  var ds = null;
6156
- if (_session.WORKER_OBJ.jobs[0])
6157
- ds = _session.WORKER_OBJ.jobs[0].dsSessionP;
6054
+ if (_session.WORKER_OBJ.jobs[0]) ds = _session.WORKER_OBJ.jobs[0].dsSessionP;
6158
6055
  lock(ds);
6159
6056
  }
6160
6057
  }, 1);
@@ -6168,7 +6065,7 @@ func.utils.job_worker = function (session_id) {
6168
6065
  func.utils.base64MimeType = function (encoded) {
6169
6066
  var result = null;
6170
6067
 
6171
- if (typeof encoded !== "string") {
6068
+ if (typeof encoded !== 'string') {
6172
6069
  return result;
6173
6070
  }
6174
6071
 
@@ -6182,9 +6079,8 @@ func.utils.base64MimeType = function (encoded) {
6182
6079
  };
6183
6080
 
6184
6081
  func.utils.makeid = function (length) {
6185
- var result = "";
6186
- var characters =
6187
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
6082
+ var result = '';
6083
+ var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
6188
6084
  var charactersLength = characters.length;
6189
6085
  for (var i = 0; i < length; i++) {
6190
6086
  result += characters.charAt(Math.floor(Math.random() * charactersLength));
@@ -6199,7 +6095,7 @@ func.utils.get_device = function () {
6199
6095
  device = window.cordova.platformId;
6200
6096
  }
6201
6097
  } catch (e) {
6202
- console.error("error using ui element in server side request");
6098
+ console.error('error using ui element in server side request');
6203
6099
  }
6204
6100
  return device;
6205
6101
  };
@@ -6213,12 +6109,9 @@ func.utils.ws_worker.functions = {
6213
6109
  APP_OBJ[data.app_id] = data.APP_OBJ;
6214
6110
  PROJECT_OBJ[data.app_id] = data.PROJECT_OBJ;
6215
6111
 
6216
- if (data.SESSION_INFO.engine_mode === "live_preview") {
6112
+ if (data.SESSION_INFO.engine_mode === 'live_preview') {
6217
6113
  DOCS_OBJ[data.app_id] = data.DOCS_OBJ;
6218
- } else if (
6219
- typeof IS_DOCKER === "undefined" &&
6220
- typeof IS_PROCESS_SERVER === "undefined"
6221
- ) {
6114
+ } else if (typeof IS_DOCKER === 'undefined' && typeof IS_PROCESS_SERVER === 'undefined') {
6222
6115
  if (!DOCS_OBJ[data.app_id]) {
6223
6116
  DOCS_OBJ[data.app_id] = {};
6224
6117
  }
@@ -6246,11 +6139,8 @@ func.utils.ws_worker.functions = {
6246
6139
  _session.dataSourceSessionGlobal = Number(key);
6247
6140
  }
6248
6141
  }
6249
- if (typeof _session.SLIM_BUNDLE === "undefined" || !_session.SLIM_BUNDLE) {
6250
- const db_adapter = await func.common.get_module(
6251
- SESSION_ID,
6252
- "xuda-db-adapter-module.mjs"
6253
- );
6142
+ if (typeof _session.SLIM_BUNDLE === 'undefined' || !_session.SLIM_BUNDLE) {
6143
+ const db_adapter = await func.common.get_module(SESSION_ID, 'xuda-db-adapter-module.mjs');
6254
6144
 
6255
6145
  func.db = db_adapter._db;
6256
6146
  }
@@ -6258,20 +6148,17 @@ func.utils.ws_worker.functions = {
6258
6148
  _session.WORKER_OBJ.fx = new func.utils.job_worker(SESSION_ID);
6259
6149
  _session.WORKER_OBJ.fx.init();
6260
6150
 
6261
- if (_session.app_id === "unknown") {
6151
+ if (_session.app_id === 'unknown') {
6262
6152
  worker_post_message({
6263
- fx_to_execute: "init_done",
6153
+ fx_to_execute: 'init_done',
6264
6154
  worker_id: ws_worker_id,
6265
6155
  session_id: SESSION_ID,
6266
6156
  });
6267
6157
  } else {
6268
- const module = await func.common.get_module(
6269
- SESSION_ID,
6270
- `xuda-progs-loader-module.mjs`
6271
- );
6158
+ const module = await func.common.get_module(SESSION_ID, `xuda-progs-loader-module.mjs`);
6272
6159
  await module.load_objects_cache(SESSION_ID);
6273
6160
  worker_post_message({
6274
- fx_to_execute: "init_done",
6161
+ fx_to_execute: 'init_done',
6275
6162
  worker_id: ws_worker_id,
6276
6163
  session_id: SESSION_ID,
6277
6164
  });
@@ -6287,14 +6174,9 @@ func.utils.ws_worker.functions = {
6287
6174
  args.SESSION_ID = SESSION_ID;
6288
6175
 
6289
6176
  if (show_log) {
6290
- console.log(
6291
- "DATASOURCE EXECUTING SESSION_ID: " + SESSION_ID,
6292
- APP_OBJ[_session.app_id].app_name
6293
- );
6177
+ console.log('DATASOURCE EXECUTING SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
6294
6178
  }
6295
- if (
6296
- Number(params.dataSourceSessionGlobal) > _session.dataSourceSessionGlobal
6297
- ) {
6179
+ if (Number(params.dataSourceSessionGlobal) > _session.dataSourceSessionGlobal) {
6298
6180
  _session.dataSourceSessionGlobal = Number(params.dataSourceSessionGlobal);
6299
6181
  }
6300
6182
 
@@ -6316,18 +6198,10 @@ func.utils.ws_worker.functions = {
6316
6198
  args.parameters_obj_inP,
6317
6199
  args.static_refreshP,
6318
6200
  args.run_atP,
6319
- args.worker_id
6201
+ args.worker_id,
6320
6202
  );
6321
6203
 
6322
- if (show_log)
6323
- console.log(
6324
- "DATASOURCE EXECUTION DONE " +
6325
- ret.dsSessionP +
6326
- " " +
6327
- _session.DS_GLB[ret.dsSessionP]?.tree_obj?.menuName ||
6328
- "" + " SESSION_ID: " + SESSION_ID,
6329
- APP_OBJ[_session.app_id].app_name
6330
- );
6204
+ if (show_log) console.log('DATASOURCE EXECUTION DONE ' + ret.dsSessionP + ' ' + _session.DS_GLB[ret.dsSessionP]?.tree_obj?.menuName || '' + ' SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
6331
6205
  var obj = func.utils.clean_returned_datasource(SESSION_ID, ret.dsSessionP);
6332
6206
  obj.dataSourceSessionGlobal = _session.dataSourceSessionGlobal;
6333
6207
 
@@ -6343,19 +6217,11 @@ func.utils.ws_worker.functions = {
6343
6217
  datasource_delete: function (params, promise_queue_id) {
6344
6218
  var SESSION_ID = params.session_id;
6345
6219
  var _session = SESSION_OBJ[SESSION_ID];
6346
- if (
6347
- DATASOURCE_INTERVALS[SESSION_ID] &&
6348
- DATASOURCE_INTERVALS[SESSION_ID][params.dssession]
6349
- ) {
6220
+ if (DATASOURCE_INTERVALS[SESSION_ID] && DATASOURCE_INTERVALS[SESSION_ID][params.dssession]) {
6350
6221
  DATASOURCE_INTERVALS[SESSION_ID][params.dssession].clear();
6351
6222
  }
6352
6223
  delete _session.DS_GLB[params.dssession];
6353
- if (show_log)
6354
- console.log(
6355
- "DATASOURCE DELETE SESSION_ID: " + SESSION_ID,
6356
- APP_OBJ[_session.app_id].app_name,
6357
- params.dssession
6358
- );
6224
+ if (show_log) console.log('DATASOURCE DELETE SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name, params.dssession);
6359
6225
  // debugger;
6360
6226
  worker_post_message({
6361
6227
  promise_queue_id,
@@ -6365,10 +6231,7 @@ func.utils.ws_worker.functions = {
6365
6231
  service: params.service,
6366
6232
  });
6367
6233
  },
6368
- update_datasource_changes_from_client: async function (
6369
- params,
6370
- promise_queue_id
6371
- ) {
6234
+ update_datasource_changes_from_client: async function (params, promise_queue_id) {
6372
6235
  if (_.isEmpty(SESSION_OBJ)) return;
6373
6236
  var SESSION_ID = params.session_id;
6374
6237
  var _session = SESSION_OBJ[SESSION_ID];
@@ -6378,12 +6241,7 @@ func.utils.ws_worker.functions = {
6378
6241
  _session.dataSourceSessionGlobal = -1;
6379
6242
  _session.DS_GLB = {};
6380
6243
  }
6381
- if (show_log)
6382
- console.log(
6383
- "DATASOURCE UPDATE SESSION_ID: " + SESSION_ID,
6384
- APP_OBJ[_session.app_id].app_name,
6385
- params.dssession
6386
- );
6244
+ if (show_log) console.log('DATASOURCE UPDATE SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name, params.dssession);
6387
6245
 
6388
6246
  await func.datasource.update(SESSION_ID, params.datasource_changes, true);
6389
6247
 
@@ -6403,33 +6261,15 @@ func.utils.ws_worker.functions = {
6403
6261
  var ds = _session.DS_GLB[params.dssession];
6404
6262
  var type = params.return_to_data_source_type;
6405
6263
  var args = ds.args;
6406
- if (show_log)
6407
- console.log(
6408
- "DATASOURCE RETURN TO DATASOURCE " +
6409
- params.dssession +
6410
- " SESSION_ID: " +
6411
- SESSION_ID,
6412
- APP_OBJ[_session.app_id].app_name
6413
- );
6414
- _session.DS_GLB[params.dssession].v.onscreen_events_active =
6415
- params.onscreen_events_active;
6416
- if (params.viewEventExec_arr)
6417
- _session.DS_GLB[params.dssession].viewEventExec_arr = JSON.parse(
6418
- params.viewEventExec_arr
6419
- );
6264
+ if (show_log) console.log('DATASOURCE RETURN TO DATASOURCE ' + params.dssession + ' SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
6265
+ _session.DS_GLB[params.dssession].v.onscreen_events_active = params.onscreen_events_active;
6266
+ if (params.viewEventExec_arr) _session.DS_GLB[params.dssession].viewEventExec_arr = JSON.parse(params.viewEventExec_arr);
6420
6267
  var done = function (SESSION_ID, DS) {
6421
- if (show_log)
6422
- console.log(
6423
- "DATASOURCE RETURN TO DATASOURCE DONE " +
6424
- DS +
6425
- " SESSION_ID: " +
6426
- SESSION_ID,
6427
- APP_OBJ[_session.app_id].app_name
6428
- );
6268
+ if (show_log) console.log('DATASOURCE RETURN TO DATASOURCE DONE ' + DS + ' SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
6429
6269
  var obj = func.utils.clean_returned_datasource(SESSION_ID, DS);
6430
6270
  obj.dataSourceSessionGlobal = _session.dataSourceSessionGlobal;
6431
6271
  worker_post_message({
6432
- fx_to_execute: "post_datasource",
6272
+ fx_to_execute: 'post_datasource',
6433
6273
  params: {
6434
6274
  ds_obj: obj,
6435
6275
  dsSessionP: params.dssession,
@@ -6448,47 +6288,23 @@ func.utils.ws_worker.functions = {
6448
6288
  var _session = SESSION_OBJ[SESSION_ID];
6449
6289
  var ds = _session.DS_GLB[params.dssession];
6450
6290
 
6451
- if (show_log)
6452
- console.log(
6453
- "UPDATE CHANGE EVENT DONE TO DATASOURCE " +
6454
- params.dssession +
6455
- " SESSION_ID: " +
6456
- SESSION_ID,
6457
- APP_OBJ[_session.app_id].app_name
6458
- );
6291
+ if (show_log) console.log('UPDATE CHANGE EVENT DONE TO DATASOURCE ' + params.dssession + ' SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
6459
6292
  ds.eventChangesResults_done = true;
6460
6293
  },
6461
6294
  return_from_db_query: function (params) {
6462
6295
  var SESSION_ID = params.session_id;
6463
6296
  var _session = SESSION_OBJ[SESSION_ID];
6464
6297
  var id = params.id;
6465
- if (show_log)
6466
- console.log(
6467
- "RETURN FROM DB_QUERY " +
6468
- params.dssession +
6469
- " SESSION_ID: " +
6470
- SESSION_ID,
6471
- APP_OBJ[_session.app_id].app_name
6472
- );
6298
+ if (show_log) console.log('RETURN FROM DB_QUERY ' + params.dssession + ' SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
6473
6299
  debugger;
6474
- var callback = func.utils.get_callback_queue(
6475
- SESSION_ID,
6476
- params.callback_id
6477
- );
6300
+ var callback = func.utils.get_callback_queue(SESSION_ID, params.callback_id);
6478
6301
  if (callback) callback(params.data);
6479
6302
  },
6480
6303
  return_from_sava_data: function (params) {
6481
6304
  var SESSION_ID = params.session_id;
6482
6305
  var _session = SESSION_OBJ[SESSION_ID];
6483
6306
  var id = params.id;
6484
- if (show_log)
6485
- console.log(
6486
- "RETURN FROM SAVE_DATA " +
6487
- params.dssession +
6488
- " SESSION_ID: " +
6489
- SESSION_ID,
6490
- APP_OBJ[_session.app_id].app_name
6491
- );
6307
+ if (show_log) console.log('RETURN FROM SAVE_DATA ' + params.dssession + ' SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
6492
6308
  func.utils.get_callback_queue(SESSION_ID, params.callback_id)();
6493
6309
  },
6494
6310
  update_debug_info: function (params) {
@@ -6508,8 +6324,7 @@ func.utils.ws_worker.functions = {
6508
6324
  get_dataSourceSessionGlobal: function (params) {
6509
6325
  var SESSION_ID = params.session_id;
6510
6326
  SESSION_OBJ[SESSION_ID].dataSourceSessionGlobal++;
6511
- let new_dataSourceSessionGlobal =
6512
- SESSION_OBJ[SESSION_ID].dataSourceSessionGlobal;
6327
+ let new_dataSourceSessionGlobal = SESSION_OBJ[SESSION_ID].dataSourceSessionGlobal;
6513
6328
  return { new_dataSourceSessionGlobal };
6514
6329
  },
6515
6330
  create_webworker_globals: function (params) {
@@ -6522,7 +6337,7 @@ func.utils.ws_worker.functions = {
6522
6337
  const event = new CustomEvent(eventName, { detail });
6523
6338
  self.dispatchEvent(event);
6524
6339
  }
6525
- emitCustomEvent("live_preview_get_obj_response_worker_" + params._id, {
6340
+ emitCustomEvent('live_preview_get_obj_response_worker_' + params._id, {
6526
6341
  data: params,
6527
6342
  });
6528
6343
  },
@@ -6532,7 +6347,7 @@ func.utils.ws_worker.functions = {
6532
6347
  const event = new CustomEvent(eventName, { detail });
6533
6348
  self.dispatchEvent(event);
6534
6349
  }
6535
- emitCustomEvent("get_doc_obj_from_build_worker_" + params._id, {
6350
+ emitCustomEvent('get_doc_obj_from_build_worker_' + params._id, {
6536
6351
  data: params,
6537
6352
  });
6538
6353
  },
@@ -6542,7 +6357,7 @@ func.utils.ws_worker.functions = {
6542
6357
  const event = new CustomEvent(eventName, { detail });
6543
6358
  self.dispatchEvent(event);
6544
6359
  }
6545
- emitCustomEvent("get_ws_data_worker_" + params.websocket_queue_num, {
6360
+ emitCustomEvent('get_ws_data_worker_' + params.websocket_queue_num, {
6546
6361
  data: params.data,
6547
6362
  });
6548
6363
  },
@@ -6550,37 +6365,16 @@ func.utils.ws_worker.functions = {
6550
6365
  var SESSION_ID = params.session_id;
6551
6366
 
6552
6367
  try {
6553
- const do_heartbeat = async function (
6554
- app_replicate,
6555
- app_id,
6556
- token_id,
6557
- fingerprint,
6558
- device_name,
6559
- stat
6560
- ) {
6368
+ const do_heartbeat = async function (app_replicate, app_id, token_id, fingerprint, device_name, stat) {
6561
6369
  try {
6562
6370
  module.exports.close_expired_device_log_sessions(app_id);
6563
6371
 
6564
- return await update_device(
6565
- app_replicate,
6566
- app_id,
6567
- token_id,
6568
- fingerprint,
6569
- device_name,
6570
- stat
6571
- );
6372
+ return await update_device(app_replicate, app_id, token_id, fingerprint, device_name, stat);
6572
6373
  } catch (err) {
6573
6374
  return { code: -400, data: err.message };
6574
6375
  }
6575
6376
  };
6576
- let ret = await do_heartbeat(
6577
- params.app_replicate,
6578
- params.app_id,
6579
- params.gtp_token || req.body.app_token,
6580
- params.fingerprint,
6581
- params.device_name,
6582
- params.stat
6583
- );
6377
+ let ret = await do_heartbeat(params.app_replicate, params.app_id, params.gtp_token || req.body.app_token, params.fingerprint, params.device_name, params.stat);
6584
6378
 
6585
6379
  // session_status: ret_session.data.stat
6586
6380
  if (params.token) {
@@ -6600,7 +6394,7 @@ func.utils.ws_worker.functions = {
6600
6394
  const event = new CustomEvent(eventName, { detail });
6601
6395
  self.dispatchEvent(event);
6602
6396
  }
6603
- emitCustomEvent("rpi_request_response_worker_" + params.table_id, {
6397
+ emitCustomEvent('rpi_request_response_worker_' + params.table_id, {
6604
6398
  data: params.data,
6605
6399
  });
6606
6400
  },
@@ -6619,8 +6413,7 @@ func.utils.set_callback_queue = function (SESSION_ID, func) {
6619
6413
  func.utils.get_callback_queue = function (SESSION_ID, t) {
6620
6414
  var func = WEB_WORKER_CALLBACK_QUEUE[SESSION_ID][t];
6621
6415
  setTimeout(function () {
6622
- if (WEB_WORKER_CALLBACK_QUEUE[SESSION_ID][t])
6623
- delete WEB_WORKER_CALLBACK_QUEUE[SESSION_ID][t];
6416
+ if (WEB_WORKER_CALLBACK_QUEUE[SESSION_ID][t]) delete WEB_WORKER_CALLBACK_QUEUE[SESSION_ID][t];
6624
6417
  }, 1000);
6625
6418
  return func;
6626
6419
  };
@@ -6636,7 +6429,7 @@ func.utils.clean_stringify_null = function (key, value) {
6636
6429
  func.utils.load_js_on_demand = async function (js_src, type) {
6637
6430
  const get_script = function (callback) {
6638
6431
  function getScript(scriptUrl, callback) {
6639
- const script = document.createElement("script");
6432
+ const script = document.createElement('script');
6640
6433
  script.src = scriptUrl;
6641
6434
  if (type) script.type = type;
6642
6435
  script.onload = callback;
@@ -6680,27 +6473,20 @@ func.utils.load_css_on_demand = function (css_href) {
6680
6473
  if (isCssLoaded(css_href)) {
6681
6474
  return;
6682
6475
  }
6683
- return $("<link/>", {
6684
- rel: "stylesheet",
6685
- type: "text/css",
6476
+ return $('<link/>', {
6477
+ rel: 'stylesheet',
6478
+ type: 'text/css',
6686
6479
  href: css_href,
6687
- }).prependTo("head");
6480
+ }).prependTo('head');
6688
6481
  };
6689
6482
 
6690
6483
  func.utils.remove_js_css_file = function (filename, filetype) {
6691
- var targetelement =
6692
- filetype == "js" ? "script" : filetype == "css" ? "link" : "none"; //determine element type to create nodelist from
6693
- var targetattr =
6694
- filetype == "js" ? "src" : filetype == "css" ? "href" : "none"; //determine corresponding attribute to test for
6484
+ var targetelement = filetype == 'js' ? 'script' : filetype == 'css' ? 'link' : 'none'; //determine element type to create nodelist from
6485
+ var targetattr = filetype == 'js' ? 'src' : filetype == 'css' ? 'href' : 'none'; //determine corresponding attribute to test for
6695
6486
  var allsuspects = document.getElementsByTagName(targetelement);
6696
6487
  for (var i = allsuspects.length; i >= 0; i--) {
6697
6488
  //search backwards within node list for matching elements to remove
6698
- if (
6699
- allsuspects[i] &&
6700
- allsuspects[i].getAttribute(targetattr) != null &&
6701
- allsuspects[i].getAttribute(targetattr).indexOf(filename) != -1
6702
- )
6703
- allsuspects[i].parentNode.removeChild(allsuspects[i]); //remove element by calling parentNode.removeChild()
6489
+ if (allsuspects[i] && allsuspects[i].getAttribute(targetattr) != null && allsuspects[i].getAttribute(targetattr).indexOf(filename) != -1) allsuspects[i].parentNode.removeChild(allsuspects[i]); //remove element by calling parentNode.removeChild()
6704
6490
  }
6705
6491
  };
6706
6492
 
@@ -6708,11 +6494,7 @@ func.utils.replace_studio_drive_url = function (SESSION_ID, val) {
6708
6494
  var _session = SESSION_OBJ[SESSION_ID];
6709
6495
  if (!_session.is_deployment) return val;
6710
6496
  try {
6711
- return val.replaceAll(
6712
- `https://xuda.io/studio-drive/${APP_OBJ[_session.app_id].app_replicate}`,
6713
- `https://${_session.domain}/studio-drive/${APP_OBJ[_session.app_id].app_replicate
6714
- }`
6715
- );
6497
+ return val.replaceAll(`https://xuda.io/studio-drive/${APP_OBJ[_session.app_id].app_replicate}`, `https://${_session.domain}/studio-drive/${APP_OBJ[_session.app_id].app_replicate}`);
6716
6498
  } catch (err) {
6717
6499
  return val;
6718
6500
  }
@@ -6725,8 +6507,7 @@ func.utils.get_drive_url = function (SESSION_ID, val, wrap) {
6725
6507
  function replaceFiletoURL(fileString) {
6726
6508
  const _app = APP_OBJ[_session.app_id];
6727
6509
 
6728
- let url = `https://${_session.domain}/workspace-drive/${_app.is_deployment ? _app.app_datacenter_id : _app.app_id_reference
6729
- }/`;
6510
+ let url = `https://${_session.domain}/workspace-drive/${_app.is_deployment ? _app.app_datacenter_id : _app.app_id_reference}/`;
6730
6511
 
6731
6512
  let FILE_REPLACE_URL = `${url}${val}`;
6732
6513
 
@@ -6735,10 +6516,9 @@ func.utils.get_drive_url = function (SESSION_ID, val, wrap) {
6735
6516
  FILE_REPLACE_URL += `?app_token=${_session.app_token}`;
6736
6517
  }
6737
6518
 
6738
- let match = `drv_${_app.app_replicate || _session.app_id
6739
- }_[0-9a-f\\-]+\\.[a-zA-Z0-9]+`;
6519
+ let match = `drv_${_app.app_replicate || _session.app_id}_[0-9a-f\\-]+\\.[a-zA-Z0-9]+`;
6740
6520
 
6741
- let pat = new RegExp(match, "g");
6521
+ let pat = new RegExp(match, 'g');
6742
6522
  let URLString = fileString.replace(pat, function (match, idx) {
6743
6523
  // debugger;
6744
6524
  const hasURLbefore = fileString.substring(idx - url.length, idx) === url;
@@ -6747,15 +6527,15 @@ func.utils.get_drive_url = function (SESSION_ID, val, wrap) {
6747
6527
  return match;
6748
6528
  }
6749
6529
 
6750
- return FILE_REPLACE_URL.replace("{val}", match);
6530
+ return FILE_REPLACE_URL.replace('{val}', match);
6751
6531
  });
6752
6532
 
6753
6533
  return URLString;
6754
6534
  }
6755
6535
 
6756
- if (typeof val === "string" || typeof val === "object") {
6757
- if (typeof val === "string") {
6758
- if (val.includes(".") && val.includes("drv_") && val.length > 30) {
6536
+ if (typeof val === 'string' || typeof val === 'object') {
6537
+ if (typeof val === 'string') {
6538
+ if (val.includes('.') && val.includes('drv_') && val.length > 30) {
6759
6539
  var ret = replaceFiletoURL(val);
6760
6540
  if (wrap) {
6761
6541
  return { value: '"' + ret + '"', changed: true };
@@ -6767,9 +6547,9 @@ func.utils.get_drive_url = function (SESSION_ID, val, wrap) {
6767
6547
  }
6768
6548
  }
6769
6549
 
6770
- if (typeof val === "object") {
6550
+ if (typeof val === 'object') {
6771
6551
  let str = JSON.stringify(val);
6772
- if (str.includes(".") && str.includes("drv_") && str.length > 30) {
6552
+ if (str.includes('.') && str.includes('drv_') && str.length > 30) {
6773
6553
  let new_val = replaceFiletoURL(str);
6774
6554
 
6775
6555
  return { value: new_val, changed: true };
@@ -6782,19 +6562,12 @@ func.utils.get_drive_url = function (SESSION_ID, val, wrap) {
6782
6562
  }
6783
6563
  };
6784
6564
 
6785
- func.utils.debug_report = async function (
6786
- SESSION_ID,
6787
- sourceP,
6788
- msgP,
6789
- typeP,
6790
- errP,
6791
- objP
6792
- ) {
6565
+ func.utils.debug_report = async function (SESSION_ID, sourceP, msgP, typeP, errP, objP) {
6793
6566
  var _session = SESSION_OBJ[SESSION_ID];
6794
6567
  var details = [sourceP];
6795
6568
  if (errP) details.push(errP);
6796
6569
  if (objP) details.push(objP);
6797
- if (!typeP || typeP === "E") {
6570
+ if (!typeP || typeP === 'E') {
6798
6571
  setTimeout(() => {
6799
6572
  // if (
6800
6573
  // typeof IS_DOCKER === "undefined" &&
@@ -6817,44 +6590,26 @@ func.utils.debug_report = async function (
6817
6590
  // msgP,
6818
6591
  // sourceP //arguments.callee.caller.toString()- deprecated es6
6819
6592
  // );
6820
- console.error("XUDA", "ERROR", sourceP, msgP, details);
6593
+ console.error('XUDA', 'ERROR', sourceP, msgP, details);
6821
6594
 
6822
- if (
6823
- typeof IS_API_SERVER !== "undefined" ||
6824
- typeof IS_DOCKER !== "undefined" ||
6825
- typeof IS_PROCESS_SERVER !== "undefined"
6826
- ) {
6827
- return __.rpi.write_log(
6828
- SESSION_OBJ[SESSION_ID].app_id,
6829
- "error",
6830
- "worker",
6831
- "runtime",
6832
- msgP,
6833
- null,
6834
- objP,
6835
- sourceP
6836
- );
6595
+ if (typeof IS_API_SERVER !== 'undefined' || typeof IS_DOCKER !== 'undefined' || typeof IS_PROCESS_SERVER !== 'undefined') {
6596
+ return __.rpi.write_log(SESSION_OBJ[SESSION_ID].app_id, 'error', 'worker', 'runtime', msgP, null, objP, sourceP);
6837
6597
  }
6838
6598
 
6839
6599
  if (glb.IS_WORKER) {
6840
6600
  let obj = {
6841
- service: "write_log",
6601
+ service: 'write_log',
6842
6602
  data: msgP,
6843
- log_type: "error",
6603
+ log_type: 'error',
6844
6604
  id: STUDIO_WEBSOCKET_CONNECTION_ID,
6845
6605
  uid: _session.USR_OBJ._id,
6846
- source: "runtime",
6606
+ source: 'runtime',
6847
6607
  app_id: _session.app_id,
6848
6608
  gtp_token: _session.gtp_token,
6849
6609
  app_token: _session.app_token,
6850
6610
  };
6851
6611
 
6852
- return func.utils.post_back_to_client(
6853
- SESSION_ID,
6854
- "write_log",
6855
- _session.worker_id,
6856
- obj
6857
- );
6612
+ return func.utils.post_back_to_client(SESSION_ID, 'write_log', _session.worker_id, obj);
6858
6613
  }
6859
6614
 
6860
6615
  // // temp inactive cause to loop
@@ -6867,64 +6622,47 @@ func.utils.debug_report = async function (
6867
6622
  // });
6868
6623
  // }
6869
6624
  }
6870
- if (typeP === "W") console.warn("XUDA", "WARNING", msgP, details);
6871
- if (typeP === "I") console.log("XUDA", "INFO", msgP, details);
6625
+ if (typeP === 'W') console.warn('XUDA', 'WARNING', msgP, details);
6626
+ if (typeP === 'I') console.log('XUDA', 'INFO', msgP, details);
6872
6627
  };
6873
6628
 
6874
6629
  func.utils.request_error = function (SESSION_ID, type, e) {
6875
6630
  var _session = SESSION_OBJ[SESSION_ID];
6876
6631
  console.error(type, e);
6877
- if (typeof IS_PROCESS_SERVER !== "undefined") return;
6632
+ if (typeof IS_PROCESS_SERVER !== 'undefined') return;
6878
6633
  if (!glb.IS_WORKER) {
6879
- func.utils.debug_report(SESSION_ID, type, e, "E");
6634
+ func.utils.debug_report(SESSION_ID, type, e, 'E');
6880
6635
  setTimeout(function () {
6881
6636
  if (!glb.debug_js) {
6882
6637
  // location.reload();
6883
- console.warn("** reload request");
6638
+ console.warn('** reload request');
6884
6639
  }
6885
6640
  }, 2000);
6886
6641
  } else {
6887
- func.utils.post_back_to_client(
6888
- SESSION_ID,
6889
- "ajax_error",
6890
- _session.worker_id,
6891
- null
6892
- );
6642
+ func.utils.post_back_to_client(SESSION_ID, 'ajax_error', _session.worker_id, null);
6893
6643
  }
6894
6644
  };
6895
6645
 
6896
6646
  func.utils.alerts = {};
6897
- func.utils.alerts.invoke = async function (
6898
- SESSION_ID,
6899
- typeP,
6900
- paramsP,
6901
- sourceP,
6902
- dsSessionP,
6903
- msgP
6904
- ) {
6647
+ func.utils.alerts.invoke = async function (SESSION_ID, typeP, paramsP, sourceP, dsSessionP, msgP) {
6905
6648
  try {
6906
6649
  var _session = SESSION_OBJ[SESSION_ID];
6907
6650
  if (ALERT_IS_ACTIVE) return;
6908
6651
  ALERT_IS_ACTIVE = true;
6909
6652
  var title;
6910
- var message = "";
6911
- var alert_type = "console";
6653
+ var message = '';
6654
+ var alert_type = 'console';
6912
6655
  var alertDisplay;
6913
6656
  var expRet = {};
6914
6657
  var _ds = _session.DS_GLB[dsSessionP];
6915
- var type = "";
6658
+ var type = '';
6916
6659
  var createLog;
6917
6660
 
6918
6661
  const get_alert_properties = async function (value, fx) {
6919
- var ret = value || "";
6662
+ var ret = value || '';
6920
6663
 
6921
6664
  if (fx) {
6922
- const exp_ret = await func.expression.get(
6923
- SESSION_ID,
6924
- fx,
6925
- dsSessionP,
6926
- "alert"
6927
- );
6665
+ const exp_ret = await func.expression.get(SESSION_ID, fx, dsSessionP, 'alert');
6928
6666
  ret = exp_ret.result;
6929
6667
  }
6930
6668
 
@@ -6932,58 +6670,30 @@ func.utils.alerts.invoke = async function (
6932
6670
  };
6933
6671
 
6934
6672
  switch (typeP) {
6935
- case "alert":
6936
- type = "User defined alert";
6673
+ case 'alert':
6674
+ type = 'User defined alert';
6937
6675
 
6938
- title = await get_alert_properties(
6939
- paramsP.alertTitle,
6940
- paramsP.alertTitleFx
6941
- );
6942
- alert_type = await get_alert_properties(
6943
- paramsP.alertType,
6944
- paramsP.alertTypeFx
6945
- );
6946
- message = await get_alert_properties(
6947
- paramsP.alertBody,
6948
- paramsP.alertBodyFx
6949
- );
6950
- alertDisplay = await get_alert_properties(
6951
- paramsP.alertDisplay,
6952
- paramsP.alertDisplayFx
6953
- );
6676
+ title = await get_alert_properties(paramsP.alertTitle, paramsP.alertTitleFx);
6677
+ alert_type = await get_alert_properties(paramsP.alertType, paramsP.alertTypeFx);
6678
+ message = await get_alert_properties(paramsP.alertBody, paramsP.alertBodyFx);
6679
+ alertDisplay = await get_alert_properties(paramsP.alertDisplay, paramsP.alertDisplayFx);
6954
6680
  createLog = paramsP.createLog;
6955
6681
  break;
6956
6682
 
6957
- case "call_alert":
6958
- type = "User defined call alert";
6683
+ case 'call_alert':
6684
+ type = 'User defined call alert';
6959
6685
  let prop = await func.utils.TREE_OBJ.get(SESSION_ID, paramsP.prog);
6960
6686
  if (!prop) {
6961
- console.log(
6962
- "events.execute",
6963
- "Missing details for alert message object: " + paramsP.prog,
6964
- "W"
6965
- );
6687
+ console.log('events.execute', 'Missing details for alert message object: ' + paramsP.prog, 'W');
6966
6688
  }
6967
6689
  // user defined
6968
6690
 
6969
6691
  let ret = await func.utils.VIEWS_OBJ.get(SESSION_ID, paramsP.prog);
6970
6692
  if (ret?.alertData) {
6971
- title = await get_alert_properties(
6972
- ret.alertData.alertTitle,
6973
- ret.alertData.alertTitleFx
6974
- );
6975
- alert_type = await get_alert_properties(
6976
- ret.alertData.alertType,
6977
- ret.alertData.alertTypeFx
6978
- );
6979
- message = await get_alert_properties(
6980
- ret.alertData.alertBody,
6981
- ret.alertData.alertBodyFx
6982
- );
6983
- alertDisplay = await get_alert_properties(
6984
- ret.alertData.alertDisplay,
6985
- ret.alertData.alertDisplayFx
6986
- );
6693
+ title = await get_alert_properties(ret.alertData.alertTitle, ret.alertData.alertTitleFx);
6694
+ alert_type = await get_alert_properties(ret.alertData.alertType, ret.alertData.alertTypeFx);
6695
+ message = await get_alert_properties(ret.alertData.alertBody, ret.alertData.alertBodyFx);
6696
+ alertDisplay = await get_alert_properties(ret.alertData.alertDisplay, ret.alertData.alertDisplayFx);
6987
6697
  createLog = ret.alertData.createLog;
6988
6698
  }
6989
6699
 
@@ -6991,43 +6701,31 @@ func.utils.alerts.invoke = async function (
6991
6701
  title = prop.menuTitle;
6992
6702
  }
6993
6703
  if (!alert_type) {
6994
- alert_type = "console";
6704
+ alert_type = 'console';
6995
6705
  }
6996
6706
 
6997
6707
  if (!alertDisplay) {
6998
- alertDisplay = "modal";
6708
+ alertDisplay = 'modal';
6999
6709
  } //window alert by definition
7000
6710
 
7001
6711
  break;
7002
6712
 
7003
- case "system_msg": {
7004
- type = "System alert";
6713
+ case 'system_msg': {
6714
+ type = 'System alert';
7005
6715
  const sys_alerts_obj = func.utils.get_system_error_msg();
7006
6716
  if (sys_alerts_obj[paramsP]) {
7007
6717
  title = sys_alerts_obj[paramsP].subject;
7008
6718
  alert_type = sys_alerts_obj[paramsP].alert_type;
7009
6719
  alertDisplay = sys_alerts_obj[paramsP].alertDisplay;
7010
6720
 
7011
- expRet = await func.expression.get(
7012
- SESSION_ID,
7013
- sys_alerts_obj[paramsP].msg,
7014
- dsSessionP,
7015
- "alert"
7016
- );
6721
+ expRet = await func.expression.get(SESSION_ID, sys_alerts_obj[paramsP].msg, dsSessionP, 'alert');
7017
6722
  message = func.expression.remove_quotes(expRet.result);
7018
6723
 
7019
6724
  if (msgP) message = msgP;
7020
6725
 
7021
- if (alert_type === "error") {
7022
- if (_ds) _ds.error = title + " " + sourceP;
7023
- func.utils.debug_report(
7024
- SESSION_ID,
7025
- sourceP,
7026
- title + " " + sourceP,
7027
- "E",
7028
- "",
7029
- _ds
7030
- );
6726
+ if (alert_type === 'error') {
6727
+ if (_ds) _ds.error = title + ' ' + sourceP;
6728
+ func.utils.debug_report(SESSION_ID, sourceP, title + ' ' + sourceP, 'E', '', _ds);
7031
6729
  }
7032
6730
  }
7033
6731
  break;
@@ -7054,12 +6752,7 @@ func.utils.alerts.invoke = async function (
7054
6752
 
7055
6753
  // if (typeof IS_PROCESS_SERVER !== "undefined") return;
7056
6754
  ALERT_IS_ACTIVE = false;
7057
- return func.utils.post_back_to_client(
7058
- SESSION_ID,
7059
- "alert",
7060
- _session.worker_id,
7061
- [SESSION_ID, alert_type, alertDisplay, message, title]
7062
- );
6755
+ return func.utils.post_back_to_client(SESSION_ID, 'alert', _session.worker_id, [SESSION_ID, alert_type, alertDisplay, message, title]);
7063
6756
  }
7064
6757
  // const sys_alerts_obj = func.utils.get_system_error_msg();
7065
6758
  // if (sys_alerts_obj[paramsP]) {
@@ -7077,61 +6770,37 @@ func.utils.alerts.invoke = async function (
7077
6770
 
7078
6771
  ALERT_IS_ACTIVE = false;
7079
6772
 
7080
- func.utils.alerts.execute(
7081
- SESSION_ID,
7082
- alert_type,
7083
- alertDisplay,
7084
- message,
7085
- title,
7086
- type
7087
- );
6773
+ func.utils.alerts.execute(SESSION_ID, alert_type, alertDisplay, message, title, type);
7088
6774
  if (createLog) {
7089
6775
  func.utils.write_log(SESSION_ID, title, message, alert_type);
7090
6776
  }
7091
6777
  };
7092
- func.utils.alerts.execute = function (
7093
- SESSION_ID,
7094
- alert_type,
7095
- alertDisplay,
7096
- message,
7097
- title,
7098
- type
7099
- ) {
6778
+ func.utils.alerts.execute = function (SESSION_ID, alert_type, alertDisplay, message, title, type) {
7100
6779
  if (!UI_FRAMEWORK_INSTALLED) {
7101
6780
  ALERT_IS_ACTIVE = false;
7102
- if (alertDisplay !== "console") {
7103
- return alert(title + "\n \n" + message);
6781
+ if (alertDisplay !== 'console') {
6782
+ return alert(title + '\n \n' + message);
7104
6783
  }
7105
- return console[alert_type === "error" ? "error" : "log"](
7106
- alert_type,
7107
- title,
7108
- message
7109
- );
6784
+ return console[alert_type === 'error' ? 'error' : 'log'](alert_type, title, message);
7110
6785
  }
7111
6786
 
7112
6787
  switch (alertDisplay) {
7113
- case "console":
7114
- console[
7115
- alert_type === "success"
7116
- ? "log"
7117
- : alert_type === "warning"
7118
- ? "warn"
7119
- : alert_type
7120
- ](alert_type, title, message);
6788
+ case 'console':
6789
+ console[alert_type === 'success' ? 'log' : alert_type === 'warning' ? 'warn' : alert_type](alert_type, title, message);
7121
6790
  ALERT_IS_ACTIVE = false;
7122
6791
  break;
7123
6792
 
7124
- case "modal":
6793
+ case 'modal':
7125
6794
  func.utils.alerts.popup(title, message, alert_type);
7126
6795
  break;
7127
6796
 
7128
- case "toast":
6797
+ case 'toast':
7129
6798
  func.utils.alerts.toast(SESSION_ID, title, message, alert_type);
7130
6799
  ALERT_IS_ACTIVE = false;
7131
6800
  break;
7132
6801
 
7133
- case "browser":
7134
- alert(title + "\n \n" + message);
6802
+ case 'browser':
6803
+ alert(title + '\n \n' + message);
7135
6804
  ALERT_IS_ACTIVE = false;
7136
6805
  default:
7137
6806
  console.log(alert_type, title, message);
@@ -7142,16 +6811,7 @@ func.utils.alerts.execute = function (
7142
6811
  func.utils.alerts.toast = function (SESSION_ID, title, message, alert_type) {
7143
6812
  if (!UI_FRAMEWORK_PLUGIN.toast) return;
7144
6813
  const toast = new UI_FRAMEWORK_PLUGIN.toast();
7145
- toast.create(
7146
- alert_type,
7147
- message,
7148
- title,
7149
- func.common.get_url(
7150
- SESSION_ID,
7151
- "dist",
7152
- `runtime/images/${alert_type}_alert_ico.svg`
7153
- )
7154
- );
6814
+ toast.create(alert_type, message, title, func.common.get_url(SESSION_ID, 'dist', `runtime/images/${alert_type}_alert_ico.svg`));
7155
6815
  ALERT_IS_ACTIVE = false;
7156
6816
  };
7157
6817
  func.utils.alerts.popup = function (title, message, alert_type) {
@@ -7159,8 +6819,8 @@ func.utils.alerts.popup = function (title, message, alert_type) {
7159
6819
 
7160
6820
  var buttons = [
7161
6821
  {
7162
- text: "Ok",
7163
- role: "cancel",
6822
+ text: 'Ok',
6823
+ role: 'cancel',
7164
6824
  // cssClass: "primary",
7165
6825
  handler: () => {
7166
6826
  ALERT_IS_ACTIVE = false;
@@ -7173,536 +6833,536 @@ func.utils.alerts.popup = function (title, message, alert_type) {
7173
6833
 
7174
6834
  func.utils.get_system_error_msg = function () {
7175
6835
  var m = {};
7176
- m["SYS_MSG_0101"] = {
7177
- alert_type: "success",
7178
- alertDisplay: "toast",
7179
- subject: "Save Success",
7180
- msg: "Settings successfully saved",
7181
- };
7182
- m["SYS_MSG_0102"] = {
7183
- alert_type: "error",
7184
- alertDisplay: "toast",
7185
- subject: "Save Failed CouchDB",
7186
- msg: "Data fail save to database",
7187
- };
7188
- m["SYS_MSG_0103"] = {
7189
- alert_type: "error",
7190
- alertDisplay: "toast",
7191
- subject: "Save Failed Table Empty",
7192
- msg: "Table empty, no fields declared",
7193
- };
7194
- m["SYS_MSG_0104"] = {
7195
- alert_type: "error",
7196
- alertDisplay: "toast",
7197
- subject: "Save Failed Missing Primary Index",
7198
- msg: "Update failed, table missing Primary index",
7199
- };
7200
- m["SYS_MSG_0105"] = {
7201
- alert_type: "error",
7202
- alertDisplay: "toast",
7203
- subject: "Save Failed Table Missing",
7204
- msg: "Table repository missing",
7205
- };
7206
- m["SYS_MSG_0106"] = {
7207
- alert_type: "error",
7208
- alertDisplay: "toast",
7209
- subject: "Save Failed Record Not Exist",
7210
- msg: "Save update failed record not exist",
7211
- };
7212
- m["SYS_MSG_0107"] = {
7213
- alert_type: "error",
7214
- alertDisplay: "modal",
7215
- subject: "Save Failed Unique Key",
7216
- msg: "Save Failed, record already exist",
7217
- };
7218
- m["SYS_MSG_0108"] = {
7219
- alert_type: "error",
7220
- alertDisplay: "modal",
7221
- subject: "Error reading document",
7222
- msg: "Save Failed, record not found",
7223
- };
7224
- m["SYS_MSG_0110"] = {
7225
- alert_type: "warning",
7226
- alertDisplay: "toast",
7227
- subject: "Record Changed",
7228
- msg: "Record changed by other user, reload to get the latest changes",
7229
- };
7230
- m["SYS_MSG_0120"] = {
7231
- alert_type: "error",
7232
- alertDisplay: "modal",
7233
- subject: "Create Mode Denied",
7234
- msg: "Create mode not allowed for this program",
7235
- };
7236
- m["SYS_MSG_0122"] = {
7237
- alert_type: "error",
7238
- alertDisplay: "modal",
7239
- subject: "Modify Mode Denied",
7240
- msg: "Modify mode not allowed for this program",
7241
- };
7242
- m["SYS_MSG_0124"] = {
7243
- alert_type: "error",
7244
- alertDisplay: "modal",
7245
- subject: "Delete Mode Denied",
7246
- msg: "Delete mode not allowed for this program",
7247
- };
7248
- m["SYS_MSG_0126"] = {
7249
- alert_type: "error",
7250
- alertDisplay: "modal",
7251
- subject: "Program Read Only",
7252
- msg: "Program set to Read Only",
7253
- };
7254
- m["SYS_MSG_0130"] = {
7255
- alert_type: "error",
7256
- alertDisplay: "modal",
7257
- subject: "Error Reduce",
7258
- msg: "Select Index to Reduce",
7259
- };
7260
- m["SYS_MSG_0201"] = {
7261
- alert_type: "error",
7262
- alertDisplay: "toast",
7263
- subject: "Failed to change GUI Property",
7264
- msg: "Failed to change GUI element property, GUI element missing",
7265
- };
7266
- m["SYS_MSG_0310"] = {
7267
- alert_type: "error",
7268
- alertDisplay: "toast",
7269
- subject: "Missing Reference Parameters Out",
7270
- msg: "Parameter out not exist in dataset",
7271
- };
7272
- m["SYS_MSG_0400"] = {
7273
- alert_type: "error",
7274
- alertDisplay: "modal",
7275
- subject: "Delete Widget Folder Denied",
7276
- msg: "The selected folder contains data, Please clean or move content to another folder",
7277
- };
7278
- m["SYS_MSG_0410"] = {
7279
- alert_type: "error",
7280
- alertDisplay: "toast",
7281
- subject: "Recipient Error",
7282
- msg: "Check recipient data",
7283
- };
7284
- m["SYS_MSG_0412"] = {
7285
- alert_type: "error",
7286
- alertDisplay: "modal",
7287
- subject: "Recipient Empty",
7288
- msg: "No recipients entered or selected",
7289
- };
7290
- m["SYS_MSG_0414"] = {
7291
- alert_type: "error",
7292
- alertDisplay: "modal",
7293
- subject: "Data Save Error",
7294
- msg: "Widget has no content",
7295
- };
7296
- m["SYS_MSG_0416"] = {
7297
- alert_type: "error",
7298
- alertDisplay: "modal",
7299
- subject: "Required Field",
7300
- msg: "Edit url field is empty",
7301
- };
7302
- m["SYS_MSG_0418"] = {
7303
- alert_type: "error",
7304
- alertDisplay: "modal",
7305
- subject: "Required Field",
7306
- msg: "Publish url field is empty",
7307
- };
7308
- m["SYS_MSG_0420"] = {
7309
- alert_type: "error",
7310
- alertDisplay: "modal",
7311
- subject: "Connection Error",
7312
- msg: "Cannot connect to mailbox",
7313
- };
7314
- m["SYS_MSG_0422"] = {
7315
- alert_type: "success",
7316
- alertDisplay: "modal",
7317
- subject: "Connection Ok",
7318
- msg: "Connection Ok :)",
7319
- };
7320
- m["SYS_MSG_0424"] = {
7321
- alert_type: "error",
7322
- alertDisplay: "modal",
7323
- subject: "Connection Failed",
7324
- msg: "Connection to POP3 failed",
7325
- };
7326
- m["SYS_MSG_0426"] = {
7327
- alert_type: "error",
7328
- alertDisplay: "modal",
7329
- subject: "Connection Failed",
7330
- msg: "SMTP Connection error, Test Email was not sent",
7331
- };
7332
- m["SYS_MSG_0430"] = {
7333
- alert_type: "error",
7334
- alertDisplay: "toast",
7335
- subject: "Email Account Error",
7336
- msg: "No email account found, Right Click Tree -> Settings->Manage Accounts -> Right click for menu options",
7337
- };
7338
- m["SYS_MSG_0440"] = {
7339
- alert_type: "error",
7340
- alertDisplay: "modal",
7341
- subject: "Widget Initiation Error",
7342
- msg: "Missing information for Link Type or Link Name",
7343
- };
7344
- m["SYS_MSG_0442"] = {
7345
- alert_type: "error",
7346
- alertDisplay: "modal",
7347
- subject: "Error Init Widget",
7348
- msg: "Missing record Id on Create Mode",
7349
- };
7350
- m["SYS_MSG_0450"] = {
7351
- alert_type: "error",
7352
- alertDisplay: "modal",
7353
- subject: "Validation Failed",
7354
- msg: "Fix fields highlight in Red",
7355
- };
7356
- m["SYS_MSG_0501"] = {
7357
- alert_type: "error",
7358
- alertDisplay: "modal",
7359
- subject: "Mandatory Alert Save",
7360
- msg: "Save action failed, Mandatory fields missing",
7361
- };
7362
-
7363
- m["SYS_MSG_0550"] = {
7364
- alert_type: "error",
7365
- alertDisplay: "toast",
7366
- subject: "Illegal input number",
6836
+ m['SYS_MSG_0101'] = {
6837
+ alert_type: 'success',
6838
+ alertDisplay: 'toast',
6839
+ subject: 'Save Success',
6840
+ msg: 'Settings successfully saved',
6841
+ };
6842
+ m['SYS_MSG_0102'] = {
6843
+ alert_type: 'error',
6844
+ alertDisplay: 'toast',
6845
+ subject: 'Save Failed CouchDB',
6846
+ msg: 'Data fail save to database',
6847
+ };
6848
+ m['SYS_MSG_0103'] = {
6849
+ alert_type: 'error',
6850
+ alertDisplay: 'toast',
6851
+ subject: 'Save Failed Table Empty',
6852
+ msg: 'Table empty, no fields declared',
6853
+ };
6854
+ m['SYS_MSG_0104'] = {
6855
+ alert_type: 'error',
6856
+ alertDisplay: 'toast',
6857
+ subject: 'Save Failed Missing Primary Index',
6858
+ msg: 'Update failed, table missing Primary index',
6859
+ };
6860
+ m['SYS_MSG_0105'] = {
6861
+ alert_type: 'error',
6862
+ alertDisplay: 'toast',
6863
+ subject: 'Save Failed Table Missing',
6864
+ msg: 'Table repository missing',
6865
+ };
6866
+ m['SYS_MSG_0106'] = {
6867
+ alert_type: 'error',
6868
+ alertDisplay: 'toast',
6869
+ subject: 'Save Failed Record Not Exist',
6870
+ msg: 'Save update failed record not exist',
6871
+ };
6872
+ m['SYS_MSG_0107'] = {
6873
+ alert_type: 'error',
6874
+ alertDisplay: 'modal',
6875
+ subject: 'Save Failed Unique Key',
6876
+ msg: 'Save Failed, record already exist',
6877
+ };
6878
+ m['SYS_MSG_0108'] = {
6879
+ alert_type: 'error',
6880
+ alertDisplay: 'modal',
6881
+ subject: 'Error reading document',
6882
+ msg: 'Save Failed, record not found',
6883
+ };
6884
+ m['SYS_MSG_0110'] = {
6885
+ alert_type: 'warning',
6886
+ alertDisplay: 'toast',
6887
+ subject: 'Record Changed',
6888
+ msg: 'Record changed by other user, reload to get the latest changes',
6889
+ };
6890
+ m['SYS_MSG_0120'] = {
6891
+ alert_type: 'error',
6892
+ alertDisplay: 'modal',
6893
+ subject: 'Create Mode Denied',
6894
+ msg: 'Create mode not allowed for this program',
6895
+ };
6896
+ m['SYS_MSG_0122'] = {
6897
+ alert_type: 'error',
6898
+ alertDisplay: 'modal',
6899
+ subject: 'Modify Mode Denied',
6900
+ msg: 'Modify mode not allowed for this program',
6901
+ };
6902
+ m['SYS_MSG_0124'] = {
6903
+ alert_type: 'error',
6904
+ alertDisplay: 'modal',
6905
+ subject: 'Delete Mode Denied',
6906
+ msg: 'Delete mode not allowed for this program',
6907
+ };
6908
+ m['SYS_MSG_0126'] = {
6909
+ alert_type: 'error',
6910
+ alertDisplay: 'modal',
6911
+ subject: 'Program Read Only',
6912
+ msg: 'Program set to Read Only',
6913
+ };
6914
+ m['SYS_MSG_0130'] = {
6915
+ alert_type: 'error',
6916
+ alertDisplay: 'modal',
6917
+ subject: 'Error Reduce',
6918
+ msg: 'Select Index to Reduce',
6919
+ };
6920
+ m['SYS_MSG_0201'] = {
6921
+ alert_type: 'error',
6922
+ alertDisplay: 'toast',
6923
+ subject: 'Failed to change GUI Property',
6924
+ msg: 'Failed to change GUI element property, GUI element missing',
6925
+ };
6926
+ m['SYS_MSG_0310'] = {
6927
+ alert_type: 'error',
6928
+ alertDisplay: 'toast',
6929
+ subject: 'Missing Reference Parameters Out',
6930
+ msg: 'Parameter out not exist in dataset',
6931
+ };
6932
+ m['SYS_MSG_0400'] = {
6933
+ alert_type: 'error',
6934
+ alertDisplay: 'modal',
6935
+ subject: 'Delete Widget Folder Denied',
6936
+ msg: 'The selected folder contains data, Please clean or move content to another folder',
6937
+ };
6938
+ m['SYS_MSG_0410'] = {
6939
+ alert_type: 'error',
6940
+ alertDisplay: 'toast',
6941
+ subject: 'Recipient Error',
6942
+ msg: 'Check recipient data',
6943
+ };
6944
+ m['SYS_MSG_0412'] = {
6945
+ alert_type: 'error',
6946
+ alertDisplay: 'modal',
6947
+ subject: 'Recipient Empty',
6948
+ msg: 'No recipients entered or selected',
6949
+ };
6950
+ m['SYS_MSG_0414'] = {
6951
+ alert_type: 'error',
6952
+ alertDisplay: 'modal',
6953
+ subject: 'Data Save Error',
6954
+ msg: 'Widget has no content',
6955
+ };
6956
+ m['SYS_MSG_0416'] = {
6957
+ alert_type: 'error',
6958
+ alertDisplay: 'modal',
6959
+ subject: 'Required Field',
6960
+ msg: 'Edit url field is empty',
6961
+ };
6962
+ m['SYS_MSG_0418'] = {
6963
+ alert_type: 'error',
6964
+ alertDisplay: 'modal',
6965
+ subject: 'Required Field',
6966
+ msg: 'Publish url field is empty',
6967
+ };
6968
+ m['SYS_MSG_0420'] = {
6969
+ alert_type: 'error',
6970
+ alertDisplay: 'modal',
6971
+ subject: 'Connection Error',
6972
+ msg: 'Cannot connect to mailbox',
6973
+ };
6974
+ m['SYS_MSG_0422'] = {
6975
+ alert_type: 'success',
6976
+ alertDisplay: 'modal',
6977
+ subject: 'Connection Ok',
6978
+ msg: 'Connection Ok :)',
6979
+ };
6980
+ m['SYS_MSG_0424'] = {
6981
+ alert_type: 'error',
6982
+ alertDisplay: 'modal',
6983
+ subject: 'Connection Failed',
6984
+ msg: 'Connection to POP3 failed',
6985
+ };
6986
+ m['SYS_MSG_0426'] = {
6987
+ alert_type: 'error',
6988
+ alertDisplay: 'modal',
6989
+ subject: 'Connection Failed',
6990
+ msg: 'SMTP Connection error, Test Email was not sent',
6991
+ };
6992
+ m['SYS_MSG_0430'] = {
6993
+ alert_type: 'error',
6994
+ alertDisplay: 'toast',
6995
+ subject: 'Email Account Error',
6996
+ msg: 'No email account found, Right Click Tree -> Settings->Manage Accounts -> Right click for menu options',
6997
+ };
6998
+ m['SYS_MSG_0440'] = {
6999
+ alert_type: 'error',
7000
+ alertDisplay: 'modal',
7001
+ subject: 'Widget Initiation Error',
7002
+ msg: 'Missing information for Link Type or Link Name',
7003
+ };
7004
+ m['SYS_MSG_0442'] = {
7005
+ alert_type: 'error',
7006
+ alertDisplay: 'modal',
7007
+ subject: 'Error Init Widget',
7008
+ msg: 'Missing record Id on Create Mode',
7009
+ };
7010
+ m['SYS_MSG_0450'] = {
7011
+ alert_type: 'error',
7012
+ alertDisplay: 'modal',
7013
+ subject: 'Validation Failed',
7014
+ msg: 'Fix fields highlight in Red',
7015
+ };
7016
+ m['SYS_MSG_0501'] = {
7017
+ alert_type: 'error',
7018
+ alertDisplay: 'modal',
7019
+ subject: 'Mandatory Alert Save',
7020
+ msg: 'Save action failed, Mandatory fields missing',
7021
+ };
7022
+
7023
+ m['SYS_MSG_0550'] = {
7024
+ alert_type: 'error',
7025
+ alertDisplay: 'toast',
7026
+ subject: 'Illegal input number',
7367
7027
  msg: "@SYS_GLOBAL_OBJ_ACTIVE_FIELD_INFO.nameform +' only allow numbers!'",
7368
7028
  };
7369
- m["SYS_MSG_0610"] = {
7370
- alert_type: "error",
7371
- alertDisplay: "toast",
7372
- subject: "Form Field Conflict",
7373
- msg: "Field declared more than once for the form",
7374
- };
7375
- m["SYS_MSG_0612"] = {
7376
- alert_type: "error",
7377
- alertDisplay: "toast",
7378
- subject: "Mask Error - Missing Definition",
7379
- msg: "Missing mask definition",
7380
- };
7381
- m["SYS_MSG_0614"] = {
7382
- alert_type: "error",
7383
- alertDisplay: "toast",
7384
- subject: "Mask Error - Wrong Definition",
7385
- msg: "Wrong mask definition",
7386
- };
7387
- m["SYS_MSG_0616"] = {
7388
- alert_type: "error",
7389
- alertDisplay: "toast",
7390
- subject: "Mask Error - Size Parser",
7391
- msg: "Size parser error",
7392
- };
7393
- m["SYS_MSG_0618"] = {
7394
- alert_type: "error",
7395
- alertDisplay: "toast",
7396
- subject: "Mask Error - Illegal Z switch",
7029
+ m['SYS_MSG_0610'] = {
7030
+ alert_type: 'error',
7031
+ alertDisplay: 'toast',
7032
+ subject: 'Form Field Conflict',
7033
+ msg: 'Field declared more than once for the form',
7034
+ };
7035
+ m['SYS_MSG_0612'] = {
7036
+ alert_type: 'error',
7037
+ alertDisplay: 'toast',
7038
+ subject: 'Mask Error - Missing Definition',
7039
+ msg: 'Missing mask definition',
7040
+ };
7041
+ m['SYS_MSG_0614'] = {
7042
+ alert_type: 'error',
7043
+ alertDisplay: 'toast',
7044
+ subject: 'Mask Error - Wrong Definition',
7045
+ msg: 'Wrong mask definition',
7046
+ };
7047
+ m['SYS_MSG_0616'] = {
7048
+ alert_type: 'error',
7049
+ alertDisplay: 'toast',
7050
+ subject: 'Mask Error - Size Parser',
7051
+ msg: 'Size parser error',
7052
+ };
7053
+ m['SYS_MSG_0618'] = {
7054
+ alert_type: 'error',
7055
+ alertDisplay: 'toast',
7056
+ subject: 'Mask Error - Illegal Z switch',
7397
7057
  msg: "Illegal 'Z' in string mask",
7398
7058
  };
7399
- m["SYS_MSG_0620"] = {
7400
- alert_type: "error",
7401
- alertDisplay: "toast",
7402
- subject: "Mask Error - Illegal N switch",
7059
+ m['SYS_MSG_0620'] = {
7060
+ alert_type: 'error',
7061
+ alertDisplay: 'toast',
7062
+ subject: 'Mask Error - Illegal N switch',
7403
7063
  msg: "Illegal 'N' in string mask",
7404
7064
  };
7405
- m["SYS_MSG_0622"] = {
7406
- alert_type: "error",
7407
- alertDisplay: "toast",
7408
- subject: "Mask Error - Illegal + switch",
7065
+ m['SYS_MSG_0622'] = {
7066
+ alert_type: 'error',
7067
+ alertDisplay: 'toast',
7068
+ subject: 'Mask Error - Illegal + switch',
7409
7069
  msg: "Illegal '+' in string mask",
7410
7070
  };
7411
- m["SYS_MSG_0624"] = {
7412
- alert_type: "error",
7413
- alertDisplay: "toast",
7414
- subject: "Mask Error - Illegal - switch",
7071
+ m['SYS_MSG_0624'] = {
7072
+ alert_type: 'error',
7073
+ alertDisplay: 'toast',
7074
+ subject: 'Mask Error - Illegal - switch',
7415
7075
  msg: "Illegal '-' in string mask",
7416
7076
  };
7417
- m["SYS_MSG_0626"] = {
7418
- alert_type: "error",
7419
- alertDisplay: "toast",
7420
- subject: "Mask Error - Illegal C switch",
7077
+ m['SYS_MSG_0626'] = {
7078
+ alert_type: 'error',
7079
+ alertDisplay: 'toast',
7080
+ subject: 'Mask Error - Illegal C switch',
7421
7081
  msg: "Illegal 'C' in string mask",
7422
7082
  };
7423
- m["SYS_MSG_0628"] = {
7424
- alert_type: "error",
7425
- alertDisplay: "toast",
7426
- subject: "Mask Error - Invalid switch",
7427
- msg: "Invalid switch in string mask",
7428
- };
7429
- m["SYS_MSG_0630"] = {
7430
- alert_type: "error",
7431
- alertDisplay: "toast",
7432
- subject: "Mask Error - Missing DOM Element",
7433
- msg: "Missing DOM element",
7434
- };
7435
- m["SYS_MSG_0632"] = {
7436
- alert_type: "error",
7437
- alertDisplay: "toast",
7438
- subject: "Mask Error - Too Big",
7439
- msg: "Size to big, max: 15.5",
7440
- };
7441
- m["SYS_MSG_0700"] = {
7442
- alert_type: "warning",
7443
- alertDisplay: "console",
7444
- subject: "Table Warning - Empty",
7445
- msg: "Table has no content",
7446
- };
7447
- m["SYS_MSG_0702"] = {
7448
- alert_type: "error",
7449
- alertDisplay: "console",
7450
- subject: "Table Error - No Fields",
7451
- msg: "Table missing fields content",
7452
- };
7453
- m["SYS_MSG_0704"] = {
7454
- alert_type: "warning",
7455
- alertDisplay: "console",
7456
- subject: "Table Warning - Not In Use",
7457
- msg: "Table not in use by any object",
7458
- };
7459
- m["SYS_MSG_0706"] = {
7460
- alert_type: "error",
7461
- alertDisplay: "console",
7462
- subject: "Table Error - No Primary Index",
7463
- msg: "Table must have at least one index",
7464
- };
7465
- m["SYS_MSG_0708"] = {
7466
- alert_type: "error",
7467
- alertDisplay: "console",
7468
- subject: "Table Error - Bad Index Name",
7469
- msg: "Index name is invalid or cannot contain any of non word characters",
7470
- };
7471
- m["SYS_MSG_0710"] = {
7472
- alert_type: "error",
7473
- alertDisplay: "console",
7474
- subject: "Table Error - Empty Index",
7475
- msg: "Index has no keys",
7476
- };
7477
- m["SYS_MSG_0712"] = {
7478
- alert_type: "error",
7479
- alertDisplay: "console",
7480
- subject: "Table Error - Key Not Exist",
7481
- msg: "Key not exist in the table fields repository",
7482
- };
7483
- m["SYS_MSG_0714"] = {
7484
- alert_type: "error",
7485
- alertDisplay: "console",
7486
- subject: "Table Error - Duplicate Fields",
7487
- msg: "Duplicate fields in the table fields repository",
7488
- };
7489
- m["SYS_MSG_0716"] = {
7490
- alert_type: "error",
7491
- alertDisplay: "console",
7492
- subject: "Table Error - Bad Field Name",
7493
- msg: "Field name is invalid or cannot contain any of non word characters",
7494
- };
7495
- m["SYS_MSG_0718"] = {
7496
- alert_type: "error",
7497
- alertDisplay: "console",
7498
- subject: "Table Error - Integrity Broken",
7499
- msg: "Field broken from its properties, edit the field and save",
7500
- };
7501
- m["SYS_MSG_0720"] = {
7502
- alert_type: "error",
7503
- alertDisplay: "console",
7504
- subject: "Table Error - Model Not Exist",
7505
- msg: "Model assigned to the field not exist",
7506
- };
7507
- m["SYS_MSG_0722"] = {
7508
- alert_type: "warning",
7509
- alertDisplay: "console",
7510
- subject: "Object Warning - Not In Use",
7511
- msg: "Object not in use or not call by any object",
7512
- };
7513
- m["SYS_MSG_0724"] = {
7514
- alert_type: "error",
7515
- alertDisplay: "console",
7516
- subject: "Object Error - Table Not Exist",
7517
- msg: "Table assigned in object datasource not exist",
7518
- };
7519
- m["SYS_MSG_0726"] = {
7520
- alert_type: "error",
7521
- alertDisplay: "console",
7522
- subject: "Object Error - Index Keys Mismatch",
7523
- msg: "Table index has different structure",
7524
- };
7525
- m["SYS_MSG_0728"] = {
7526
- alert_type: "error",
7527
- alertDisplay: "console",
7528
- subject: "Object Error - Index Key From Empty",
7529
- msg: "Index key From must have a value",
7530
- };
7531
- m["SYS_MSG_0730"] = {
7532
- alert_type: "error",
7533
- alertDisplay: "console",
7534
- subject: "Object Error - Index Key From Reference",
7535
- msg: "Field reference not exist in any dataset or parameters",
7536
- };
7537
- m["SYS_MSG_0732"] = {
7538
- alert_type: "error",
7539
- alertDisplay: "console",
7540
- subject: "Object Error - Index Key To Empty",
7541
- msg: "Index key To must have a value",
7542
- };
7543
- m["SYS_MSG_0734"] = {
7544
- alert_type: "error",
7545
- alertDisplay: "console",
7546
- subject: "Object Error - Index Key To Reference",
7547
- msg: "Field reference not exist in any dataset or parameters",
7548
- };
7549
- m["SYS_MSG_0736"] = {
7550
- alert_type: "error",
7551
- alertDisplay: "console",
7552
- subject: "Object Error - Index Locate From Reference",
7553
- msg: "Field reference not exist in any dataset or parameters",
7554
- };
7555
- m["SYS_MSG_0738"] = {
7556
- alert_type: "error",
7557
- alertDisplay: "console",
7558
- subject: "Object Error - Index Locate To Reference",
7559
- msg: "Field reference not exist in any dataset or parameters",
7560
- };
7561
- m["SYS_MSG_0740"] = {
7562
- alert_type: "error",
7563
- alertDisplay: "console",
7564
- subject: "Object Error - Index Empty",
7565
- msg: "Index empty - no keys defined",
7566
- };
7567
- m["SYS_MSG_0742"] = {
7568
- alert_type: "error",
7569
- alertDisplay: "console",
7570
- subject: "Object Error - Index Reference",
7571
- msg: "Table index reference error",
7572
- };
7573
- m["SYS_MSG_0744"] = {
7574
- alert_type: "error",
7575
- alertDisplay: "console",
7576
- subject: "Object Error - Duplicate Fields",
7577
- msg: "Duplicate fields in the dataset fields repository",
7578
- };
7579
- m["SYS_MSG_0746"] = {
7580
- alert_type: "error",
7581
- alertDisplay: "console",
7582
- subject: "Object Error - Field reference error",
7583
- msg: "Field not exist in datasource table fields repository",
7584
- };
7585
- m["SYS_MSG_0748"] = {
7586
- alert_type: "error",
7587
- alertDisplay: "console",
7588
- subject: "Object Error - Mismatch Reference Type",
7589
- msg: "Mismatch in calling reference type",
7590
- };
7591
- m["SYS_MSG_0750"] = {
7592
- alert_type: "error",
7593
- alertDisplay: "console",
7594
- subject: "Object Error - Reference Broken",
7595
- msg: "Reference broken calling object not exist",
7596
- };
7597
- m["SYS_MSG_0752"] = {
7598
- alert_type: "error",
7599
- alertDisplay: "console",
7600
- subject: "Object Error - Empty Reference",
7601
- msg: "Reference empty",
7602
- };
7603
- m["SYS_MSG_0754"] = {
7604
- alert_type: "error",
7605
- alertDisplay: "console",
7606
- subject: "Object Error - Action Not Exist",
7607
- msg: "Action not exist",
7608
- };
7609
- m["SYS_MSG_0756"] = {
7610
- alert_type: "error",
7611
- alertDisplay: "console",
7612
- subject: "Object Error - Empty Event Reference",
7613
- msg: "Empty event reference",
7614
- };
7615
- m["SYS_MSG_0758"] = {
7616
- alert_type: "error",
7617
- alertDisplay: "console",
7618
- subject: "Object Error - Bad Field Name",
7619
- msg: "Field name is invalid or cannot contain any of non word characters",
7620
- };
7621
- m["SYS_MSG_0760"] = {
7622
- alert_type: "error",
7623
- alertDisplay: "console",
7624
- subject: "Object Error - Integrity Broken",
7625
- msg: "Field broken from its properties, edit the object and save",
7626
- };
7627
- m["SYS_MSG_0762"] = {
7628
- alert_type: "error",
7629
- alertDisplay: "console",
7630
- subject: "Object Error - Model Not Exist",
7631
- msg: "Model assigned to the field not exist",
7632
- };
7633
- m["SYS_MSG_0764"] = {
7634
- alert_type: "error",
7635
- alertDisplay: "console",
7636
- subject: "Object Error - Empty Dataset",
7637
- msg: "Dataset empty from fields",
7638
- };
7639
- m["SYS_MSG_0766"] = {
7640
- alert_type: "error",
7641
- alertDisplay: "console",
7642
- subject: "Object Error - Field Type Mismatch",
7643
- msg: "Field type not match to the underlined table field definition",
7644
- };
7645
- m["SYS_MSG_0768"] = {
7646
- alert_type: "error",
7647
- alertDisplay: "console",
7648
- subject: "Object Error - Field Mask Mismatch",
7649
- msg: "Field masks not match to the underlined table field definition",
7650
- };
7651
- m["SYS_MSG_0770"] = {
7652
- alert_type: "error",
7653
- alertDisplay: "console",
7654
- subject: "Object Error - Bad Event Name",
7655
- msg: "Event name is invalid or cannot contain any of non word characters",
7656
- };
7657
- m["SYS_MSG_0772"] = {
7658
- alert_type: "error",
7659
- alertDisplay: "console",
7660
- subject: "Object Error - UI Field Not Exist",
7661
- msg: "UI Field not exist in the dataset repository",
7662
- };
7663
- m["SYS_MSG_0774"] = {
7664
- alert_type: "error",
7665
- alertDisplay: "console",
7666
- subject: "Object Error - UI Field Reference Broken",
7667
- msg: "UI Field reference broken",
7668
- };
7669
- m["SYS_MSG_0780"] = {
7670
- alert_type: "error",
7671
- alertDisplay: "toast",
7672
- subject: "UI element error",
7673
- msg: "UI element not exist",
7674
- };
7675
-
7676
- m["SYS_MSG_1210"] = {
7677
- alert_type: "error",
7678
- alertDisplay: "modal",
7679
- subject: "Program error",
7680
- msg: "Program not exist",
7681
- };
7682
- m["SYS_MSG_1220"] = {
7683
- alert_type: "error",
7684
- alertDisplay: "modal",
7685
- subject: "Program error",
7686
- msg: "Non grid output defined",
7687
- };
7688
-
7689
- m["SYS_MSG_1240"] = {
7690
- alert_type: "error",
7691
- alertDisplay: "toast",
7692
- subject: "Debug error",
7693
- msg: "",
7694
- };
7695
- m["SYS_MSG_1250"] = {
7696
- alert_type: "error",
7697
- alertDisplay: "toast",
7698
- subject: "Debug log error",
7699
- msg: "",
7700
- };
7701
- m["SYS_MSG_1260"] = {
7702
- alert_type: "error",
7703
- alertDisplay: "toast",
7704
- subject: "Session Expired",
7705
- msg: "Renew token session in Studio",
7083
+ m['SYS_MSG_0628'] = {
7084
+ alert_type: 'error',
7085
+ alertDisplay: 'toast',
7086
+ subject: 'Mask Error - Invalid switch',
7087
+ msg: 'Invalid switch in string mask',
7088
+ };
7089
+ m['SYS_MSG_0630'] = {
7090
+ alert_type: 'error',
7091
+ alertDisplay: 'toast',
7092
+ subject: 'Mask Error - Missing DOM Element',
7093
+ msg: 'Missing DOM element',
7094
+ };
7095
+ m['SYS_MSG_0632'] = {
7096
+ alert_type: 'error',
7097
+ alertDisplay: 'toast',
7098
+ subject: 'Mask Error - Too Big',
7099
+ msg: 'Size to big, max: 15.5',
7100
+ };
7101
+ m['SYS_MSG_0700'] = {
7102
+ alert_type: 'warning',
7103
+ alertDisplay: 'console',
7104
+ subject: 'Table Warning - Empty',
7105
+ msg: 'Table has no content',
7106
+ };
7107
+ m['SYS_MSG_0702'] = {
7108
+ alert_type: 'error',
7109
+ alertDisplay: 'console',
7110
+ subject: 'Table Error - No Fields',
7111
+ msg: 'Table missing fields content',
7112
+ };
7113
+ m['SYS_MSG_0704'] = {
7114
+ alert_type: 'warning',
7115
+ alertDisplay: 'console',
7116
+ subject: 'Table Warning - Not In Use',
7117
+ msg: 'Table not in use by any object',
7118
+ };
7119
+ m['SYS_MSG_0706'] = {
7120
+ alert_type: 'error',
7121
+ alertDisplay: 'console',
7122
+ subject: 'Table Error - No Primary Index',
7123
+ msg: 'Table must have at least one index',
7124
+ };
7125
+ m['SYS_MSG_0708'] = {
7126
+ alert_type: 'error',
7127
+ alertDisplay: 'console',
7128
+ subject: 'Table Error - Bad Index Name',
7129
+ msg: 'Index name is invalid or cannot contain any of non word characters',
7130
+ };
7131
+ m['SYS_MSG_0710'] = {
7132
+ alert_type: 'error',
7133
+ alertDisplay: 'console',
7134
+ subject: 'Table Error - Empty Index',
7135
+ msg: 'Index has no keys',
7136
+ };
7137
+ m['SYS_MSG_0712'] = {
7138
+ alert_type: 'error',
7139
+ alertDisplay: 'console',
7140
+ subject: 'Table Error - Key Not Exist',
7141
+ msg: 'Key not exist in the table fields repository',
7142
+ };
7143
+ m['SYS_MSG_0714'] = {
7144
+ alert_type: 'error',
7145
+ alertDisplay: 'console',
7146
+ subject: 'Table Error - Duplicate Fields',
7147
+ msg: 'Duplicate fields in the table fields repository',
7148
+ };
7149
+ m['SYS_MSG_0716'] = {
7150
+ alert_type: 'error',
7151
+ alertDisplay: 'console',
7152
+ subject: 'Table Error - Bad Field Name',
7153
+ msg: 'Field name is invalid or cannot contain any of non word characters',
7154
+ };
7155
+ m['SYS_MSG_0718'] = {
7156
+ alert_type: 'error',
7157
+ alertDisplay: 'console',
7158
+ subject: 'Table Error - Integrity Broken',
7159
+ msg: 'Field broken from its properties, edit the field and save',
7160
+ };
7161
+ m['SYS_MSG_0720'] = {
7162
+ alert_type: 'error',
7163
+ alertDisplay: 'console',
7164
+ subject: 'Table Error - Model Not Exist',
7165
+ msg: 'Model assigned to the field not exist',
7166
+ };
7167
+ m['SYS_MSG_0722'] = {
7168
+ alert_type: 'warning',
7169
+ alertDisplay: 'console',
7170
+ subject: 'Object Warning - Not In Use',
7171
+ msg: 'Object not in use or not call by any object',
7172
+ };
7173
+ m['SYS_MSG_0724'] = {
7174
+ alert_type: 'error',
7175
+ alertDisplay: 'console',
7176
+ subject: 'Object Error - Table Not Exist',
7177
+ msg: 'Table assigned in object datasource not exist',
7178
+ };
7179
+ m['SYS_MSG_0726'] = {
7180
+ alert_type: 'error',
7181
+ alertDisplay: 'console',
7182
+ subject: 'Object Error - Index Keys Mismatch',
7183
+ msg: 'Table index has different structure',
7184
+ };
7185
+ m['SYS_MSG_0728'] = {
7186
+ alert_type: 'error',
7187
+ alertDisplay: 'console',
7188
+ subject: 'Object Error - Index Key From Empty',
7189
+ msg: 'Index key From must have a value',
7190
+ };
7191
+ m['SYS_MSG_0730'] = {
7192
+ alert_type: 'error',
7193
+ alertDisplay: 'console',
7194
+ subject: 'Object Error - Index Key From Reference',
7195
+ msg: 'Field reference not exist in any dataset or parameters',
7196
+ };
7197
+ m['SYS_MSG_0732'] = {
7198
+ alert_type: 'error',
7199
+ alertDisplay: 'console',
7200
+ subject: 'Object Error - Index Key To Empty',
7201
+ msg: 'Index key To must have a value',
7202
+ };
7203
+ m['SYS_MSG_0734'] = {
7204
+ alert_type: 'error',
7205
+ alertDisplay: 'console',
7206
+ subject: 'Object Error - Index Key To Reference',
7207
+ msg: 'Field reference not exist in any dataset or parameters',
7208
+ };
7209
+ m['SYS_MSG_0736'] = {
7210
+ alert_type: 'error',
7211
+ alertDisplay: 'console',
7212
+ subject: 'Object Error - Index Locate From Reference',
7213
+ msg: 'Field reference not exist in any dataset or parameters',
7214
+ };
7215
+ m['SYS_MSG_0738'] = {
7216
+ alert_type: 'error',
7217
+ alertDisplay: 'console',
7218
+ subject: 'Object Error - Index Locate To Reference',
7219
+ msg: 'Field reference not exist in any dataset or parameters',
7220
+ };
7221
+ m['SYS_MSG_0740'] = {
7222
+ alert_type: 'error',
7223
+ alertDisplay: 'console',
7224
+ subject: 'Object Error - Index Empty',
7225
+ msg: 'Index empty - no keys defined',
7226
+ };
7227
+ m['SYS_MSG_0742'] = {
7228
+ alert_type: 'error',
7229
+ alertDisplay: 'console',
7230
+ subject: 'Object Error - Index Reference',
7231
+ msg: 'Table index reference error',
7232
+ };
7233
+ m['SYS_MSG_0744'] = {
7234
+ alert_type: 'error',
7235
+ alertDisplay: 'console',
7236
+ subject: 'Object Error - Duplicate Fields',
7237
+ msg: 'Duplicate fields in the dataset fields repository',
7238
+ };
7239
+ m['SYS_MSG_0746'] = {
7240
+ alert_type: 'error',
7241
+ alertDisplay: 'console',
7242
+ subject: 'Object Error - Field reference error',
7243
+ msg: 'Field not exist in datasource table fields repository',
7244
+ };
7245
+ m['SYS_MSG_0748'] = {
7246
+ alert_type: 'error',
7247
+ alertDisplay: 'console',
7248
+ subject: 'Object Error - Mismatch Reference Type',
7249
+ msg: 'Mismatch in calling reference type',
7250
+ };
7251
+ m['SYS_MSG_0750'] = {
7252
+ alert_type: 'error',
7253
+ alertDisplay: 'console',
7254
+ subject: 'Object Error - Reference Broken',
7255
+ msg: 'Reference broken calling object not exist',
7256
+ };
7257
+ m['SYS_MSG_0752'] = {
7258
+ alert_type: 'error',
7259
+ alertDisplay: 'console',
7260
+ subject: 'Object Error - Empty Reference',
7261
+ msg: 'Reference empty',
7262
+ };
7263
+ m['SYS_MSG_0754'] = {
7264
+ alert_type: 'error',
7265
+ alertDisplay: 'console',
7266
+ subject: 'Object Error - Action Not Exist',
7267
+ msg: 'Action not exist',
7268
+ };
7269
+ m['SYS_MSG_0756'] = {
7270
+ alert_type: 'error',
7271
+ alertDisplay: 'console',
7272
+ subject: 'Object Error - Empty Event Reference',
7273
+ msg: 'Empty event reference',
7274
+ };
7275
+ m['SYS_MSG_0758'] = {
7276
+ alert_type: 'error',
7277
+ alertDisplay: 'console',
7278
+ subject: 'Object Error - Bad Field Name',
7279
+ msg: 'Field name is invalid or cannot contain any of non word characters',
7280
+ };
7281
+ m['SYS_MSG_0760'] = {
7282
+ alert_type: 'error',
7283
+ alertDisplay: 'console',
7284
+ subject: 'Object Error - Integrity Broken',
7285
+ msg: 'Field broken from its properties, edit the object and save',
7286
+ };
7287
+ m['SYS_MSG_0762'] = {
7288
+ alert_type: 'error',
7289
+ alertDisplay: 'console',
7290
+ subject: 'Object Error - Model Not Exist',
7291
+ msg: 'Model assigned to the field not exist',
7292
+ };
7293
+ m['SYS_MSG_0764'] = {
7294
+ alert_type: 'error',
7295
+ alertDisplay: 'console',
7296
+ subject: 'Object Error - Empty Dataset',
7297
+ msg: 'Dataset empty from fields',
7298
+ };
7299
+ m['SYS_MSG_0766'] = {
7300
+ alert_type: 'error',
7301
+ alertDisplay: 'console',
7302
+ subject: 'Object Error - Field Type Mismatch',
7303
+ msg: 'Field type not match to the underlined table field definition',
7304
+ };
7305
+ m['SYS_MSG_0768'] = {
7306
+ alert_type: 'error',
7307
+ alertDisplay: 'console',
7308
+ subject: 'Object Error - Field Mask Mismatch',
7309
+ msg: 'Field masks not match to the underlined table field definition',
7310
+ };
7311
+ m['SYS_MSG_0770'] = {
7312
+ alert_type: 'error',
7313
+ alertDisplay: 'console',
7314
+ subject: 'Object Error - Bad Event Name',
7315
+ msg: 'Event name is invalid or cannot contain any of non word characters',
7316
+ };
7317
+ m['SYS_MSG_0772'] = {
7318
+ alert_type: 'error',
7319
+ alertDisplay: 'console',
7320
+ subject: 'Object Error - UI Field Not Exist',
7321
+ msg: 'UI Field not exist in the dataset repository',
7322
+ };
7323
+ m['SYS_MSG_0774'] = {
7324
+ alert_type: 'error',
7325
+ alertDisplay: 'console',
7326
+ subject: 'Object Error - UI Field Reference Broken',
7327
+ msg: 'UI Field reference broken',
7328
+ };
7329
+ m['SYS_MSG_0780'] = {
7330
+ alert_type: 'error',
7331
+ alertDisplay: 'toast',
7332
+ subject: 'UI element error',
7333
+ msg: 'UI element not exist',
7334
+ };
7335
+
7336
+ m['SYS_MSG_1210'] = {
7337
+ alert_type: 'error',
7338
+ alertDisplay: 'modal',
7339
+ subject: 'Program error',
7340
+ msg: 'Program not exist',
7341
+ };
7342
+ m['SYS_MSG_1220'] = {
7343
+ alert_type: 'error',
7344
+ alertDisplay: 'modal',
7345
+ subject: 'Program error',
7346
+ msg: 'Non grid output defined',
7347
+ };
7348
+
7349
+ m['SYS_MSG_1240'] = {
7350
+ alert_type: 'error',
7351
+ alertDisplay: 'toast',
7352
+ subject: 'Debug error',
7353
+ msg: '',
7354
+ };
7355
+ m['SYS_MSG_1250'] = {
7356
+ alert_type: 'error',
7357
+ alertDisplay: 'toast',
7358
+ subject: 'Debug log error',
7359
+ msg: '',
7360
+ };
7361
+ m['SYS_MSG_1260'] = {
7362
+ alert_type: 'error',
7363
+ alertDisplay: 'toast',
7364
+ subject: 'Session Expired',
7365
+ msg: 'Renew token session in Studio',
7706
7366
  };
7707
7367
  return m;
7708
7368
  };
@@ -7718,15 +7378,15 @@ func.utils.find_key_in_ViewUITreeObj = function (arr, key, val) {
7718
7378
  func.utils.get_plugin_setup = function (SESSION_ID, plugin_name) {
7719
7379
  const report_error = function (descP, warn) {
7720
7380
  func.utils.debug.log(SESSION_ID, plugin_name, {
7721
- module: "plugin",
7722
- action: "Init",
7723
- source: "get_plugin_setup",
7381
+ module: 'plugin',
7382
+ action: 'Init',
7383
+ source: 'get_plugin_setup',
7724
7384
  prop: descP,
7725
7385
  details: descP,
7726
7386
  result: null,
7727
7387
  error: warn ? false : true,
7728
7388
  fields: null,
7729
- type: "plugin",
7389
+ type: 'plugin',
7730
7390
  });
7731
7391
  };
7732
7392
 
@@ -7739,28 +7399,25 @@ func.utils.get_plugin_setup = function (SESSION_ID, plugin_name) {
7739
7399
  return resolve(ret.data);
7740
7400
  } catch (err) {
7741
7401
  // cache not found
7742
- const json = await func.common.db(SESSION_ID, "get_plugin_setup", {
7402
+ const json = await func.common.db(SESSION_ID, 'get_plugin_setup', {
7743
7403
  plugin_name,
7744
7404
  });
7745
7405
  if (json.code < 0) {
7746
- report_error(
7747
- "Error: " + json.data,
7748
- json.error_type === "W" ? true : false
7749
- );
7406
+ report_error('Error: ' + json.data, json.error_type === 'W' ? true : false);
7750
7407
  }
7751
7408
  resolve(json);
7752
7409
 
7753
7410
  var doc = {
7754
7411
  _id: `cache_plugin_setup_${plugin_name}`,
7755
7412
  data: json,
7756
- docType: "cache_plugin",
7413
+ docType: 'cache_plugin',
7757
7414
  };
7758
7415
  db.put(doc);
7759
7416
  }
7760
7417
  } catch (e) {
7761
7418
  console.error(e);
7762
7419
 
7763
- report_error("Error: " + e.msg, e.error_type === "W" ? true : false);
7420
+ report_error('Error: ' + e.msg, e.error_type === 'W' ? true : false);
7764
7421
  resolve(e.msg);
7765
7422
  }
7766
7423
  });
@@ -7768,7 +7425,7 @@ func.utils.get_plugin_setup = function (SESSION_ID, plugin_name) {
7768
7425
 
7769
7426
  func.utils.connect_pouchdb = async function (SESSION_ID) {
7770
7427
  const app_id = SESSION_OBJ[SESSION_ID].app_id;
7771
- return new PouchDB("xuda_rt_" + app_id);
7428
+ return new PouchDB('xuda_rt_' + app_id);
7772
7429
  };
7773
7430
 
7774
7431
  // func.utils.validate_pouchdb = async function (SESSION_ID) {
@@ -7798,15 +7455,15 @@ func.utils.call_plugin_api = function (SESSION_ID, plugin_nameP, dataP) {
7798
7455
 
7799
7456
  const report_error = function (descP, warn) {
7800
7457
  func.utils.debug.log(SESSION_ID, plugin_nameP, {
7801
- module: "plugin",
7802
- action: "Init",
7803
- source: "call_plugin_api",
7458
+ module: 'plugin',
7459
+ action: 'Init',
7460
+ source: 'call_plugin_api',
7804
7461
  prop: descP,
7805
7462
  details: descP,
7806
7463
  result: null,
7807
7464
  error: warn ? false : true,
7808
7465
  fields: null,
7809
- type: "plugin",
7466
+ type: 'plugin',
7810
7467
  });
7811
7468
  };
7812
7469
  return new Promise(async (resolve) => {
@@ -7821,10 +7478,10 @@ func.utils.call_plugin_api = function (SESSION_ID, plugin_nameP, dataP) {
7821
7478
  data = _.assignIn(data, dataP);
7822
7479
 
7823
7480
  fetch(`https://xuda.io/ppi/${plugin_nameP}`, {
7824
- method: "POST",
7481
+ method: 'POST',
7825
7482
  headers: {
7826
- Accept: "application/json",
7827
- "Content-Type": "application/json",
7483
+ Accept: 'application/json',
7484
+ 'Content-Type': 'application/json',
7828
7485
  },
7829
7486
  body: JSON.stringify(data),
7830
7487
  })
@@ -7838,10 +7495,7 @@ func.utils.call_plugin_api = function (SESSION_ID, plugin_nameP, dataP) {
7838
7495
  })
7839
7496
  .then((json) => {
7840
7497
  if (json.code < 0) {
7841
- report_error(
7842
- "Error: " + json.data,
7843
- json.error_type === "W" ? true : false
7844
- );
7498
+ report_error('Error: ' + json.data, json.error_type === 'W' ? true : false);
7845
7499
  }
7846
7500
  resolve(json.data);
7847
7501
 
@@ -7853,25 +7507,21 @@ func.utils.call_plugin_api = function (SESSION_ID, plugin_nameP, dataP) {
7853
7507
  // db.put(doc);
7854
7508
  })
7855
7509
  .catch((err) => {
7856
- report_error("Error: " + err.message);
7510
+ report_error('Error: ' + err.message);
7857
7511
  resolve(err.message);
7858
7512
  });
7859
7513
  // }
7860
7514
  });
7861
7515
  };
7862
7516
 
7863
- func.utils.get_plugin_resource = function (
7864
- SESSION_ID,
7865
- plugin_name,
7866
- plugin_resource
7867
- ) {
7517
+ func.utils.get_plugin_resource = function (SESSION_ID, plugin_name, plugin_resource) {
7868
7518
  var _session = SESSION_OBJ[SESSION_ID];
7869
7519
 
7870
7520
  const get_path = function (resource) {
7871
- if (_session.worker_type === "Dev") {
7521
+ if (_session.worker_type === 'Dev') {
7872
7522
  return `../../plugins/${plugin_name}/${resource}`;
7873
7523
  }
7874
- if (typeof IS_PROCESS_SERVER !== "undefined") {
7524
+ if (typeof IS_PROCESS_SERVER !== 'undefined') {
7875
7525
  return `${_conf.plugins_drive_path}/${_session.app_id}/node_modules/${plugin_name}/${resource}`;
7876
7526
  } else {
7877
7527
  // return `./node_modules/${plugin_name}/${resource}?app_id=${_session.app_id}`;
@@ -7916,24 +7566,20 @@ func.utils.get_plugin_resource = function (
7916
7566
  };
7917
7567
 
7918
7568
  func.utils.remove_cached_objects = async function (SESSION_ID) {
7919
- if (
7920
- typeof IS_DOCKER !== "undefined" ||
7921
- typeof IS_PROCESS_SERVER !== "undefined"
7922
- )
7923
- return;
7569
+ if (typeof IS_DOCKER !== 'undefined' || typeof IS_PROCESS_SERVER !== 'undefined') return;
7924
7570
  try {
7925
7571
  const db = await func.utils.connect_pouchdb(SESSION_ID);
7926
7572
 
7927
7573
  let opt = {
7928
7574
  $or: [
7929
7575
  {
7930
- docType: "cache_objects",
7576
+ docType: 'cache_objects',
7931
7577
  },
7932
7578
  {
7933
- docType: "cache_plugin",
7579
+ docType: 'cache_plugin',
7934
7580
  },
7935
7581
  {
7936
- docType: "cache_app",
7582
+ docType: 'cache_app',
7937
7583
  },
7938
7584
  ],
7939
7585
  };
@@ -7947,15 +7593,11 @@ func.utils.remove_cached_objects = async function (SESSION_ID) {
7947
7593
  }
7948
7594
  };
7949
7595
 
7950
- func.utils.get_plugin_npm_cdn = async function (
7951
- SESSION_ID,
7952
- plugin_name,
7953
- resource
7954
- ) {
7596
+ func.utils.get_plugin_npm_cdn = async function (SESSION_ID, plugin_name, resource) {
7955
7597
  const _session = SESSION_OBJ[SESSION_ID];
7956
7598
 
7957
7599
  const get_path = function (resource) {
7958
- if (_session.worker_type === "Dev") {
7600
+ if (_session.worker_type === 'Dev') {
7959
7601
  return `../../plugins/${plugin_name}/${resource}`;
7960
7602
  }
7961
7603
 
@@ -7965,24 +7607,13 @@ func.utils.get_plugin_npm_cdn = async function (
7965
7607
  return get_path(resource);
7966
7608
  };
7967
7609
 
7968
- func.utils.write_log = async function (
7969
- SESSION_ID,
7970
- method = "",
7971
- msg = "",
7972
- log_type = "error",
7973
- source = "runtime",
7974
- details
7975
- ) {
7610
+ func.utils.write_log = async function (SESSION_ID, method = '', msg = '', log_type = 'error', source = 'runtime', details) {
7976
7611
  const _session = SESSION_OBJ[SESSION_ID];
7977
- if (
7978
- typeof IS_API_SERVER !== "undefined" ||
7979
- typeof IS_DOCKER !== "undefined" ||
7980
- typeof IS_PROCESS_SERVER !== "undefined"
7981
- ) {
7612
+ if (typeof IS_API_SERVER !== 'undefined' || typeof IS_DOCKER !== 'undefined' || typeof IS_PROCESS_SERVER !== 'undefined') {
7982
7613
  return __.rpi.write_log(_session.app_id, log_type, source, msg, details);
7983
7614
  }
7984
7615
 
7985
- await func.common.db(SESSION_ID, "write_log", {
7616
+ await func.common.db(SESSION_ID, 'write_log', {
7986
7617
  msg,
7987
7618
  log_type,
7988
7619
  source,
@@ -8000,26 +7631,24 @@ func.utils.get_resource_filename = function (build, filename) {
8000
7631
 
8001
7632
  func.utils.set_SYS_GLOBAL_OBJ_WIDGET_INFO = async function (SESSION_ID, docP) {
8002
7633
  var obj = _.clone(docP);
8003
- obj.date = await func.utils.get_dateTime(SESSION_ID, "SYS_DATE", docP.date);
8004
- obj.time = await func.utils.get_dateTime(SESSION_ID, "SYS_TIME", docP.date);
7634
+ obj.date = await func.utils.get_dateTime(SESSION_ID, 'SYS_DATE', docP.date);
7635
+ obj.time = await func.utils.get_dateTime(SESSION_ID, 'SYS_TIME', docP.date);
8005
7636
 
8006
7637
  var datasource_changes = {
8007
7638
  [0]: {
8008
- ["data_system"]: {
8009
- ["SYS_GLOBAL_OBJ_WIDGET_INFO"]: obj,
7639
+ ['data_system']: {
7640
+ ['SYS_GLOBAL_OBJ_WIDGET_INFO']: obj,
8010
7641
  },
8011
7642
  },
8012
7643
  };
8013
7644
  await func.datasource.update(SESSION_ID, datasource_changes);
8014
7645
  };
8015
7646
 
8016
-
8017
- func.utils.get_last_datasource_no = function () {
8018
-
8019
- const filtered = Object.values(SESSION_OBJ[SESSION_ID].DS_GLB).filter(e => e.tree_obj.menuType !== 'api')
7647
+ func.utils.get_last_datasource_no = function (SESSION_ID) {
7648
+ const filtered = Object.values(SESSION_OBJ[SESSION_ID].DS_GLB).filter((e) => e.tree_obj.menuType !== 'api');
8020
7649
 
8021
7650
  return filtered.at(-1).dssession;
8022
- }
7651
+ };
8023
7652
  func.events = {};
8024
7653
  func.events.validate = async function (
8025
7654
  SESSION_ID,