@xuda.io/runtime-bundle 1.0.885 → 1.0.887

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.
@@ -99,53 +99,12 @@ glb.API_OUTPUT_ARR = ['json', 'html', 'xml', 'text', 'css', 'javascript'];
99
99
 
100
100
  const PROTECTED_NAMES_ARR = ['THIS', 'ROWID']; //tbd
101
101
 
102
- // func.common.get_custom_icon = async function (
103
- // SESSION_ID,
104
- // menuIdP,
105
- // fromTreeP,
106
- // get_image_onlyP
107
- // ) {
108
- // var ret = "";
109
- // var iconItemId;
110
- // let tree_ret = await func.utils.TREE_OBJ.get(SESSION_ID, menuIdP);
111
- // if (tree_ret) {
112
- // if (tree_ret.menuType === "icon") {
113
- // iconItemId = menuIdP;
114
- // } else {
115
- // if (tree_ret.rICN) iconItemId = tree_ret.rICN;
116
- // }
117
- // if (iconItemId) {
118
- // let tree_ret2 = await func.utils.TREE_OBJ.get(SESSION_ID, iconItemId);
119
- // if (tree_ret2) {
120
- // if (get_image_onlyP) {
121
- // return tree_ret2.rPTH;
122
- // } else {
123
- // const app_obj = APP_OBJ[SESSION_OBJ[SESSION_ID].app_id];
124
- // const url = func.common.get_url(
125
- // SESSION_ID,
126
- // "studio-drive",
127
- // `${app_obj.app_replicate ? app_obj.app_replicate : app_obj._id}/${
128
- // tree_ret2.rPTH
129
- // }`
130
- // );
131
- // return url;
132
- // }
133
- // // }
134
- // } else {
135
- // return ret;
136
- // }
137
- // } else {
138
- // return ret;
139
- // }
140
- // } else return ret;
141
- // };
142
-
143
102
  func.common.db = async function (SESSION_ID, serviceP, dataP, opt = {}, dsSession) {
144
103
  return new Promise(async function (resolve, reject) {
145
104
  var _session = SESSION_OBJ[SESSION_ID];
146
105
  const app_id = _session.app_id;
147
106
 
148
- if (_session.engine_mode === 'live_preview') {
107
+ if (glb.DEBUG_MODE) {
149
108
  console.log('request', dataP);
150
109
  }
151
110
 
@@ -180,7 +139,7 @@ func.common.db = async function (SESSION_ID, serviceP, dataP, opt = {}, dsSessio
180
139
  });
181
140
  }
182
141
 
183
- if (_session.engine_mode === 'live_preview') {
142
+ if (glb.DEBUG_MODE) {
184
143
  console.log('response', ret);
185
144
  }
186
145
  resolve(ret, true);
@@ -762,9 +721,9 @@ func.common.get_module = async function (SESSION_ID, module, paramsP = {}) {
762
721
  }
763
722
  if (_session.worker_type === 'Debug') {
764
723
  if (typeof IS_DOCKER !== 'undefined' || typeof IS_PROCESS_SERVER !== 'undefined') {
765
- ret = await get_ret(func.utils.get_resource_filename(SESSION_OBJ[SESSION_ID].engine_mode === 'live_preview' ? '' : SESSION_OBJ[SESSION_ID]?.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', 'cms'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, `${_conf.xuda_home}root/dist/runtime/js/modules/` + module));
766
725
  } else {
767
- ret = await get_ret(func.common.get_url(SESSION_ID, 'dist', func.utils.get_resource_filename(SESSION_OBJ[SESSION_ID].engine_mode === 'live_preview' ? '' : SESSION_OBJ[SESSION_ID]?.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', 'cms'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, 'runtime/js/modules/' + module)));
768
727
  }
769
728
 
770
729
  return ret;
@@ -775,9 +734,9 @@ func.common.get_module = async function (SESSION_ID, module, paramsP = {}) {
775
734
  };
776
735
 
777
736
  if (typeof IS_DOCKER !== 'undefined' || typeof IS_PROCESS_SERVER !== 'undefined') {
778
- ret = await get_ret(func.utils.get_resource_filename(SESSION_OBJ[SESSION_ID].engine_mode === 'live_preview' ? '' : SESSION_OBJ[SESSION_ID]?.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', 'cms'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, `${_conf.xuda_home}root/dist/runtime/js/modules/` + rep()));
779
738
  } else {
780
- ret = await get_ret(func.common.get_url(SESSION_ID, 'dist', func.utils.get_resource_filename(SESSION_OBJ[SESSION_ID].engine_mode === 'live_preview' ? '' : SESSION_OBJ[SESSION_ID]?.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', 'cms'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, 'runtime/js/modules/' + rep())));
781
740
  }
782
741
 
783
742
  return ret;
@@ -1358,7 +1317,7 @@ func.datasource.create = async function (
1358
1317
 
1359
1318
  var run_at = _prog_obj?.properties?.runAt;
1360
1319
 
1361
- if (_session.engine_mode !== 'live_preview') {
1320
+ if (!['live_preview', 'cms'].includes(_session.engine_mode)) {
1362
1321
  if (_session.opt.app_computing_mode === 'main') {
1363
1322
  run_at = 'client';
1364
1323
  }
@@ -1534,7 +1493,7 @@ func.datasource.prepare = async function (SESSION_ID, prog_id, dataSourceNoP, pa
1534
1493
 
1535
1494
  if (typeof parameters_obj_inP?.[val.data.parameter] !== 'undefined') {
1536
1495
  _ds.in_parameters[val.data.parameter].value = parameters_obj_inP[val.data.parameter];
1537
- } else if (_session.engine_mode === 'live_preview') {
1496
+ } else if (['live_preview', 'cms'].includes(_session.engine_mode)) {
1538
1497
  _ds.in_parameters[val.data.parameter].value = _session?.url_params?.[val.data.parameter];
1539
1498
  }
1540
1499
 
@@ -1556,7 +1515,7 @@ func.datasource.prepare = async function (SESSION_ID, prog_id, dataSourceNoP, pa
1556
1515
  _ds.data_system['SYS_GLOBAL_STR_SESSION_ID'] = SESSION_ID;
1557
1516
  _ds.data_system['SYS_GLOBAL_STR_LOGIN_USER_ID'] = _session.USR_OBJ._id;
1558
1517
 
1559
- if (_session.engine_mode !== 'live_preview' && PROJECT_OBJ[_session.app_id].info) {
1518
+ if (!['live_preview', 'cms'].includes(_session.engine_mode) && PROJECT_OBJ[_session.app_id].info) {
1560
1519
  _ds.data_system['SYS_GLOBAL_OBJ_APP_INFO'] = {
1561
1520
  build: PROJECT_OBJ[_session.app_id].info.build_id,
1562
1521
  author: PROJECT_OBJ[_session.app_id].info.author,
@@ -4621,7 +4580,7 @@ func.utils.ws_worker.functions = {
4621
4580
  APP_OBJ[data.app_id] = data.APP_OBJ;
4622
4581
  PROJECT_OBJ[data.app_id] = data.PROJECT_OBJ;
4623
4582
 
4624
- if (data.SESSION_INFO.engine_mode === 'live_preview') {
4583
+ if (['live_preview', 'cms'].includes(data.SESSION_INFO.engine_mode)) {
4625
4584
  DOCS_OBJ[data.app_id] = data.DOCS_OBJ;
4626
4585
  } else if (typeof IS_DOCKER === 'undefined' && typeof IS_PROCESS_SERVER === 'undefined') {
4627
4586
  if (!DOCS_OBJ[data.app_id]) {
@@ -99,53 +99,12 @@ glb.API_OUTPUT_ARR = ['json', 'html', 'xml', 'text', 'css', 'javascript'];
99
99
 
100
100
  const PROTECTED_NAMES_ARR = ['THIS', 'ROWID']; //tbd
101
101
 
102
- // func.common.get_custom_icon = async function (
103
- // SESSION_ID,
104
- // menuIdP,
105
- // fromTreeP,
106
- // get_image_onlyP
107
- // ) {
108
- // var ret = "";
109
- // var iconItemId;
110
- // let tree_ret = await func.utils.TREE_OBJ.get(SESSION_ID, menuIdP);
111
- // if (tree_ret) {
112
- // if (tree_ret.menuType === "icon") {
113
- // iconItemId = menuIdP;
114
- // } else {
115
- // if (tree_ret.rICN) iconItemId = tree_ret.rICN;
116
- // }
117
- // if (iconItemId) {
118
- // let tree_ret2 = await func.utils.TREE_OBJ.get(SESSION_ID, iconItemId);
119
- // if (tree_ret2) {
120
- // if (get_image_onlyP) {
121
- // return tree_ret2.rPTH;
122
- // } else {
123
- // const app_obj = APP_OBJ[SESSION_OBJ[SESSION_ID].app_id];
124
- // const url = func.common.get_url(
125
- // SESSION_ID,
126
- // "studio-drive",
127
- // `${app_obj.app_replicate ? app_obj.app_replicate : app_obj._id}/${
128
- // tree_ret2.rPTH
129
- // }`
130
- // );
131
- // return url;
132
- // }
133
- // // }
134
- // } else {
135
- // return ret;
136
- // }
137
- // } else {
138
- // return ret;
139
- // }
140
- // } else return ret;
141
- // };
142
-
143
102
  func.common.db = async function (SESSION_ID, serviceP, dataP, opt = {}, dsSession) {
144
103
  return new Promise(async function (resolve, reject) {
145
104
  var _session = SESSION_OBJ[SESSION_ID];
146
105
  const app_id = _session.app_id;
147
106
 
148
- if (_session.engine_mode === 'live_preview') {
107
+ if (glb.DEBUG_MODE) {
149
108
  console.log('request', dataP);
150
109
  }
151
110
 
@@ -180,7 +139,7 @@ func.common.db = async function (SESSION_ID, serviceP, dataP, opt = {}, dsSessio
180
139
  });
181
140
  }
182
141
 
183
- if (_session.engine_mode === 'live_preview') {
142
+ if (glb.DEBUG_MODE) {
184
143
  console.log('response', ret);
185
144
  }
186
145
  resolve(ret, true);
@@ -762,9 +721,9 @@ func.common.get_module = async function (SESSION_ID, module, paramsP = {}) {
762
721
  }
763
722
  if (_session.worker_type === 'Debug') {
764
723
  if (typeof IS_DOCKER !== 'undefined' || typeof IS_PROCESS_SERVER !== 'undefined') {
765
- ret = await get_ret(func.utils.get_resource_filename(SESSION_OBJ[SESSION_ID].engine_mode === 'live_preview' ? '' : SESSION_OBJ[SESSION_ID]?.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', 'cms'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, `${_conf.xuda_home}root/dist/runtime/js/modules/` + module));
766
725
  } else {
767
- ret = await get_ret(func.common.get_url(SESSION_ID, 'dist', func.utils.get_resource_filename(SESSION_OBJ[SESSION_ID].engine_mode === 'live_preview' ? '' : SESSION_OBJ[SESSION_ID]?.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', 'cms'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, 'runtime/js/modules/' + module)));
768
727
  }
769
728
 
770
729
  return ret;
@@ -775,9 +734,9 @@ func.common.get_module = async function (SESSION_ID, module, paramsP = {}) {
775
734
  };
776
735
 
777
736
  if (typeof IS_DOCKER !== 'undefined' || typeof IS_PROCESS_SERVER !== 'undefined') {
778
- ret = await get_ret(func.utils.get_resource_filename(SESSION_OBJ[SESSION_ID].engine_mode === 'live_preview' ? '' : SESSION_OBJ[SESSION_ID]?.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', 'cms'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, `${_conf.xuda_home}root/dist/runtime/js/modules/` + rep()));
779
738
  } else {
780
- ret = await get_ret(func.common.get_url(SESSION_ID, 'dist', func.utils.get_resource_filename(SESSION_OBJ[SESSION_ID].engine_mode === 'live_preview' ? '' : SESSION_OBJ[SESSION_ID]?.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', 'cms'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, 'runtime/js/modules/' + rep())));
781
740
  }
782
741
 
783
742
  return ret;
@@ -1358,7 +1317,7 @@ func.datasource.create = async function (
1358
1317
 
1359
1318
  var run_at = _prog_obj?.properties?.runAt;
1360
1319
 
1361
- if (_session.engine_mode !== 'live_preview') {
1320
+ if (!['live_preview', 'cms'].includes(_session.engine_mode)) {
1362
1321
  if (_session.opt.app_computing_mode === 'main') {
1363
1322
  run_at = 'client';
1364
1323
  }
@@ -1534,7 +1493,7 @@ func.datasource.prepare = async function (SESSION_ID, prog_id, dataSourceNoP, pa
1534
1493
 
1535
1494
  if (typeof parameters_obj_inP?.[val.data.parameter] !== 'undefined') {
1536
1495
  _ds.in_parameters[val.data.parameter].value = parameters_obj_inP[val.data.parameter];
1537
- } else if (_session.engine_mode === 'live_preview') {
1496
+ } else if (['live_preview', 'cms'].includes(_session.engine_mode)) {
1538
1497
  _ds.in_parameters[val.data.parameter].value = _session?.url_params?.[val.data.parameter];
1539
1498
  }
1540
1499
 
@@ -1556,7 +1515,7 @@ func.datasource.prepare = async function (SESSION_ID, prog_id, dataSourceNoP, pa
1556
1515
  _ds.data_system['SYS_GLOBAL_STR_SESSION_ID'] = SESSION_ID;
1557
1516
  _ds.data_system['SYS_GLOBAL_STR_LOGIN_USER_ID'] = _session.USR_OBJ._id;
1558
1517
 
1559
- if (_session.engine_mode !== 'live_preview' && PROJECT_OBJ[_session.app_id].info) {
1518
+ if (!['live_preview', 'cms'].includes(_session.engine_mode) && PROJECT_OBJ[_session.app_id].info) {
1560
1519
  _ds.data_system['SYS_GLOBAL_OBJ_APP_INFO'] = {
1561
1520
  build: PROJECT_OBJ[_session.app_id].info.build_id,
1562
1521
  author: PROJECT_OBJ[_session.app_id].info.author,
@@ -4621,7 +4580,7 @@ func.utils.ws_worker.functions = {
4621
4580
  APP_OBJ[data.app_id] = data.APP_OBJ;
4622
4581
  PROJECT_OBJ[data.app_id] = data.PROJECT_OBJ;
4623
4582
 
4624
- if (data.SESSION_INFO.engine_mode === 'live_preview') {
4583
+ if (['live_preview', 'cms'].includes(data.SESSION_INFO.engine_mode)) {
4625
4584
  DOCS_OBJ[data.app_id] = data.DOCS_OBJ;
4626
4585
  } else if (typeof IS_DOCKER === 'undefined' && typeof IS_PROCESS_SERVER === 'undefined') {
4627
4586
  if (!DOCS_OBJ[data.app_id]) {