@xuda.io/runtime-bundle 1.0.677 → 1.0.679

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.
@@ -1975,6 +1975,16 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
1975
1975
  filterModelUserSql: _ds.progDataSource.filterModelUserSql,
1976
1976
  };
1977
1977
 
1978
+ let _dataSourceFilterModelType = _ds?.progDataSource?.dataSourceFilterModelType;
1979
+
1980
+ if (ds?.progDataSource?.dataSourceFilterModelTypeFx) {
1981
+ const fx_ret = await func.expression.get(SESSION_ID, _ds.progDataSource.dataSourceFilterModelTypeFx, dataSourceSession, 'query');
1982
+ _dataSourceFilterModelType = fx_ret.result;
1983
+ }
1984
+ if (!['query', 'index'].includes(_dataSourceFilterModelType)) {
1985
+ return func.utils.debug_report(SESSION_ID, 'Data source', `Valid values for dataSourceFilterModelType are: "query" or "index" (${_dataSourceFilterModelType})`, 'E');
1986
+ }
1987
+
1978
1988
  _ds.v.raw_data = await func.db.get_query(
1979
1989
  SESSION_ID,
1980
1990
  _ds._dataSourceTableId,
@@ -1990,27 +2000,11 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
1990
2000
  _ds?.progDataSource?.sortModel,
1991
2001
  null,
1992
2002
  filterModel,
1993
- _ds?.progDataSource?.dataSourceFilterModelType,
2003
+ _dataSourceFilterModelType,
1994
2004
  );
1995
2005
 
1996
2006
  if (_ds?.progDataSource?.dataSourceLimit) {
1997
- const ret_rows_found = await func.db.get_query(
1998
- SESSION_ID,
1999
- _ds._dataSourceTableId,
2000
- _ds.v.couchView,
2001
- dataSourceSession,
2002
- _ds.viewSourceDesc,
2003
- 'datasource table',
2004
- prog_obj.progDataSource.dataSourceReduce,
2005
- null,
2006
- null,
2007
- true,
2008
- null,
2009
- null,
2010
- null,
2011
- filterModel,
2012
- _ds?.progDataSource?.dataSourceFilterModelType,
2013
- );
2007
+ 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);
2014
2008
  _ds.rows_found = ret_rows_found?.rows?.[0]?.value || 0;
2015
2009
  } else {
2016
2010
  _ds.rows_found = _ds?.v?.raw_data?.rows?.length || 0;
@@ -1975,6 +1975,16 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
1975
1975
  filterModelUserSql: _ds.progDataSource.filterModelUserSql,
1976
1976
  };
1977
1977
 
1978
+ let _dataSourceFilterModelType = _ds?.progDataSource?.dataSourceFilterModelType;
1979
+
1980
+ if (ds?.progDataSource?.dataSourceFilterModelTypeFx) {
1981
+ const fx_ret = await func.expression.get(SESSION_ID, _ds.progDataSource.dataSourceFilterModelTypeFx, dataSourceSession, 'query');
1982
+ _dataSourceFilterModelType = fx_ret.result;
1983
+ }
1984
+ if (!['query', 'index'].includes(_dataSourceFilterModelType)) {
1985
+ return func.utils.debug_report(SESSION_ID, 'Data source', `Valid values for dataSourceFilterModelType are: "query" or "index" (${_dataSourceFilterModelType})`, 'E');
1986
+ }
1987
+
1978
1988
  _ds.v.raw_data = await func.db.get_query(
1979
1989
  SESSION_ID,
1980
1990
  _ds._dataSourceTableId,
@@ -1990,27 +2000,11 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
1990
2000
  _ds?.progDataSource?.sortModel,
1991
2001
  null,
1992
2002
  filterModel,
1993
- _ds?.progDataSource?.dataSourceFilterModelType,
2003
+ _dataSourceFilterModelType,
1994
2004
  );
1995
2005
 
1996
2006
  if (_ds?.progDataSource?.dataSourceLimit) {
1997
- const ret_rows_found = await func.db.get_query(
1998
- SESSION_ID,
1999
- _ds._dataSourceTableId,
2000
- _ds.v.couchView,
2001
- dataSourceSession,
2002
- _ds.viewSourceDesc,
2003
- 'datasource table',
2004
- prog_obj.progDataSource.dataSourceReduce,
2005
- null,
2006
- null,
2007
- true,
2008
- null,
2009
- null,
2010
- null,
2011
- filterModel,
2012
- _ds?.progDataSource?.dataSourceFilterModelType,
2013
- );
2007
+ 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);
2014
2008
  _ds.rows_found = ret_rows_found?.rows?.[0]?.value || 0;
2015
2009
  } else {
2016
2010
  _ds.rows_found = _ds?.v?.raw_data?.rows?.length || 0;