@xuda.io/runtime-bundle 1.0.491 → 1.0.493

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.
@@ -34922,7 +34922,7 @@ func.UI.component.init_xu_nav = function ($container, $nav) {
34922
34922
  };
34923
34923
  func.expression = {};
34924
34924
 
34925
- func.expression.get_org = async function (SESSION_ID, valP, dsSessionP, sourceP, rowIdP, sourceActionP, secondPassP, calling_fieldIdP, fieldsP, debug_infoP, iterate_info, js_script_callback, jobNo, api_output_type) {
34925
+ func.expression.get = async function (SESSION_ID, valP, dsSessionP, sourceP, rowIdP, sourceActionP, secondPassP, calling_fieldIdP, fieldsP, debug_infoP, iterate_info, js_script_callback, jobNo, api_output_type) {
34926
34926
  class xu_class {
34927
34927
  async get() {
34928
34928
  var ret;
@@ -35276,7 +35276,7 @@ func.expression.get_org = async function (SESSION_ID, valP, dsSessionP, sourceP,
35276
35276
  return new_class.get();
35277
35277
  };
35278
35278
 
35279
- func.expression.get = async function (SESSION_ID, valP, dsSessionP, sourceP, rowIdP, sourceActionP, secondPassP, calling_fieldIdP, fieldsP = {}, debug_infoP, iterate_info, js_script_callback, jobNo, api_output_type) {
35279
+ func.expression.get_bad = async function (SESSION_ID, valP, dsSessionP, sourceP, rowIdP, sourceActionP, secondPassP, calling_fieldIdP, fieldsP = {}, debug_infoP, iterate_info, js_script_callback, jobNo, api_output_type) {
35280
35280
  const evalJson = (text) => eval(`(${text})`);
35281
35281
  const replaceQuotes = (str) => {
35282
35282
  for (const [key, val] of Object.entries(fields)) {
@@ -35542,64 +35542,6 @@ func.expression.parse_org = function (strP) {
35542
35542
  return res;
35543
35543
  };
35544
35544
 
35545
- func.expression.parse_bad = function (strP) {
35546
- const nonLettersPatt = /\W/;
35547
- const validSymbolsNoArray = /[^.@\[]/;
35548
- const validSymbolsWithArray = /[^.@"'\[\]]/;
35549
-
35550
- function extractStr(str, startPos = 0) {
35551
- const cleanSplit = (arr) => (arr?.length > 1 && arr[0] === '' && arr[1].includes('@') ? arr.slice(1) : arr);
35552
-
35553
- const segments = cleanSplit(str.replace(/@/g, '^^@').split('^^'));
35554
- const result = [];
35555
-
35556
- for (const val of segments || []) {
35557
- if (!val) continue;
35558
- const pos = str.indexOf(val) + startPos;
35559
-
35560
- if (val.startsWith('@')) {
35561
- let tmpStr = '';
35562
- let wordStart = null;
35563
- let wordEnd = null;
35564
- let validSymbols = validSymbolsNoArray;
35565
-
35566
- for (let i = 0; i < val.length; i++) {
35567
- const char = val[i];
35568
-
35569
- if (char === '[') validSymbols = validSymbolsWithArray;
35570
- if (char === '.' && wordStart === null) wordStart = i;
35571
- else if (wordStart !== null && nonLettersPatt.test(char)) wordEnd = i;
35572
-
35573
- if (wordStart !== null && wordEnd !== null) {
35574
- const word = val.slice(wordStart + 1, wordEnd);
35575
- tmpStr = tmpStr.slice(0, wordStart) + '^^' + tmpStr.slice(wordStart, wordEnd);
35576
- wordStart = char === '.' ? wordEnd : null;
35577
- wordEnd = null;
35578
- }
35579
-
35580
- tmpStr += nonLettersPatt.test(char) && validSymbols.test(char) && !tmpStr.includes('^^') ? '^^' + char : char;
35581
- }
35582
-
35583
- if (tmpStr.includes('^^')) {
35584
- result.push(...extractStr(tmpStr, pos));
35585
- } else {
35586
- const fieldIdMatch = val.match(/^@([^.\[]+)/);
35587
- result.push({
35588
- value: val,
35589
- fieldId: fieldIdMatch ? fieldIdMatch[1] : undefined,
35590
- pos,
35591
- });
35592
- }
35593
- } else {
35594
- result.push({ value: val, pos });
35595
- }
35596
- }
35597
- return result;
35598
- }
35599
-
35600
- return extractStr(strP);
35601
- };
35602
-
35603
35545
  func.expression.parse = function (input) {
35604
35546
  if (typeof input !== 'string') return [];
35605
35547
 
@@ -35628,7 +35570,7 @@ func.expression.parse = function (input) {
35628
35570
  return segments;
35629
35571
  };
35630
35572
 
35631
- func.expression.get_property_org = async function (valP) {
35573
+ func.expression.get_property = async function (valP) {
35632
35574
  async function secure_eval(val) {
35633
35575
  if (typeof IS_PROCESS_SERVER === 'undefined') {
35634
35576
  try {
@@ -35667,7 +35609,7 @@ func.expression.get_property_org = async function (valP) {
35667
35609
  };
35668
35610
  };
35669
35611
 
35670
- func.expression.get_property = async function (valP) {
35612
+ func.expression.get_property_bad = async function (valP) {
35671
35613
  if (typeof valP !== 'string') return { property1: undefined, property2: undefined };
35672
35614
 
35673
35615
  const secureEval = async (expr) => {
@@ -35712,27 +35654,27 @@ func.expression.get_property = async function (valP) {
35712
35654
  return { property1, property2 };
35713
35655
  };
35714
35656
 
35715
- func.expression.validate_constant_org = function (valP) {
35657
+ func.expression.validate_constant = function (valP) {
35716
35658
  var patt = /["']/;
35717
35659
  if (typeof valP === 'string' && patt.test(valP.substr(0, 1)) && patt.test(valP.substr(0, valP.length - 1))) return true;
35718
35660
  else return false;
35719
35661
  };
35720
- func.expression.validate_variables_org = function (valP) {
35662
+ func.expression.validate_variables = function (valP) {
35721
35663
  if (typeof valP === 'string' && valP.indexOf('@') > -1) return true;
35722
35664
  else return false;
35723
35665
  };
35724
- func.expression.remove_quotes_org = function (valP) {
35666
+ func.expression.remove_quotes = function (valP) {
35725
35667
  if (func.expression.validate_constant(valP)) return valP.substr(1, valP.length - 2);
35726
35668
  else return valP;
35727
35669
  };
35728
35670
 
35729
- func.expression.validate_constant = (valP) => typeof valP === 'string' && /^["'].*["']$/.test(valP);
35671
+ func.expression.validate_constant_bad = (valP) => typeof valP === 'string' && /^["'].*["']$/.test(valP);
35730
35672
 
35731
- func.expression.validate_variables = (valP) => typeof valP === 'string' && valP.includes('@');
35673
+ func.expression.validate_variables_bad = (valP) => typeof valP === 'string' && valP.includes('@');
35732
35674
 
35733
- func.expression.remove_quotes = (valP) => (func.expression.validate_constant(valP) && typeof valP === 'string' ? valP.slice(1, -1) : valP);
35675
+ func.expression.remove_quotes_bad = (valP) => (func.expression.validate_constant(valP) && typeof valP === 'string' ? valP.slice(1, -1) : valP);
35734
35676
 
35735
- func.expression.secure_eval_org = async function (SESSION_ID, sourceP, val, job_id, dsSessionP, js_script_callback, evt) {
35677
+ func.expression.secure_eval = async function (SESSION_ID, sourceP, val, job_id, dsSessionP, js_script_callback, evt) {
35736
35678
  const api_utils = await func.common.get_module(SESSION_ID, 'xuda-api-library.mjs', {
35737
35679
  func,
35738
35680
  glb,
@@ -35834,7 +35776,7 @@ func.expression.secure_eval_org = async function (SESSION_ID, sourceP, val, job_
35834
35776
  }
35835
35777
  };
35836
35778
 
35837
- func.expression.secure_eval = async function (SESSION_ID, sourceP, val, job_id, dsSessionP, js_script_callback, evt) {
35779
+ func.expression.secure_eval_bad = async function (SESSION_ID, sourceP, val, job_id, dsSessionP, js_script_callback, evt) {
35838
35780
  if (typeof val !== 'string') return val;
35839
35781
 
35840
35782
  const xu = await func.common.get_module(SESSION_ID, 'xuda-api-library.mjs', {