tango-app-api-client 3.4.0-beta.5 → 3.4.0-beta.6

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.4.0-beta.5",
3
+ "version": "3.4.0-beta.6",
4
4
  "description": "client",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -27,7 +27,7 @@
27
27
  "npm": "^10.9.1",
28
28
  "swagger-ui-express": "^5.0.0",
29
29
  "tango-api-schema": "^2.2.59",
30
- "tango-app-api-middleware": "^3.1.60",
30
+ "tango-app-api-middleware": "^3.1.67",
31
31
  "winston": "^3.11.0",
32
32
  "winston-daily-rotate-file": "^5.0.0"
33
33
  },
@@ -1187,22 +1187,22 @@ export async function updateFeatureConfiguration( req, res ) {
1187
1187
  InfraAlertValue: postData?.featureConfigs?.infraAlert?.value,
1188
1188
  InfraAlertCondition: postData?.featureConfigs?.infraAlert?.condition,
1189
1189
  ConversionCalculations: postData?.featureConfigs?.conversionCalculation,
1190
- ExcludedArea: postData?.featureConfigs?.isExcludedArea ==true ? 'Enable': 'Disable',
1191
- PasserBydata: postData?.featureConfigs?.isPasserByData ==true ? 'Enable': 'Disable',
1192
- NormalizedDataDuringDowntime: postData?.featureConfigs?.isNormalized ==true ? 'Enable': 'Disable',
1193
- Billing: postData?.featureConfigs?.isbillingDisabled ==true ? 'Enable': 'Disable',
1194
- CameraBlurring: postData?.featureConfigs?.isCameraDisabled ==true ? 'Enable': 'Disable',
1195
- FootfallDirectory: postData?.featureConfigs?.isFootfallDirectory ==true ? 'Enable': 'Disable',
1196
- NOBStatus: postData?.featureConfigs?.isNOB ==true ? 'Enable': 'Disable',
1197
- EnableAnalyze: postData?.featureConfigs?.isNewDashboard ==true ? 'Enable': 'Disable',
1198
- Traffic: postData?.featureConfigs?.isNewTraffic==true ? 'Enable': 'Disable',
1199
- Zone: postData?.featureConfigs?.isNewZone ==true ? 'Enable': 'Disable',
1200
- Zonev2: postData?.featureConfigs?.isNewZoneV2 ==true ? 'Enable': 'Disable',
1201
- Reports: postData?.featureConfigs?.isNewReports ==true ? 'Enable': 'Disable',
1202
- Trax: postData?.featureConfigs?.isTrax ==true ? 'Enable': 'Disable',
1190
+ ExcludedArea: postData?.featureConfigs?.isExcludedArea ==true ? 'Enabled': 'Disabled',
1191
+ PasserBydata: postData?.featureConfigs?.isPasserByData ==true ? 'Enabled': 'Disabled',
1192
+ NormalizedDataDuringDowntime: postData?.featureConfigs?.isNormalized ==true ? 'Enabled': 'Disabled',
1193
+ Billing: postData?.featureConfigs?.isbillingDisabled ==true ? 'Enabled': 'Disabled',
1194
+ CameraBlurring: postData?.featureConfigs?.isCameraDisabled ==true ? 'Enabled': 'Disabled',
1195
+ FootfallDirectory: postData?.featureConfigs?.isFootfallDirectory ==true ? 'Enabled': 'Disabled',
1196
+ NOBStatus: postData?.featureConfigs?.isNOB ==true ? 'Enabled': 'Disabled',
1197
+ EnableAnalyze: postData?.featureConfigs?.isNewDashboard ==true ? 'Enabled': 'Disabled',
1198
+ Traffic: postData?.featureConfigs?.isNewTraffic==true ? 'Enabled': 'Disabled',
1199
+ Zone: postData?.featureConfigs?.isNewZone ==true ? 'Enabled': 'Disabled',
1200
+ Zonev2: postData?.featureConfigs?.isNewZoneV2 ==true ? 'Enabled': 'Disabled',
1201
+ Reports: postData?.featureConfigs?.isNewReports ==true ? 'Enabled': 'Disabled',
1202
+ Trax: postData?.featureConfigs?.isTrax ==true ? 'Enabled': 'Disabled',
1203
1203
  StreamType: postData?.featureConfigs?.streamBy =='Edge' ? 'Edge App': 'RTSP',
1204
- FootfallDirectoryOnlyAudit: postData?.featureConfigs?.isFootfallDirectoryAudit ==true ? 'Enable': 'Disable',
1205
- FootfallDirectoryOnlyFew: postData?.featureConfigs?.isFootfallDirectoryLimit ==true ? 'Enable': 'Disable',
1204
+ FootfallDirectoryOnlyAudit: postData?.featureConfigs?.isFootfallDirectoryAudit ==true ? 'Enabled': 'Disabled',
1205
+ FootfallDirectoryOnlyFew: postData?.featureConfigs?.isFootfallDirectoryLimit ==true ? 'Enabled': 'Disabled',
1206
1206
 
1207
1207
  };
1208
1208
 
@@ -1246,11 +1246,11 @@ export async function domainDetailsConfiguration( req, res ) {
1246
1246
  const getPreData = await findOneClient(
1247
1247
  { clientId: req.params?.id }, // filter by clientId
1248
1248
  {
1249
- domainName: '$domainConfig.ssoLogin.domainName',
1250
- isEnable: '$domainConfig.ssoLogin.isEnable',
1251
- ipWhitelist: '$domainConfig.ipWhitelisting.enableWhitelisting',
1252
- WhitelistedIps: '$domainConfig.ipWhitelisting.allowedIps',
1253
- TwoFactorAuthentication: '$domainConfig.enableOtp',
1249
+ 'domainConfig.ssoLogin.domainName': 1,
1250
+ 'domainConfig.ssoLogin.isEnable': 1,
1251
+ 'domainConfig.ipWhitelisting.enableWhitelisting': 1,
1252
+ 'domainConfig.ipWhitelisting.allowedIps': 1,
1253
+ 'domainConfig.enableOtp': 1,
1254
1254
  },
1255
1255
  );
1256
1256
  const updateAck = await domainDetailsConfigurationUpdate( {
@@ -1271,35 +1271,35 @@ export async function domainDetailsConfiguration( req, res ) {
1271
1271
  const getPostData = await findOneClient(
1272
1272
  { clientId: req.params?.id }, // Filter by clientId
1273
1273
  {
1274
- domainName: '$domainConfig.ssoLogin.domainName',
1275
- isEnable: '$domainConfig.ssoLogin.isEnable',
1276
- ipWhitelist: '$domainConfig.ipWhitelisting.enableWhitelisting',
1277
- WhitelistedIps: '$domainConfig.ipWhitelisting.allowedIps',
1278
- TwoFactorAuthentication: '$domainConfig.enableOtp',
1274
+ 'domainConfig.ssoLogin.domainName': 1,
1275
+ 'domainConfig.ssoLogin.isEnable': 1,
1276
+ 'domainConfig.ipWhitelisting.enableWhitelisting': 1,
1277
+ 'domainConfig.ipWhitelisting.allowedIps': 1,
1278
+ 'domainConfig.enableOtp': 1,
1279
1279
  },
1280
1280
  );
1281
1281
 
1282
1282
 
1283
1283
  // Map and rename keys from previous client info for UI display and logging
1284
- // const oldData = {
1285
- // DomainName: getPreData?.domainConfig?.ssoLogin?.domainName,
1286
- // IsEnable: getPreData?.domainConfig?.ssoLogin?.isEnable ==true ? 'Enable': 'Disable',
1287
- // IPWhitelist: getPreData?.domainConfig?.ipWhitelisting?.enableWhitelisting ==true ? 'Enable': 'Disable',
1288
- // WhitelistedIps: ( getPreData?.domainConfig?.ipWhitelisting?.allowedIps )?.join( ', ' ),
1289
- // TwoFactorAuthentication: getPreData?.domainConfig?.enableOtp ==true ? 'Enable': 'Disable',
1284
+ const oldData = {
1285
+ DomainName: getPreData?.domainConfig?.ssoLogin?.domainName?.join( ', ' ),
1286
+ IsEnable: getPreData?.domainConfig?.ssoLogin?.isEnable ==true ? 'Enable': 'Disable',
1287
+ IPWhitelist: getPreData?.domainConfig?.ipWhitelisting?.enableWhitelisting ==true ? 'Enable': 'Disable',
1288
+ WhitelistedIps: getPreData?.domainConfig?.ipWhitelisting?.allowedIps?.join( ', ' ),
1289
+ TwoFactorAuthentication: getPreData?.domainConfig?.enableOtp ==true ? 'Enable': 'Disable',
1290
1290
 
1291
- // };
1291
+ };
1292
1292
 
1293
1293
  // Map and rename keys from current client info for UI display and logging
1294
- // const newData ={
1295
- // DomainName: getPostData?.domainConfig?.ssoLogin?.domainName,
1296
- // IsEnable: getPostData?.domainConfig?.ssoLogin?.isEnable ==true ? 'Enable': 'Disable',
1297
- // IPWhitelist: getPostData?.domainConfig?.ipWhitelisting?.enableWhitelisting ==true ? 'Enable': 'Disable',
1298
- // WhitelistedIps: ( getPostData?.domainConfig?.ipWhitelisting?.allowedIps ).join( ', ' ),
1299
- // TwoFactorAuthentication: getPostData?.domainConfig?.enableOtp ==true ? 'Enable': 'Disable',
1300
- // };
1301
-
1294
+ const newData ={
1295
+ DomainName: getPostData?.domainConfig?.ssoLogin?.domainName?.join( ', ' ),
1296
+ IsEnable: getPostData?.domainConfig?.ssoLogin?.isEnable ==true ? 'Enable': 'Disable',
1297
+ IPWhitelist: getPostData?.domainConfig?.ipWhitelisting?.enableWhitelisting ==true ? 'Enable': 'Disable',
1298
+ WhitelistedIps: getPostData?.domainConfig?.ipWhitelisting?.allowedIps?.join( ', ' ),
1299
+ TwoFactorAuthentication: getPostData?.domainConfig?.enableOtp ==true ? 'Enable': 'Disable',
1300
+ };
1302
1301
 
1302
+ logger.info( { getPreData: getPreData, getPostData: getPostData, newData: newData, oldData: oldData } );
1303
1303
  // Prepare activity log object with all relevant details for OpenSearch logging
1304
1304
  const logObj = {
1305
1305
  clientId: req.params?.id, // ID of the client whose data was updated
@@ -1313,8 +1313,8 @@ export async function domainDetailsConfiguration( req, res ) {
1313
1313
  showTo: [ 'client', 'tango' ], // Visibility of the log (who can see this log)
1314
1314
  previous: getPreData, // Previous (old) client information before update based on DB keys (for internal reference and comparison).
1315
1315
  current: getPostData, // Current (new) client information after update based on DB keys (for internal reference and comparison).
1316
- // oldData: oldData, // Previous (old) client information before update (used for showing detailed changes in the UI).
1317
- // newData: newData, // Current (new) client information after update (used for showing detailed changes in the UI).
1316
+ oldData: oldData, // Previous (old) client information before update (used for showing detailed changes in the UI).
1317
+ newData: newData, // Current (new) client information after update (used for showing detailed changes in the UI).
1318
1318
  };
1319
1319
 
1320
1320
  // Insert activity log into OpenSearch if there are fields that were updated
@@ -2276,7 +2276,7 @@ export async function detailedClientCount( req, res ) {
2276
2276
  }
2277
2277
  }
2278
2278
 
2279
- export async function getActivityLogs( req, res ) {
2279
+ export async function getActivityLogs1( req, res ) {
2280
2280
  try {
2281
2281
  const inputData = req.body;
2282
2282
  const openSearch = JSON.parse( process.env.OPENSEARCH );
@@ -2536,7 +2536,7 @@ function getUserFriendlyKey( keyPath, mapping ) {
2536
2536
  return typeof value === 'string' ? value : keyPath; // Return mapped value or original key
2537
2537
  }
2538
2538
 
2539
- export async function getActivityLogs1( req, res ) {
2539
+ export async function getActivityLogs( req, res ) {
2540
2540
  try {
2541
2541
  const inputData = req.body;
2542
2542
  const openSearch = JSON.parse( process.env.OPENSEARCH );
@@ -2688,7 +2688,8 @@ function findDifferences( oldData, newData ) {
2688
2688
 
2689
2689
  function splitCamelCase( text ) {
2690
2690
  return text.replace( /([a-z])([A-Z])/g, '$1 $2' ) // Add space between camelCase words
2691
- .replace( /(\d+)/g, ' $1 ' ) // Add space between numbers
2691
+ .replace( /([a-zA-Z])(\d+)/g, '$1 $2' ) // Add space between letters and numbers
2692
+ .replace( /(\d+)([a-zA-Z])/g, '$1 $2' )
2692
2693
  .trim();
2693
2694
  }
2694
2695
 
@@ -52,8 +52,8 @@ export const signatoryDetailsSchemaBody = joi.object( {
52
52
  name: joi.string().optional(),
53
53
  email: joi.string().email().message( 'Enter a valid email' ).optional(),
54
54
  number: joi.string()
55
- .pattern( /^\d{4,12}$/ )
56
- .message( 'Enter a valid mobile number' )
55
+ .pattern( /^\d{7,15}$/ )
56
+ .message( 'Mobile Number Must be Valid' )
57
57
  .optional(),
58
58
  designation: joi.string().optional(),
59
59
  } );