@xuda.io/runtime-bundle 1.0.929 → 1.0.931

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.
@@ -721,9 +721,9 @@ func.common.get_module = async function (SESSION_ID, module, paramsP = {}) {
721
721
  }
722
722
  if (_session.worker_type === 'Debug') {
723
723
  if (typeof IS_DOCKER !== 'undefined' || typeof IS_PROCESS_SERVER !== 'undefined') {
724
- ret = await get_ret(func.utils.get_resource_filename(['live_preview', 'cms'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, `${_conf.xuda_home}root/dist/runtime/js/modules/` + module));
724
+ ret = await get_ret(func.utils.get_resource_filename(['live_preview', 'miniapp'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, `${_conf.xuda_home}root/dist/runtime/js/modules/` + module));
725
725
  } else {
726
- ret = await get_ret(func.common.get_url(SESSION_ID, 'dist', func.utils.get_resource_filename(['live_preview', 'cms'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, 'runtime/js/modules/' + module)));
726
+ ret = await get_ret(func.common.get_url(SESSION_ID, 'dist', func.utils.get_resource_filename(['live_preview', 'miniapp'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, 'runtime/js/modules/' + module)));
727
727
  }
728
728
 
729
729
  return ret;
@@ -734,9 +734,9 @@ func.common.get_module = async function (SESSION_ID, module, paramsP = {}) {
734
734
  };
735
735
 
736
736
  if (typeof IS_DOCKER !== 'undefined' || typeof IS_PROCESS_SERVER !== 'undefined') {
737
- ret = await get_ret(func.utils.get_resource_filename(['live_preview', 'cms'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, `${_conf.xuda_home}root/dist/runtime/js/modules/` + rep()));
737
+ ret = await get_ret(func.utils.get_resource_filename(['live_preview', 'miniapp'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, `${_conf.xuda_home}root/dist/runtime/js/modules/` + rep()));
738
738
  } else {
739
- ret = await get_ret(func.common.get_url(SESSION_ID, 'dist', func.utils.get_resource_filename(['live_preview', 'cms'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, 'runtime/js/modules/' + rep())));
739
+ ret = await get_ret(func.common.get_url(SESSION_ID, 'dist', func.utils.get_resource_filename(['live_preview', 'miniapp'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, 'runtime/js/modules/' + rep())));
740
740
  }
741
741
 
742
742
  return ret;
@@ -1317,7 +1317,7 @@ func.datasource.create = async function (
1317
1317
 
1318
1318
  var run_at = _prog_obj?.properties?.runAt;
1319
1319
 
1320
- if (!['live_preview', 'cms'].includes(_session.engine_mode)) {
1320
+ if (!['live_preview', 'miniapp'].includes(_session.engine_mode)) {
1321
1321
  if (_session.opt.app_computing_mode === 'main') {
1322
1322
  run_at = 'client';
1323
1323
  }
@@ -1493,7 +1493,7 @@ func.datasource.prepare = async function (SESSION_ID, prog_id, dataSourceNoP, pa
1493
1493
 
1494
1494
  if (typeof parameters_obj_inP?.[val.data.parameter] !== 'undefined') {
1495
1495
  _ds.in_parameters[val.data.parameter].value = parameters_obj_inP[val.data.parameter];
1496
- } else if (['live_preview', 'cms'].includes(_session.engine_mode)) {
1496
+ } else if (['live_preview', 'miniapp'].includes(_session.engine_mode)) {
1497
1497
  _ds.in_parameters[val.data.parameter].value = _session?.url_params?.[val.data.parameter];
1498
1498
  }
1499
1499
 
@@ -1515,7 +1515,7 @@ func.datasource.prepare = async function (SESSION_ID, prog_id, dataSourceNoP, pa
1515
1515
  _ds.data_system['SYS_GLOBAL_STR_SESSION_ID'] = SESSION_ID;
1516
1516
  _ds.data_system['SYS_GLOBAL_STR_LOGIN_USER_ID'] = _session.USR_OBJ._id;
1517
1517
 
1518
- if (!['live_preview', 'cms'].includes(_session.engine_mode) && PROJECT_OBJ[_session.app_id].info) {
1518
+ if (!['live_preview', 'miniapp'].includes(_session.engine_mode) && PROJECT_OBJ[_session.app_id].info) {
1519
1519
  _ds.data_system['SYS_GLOBAL_OBJ_APP_INFO'] = {
1520
1520
  build: PROJECT_OBJ[_session.app_id].info.build_id,
1521
1521
  author: PROJECT_OBJ[_session.app_id].info.author,
@@ -1784,18 +1784,9 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
1784
1784
  _ds.v.batch_loops = await get_limit();
1785
1785
  return false;
1786
1786
  }
1787
- // _ds.v.batch_loops =
1788
- // (await get_limit()) <= _ds.data_feed?.rows?.length
1789
- // ? await get_limit()
1790
- // : _ds?.data_feed?.rows?.length;
1791
1787
 
1792
1788
  _ds.v.batch_loops = (await get_limit()) <= _ds.v.raw_data?.rows?.length ? await get_limit() : _ds.v.raw_data?.rows?.length;
1793
1789
  return true;
1794
- // _ds.v.batch_loops =
1795
- // (await get_limit()) <= _ds.v?.raw_data?.rows?.length
1796
- // ? await get_limit()
1797
- // : _ds.v?.raw_data?.rows?.length;
1798
- // return true;
1799
1790
  };
1800
1791
 
1801
1792
  const render_api_output = async function () {
@@ -2167,16 +2158,6 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2167
2158
  return func.utils.debug_report(SESSION_ID, 'Data source', 'Datasource DB Table must be defined for Set Data operation', 'E');
2168
2159
  }
2169
2160
 
2170
- // const get_data_from_data_feed = function () {
2171
- // const rows = _ds?.data_feed?.rows || [];
2172
- // return rows.map((item) => ({
2173
- // id: item._ROWID,
2174
- // value: {
2175
- // ...item.value,
2176
- // },
2177
- // }));
2178
- // };
2179
-
2180
2161
  const find_ROWID_idx_from_raw_data_arr = function (rowId) {
2181
2162
  if (!_raw_data_rows) {
2182
2163
  throw new Error('_raw_data_rows not found');
@@ -2191,21 +2172,20 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2191
2172
 
2192
2173
  if (tree_obj.crudMode === 'U') {
2193
2174
  _ds.set_mode = 'U';
2194
- // _raw_data_rows = get_data_from_data_feed(); // _ds?.raw_data?.rows || [];
2175
+
2195
2176
  _raw_data_rows = _ds?.v.raw_data?.rows || [];
2196
2177
  }
2197
2178
 
2198
2179
  if (tree_obj.crudMode === 'D') {
2199
2180
  _ds.set_mode = 'D';
2200
- // _raw_data_rows = get_data_from_data_feed(); // _ds.raw_data?.rows || [];
2181
+
2201
2182
  _raw_data_rows = _ds?.v.raw_data?.rows || [];
2202
2183
  }
2203
2184
 
2204
2185
  // initiated with Update but no rows found
2205
- // if (tree_obj.crudMode === 'U' && tree_obj.allowCreate && !_ds?.data_feed?.rows?.length) {
2186
+
2206
2187
  if (tree_obj.crudMode === 'U' && tree_obj.allowCreate && !_raw_data_rows?.length) {
2207
2188
  _ds.set_mode = 'C';
2208
- // _raw_data_rows[glb.newRecord] = [{ _ROWID: "newRecord" }];
2209
2189
 
2210
2190
  try {
2211
2191
  const row_idx = find_ROWID_idx_from_raw_data_arr('newRecord');
@@ -2217,7 +2197,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2217
2197
 
2218
2198
  if (tree_obj.crudMode === 'C') {
2219
2199
  _ds.set_mode = 'C';
2220
- // _raw_data_rows[glb.newRecord] = [{ _ROWID: "newRecord" }];
2200
+
2221
2201
  try {
2222
2202
  const row_idx = find_ROWID_idx_from_raw_data_arr('newRecord');
2223
2203
  _raw_data_rows[row_idx] = [{ id: 'newRecord', value: {} }];
@@ -2250,7 +2230,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2250
2230
  if (dbMsgP) _ds.currentRecordId = dbMsgP.id;
2251
2231
  }
2252
2232
  }
2253
- // ret = await callback_datasource();
2233
+
2254
2234
  await func.datasource.set_outputField(SESSION_ID, dataSourceSession, _ds?.v?.raw_data?.rows, _ds.args);
2255
2235
  break;
2256
2236
  }
@@ -2272,25 +2252,6 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2272
2252
  }
2273
2253
 
2274
2254
  const row_not_found = async function () {
2275
- // if (!prog_obj.progDataSource?.dataSourceType || (tree_obj.rwMode === 'U' && tree_obj.allowCreate)) {
2276
- // _ds.currentRecordId = 'newRecord';
2277
- // _ds.set_mode = 'C';
2278
- // _ds.record_not_found = true;
2279
-
2280
- // try {
2281
- // const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
2282
- // } catch (error) {
2283
- // await func.datasource.render_fields_form(SESSION_ID, dataSourceSession, { id: 'newRecord', value: {} });
2284
- // }
2285
-
2286
- // var count = await func.datasource.get_field_init_count(SESSION_ID, dataSourceSession, 'newRecord', false);
2287
- // if (
2288
- // count > 0 // was: && !args.dataSourceNoP
2289
- // ) {
2290
- // await func.datasource.execute_field_init_events(SESSION_ID, dataSourceSession, 'form', 'newRecord');
2291
- // }
2292
- // }
2293
-
2294
2255
  if (!prog_obj.progDataSource?.dataSourceType || prog_obj.properties.renderType === 'form' || (tree_obj.rwMode === 'U' && tree_obj.allowCreate)) {
2295
2256
  _ds.currentRecordId = 'newRecord';
2296
2257
  if (tree_obj.rwMode === 'U' && tree_obj.allowCreate) {
@@ -2344,15 +2305,6 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2344
2305
  await func.datasource.execute_view_events(SESSION_ID, dataSourceSession, 'before_record');
2345
2306
  }
2346
2307
 
2347
- // await func.datasource.run_rows_form(
2348
- // SESSION_ID,
2349
- // dataSourceSession,
2350
- // idx,
2351
- // raw_data_row
2352
- // );
2353
-
2354
- ///////////////////////
2355
-
2356
2308
  _ds.currentRecordId = raw_data_row.id; // set temporary to allow expression decoder work
2357
2309
 
2358
2310
  await func.datasource.render_fields_form(SESSION_ID, dataSourceSession, raw_data_row);
@@ -2367,8 +2319,6 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2367
2319
  console.error(err);
2368
2320
  }
2369
2321
 
2370
- /////////////////////
2371
-
2372
2322
  if (await get_after_record_count()) {
2373
2323
  await func.datasource.execute_view_events(SESSION_ID, dataSourceSession, 'after_record');
2374
2324
  }
@@ -2684,10 +2634,10 @@ func.datasource.get_field_init_count = async function (SESSION_ID, dataSourceSes
2684
2634
  for await (const field_obj of _view_obj.progFields) {
2685
2635
  var fieldId = field_obj.data.field_id;
2686
2636
 
2687
- if (!field_obj?.triggers?.length) {
2637
+ if (!field_obj?.workflow?.length) {
2688
2638
  continue;
2689
2639
  }
2690
- for await (const trigger_obj of field_obj.triggers) {
2640
+ for await (const trigger_obj of field_obj.workflow) {
2691
2641
  if (oninit_triggers_to_runP && !oninit_triggers_to_runP?.includes(trigger_obj.id)) {
2692
2642
  continue;
2693
2643
  }
@@ -2778,8 +2728,8 @@ func.datasource.get_view_events_count = async function (SESSION_ID, dataSourceSe
2778
2728
  }
2779
2729
  }
2780
2730
 
2781
- if (_.isEmpty(event_obj.triggers)) continue;
2782
- for (const trigger_obj of event_obj.triggers) {
2731
+ if (_.isEmpty(event_obj.workflow)) continue;
2732
+ for (const trigger_obj of event_obj.workflow) {
2783
2733
  if (trigger_obj.data.enabled) {
2784
2734
  var expression;
2785
2735
  if (trigger_obj.props.condition) expression = trigger_obj.props.condition;
@@ -4005,7 +3955,7 @@ func.datasource.get_field_init_triggers_to_run = function (SESSION_ID, dataSourc
4005
3955
  if (!_ds) return;
4006
3956
 
4007
3957
  return []; // inactive 021617
4008
- }; // inactive temporary, design to execute init triggers when querying large datasets
3958
+ }; // inactive temporary, design to execute init workflow when querying large datasets
4009
3959
  func.datasource.get_pre_init_fields = function (SESSION_ID, dsSessionP, viewRangeExpP, viewSortExpP, viewGroupByExpP, viewLocateExpP) {
4010
3960
  var ret = [];
4011
3961
  return; // inactive 021617
@@ -4580,7 +4530,7 @@ func.utils.ws_worker.functions = {
4580
4530
  APP_OBJ[data.app_id] = data.APP_OBJ;
4581
4531
  PROJECT_OBJ[data.app_id] = data.PROJECT_OBJ;
4582
4532
 
4583
- if (['live_preview', 'cms'].includes(data.SESSION_INFO.engine_mode)) {
4533
+ if (['live_preview', 'miniapp'].includes(data.SESSION_INFO.engine_mode)) {
4584
4534
  DOCS_OBJ[data.app_id] = data.DOCS_OBJ;
4585
4535
  } else if (typeof IS_DOCKER === 'undefined' && typeof IS_PROCESS_SERVER === 'undefined') {
4586
4536
  if (!DOCS_OBJ[data.app_id]) {
@@ -6246,12 +6196,12 @@ func.events.validate = async function (SESSION_ID, triggerP, dsSessionP, eventId
6246
6196
  };
6247
6197
  const add_event = async function () {
6248
6198
  const _event = func.common.find_item_by_key_root(_view_obj.progEvents, 'id', val.id);
6249
- if (_event.triggers) {
6199
+ if (_event.workflow) {
6250
6200
  // check if event property exist
6251
6201
 
6252
- if (!_event.triggers || _.isEmpty(_event.triggers)) return;
6202
+ if (!_event.workflow || _.isEmpty(_event.workflow)) return;
6253
6203
  // check events has rows
6254
- for (const trigger_obj of _event.triggers) {
6204
+ for (const trigger_obj of _event.workflow) {
6255
6205
  //run events rows
6256
6206
  if (!trigger_obj.data.action) continue;
6257
6207
  if (!trigger_obj.data.enabled) continue;
@@ -6963,9 +6913,9 @@ func.events.execute = async function (
6963
6913
  const _view_obj = await func.utils.VIEWS_OBJ.get(SESSION_ID, _ds.prog_id);
6964
6914
  if (callingSourceP === 'grid' || callingSourceP === 'form') {
6965
6915
  let _field_obj = func.common.find_item_by_key(_view_obj.progFields, 'field_id', field_elm);
6966
- var event_name = _field_obj?.triggers?.[eventIdP].name.event;
6916
+ var event_name = _field_obj?.workflow?.[eventIdP].name.event;
6967
6917
 
6968
- if (_field_obj?.triggers?.[eventIdP].name?.properties['xu-exp:event']) {
6918
+ if (_field_obj?.workflow?.[eventIdP].name?.properties['xu-exp:event']) {
6969
6919
  event_name = (await func.expression.get(SESSION_ID, props[`xu-exp:event`], dsSession, 'event_name expression')).result;
6970
6920
  }
6971
6921
 
@@ -7620,7 +7570,7 @@ func.expression.get = async function (SESSION_ID, valP, dsSessionP, sourceP, row
7620
7570
  }
7621
7571
  if (typeof retP.value !== 'undefined') {
7622
7572
  var_Arr[key].type = retP.type;
7623
- var_Arr[key].value = typeof retP.value === 'string' && !retP.value.includes('<svg xmlns=') && retP.value.indexOf('\\') === -1 ? retP.value.replaceAll('"', '\\"') : retP.value; // new Apr 6 2025 fixing "\"how much?\""
7573
+ var_Arr[key].value = typeof retP.value === 'string' && !retP.value.includes('<svg xmlns=') && retP.value.indexOf('\\') === -1 && source !== 'UI Attr EXP' ? retP.value.replaceAll('"', '\\"') : retP.value; // new Apr 6 2025 fixing "\"how much?\"" // new Jul 29 25 to fix quil extra "\" " source!=="UI Attr EXP"
7624
7574
  if ((val.value.indexOf('[') > -1) | (val.value.indexOf('.') > -1)) {
7625
7575
  //get values from array '@var==="sss" && @var_B==="sss" && @obj.property===5 && @objA["value"]===123 | @objB["value"].property===1234'
7626
7576
  var data = retP.prop;
@@ -721,9 +721,9 @@ func.common.get_module = async function (SESSION_ID, module, paramsP = {}) {
721
721
  }
722
722
  if (_session.worker_type === 'Debug') {
723
723
  if (typeof IS_DOCKER !== 'undefined' || typeof IS_PROCESS_SERVER !== 'undefined') {
724
- ret = await get_ret(func.utils.get_resource_filename(['live_preview', 'cms'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, `${_conf.xuda_home}root/dist/runtime/js/modules/` + module));
724
+ ret = await get_ret(func.utils.get_resource_filename(['live_preview', 'miniapp'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, `${_conf.xuda_home}root/dist/runtime/js/modules/` + module));
725
725
  } else {
726
- ret = await get_ret(func.common.get_url(SESSION_ID, 'dist', func.utils.get_resource_filename(['live_preview', 'cms'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, 'runtime/js/modules/' + module)));
726
+ ret = await get_ret(func.common.get_url(SESSION_ID, 'dist', func.utils.get_resource_filename(['live_preview', 'miniapp'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, 'runtime/js/modules/' + module)));
727
727
  }
728
728
 
729
729
  return ret;
@@ -734,9 +734,9 @@ func.common.get_module = async function (SESSION_ID, module, paramsP = {}) {
734
734
  };
735
735
 
736
736
  if (typeof IS_DOCKER !== 'undefined' || typeof IS_PROCESS_SERVER !== 'undefined') {
737
- ret = await get_ret(func.utils.get_resource_filename(['live_preview', 'cms'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, `${_conf.xuda_home}root/dist/runtime/js/modules/` + rep()));
737
+ ret = await get_ret(func.utils.get_resource_filename(['live_preview', 'miniapp'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, `${_conf.xuda_home}root/dist/runtime/js/modules/` + rep()));
738
738
  } else {
739
- ret = await get_ret(func.common.get_url(SESSION_ID, 'dist', func.utils.get_resource_filename(['live_preview', 'cms'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, 'runtime/js/modules/' + rep())));
739
+ ret = await get_ret(func.common.get_url(SESSION_ID, 'dist', func.utils.get_resource_filename(['live_preview', 'miniapp'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, 'runtime/js/modules/' + rep())));
740
740
  }
741
741
 
742
742
  return ret;
@@ -1317,7 +1317,7 @@ func.datasource.create = async function (
1317
1317
 
1318
1318
  var run_at = _prog_obj?.properties?.runAt;
1319
1319
 
1320
- if (!['live_preview', 'cms'].includes(_session.engine_mode)) {
1320
+ if (!['live_preview', 'miniapp'].includes(_session.engine_mode)) {
1321
1321
  if (_session.opt.app_computing_mode === 'main') {
1322
1322
  run_at = 'client';
1323
1323
  }
@@ -1493,7 +1493,7 @@ func.datasource.prepare = async function (SESSION_ID, prog_id, dataSourceNoP, pa
1493
1493
 
1494
1494
  if (typeof parameters_obj_inP?.[val.data.parameter] !== 'undefined') {
1495
1495
  _ds.in_parameters[val.data.parameter].value = parameters_obj_inP[val.data.parameter];
1496
- } else if (['live_preview', 'cms'].includes(_session.engine_mode)) {
1496
+ } else if (['live_preview', 'miniapp'].includes(_session.engine_mode)) {
1497
1497
  _ds.in_parameters[val.data.parameter].value = _session?.url_params?.[val.data.parameter];
1498
1498
  }
1499
1499
 
@@ -1515,7 +1515,7 @@ func.datasource.prepare = async function (SESSION_ID, prog_id, dataSourceNoP, pa
1515
1515
  _ds.data_system['SYS_GLOBAL_STR_SESSION_ID'] = SESSION_ID;
1516
1516
  _ds.data_system['SYS_GLOBAL_STR_LOGIN_USER_ID'] = _session.USR_OBJ._id;
1517
1517
 
1518
- if (!['live_preview', 'cms'].includes(_session.engine_mode) && PROJECT_OBJ[_session.app_id].info) {
1518
+ if (!['live_preview', 'miniapp'].includes(_session.engine_mode) && PROJECT_OBJ[_session.app_id].info) {
1519
1519
  _ds.data_system['SYS_GLOBAL_OBJ_APP_INFO'] = {
1520
1520
  build: PROJECT_OBJ[_session.app_id].info.build_id,
1521
1521
  author: PROJECT_OBJ[_session.app_id].info.author,
@@ -1784,18 +1784,9 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
1784
1784
  _ds.v.batch_loops = await get_limit();
1785
1785
  return false;
1786
1786
  }
1787
- // _ds.v.batch_loops =
1788
- // (await get_limit()) <= _ds.data_feed?.rows?.length
1789
- // ? await get_limit()
1790
- // : _ds?.data_feed?.rows?.length;
1791
1787
 
1792
1788
  _ds.v.batch_loops = (await get_limit()) <= _ds.v.raw_data?.rows?.length ? await get_limit() : _ds.v.raw_data?.rows?.length;
1793
1789
  return true;
1794
- // _ds.v.batch_loops =
1795
- // (await get_limit()) <= _ds.v?.raw_data?.rows?.length
1796
- // ? await get_limit()
1797
- // : _ds.v?.raw_data?.rows?.length;
1798
- // return true;
1799
1790
  };
1800
1791
 
1801
1792
  const render_api_output = async function () {
@@ -2167,16 +2158,6 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2167
2158
  return func.utils.debug_report(SESSION_ID, 'Data source', 'Datasource DB Table must be defined for Set Data operation', 'E');
2168
2159
  }
2169
2160
 
2170
- // const get_data_from_data_feed = function () {
2171
- // const rows = _ds?.data_feed?.rows || [];
2172
- // return rows.map((item) => ({
2173
- // id: item._ROWID,
2174
- // value: {
2175
- // ...item.value,
2176
- // },
2177
- // }));
2178
- // };
2179
-
2180
2161
  const find_ROWID_idx_from_raw_data_arr = function (rowId) {
2181
2162
  if (!_raw_data_rows) {
2182
2163
  throw new Error('_raw_data_rows not found');
@@ -2191,21 +2172,20 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2191
2172
 
2192
2173
  if (tree_obj.crudMode === 'U') {
2193
2174
  _ds.set_mode = 'U';
2194
- // _raw_data_rows = get_data_from_data_feed(); // _ds?.raw_data?.rows || [];
2175
+
2195
2176
  _raw_data_rows = _ds?.v.raw_data?.rows || [];
2196
2177
  }
2197
2178
 
2198
2179
  if (tree_obj.crudMode === 'D') {
2199
2180
  _ds.set_mode = 'D';
2200
- // _raw_data_rows = get_data_from_data_feed(); // _ds.raw_data?.rows || [];
2181
+
2201
2182
  _raw_data_rows = _ds?.v.raw_data?.rows || [];
2202
2183
  }
2203
2184
 
2204
2185
  // initiated with Update but no rows found
2205
- // if (tree_obj.crudMode === 'U' && tree_obj.allowCreate && !_ds?.data_feed?.rows?.length) {
2186
+
2206
2187
  if (tree_obj.crudMode === 'U' && tree_obj.allowCreate && !_raw_data_rows?.length) {
2207
2188
  _ds.set_mode = 'C';
2208
- // _raw_data_rows[glb.newRecord] = [{ _ROWID: "newRecord" }];
2209
2189
 
2210
2190
  try {
2211
2191
  const row_idx = find_ROWID_idx_from_raw_data_arr('newRecord');
@@ -2217,7 +2197,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2217
2197
 
2218
2198
  if (tree_obj.crudMode === 'C') {
2219
2199
  _ds.set_mode = 'C';
2220
- // _raw_data_rows[glb.newRecord] = [{ _ROWID: "newRecord" }];
2200
+
2221
2201
  try {
2222
2202
  const row_idx = find_ROWID_idx_from_raw_data_arr('newRecord');
2223
2203
  _raw_data_rows[row_idx] = [{ id: 'newRecord', value: {} }];
@@ -2250,7 +2230,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2250
2230
  if (dbMsgP) _ds.currentRecordId = dbMsgP.id;
2251
2231
  }
2252
2232
  }
2253
- // ret = await callback_datasource();
2233
+
2254
2234
  await func.datasource.set_outputField(SESSION_ID, dataSourceSession, _ds?.v?.raw_data?.rows, _ds.args);
2255
2235
  break;
2256
2236
  }
@@ -2272,25 +2252,6 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2272
2252
  }
2273
2253
 
2274
2254
  const row_not_found = async function () {
2275
- // if (!prog_obj.progDataSource?.dataSourceType || (tree_obj.rwMode === 'U' && tree_obj.allowCreate)) {
2276
- // _ds.currentRecordId = 'newRecord';
2277
- // _ds.set_mode = 'C';
2278
- // _ds.record_not_found = true;
2279
-
2280
- // try {
2281
- // const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
2282
- // } catch (error) {
2283
- // await func.datasource.render_fields_form(SESSION_ID, dataSourceSession, { id: 'newRecord', value: {} });
2284
- // }
2285
-
2286
- // var count = await func.datasource.get_field_init_count(SESSION_ID, dataSourceSession, 'newRecord', false);
2287
- // if (
2288
- // count > 0 // was: && !args.dataSourceNoP
2289
- // ) {
2290
- // await func.datasource.execute_field_init_events(SESSION_ID, dataSourceSession, 'form', 'newRecord');
2291
- // }
2292
- // }
2293
-
2294
2255
  if (!prog_obj.progDataSource?.dataSourceType || prog_obj.properties.renderType === 'form' || (tree_obj.rwMode === 'U' && tree_obj.allowCreate)) {
2295
2256
  _ds.currentRecordId = 'newRecord';
2296
2257
  if (tree_obj.rwMode === 'U' && tree_obj.allowCreate) {
@@ -2344,15 +2305,6 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2344
2305
  await func.datasource.execute_view_events(SESSION_ID, dataSourceSession, 'before_record');
2345
2306
  }
2346
2307
 
2347
- // await func.datasource.run_rows_form(
2348
- // SESSION_ID,
2349
- // dataSourceSession,
2350
- // idx,
2351
- // raw_data_row
2352
- // );
2353
-
2354
- ///////////////////////
2355
-
2356
2308
  _ds.currentRecordId = raw_data_row.id; // set temporary to allow expression decoder work
2357
2309
 
2358
2310
  await func.datasource.render_fields_form(SESSION_ID, dataSourceSession, raw_data_row);
@@ -2367,8 +2319,6 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2367
2319
  console.error(err);
2368
2320
  }
2369
2321
 
2370
- /////////////////////
2371
-
2372
2322
  if (await get_after_record_count()) {
2373
2323
  await func.datasource.execute_view_events(SESSION_ID, dataSourceSession, 'after_record');
2374
2324
  }
@@ -2684,10 +2634,10 @@ func.datasource.get_field_init_count = async function (SESSION_ID, dataSourceSes
2684
2634
  for await (const field_obj of _view_obj.progFields) {
2685
2635
  var fieldId = field_obj.data.field_id;
2686
2636
 
2687
- if (!field_obj?.triggers?.length) {
2637
+ if (!field_obj?.workflow?.length) {
2688
2638
  continue;
2689
2639
  }
2690
- for await (const trigger_obj of field_obj.triggers) {
2640
+ for await (const trigger_obj of field_obj.workflow) {
2691
2641
  if (oninit_triggers_to_runP && !oninit_triggers_to_runP?.includes(trigger_obj.id)) {
2692
2642
  continue;
2693
2643
  }
@@ -2778,8 +2728,8 @@ func.datasource.get_view_events_count = async function (SESSION_ID, dataSourceSe
2778
2728
  }
2779
2729
  }
2780
2730
 
2781
- if (_.isEmpty(event_obj.triggers)) continue;
2782
- for (const trigger_obj of event_obj.triggers) {
2731
+ if (_.isEmpty(event_obj.workflow)) continue;
2732
+ for (const trigger_obj of event_obj.workflow) {
2783
2733
  if (trigger_obj.data.enabled) {
2784
2734
  var expression;
2785
2735
  if (trigger_obj.props.condition) expression = trigger_obj.props.condition;
@@ -4005,7 +3955,7 @@ func.datasource.get_field_init_triggers_to_run = function (SESSION_ID, dataSourc
4005
3955
  if (!_ds) return;
4006
3956
 
4007
3957
  return []; // inactive 021617
4008
- }; // inactive temporary, design to execute init triggers when querying large datasets
3958
+ }; // inactive temporary, design to execute init workflow when querying large datasets
4009
3959
  func.datasource.get_pre_init_fields = function (SESSION_ID, dsSessionP, viewRangeExpP, viewSortExpP, viewGroupByExpP, viewLocateExpP) {
4010
3960
  var ret = [];
4011
3961
  return; // inactive 021617
@@ -4580,7 +4530,7 @@ func.utils.ws_worker.functions = {
4580
4530
  APP_OBJ[data.app_id] = data.APP_OBJ;
4581
4531
  PROJECT_OBJ[data.app_id] = data.PROJECT_OBJ;
4582
4532
 
4583
- if (['live_preview', 'cms'].includes(data.SESSION_INFO.engine_mode)) {
4533
+ if (['live_preview', 'miniapp'].includes(data.SESSION_INFO.engine_mode)) {
4584
4534
  DOCS_OBJ[data.app_id] = data.DOCS_OBJ;
4585
4535
  } else if (typeof IS_DOCKER === 'undefined' && typeof IS_PROCESS_SERVER === 'undefined') {
4586
4536
  if (!DOCS_OBJ[data.app_id]) {
@@ -6246,12 +6196,12 @@ func.events.validate = async function (SESSION_ID, triggerP, dsSessionP, eventId
6246
6196
  };
6247
6197
  const add_event = async function () {
6248
6198
  const _event = func.common.find_item_by_key_root(_view_obj.progEvents, 'id', val.id);
6249
- if (_event.triggers) {
6199
+ if (_event.workflow) {
6250
6200
  // check if event property exist
6251
6201
 
6252
- if (!_event.triggers || _.isEmpty(_event.triggers)) return;
6202
+ if (!_event.workflow || _.isEmpty(_event.workflow)) return;
6253
6203
  // check events has rows
6254
- for (const trigger_obj of _event.triggers) {
6204
+ for (const trigger_obj of _event.workflow) {
6255
6205
  //run events rows
6256
6206
  if (!trigger_obj.data.action) continue;
6257
6207
  if (!trigger_obj.data.enabled) continue;
@@ -6963,9 +6913,9 @@ func.events.execute = async function (
6963
6913
  const _view_obj = await func.utils.VIEWS_OBJ.get(SESSION_ID, _ds.prog_id);
6964
6914
  if (callingSourceP === 'grid' || callingSourceP === 'form') {
6965
6915
  let _field_obj = func.common.find_item_by_key(_view_obj.progFields, 'field_id', field_elm);
6966
- var event_name = _field_obj?.triggers?.[eventIdP].name.event;
6916
+ var event_name = _field_obj?.workflow?.[eventIdP].name.event;
6967
6917
 
6968
- if (_field_obj?.triggers?.[eventIdP].name?.properties['xu-exp:event']) {
6918
+ if (_field_obj?.workflow?.[eventIdP].name?.properties['xu-exp:event']) {
6969
6919
  event_name = (await func.expression.get(SESSION_ID, props[`xu-exp:event`], dsSession, 'event_name expression')).result;
6970
6920
  }
6971
6921
 
@@ -7620,7 +7570,7 @@ func.expression.get = async function (SESSION_ID, valP, dsSessionP, sourceP, row
7620
7570
  }
7621
7571
  if (typeof retP.value !== 'undefined') {
7622
7572
  var_Arr[key].type = retP.type;
7623
- var_Arr[key].value = typeof retP.value === 'string' && !retP.value.includes('<svg xmlns=') && retP.value.indexOf('\\') === -1 ? retP.value.replaceAll('"', '\\"') : retP.value; // new Apr 6 2025 fixing "\"how much?\""
7573
+ var_Arr[key].value = typeof retP.value === 'string' && !retP.value.includes('<svg xmlns=') && retP.value.indexOf('\\') === -1 && source !== 'UI Attr EXP' ? retP.value.replaceAll('"', '\\"') : retP.value; // new Apr 6 2025 fixing "\"how much?\"" // new Jul 29 25 to fix quil extra "\" " source!=="UI Attr EXP"
7624
7574
  if ((val.value.indexOf('[') > -1) | (val.value.indexOf('.') > -1)) {
7625
7575
  //get values from array '@var==="sss" && @var_B==="sss" && @obj.property===5 && @objA["value"]===123 | @objB["value"].property===1234'
7626
7576
  var data = retP.prop;