tango-app-api-client 3.3.3-beta.16 → 3.3.3-beta.17

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-client",
3
- "version": "3.3.3-beta.16",
3
+ "version": "3.3.3-beta.17",
4
4
  "description": "client",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1249,7 +1249,7 @@ export async function auditConfiguration( req, res ) {
1249
1249
  eventType: 'update',
1250
1250
  showTo: [ 'tango' ],
1251
1251
  changes: [ `Audit config for client id ${req.params?.id}` ],
1252
- previous: previousClient,
1252
+ previous: previousClient.auditConfigs,
1253
1253
  current: {
1254
1254
  clientId: req.params?.id,
1255
1255
  count: inputData.count,
@@ -2107,7 +2107,6 @@ export async function getActivityLogs( req, res ) {
2107
2107
  const logSubType =hit?._source?.logSubType;
2108
2108
  respo = findDifferences( previous, current, logType, logSubType );
2109
2109
  hit._source.updatedValue = respo;
2110
- // Object.keys( respo ).length === 0?null:
2111
2110
  temp.push( hit?._source );
2112
2111
  hit._source.changes =logSubType === 'ticketConfig'? Object.keys( respo ).map( ( item ) => item ) : hit._source.changes;
2113
2112
  } else {
@@ -2159,6 +2158,9 @@ function findDifferences( previous, current, logType, logSubType, path = '' ) {
2159
2158
  differences[`${path}${key}`] = { previous: prevValue.length> 0 ? prevValue.join( ',' ): null, current: currValue.length > 0? currValue.join( ',' ): null } : null;
2160
2159
 
2161
2160
  // differences[`${path}${key}`] = { previous: removed.length> 0 ? prevValue.join( ',' ): prevValue.join( ', ' ) :, current: added.length > 0? addedUsers.join( ', ' ) : currValue.join( ',' ) } : null;
2161
+ } else {
2162
+ const nestedDiffs = findDifferences( prevValue, currValue, logType, logSubType, `${path}${key}.` );
2163
+ Object.assign( differences, nestedDiffs );
2162
2164
  }
2163
2165
  } else {
2164
2166
  const nestedDiffs = findDifferences( prevValue, currValue, logType, logSubType, `${path}${key}.` );
@@ -2191,7 +2193,7 @@ function findDifferences( previous, current, logType, logSubType, path = '' ) {
2191
2193
  if ( userFriendlyKey ) {
2192
2194
  newKey = userFriendlyKey;
2193
2195
  }
2194
- const binaryKeys = [ 'Two Factor Authentication', 'Mat Enabled', 'Audit', 'Infra Email Alert', 'Ip Whitelist', 'Excluded Area', 'Passer-by data', 'Normalized data during downtime', 'Billing', 'Camera Blurring', 'Footfall Directory', 'Footfall Directory Audit', 'Footfall Directory Limit', 'NOB Status', 'Traffic', 'Trax', 'Zone V1', 'Zone V2', 'Reports', 'Analyze' ];
2196
+ const binaryKeys = [ 'Two Factor Authentication', 'Mat Enabled', 'Audit Status', 'Infra Email Alert', 'Ip Whitelist', 'Excluded Area', 'Passer-by data', 'Normalized data during downtime', 'Billing', 'Camera Blurring', 'Footfall Directory', 'Footfall Directory Audit', 'Footfall Directory Limit', 'NOB Status', 'Traffic', 'Trax', 'Zone V1', 'Zone V2', 'Reports', 'Analyze' ];
2195
2197
  if ( binaryKeys.includes( newKey ) ) {
2196
2198
  diff.previous = ( diff.previous == true || diff.previous == 'Enabled' ) ? 'Enabled' : 'Disabled';
2197
2199
  diff.current = ( diff.current == true || diff.current == 'Enabled' ) ? 'Enabled' : 'Disabled';
@@ -2327,7 +2329,7 @@ export async function clientCsmAssignAction( req, res ) {
2327
2329
 
2328
2330
  function compareArrayObjects( prevArray, currArray ) {
2329
2331
  let changes = {};
2330
- logger.info( { prevArray: prevArray, currArray: currArray } );
2332
+ // logger.info( { prevArray: prevArray, currArray: currArray } );
2331
2333
  // Find the longest array length to avoid index mismatch
2332
2334
  let maxLength = Math.max( prevArray.length, currArray.length );
2333
2335