tango-app-api-client 3.4.0-beta.5 → 3.4.0-beta.7
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.
|
|
3
|
+
"version": "3.4.0-beta.7",
|
|
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.
|
|
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
|
},
|
|
@@ -996,7 +996,7 @@ export async function updateTicketConfiguration( req, res ) {
|
|
|
996
996
|
|
|
997
997
|
// Map and rename keys from previous client info for UI display and logging
|
|
998
998
|
const oldData = {
|
|
999
|
-
InfraDowntimeType: findClient?.ticketConfigs?.downTimeType,
|
|
999
|
+
InfraDowntimeType: findClient?.ticketConfigs?.downTimeType==0? 'Single Camera': 'All Cameras',
|
|
1000
1000
|
AutoReAssignInstallation: findClient?.ticketConfigs?.installationReAssign,
|
|
1001
1001
|
InfraDowntime: findClient?.ticketConfigs?.infraDownTime,
|
|
1002
1002
|
InfraFiles: findClient?.ticketConfigs?.MinFilesCount,
|
|
@@ -1009,7 +1009,7 @@ export async function updateTicketConfiguration( req, res ) {
|
|
|
1009
1009
|
|
|
1010
1010
|
// Map and rename keys from current client info for UI display and logging
|
|
1011
1011
|
const newData ={
|
|
1012
|
-
InfraDowntimeType: updatedClient?.ticketConfigs?.downTimeType,
|
|
1012
|
+
InfraDowntimeType: updatedClient?.ticketConfigs?.downTimeType==0? 'Single Camera': 'All Cameras',
|
|
1013
1013
|
AutoReAssignInstallation: updatedClient?.ticketConfigs?.installationReAssign,
|
|
1014
1014
|
InfraDowntime: updatedClient?.ticketConfigs?.infraDownTime,
|
|
1015
1015
|
InfraFiles: updatedClient?.ticketConfigs?.MinFilesCount,
|
|
@@ -1136,9 +1136,9 @@ export async function updateFeatureConfiguration( req, res ) {
|
|
|
1136
1136
|
const oldData = {
|
|
1137
1137
|
StoreOpenTime: previousData?.featureConfigs?.open,
|
|
1138
1138
|
StoreCloseTime: previousData?.featureConfigs?.close,
|
|
1139
|
-
ConversionCalculations: previousData?.featureConfigs?.conversionCalculation,
|
|
1140
|
-
MissedOpportunityCalculation: previousData?.featureConfigs?.missedOpportunityCalculation,
|
|
1141
|
-
PotentialCalculations: previousData?.featureConfigs?.billableCalculation,
|
|
1139
|
+
ConversionCalculations: previousData?.featureConfigs?.conversionCalculation=='footfall-count'? 'Footfall Count': postData?.featureConfigs?.conversionCalculation=='engagers-count'?'Engagers Count':'Potential Entities',
|
|
1140
|
+
MissedOpportunityCalculation: previousData?.featureConfigs?.missedOpportunityCalculation=='engagers-conversion'? 'Engagers - Conversion': 'Potential Entities - Conversion',
|
|
1141
|
+
PotentialCalculations: previousData?.featureConfigs?.billableCalculation=='footfall-count'? 'Footfall Count': 'Engagers Count',
|
|
1142
1142
|
ConversionCondition: previousData?.featureConfigs?.conversion.condition,
|
|
1143
1143
|
ConversionValue: previousData?.featureConfigs?.conversion.value,
|
|
1144
1144
|
MissedOpportunityFromCondition: previousData?.featureConfigs?.missedOpportunityFrom?.condition,
|
|
@@ -1149,7 +1149,6 @@ export async function updateFeatureConfiguration( req, res ) {
|
|
|
1149
1149
|
BouncedLimitValue: previousData?.featureConfigs?.bouncedLimit?.value,
|
|
1150
1150
|
InfraAlertValue: previousData?.featureConfigs?.infraAlert?.value,
|
|
1151
1151
|
InfraAlertCondition: previousData?.featureConfigs?.infraAlert?.condition,
|
|
1152
|
-
ConversionCalculations: previousData?.featureConfigs?.conversionCalculation,
|
|
1153
1152
|
ExcludedArea: previousData?.featureConfigs?.isExcludedArea ==true ? 'Enabled': 'Disabled',
|
|
1154
1153
|
PasserBydata: previousData?.featureConfigs?.isPasserByData ==true ? 'Enabled': 'Disabled',
|
|
1155
1154
|
NormalizedDataDuringDowntime: previousData?.featureConfigs?.isNormalized ==true ? 'Enabled': 'Disabled',
|
|
@@ -1173,9 +1172,9 @@ export async function updateFeatureConfiguration( req, res ) {
|
|
|
1173
1172
|
const newData ={
|
|
1174
1173
|
StoreOpenTime: postData?.featureConfigs?.open,
|
|
1175
1174
|
StoreCloseTime: postData?.featureConfigs?.close,
|
|
1176
|
-
ConversionCalculations: postData?.featureConfigs?.conversionCalculation,
|
|
1177
|
-
MissedOpportunityCalculation: postData?.featureConfigs?.missedOpportunityCalculation,
|
|
1178
|
-
PotentialCalculations: postData?.featureConfigs?.billableCalculation,
|
|
1175
|
+
ConversionCalculations: postData?.featureConfigs?.conversionCalculation=='footfall-count'? 'Footfall Count': postData?.featureConfigs?.conversionCalculation=='engagers-count'?'Engagers Count':'Potential Entities',
|
|
1176
|
+
MissedOpportunityCalculation: postData?.featureConfigs?.missedOpportunityCalculation=='engagers-conversion'? 'Engagers - Conversion': 'Potential Entities - Conversion',
|
|
1177
|
+
PotentialCalculations: postData?.featureConfigs?.billableCalculation=='footfall-count'? 'Footfall Count':'Engagers Count',
|
|
1179
1178
|
ConversionCondition: postData?.featureConfigs?.conversion.condition,
|
|
1180
1179
|
ConversionValue: postData?.featureConfigs?.conversion.value,
|
|
1181
1180
|
MissedOpportunityFromCondition: postData?.featureConfigs?.missedOpportunityFrom?.condition,
|
|
@@ -1186,23 +1185,22 @@ export async function updateFeatureConfiguration( req, res ) {
|
|
|
1186
1185
|
BouncedLimitValue: postData?.featureConfigs?.bouncedLimit?.value,
|
|
1187
1186
|
InfraAlertValue: postData?.featureConfigs?.infraAlert?.value,
|
|
1188
1187
|
InfraAlertCondition: postData?.featureConfigs?.infraAlert?.condition,
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
Trax: postData?.featureConfigs?.isTrax ==true ? 'Enable': 'Disable',
|
|
1188
|
+
ExcludedArea: postData?.featureConfigs?.isExcludedArea ==true ? 'Enabled': 'Disabled',
|
|
1189
|
+
PasserBydata: postData?.featureConfigs?.isPasserByData ==true ? 'Enabled': 'Disabled',
|
|
1190
|
+
NormalizedDataDuringDowntime: postData?.featureConfigs?.isNormalized ==true ? 'Enabled': 'Disabled',
|
|
1191
|
+
Billing: postData?.featureConfigs?.isbillingDisabled ==true ? 'Enabled': 'Disabled',
|
|
1192
|
+
CameraBlurring: postData?.featureConfigs?.isCameraDisabled ==true ? 'Enabled': 'Disabled',
|
|
1193
|
+
FootfallDirectory: postData?.featureConfigs?.isFootfallDirectory ==true ? 'Enabled': 'Disabled',
|
|
1194
|
+
NOBStatus: postData?.featureConfigs?.isNOB ==true ? 'Enabled': 'Disabled',
|
|
1195
|
+
EnableAnalyze: postData?.featureConfigs?.isNewDashboard ==true ? 'Enabled': 'Disabled',
|
|
1196
|
+
Traffic: postData?.featureConfigs?.isNewTraffic==true ? 'Enabled': 'Disabled',
|
|
1197
|
+
Zone: postData?.featureConfigs?.isNewZone ==true ? 'Enabled': 'Disabled',
|
|
1198
|
+
Zonev2: postData?.featureConfigs?.isNewZoneV2 ==true ? 'Enabled': 'Disabled',
|
|
1199
|
+
Reports: postData?.featureConfigs?.isNewReports ==true ? 'Enabled': 'Disabled',
|
|
1200
|
+
Trax: postData?.featureConfigs?.isTrax ==true ? 'Enabled': 'Disabled',
|
|
1203
1201
|
StreamType: postData?.featureConfigs?.streamBy =='Edge' ? 'Edge App': 'RTSP',
|
|
1204
|
-
FootfallDirectoryOnlyAudit: postData?.featureConfigs?.isFootfallDirectoryAudit ==true ? '
|
|
1205
|
-
FootfallDirectoryOnlyFew: postData?.featureConfigs?.isFootfallDirectoryLimit ==true ? '
|
|
1202
|
+
FootfallDirectoryOnlyAudit: postData?.featureConfigs?.isFootfallDirectoryAudit ==true ? 'Enabled': 'Disabled',
|
|
1203
|
+
FootfallDirectoryOnlyFew: postData?.featureConfigs?.isFootfallDirectoryLimit ==true ? 'Enabled': 'Disabled',
|
|
1206
1204
|
|
|
1207
1205
|
};
|
|
1208
1206
|
|
|
@@ -1246,11 +1244,11 @@ export async function domainDetailsConfiguration( req, res ) {
|
|
|
1246
1244
|
const getPreData = await findOneClient(
|
|
1247
1245
|
{ clientId: req.params?.id }, // filter by clientId
|
|
1248
1246
|
{
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1247
|
+
'domainConfig.ssoLogin.domainName': 1,
|
|
1248
|
+
'domainConfig.ssoLogin.isEnable': 1,
|
|
1249
|
+
'domainConfig.ipWhitelisting.enableWhitelisting': 1,
|
|
1250
|
+
'domainConfig.ipWhitelisting.allowedIps': 1,
|
|
1251
|
+
'domainConfig.enableOtp': 1,
|
|
1254
1252
|
},
|
|
1255
1253
|
);
|
|
1256
1254
|
const updateAck = await domainDetailsConfigurationUpdate( {
|
|
@@ -1271,35 +1269,35 @@ export async function domainDetailsConfiguration( req, res ) {
|
|
|
1271
1269
|
const getPostData = await findOneClient(
|
|
1272
1270
|
{ clientId: req.params?.id }, // Filter by clientId
|
|
1273
1271
|
{
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1272
|
+
'domainConfig.ssoLogin.domainName': 1,
|
|
1273
|
+
'domainConfig.ssoLogin.isEnable': 1,
|
|
1274
|
+
'domainConfig.ipWhitelisting.enableWhitelisting': 1,
|
|
1275
|
+
'domainConfig.ipWhitelisting.allowedIps': 1,
|
|
1276
|
+
'domainConfig.enableOtp': 1,
|
|
1279
1277
|
},
|
|
1280
1278
|
);
|
|
1281
1279
|
|
|
1282
1280
|
|
|
1283
1281
|
// Map and rename keys from previous client info for UI display and logging
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1282
|
+
const oldData = {
|
|
1283
|
+
DomainName: getPreData?.domainConfig?.ssoLogin?.domainName?.join( ', ' ),
|
|
1284
|
+
IsEnable: getPreData?.domainConfig?.ssoLogin?.isEnable ==true ? 'Enable': 'Disable',
|
|
1285
|
+
IPWhitelist: getPreData?.domainConfig?.ipWhitelisting?.enableWhitelisting ==true ? 'Enable': 'Disable',
|
|
1286
|
+
WhitelistedIps: getPreData?.domainConfig?.ipWhitelisting?.allowedIps?.join( ', ' ),
|
|
1287
|
+
TwoFactorAuthentication: getPreData?.domainConfig?.enableOtp ==true ? 'Enable': 'Disable',
|
|
1290
1288
|
|
|
1291
|
-
|
|
1289
|
+
};
|
|
1292
1290
|
|
|
1293
1291
|
// Map and rename keys from current client info for UI display and logging
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1292
|
+
const newData ={
|
|
1293
|
+
DomainName: getPostData?.domainConfig?.ssoLogin?.domainName?.join( ', ' ),
|
|
1294
|
+
IsEnable: getPostData?.domainConfig?.ssoLogin?.isEnable ==true ? 'Enable': 'Disable',
|
|
1295
|
+
IPWhitelist: getPostData?.domainConfig?.ipWhitelisting?.enableWhitelisting ==true ? 'Enable': 'Disable',
|
|
1296
|
+
WhitelistedIps: getPostData?.domainConfig?.ipWhitelisting?.allowedIps?.join( ', ' ),
|
|
1297
|
+
TwoFactorAuthentication: getPostData?.domainConfig?.enableOtp ==true ? 'Enable': 'Disable',
|
|
1298
|
+
};
|
|
1302
1299
|
|
|
1300
|
+
logger.info( { getPreData: getPreData, getPostData: getPostData, newData: newData, oldData: oldData } );
|
|
1303
1301
|
// Prepare activity log object with all relevant details for OpenSearch logging
|
|
1304
1302
|
const logObj = {
|
|
1305
1303
|
clientId: req.params?.id, // ID of the client whose data was updated
|
|
@@ -1313,8 +1311,8 @@ export async function domainDetailsConfiguration( req, res ) {
|
|
|
1313
1311
|
showTo: [ 'client', 'tango' ], // Visibility of the log (who can see this log)
|
|
1314
1312
|
previous: getPreData, // Previous (old) client information before update based on DB keys (for internal reference and comparison).
|
|
1315
1313
|
current: getPostData, // Current (new) client information after update based on DB keys (for internal reference and comparison).
|
|
1316
|
-
|
|
1317
|
-
|
|
1314
|
+
oldData: oldData, // Previous (old) client information before update (used for showing detailed changes in the UI).
|
|
1315
|
+
newData: newData, // Current (new) client information after update (used for showing detailed changes in the UI).
|
|
1318
1316
|
};
|
|
1319
1317
|
|
|
1320
1318
|
// Insert activity log into OpenSearch if there are fields that were updated
|
|
@@ -1490,20 +1488,22 @@ export async function auditConfiguration( req, res ) {
|
|
|
1490
1488
|
};
|
|
1491
1489
|
await updateOneClient( query, record );
|
|
1492
1490
|
|
|
1493
|
-
|
|
1494
1491
|
// Map and rename keys from previous client info for UI display and logging
|
|
1495
|
-
const oldData =
|
|
1496
|
-
AuditStatus:
|
|
1497
|
-
MappingPercentage:
|
|
1498
|
-
AuditCount:
|
|
1499
|
-
|
|
1492
|
+
const oldData ={
|
|
1493
|
+
AuditStatus: previousClient?.auditConfigs?.audit ==true ? 'Enable': 'Disable',
|
|
1494
|
+
MappingPercentage: previousClient?.auditConfigs?.ratio,
|
|
1495
|
+
AuditCount: previousClient?.auditConfigs?.count,
|
|
1500
1496
|
};
|
|
1501
1497
|
|
|
1498
|
+
const currentClient = await findOneClient( query, fields );
|
|
1499
|
+
currentClient.auditConfigs.ratio = currentClient?.auditConfigs?.ratio? ( currentClient.auditConfigs.ratio )*100 : null;
|
|
1500
|
+
|
|
1502
1501
|
// Map and rename keys from current client info for UI display and logging
|
|
1503
|
-
const newData ={
|
|
1504
|
-
AuditStatus:
|
|
1505
|
-
MappingPercentage:
|
|
1506
|
-
AuditCount:
|
|
1502
|
+
const newData = {
|
|
1503
|
+
AuditStatus: currentClient?.auditConfigs?.audit ==true ? 'Enable': 'Disable',
|
|
1504
|
+
MappingPercentage: currentClient?.auditConfigs?.ratio,
|
|
1505
|
+
AuditCount: currentClient?.auditConfigs?.count,
|
|
1506
|
+
|
|
1507
1507
|
};
|
|
1508
1508
|
const logObj = {
|
|
1509
1509
|
clientId: req.params?.id,
|
|
@@ -1516,12 +1516,7 @@ export async function auditConfiguration( req, res ) {
|
|
|
1516
1516
|
showTo: [ 'tango' ],
|
|
1517
1517
|
changes: [ `Audit config for client id ${req.params?.id}` ],
|
|
1518
1518
|
previous: previousClient.auditConfigs,
|
|
1519
|
-
current:
|
|
1520
|
-
clientId: req.params?.id,
|
|
1521
|
-
count: inputData.count,
|
|
1522
|
-
audit: inputData.audit,
|
|
1523
|
-
ratio: inputData.ratio,
|
|
1524
|
-
},
|
|
1519
|
+
current: currentClient.auditConfigs,
|
|
1525
1520
|
oldData: oldData,
|
|
1526
1521
|
newData: newData,
|
|
1527
1522
|
};
|
|
@@ -2276,7 +2271,7 @@ export async function detailedClientCount( req, res ) {
|
|
|
2276
2271
|
}
|
|
2277
2272
|
}
|
|
2278
2273
|
|
|
2279
|
-
export async function
|
|
2274
|
+
export async function getActivityLogs1( req, res ) {
|
|
2280
2275
|
try {
|
|
2281
2276
|
const inputData = req.body;
|
|
2282
2277
|
const openSearch = JSON.parse( process.env.OPENSEARCH );
|
|
@@ -2536,7 +2531,7 @@ function getUserFriendlyKey( keyPath, mapping ) {
|
|
|
2536
2531
|
return typeof value === 'string' ? value : keyPath; // Return mapped value or original key
|
|
2537
2532
|
}
|
|
2538
2533
|
|
|
2539
|
-
export async function
|
|
2534
|
+
export async function getActivityLogs( req, res ) {
|
|
2540
2535
|
try {
|
|
2541
2536
|
const inputData = req.body;
|
|
2542
2537
|
const openSearch = JSON.parse( process.env.OPENSEARCH );
|
|
@@ -2688,8 +2683,10 @@ function findDifferences( oldData, newData ) {
|
|
|
2688
2683
|
|
|
2689
2684
|
function splitCamelCase( text ) {
|
|
2690
2685
|
return text.replace( /([a-z])([A-Z])/g, '$1 $2' ) // Add space between camelCase words
|
|
2691
|
-
.replace( /(\d+)/g, '
|
|
2692
|
-
.
|
|
2686
|
+
.replace( /([a-zA-Z])(\d+)/g, '$1 $2' ) // Add space between letters and numbers
|
|
2687
|
+
.replace( /(\d+)([a-zA-Z])/g, '$1 $2' )
|
|
2688
|
+
.trim()
|
|
2689
|
+
.replace( /^./, ( match ) => match.toUpperCase() ); // Capitalize the first letter
|
|
2693
2690
|
}
|
|
2694
2691
|
|
|
2695
2692
|
async function postApi( url, data ) {
|
package/src/dtos/client.dtos.js
CHANGED
|
@@ -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{
|
|
56
|
-
.message( '
|
|
55
|
+
.pattern( /^\d{7,15}$/ )
|
|
56
|
+
.message( 'Mobile Number Must be Valid' )
|
|
57
57
|
.optional(),
|
|
58
58
|
designation: joi.string().optional(),
|
|
59
59
|
} );
|