@xuda.io/runtime-bundle 1.0.677 → 1.0.678

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.
@@ -3599,6 +3599,16 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
3599
3599
  filterModelUserSql: _ds.progDataSource.filterModelUserSql,
3600
3600
  };
3601
3601
 
3602
+ let _dataSourceFilterModelType = ds?.progDataSource?.dataSourceFilterModelType;
3603
+
3604
+ if (ds?.progDataSource?.dataSourceFilterModelTypeFx) {
3605
+ const fx_ret = await func.expression.get(SESSION_ID, _ds.progDataSource.dataSourceFilterModelTypeFx, dataSourceSession, 'query');
3606
+ _dataSourceFilterModelType = fx_ret.result;
3607
+ }
3608
+ if (!['query', 'index'].includes(_dataSourceFilterModelType)) {
3609
+ return func.utils.debug_report(SESSION_ID, 'Data source', `Valid values for dataSourceFilterModelType are: "query" or "index" (${_dataSourceFilterModelType})`, 'E');
3610
+ }
3611
+
3602
3612
  _ds.v.raw_data = await func.db.get_query(
3603
3613
  SESSION_ID,
3604
3614
  _ds._dataSourceTableId,
@@ -3614,27 +3624,11 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
3614
3624
  _ds?.progDataSource?.sortModel,
3615
3625
  null,
3616
3626
  filterModel,
3617
- _ds?.progDataSource?.dataSourceFilterModelType,
3627
+ _dataSourceFilterModelType,
3618
3628
  );
3619
3629
 
3620
3630
  if (_ds?.progDataSource?.dataSourceLimit) {
3621
- const ret_rows_found = await func.db.get_query(
3622
- SESSION_ID,
3623
- _ds._dataSourceTableId,
3624
- _ds.v.couchView,
3625
- dataSourceSession,
3626
- _ds.viewSourceDesc,
3627
- 'datasource table',
3628
- prog_obj.progDataSource.dataSourceReduce,
3629
- null,
3630
- null,
3631
- true,
3632
- null,
3633
- null,
3634
- null,
3635
- filterModel,
3636
- _ds?.progDataSource?.dataSourceFilterModelType,
3637
- );
3631
+ const ret_rows_found = await func.db.get_query(SESSION_ID, _ds._dataSourceTableId, _ds.v.couchView, dataSourceSession, _ds.viewSourceDesc, 'datasource table', prog_obj.progDataSource.dataSourceReduce, null, null, true, null, null, null, filterModel, _dataSourceFilterModelType);
3638
3632
  _ds.rows_found = ret_rows_found?.rows?.[0]?.value || 0;
3639
3633
  } else {
3640
3634
  _ds.rows_found = _ds?.v?.raw_data?.rows?.length || 0;
@@ -3600,6 +3600,16 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
3600
3600
  filterModelUserSql: _ds.progDataSource.filterModelUserSql,
3601
3601
  };
3602
3602
 
3603
+ let _dataSourceFilterModelType = ds?.progDataSource?.dataSourceFilterModelType;
3604
+
3605
+ if (ds?.progDataSource?.dataSourceFilterModelTypeFx) {
3606
+ const fx_ret = await func.expression.get(SESSION_ID, _ds.progDataSource.dataSourceFilterModelTypeFx, dataSourceSession, 'query');
3607
+ _dataSourceFilterModelType = fx_ret.result;
3608
+ }
3609
+ if (!['query', 'index'].includes(_dataSourceFilterModelType)) {
3610
+ return func.utils.debug_report(SESSION_ID, 'Data source', `Valid values for dataSourceFilterModelType are: "query" or "index" (${_dataSourceFilterModelType})`, 'E');
3611
+ }
3612
+
3603
3613
  _ds.v.raw_data = await func.db.get_query(
3604
3614
  SESSION_ID,
3605
3615
  _ds._dataSourceTableId,
@@ -3615,27 +3625,11 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
3615
3625
  _ds?.progDataSource?.sortModel,
3616
3626
  null,
3617
3627
  filterModel,
3618
- _ds?.progDataSource?.dataSourceFilterModelType,
3628
+ _dataSourceFilterModelType,
3619
3629
  );
3620
3630
 
3621
3631
  if (_ds?.progDataSource?.dataSourceLimit) {
3622
- const ret_rows_found = await func.db.get_query(
3623
- SESSION_ID,
3624
- _ds._dataSourceTableId,
3625
- _ds.v.couchView,
3626
- dataSourceSession,
3627
- _ds.viewSourceDesc,
3628
- 'datasource table',
3629
- prog_obj.progDataSource.dataSourceReduce,
3630
- null,
3631
- null,
3632
- true,
3633
- null,
3634
- null,
3635
- null,
3636
- filterModel,
3637
- _ds?.progDataSource?.dataSourceFilterModelType,
3638
- );
3632
+ const ret_rows_found = await func.db.get_query(SESSION_ID, _ds._dataSourceTableId, _ds.v.couchView, dataSourceSession, _ds.viewSourceDesc, 'datasource table', prog_obj.progDataSource.dataSourceReduce, null, null, true, null, null, null, filterModel, _dataSourceFilterModelType);
3639
3633
  _ds.rows_found = ret_rows_found?.rows?.[0]?.value || 0;
3640
3634
  } else {
3641
3635
  _ds.rows_found = _ds?.v?.raw_data?.rows?.length || 0;