tango-app-api-client 3.0.41-dev → 3.0.42-dev
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.0.
|
|
3
|
+
"version": "3.0.42-dev",
|
|
4
4
|
"description": "client",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"mongodb": "^6.3.0",
|
|
26
26
|
"nodemon": "^3.0.3",
|
|
27
27
|
"swagger-ui-express": "^5.0.0",
|
|
28
|
+
"tango-app-api-middleware": "^1.0.72-test",
|
|
28
29
|
"tango-api-schema": "^2.0.93",
|
|
29
|
-
"tango-app-api-middleware": "^3.1.9",
|
|
30
30
|
"winston": "^3.11.0",
|
|
31
31
|
"winston-daily-rotate-file": "^5.0.0"
|
|
32
32
|
},
|
|
@@ -486,7 +486,9 @@ export async function updateBrandInfo( req, res ) {
|
|
|
486
486
|
eventType: 'update',
|
|
487
487
|
};
|
|
488
488
|
|
|
489
|
-
|
|
489
|
+
if ( updateKeys.length ) {
|
|
490
|
+
await insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
491
|
+
}
|
|
490
492
|
|
|
491
493
|
|
|
492
494
|
const updateAck = await brandInfoUpdate( {
|
|
@@ -580,7 +582,10 @@ export async function updateBillingDetails( req, res ) {
|
|
|
580
582
|
eventType: 'update',
|
|
581
583
|
};
|
|
582
584
|
|
|
583
|
-
|
|
585
|
+
if ( updateKeys.length ) {
|
|
586
|
+
await insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
587
|
+
}
|
|
588
|
+
|
|
584
589
|
|
|
585
590
|
const updateAck = await billingDetailsUpdate( {
|
|
586
591
|
clientId: req.params?.id, tradeName: req.body?.tradeName, gstNumber: req.body?.gstNumber,
|
|
@@ -618,7 +623,10 @@ export async function updateSignatoryDetails( req, res ) {
|
|
|
618
623
|
eventType: 'update',
|
|
619
624
|
};
|
|
620
625
|
|
|
621
|
-
|
|
626
|
+
if ( updateKeys.length ) {
|
|
627
|
+
await insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
628
|
+
}
|
|
629
|
+
|
|
622
630
|
const updateAck = await signatoryDetailsUpdate( {
|
|
623
631
|
clientId: req.params?.id, name: req.body?.name, email: req.body?.email,
|
|
624
632
|
number: req.body?.number, designation: req.body?.designation,
|
|
@@ -660,7 +668,10 @@ export async function updateTicketConfiguration( req, res ) {
|
|
|
660
668
|
changes: updateKeys,
|
|
661
669
|
eventType: 'update',
|
|
662
670
|
};
|
|
663
|
-
|
|
671
|
+
|
|
672
|
+
if ( updateKeys.length ) {
|
|
673
|
+
await insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
674
|
+
}
|
|
664
675
|
|
|
665
676
|
if ( updateAck ) {
|
|
666
677
|
res.sendSuccess( { result: 'Updated Successfully' } );
|
|
@@ -745,7 +756,9 @@ export async function updateFeatureConfiguration( req, res ) {
|
|
|
745
756
|
changes: updateKeys,
|
|
746
757
|
eventType: 'update',
|
|
747
758
|
};
|
|
748
|
-
|
|
759
|
+
if ( updateKeys.length ) {
|
|
760
|
+
await insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
761
|
+
}
|
|
749
762
|
|
|
750
763
|
if ( updateAck ) {
|
|
751
764
|
res.sendSuccess( { result: 'Updated Successfully' } );
|
|
@@ -785,7 +798,10 @@ export async function domainDetailsConfiguration( req, res ) {
|
|
|
785
798
|
eventType: 'update',
|
|
786
799
|
};
|
|
787
800
|
|
|
788
|
-
|
|
801
|
+
if ( updateKeys.length ) {
|
|
802
|
+
await insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
803
|
+
}
|
|
804
|
+
|
|
789
805
|
if ( updateAck ) {
|
|
790
806
|
res.sendSuccess( { result: 'Updated Successfully' } );
|
|
791
807
|
}
|
|
@@ -895,7 +911,9 @@ export async function updateDocuments( req, res ) {
|
|
|
895
911
|
eventType: 'update',
|
|
896
912
|
};
|
|
897
913
|
|
|
898
|
-
|
|
914
|
+
if ( updateKeys.length ) {
|
|
915
|
+
await insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
916
|
+
}
|
|
899
917
|
|
|
900
918
|
if ( updateAck ) {
|
|
901
919
|
res.sendSuccess( { result: 'Updated Successfully' } );
|
|
@@ -959,7 +977,9 @@ export async function auditConfiguration( req, res ) {
|
|
|
959
977
|
logObj.changes = [ `Audit config bulk` ];
|
|
960
978
|
}
|
|
961
979
|
|
|
962
|
-
|
|
980
|
+
if ( updateKeys.length ) {
|
|
981
|
+
await insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
982
|
+
}
|
|
963
983
|
|
|
964
984
|
res.sendSuccess( { result: 'Updated Successfully' } );
|
|
965
985
|
} catch ( error ) {
|
|
@@ -1354,7 +1374,10 @@ export async function detailedClientCount( req, res ) {
|
|
|
1354
1374
|
export async function getActivityLogs( req, res ) {
|
|
1355
1375
|
try {
|
|
1356
1376
|
const query = {
|
|
1357
|
-
'_source': [
|
|
1377
|
+
'_source': [
|
|
1378
|
+
'userId', 'userName', 'email', 'date', 'logType', 'logSubType',
|
|
1379
|
+
'changes', 'eventType',
|
|
1380
|
+
],
|
|
1358
1381
|
'query': {
|
|
1359
1382
|
'bool': {
|
|
1360
1383
|
'must': [
|
|
@@ -1368,6 +1391,13 @@ export async function getActivityLogs( req, res ) {
|
|
|
1368
1391
|
},
|
|
1369
1392
|
'from': ( req.body.offset - 1 ) * req.body.limit,
|
|
1370
1393
|
'size': req.body.limit,
|
|
1394
|
+
'sort': [
|
|
1395
|
+
{
|
|
1396
|
+
'date': {
|
|
1397
|
+
'order': 'desc',
|
|
1398
|
+
},
|
|
1399
|
+
},
|
|
1400
|
+
],
|
|
1371
1401
|
};
|
|
1372
1402
|
|
|
1373
1403
|
if ( req.body?.logTypeFilters?.length ) {
|
|
@@ -1391,7 +1421,7 @@ export async function getActivityLogs( req, res ) {
|
|
|
1391
1421
|
} );
|
|
1392
1422
|
}
|
|
1393
1423
|
|
|
1394
|
-
const logs = await getOpenSearchData(
|
|
1424
|
+
const logs = await getOpenSearchData( appConfig.opensearch.activityLog, query );
|
|
1395
1425
|
|
|
1396
1426
|
const hits = logs?.body?.hits?.hits;
|
|
1397
1427
|
const totalDocuments = logs?.body?.hits?.total?.value;
|
|
@@ -1407,6 +1437,7 @@ export async function getActivityLogs( req, res ) {
|
|
|
1407
1437
|
}
|
|
1408
1438
|
}
|
|
1409
1439
|
|
|
1440
|
+
|
|
1410
1441
|
async function postApi( url, data ) {
|
|
1411
1442
|
const requestOptions = {
|
|
1412
1443
|
method: 'POST',
|