tango-app-api-audit 3.4.66 → 3.4.68

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/README.md CHANGED
@@ -1,29 +1,29 @@
1
- # README #
2
-
3
- This README would normally document whatever steps are necessary to get your application up and running.
4
-
5
- ### What is this repository for? ###
6
-
7
- * Quick summary
8
- * Version
9
- * [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo)
10
-
11
- ### How do I get set up? ###
12
-
13
- * Summary of set up
14
- * Configuration
15
- * Dependencies
16
- * Database configuration
17
- * How to run tests
18
- * Deployment instructions
19
-
20
- ### Contribution guidelines ###
21
-
22
- * Writing tests
23
- * Code review
24
- * Other guidelines
25
-
26
- ### Who do I talk to? ###
27
-
28
- * Repo owner or admin
1
+ # README #
2
+
3
+ This README would normally document whatever steps are necessary to get your application up and running.
4
+
5
+ ### What is this repository for? ###
6
+
7
+ * Quick summary
8
+ * Version
9
+ * [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo)
10
+
11
+ ### How do I get set up? ###
12
+
13
+ * Summary of set up
14
+ * Configuration
15
+ * Dependencies
16
+ * Database configuration
17
+ * How to run tests
18
+ * Deployment instructions
19
+
20
+ ### Contribution guidelines ###
21
+
22
+ * Writing tests
23
+ * Code review
24
+ * Other guidelines
25
+
26
+ ### Who do I talk to? ###
27
+
28
+ * Repo owner or admin
29
29
  * Other community or team contact
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-audit",
3
- "version": "3.4.66",
3
+ "version": "3.4.68",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1739,6 +1739,26 @@ export async function saveBinary( req, res ) {
1739
1739
  } else {
1740
1740
  await insertOpenSearchData( openSearch.traxDetectionOutput, anomalyOutput );
1741
1741
  }
1742
+ if ( inputData.answer==='approved' ) {
1743
+ let usersList=JSON.parse( process.env.SES );
1744
+ let emails =usersList.suspeciousEmails.split( ',' );
1745
+
1746
+ for ( let user of emails ) {
1747
+ let notificationData= {
1748
+ 'title': 'Suspecious Activity Detected',
1749
+ 'description': `${getData?.sqs?.Body?.zone_name} at ${getStore2?.storeName}- Immediate action required`,
1750
+ 'storeId': inputData.storeId,
1751
+ 'type': 'suspiciousactivity',
1752
+ 'date': inputData.fileDate,
1753
+ 'clientId': req.userAudit?.clientId,
1754
+ 'email': user,
1755
+ };
1756
+ await axios.post( `${url.apiDomain}/v3/trax/internalAPI/sendAiPushNotification`, notificationData, { headers: {
1757
+ 'Content-Type': 'application/json',
1758
+ 'Authorization': 'Bearer d47433f8-9a33-47c7-ba43-1a0fbac28f55' },
1759
+ } );
1760
+ }
1761
+ }
1742
1762
 
1743
1763
  const logData4 = {
1744
1764
  userId: req.user._id,