tango-app-api-audit 3.6.32 → 3.6.34

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-audit",
3
- "version": "3.6.32",
3
+ "version": "3.6.34",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -2225,9 +2225,6 @@ export async function summaryList( req, res ) {
2225
2225
  {
2226
2226
  isActive: true,
2227
2227
  },
2228
- {
2229
- role: { $eq: 'admin' },
2230
- },
2231
2228
  ],
2232
2229
  },
2233
2230
  },
@@ -2604,8 +2601,6 @@ export async function emailAlertLog( req, res ) {
2604
2601
 
2605
2602
  let search = {
2606
2603
  'must': filter,
2607
- 'should': [],
2608
- 'minimum_should_match': 1,
2609
2604
  };
2610
2605
  if ( inputData.searchValue && inputData.searchValue !== '' ) {
2611
2606
  search ={
@@ -2668,27 +2663,39 @@ export async function emailAlertLog( req, res ) {
2668
2663
  },
2669
2664
  },
2670
2665
  ],
2671
-
2666
+ 'minimum_should_match': 1,
2672
2667
 
2673
2668
  };
2674
2669
  }
2675
2670
 
2676
2671
  if ( inputData.RMList && inputData.RMList?.length > 0 ) {
2677
- const shouldRMQuery =inputData.RMList.map( ( email ) => ( {
2678
- wildcard: {
2679
- 'RMEmail.keyword': `*${email}*`,
2680
- },
2681
- } ) );
2682
- search['should'].push( ...shouldRMQuery );
2672
+ filter.push(
2673
+ {
2674
+ bool: {
2675
+ should: inputData.RMList.map( ( email ) => ( {
2676
+ wildcard: {
2677
+ 'RMEmail.keyword': `*${email}*`,
2678
+ },
2679
+ } ) ),
2680
+ minimum_should_match: 1, // at least one should match
2681
+ },
2682
+ },
2683
+ );
2683
2684
  }
2684
2685
 
2685
2686
  if ( inputData.cluster && inputData.cluster?.length > 0 ) {
2686
- const shouldClusterQuery =inputData?.cluster?.map( ( cluster ) => ( {
2687
- wildcard: {
2688
- 'RMEmail.keyword': `*${cluster}*`,
2689
- },
2690
- } ) );
2691
- search['should'].push( ...shouldClusterQuery );
2687
+ filter.push(
2688
+ {
2689
+ bool: {
2690
+ should: inputData.cluster.map( ( cluster ) => ( {
2691
+ wildcard: {
2692
+ 'cluster.keyword': `*${cluster}*`,
2693
+ },
2694
+ } ) ),
2695
+ minimum_should_match: 1, // at least one should match
2696
+ },
2697
+ },
2698
+ );
2692
2699
  }
2693
2700
  const getQuery = {
2694
2701
  'size': inputData.isExport == true? 50000 : inputData?.limit || 10,