tango-app-api-infra 3.0.108-dev → 3.0.110-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
|
@@ -314,21 +314,20 @@ export async function installationCard( req, res ) {
|
|
|
314
314
|
export async function infraIssuesTable( req, res ) {
|
|
315
315
|
try {
|
|
316
316
|
let date = await getUTC( new Date( req.body.fromDate ), new Date( req.body.toDate ) );
|
|
317
|
-
let issueStatus = [ 'identified' ];
|
|
317
|
+
let issueStatus = [ 'notidentified', 'identified' ];
|
|
318
|
+
|
|
318
319
|
if ( req.body.infrafilterIssue == 'Issues Not Identified' ) {
|
|
319
320
|
issueStatus = [ 'notidentified' ];
|
|
320
321
|
};
|
|
321
|
-
if ( req.body.infrafilterIssue == '
|
|
322
|
-
issueStatus = [ '
|
|
323
|
-
};
|
|
324
|
-
if ( req.body.infrafilterIssue == 'Live Stores' ) {
|
|
325
|
-
issueStatus = [ 'notidentified', 'identified' ];
|
|
322
|
+
if ( req.body.infrafilterIssue == 'Identified Issues' ) {
|
|
323
|
+
issueStatus = [ 'identified' ];
|
|
326
324
|
};
|
|
325
|
+
|
|
326
|
+
|
|
327
327
|
let totalstores = await aggregateStore( [ {
|
|
328
328
|
$match: {
|
|
329
329
|
'$and': [
|
|
330
330
|
{ 'clientId': { $in: req.body.clientId } },
|
|
331
|
-
{ 'edge.firstFile': true },
|
|
332
331
|
{ 'status': 'active' },
|
|
333
332
|
{ 'createdAt': { $lte: date.end } },
|
|
334
333
|
],
|
|
@@ -338,6 +337,23 @@ export async function infraIssuesTable( req, res ) {
|
|
|
338
337
|
for ( let store of totalstores ) {
|
|
339
338
|
totalnumberstores.push( store.storeId );
|
|
340
339
|
}
|
|
340
|
+
let pendingquery = [];
|
|
341
|
+
pendingquery.push( {
|
|
342
|
+
$match: {
|
|
343
|
+
$and: [
|
|
344
|
+
{ issueType: 'installation' },
|
|
345
|
+
{ 'status': { $ne: 'closed' } },
|
|
346
|
+
{ 'basicDetails.clientId': { $in: req.body.clientId } },
|
|
347
|
+
{ createdAt: { $lte: date.end } },
|
|
348
|
+
],
|
|
349
|
+
},
|
|
350
|
+
} );
|
|
351
|
+
let pendingstorecount = await aggregateTangoTicket( pendingquery );
|
|
352
|
+
let installpendingticket = [];
|
|
353
|
+
for ( let store of pendingstorecount ) {
|
|
354
|
+
installpendingticket.push( store.basicDetails.storeId );
|
|
355
|
+
}
|
|
356
|
+
|
|
341
357
|
let query = [ {
|
|
342
358
|
$match: {
|
|
343
359
|
$and: [
|
|
@@ -346,7 +362,6 @@ export async function infraIssuesTable( req, res ) {
|
|
|
346
362
|
{ 'basicDetails.clientId': { $in: req.body.clientId } },
|
|
347
363
|
{ 'basicDetails.storeId': { $in: totalnumberstores } },
|
|
348
364
|
{ 'ticketDetails.issueStatus': { $in: issueStatus } },
|
|
349
|
-
// { createdAt: { $gte: date.start } },
|
|
350
365
|
{ createdAt: { $lte: date.end } },
|
|
351
366
|
],
|
|
352
367
|
},
|
|
@@ -426,8 +441,8 @@ export async function infraIssuesTable( req, res ) {
|
|
|
426
441
|
$match: {
|
|
427
442
|
'$and': [
|
|
428
443
|
{ 'clientId': { $in: req.body.clientId } },
|
|
429
|
-
{ 'edge.firstFile': true },
|
|
430
444
|
{ 'status': 'active' },
|
|
445
|
+
{ 'storeId': { $nin: installpendingticket } },
|
|
431
446
|
{ 'createdAt': { $lte: date.end } },
|
|
432
447
|
],
|
|
433
448
|
},
|
|
@@ -442,7 +457,7 @@ export async function infraIssuesTable( req, res ) {
|
|
|
442
457
|
}
|
|
443
458
|
let result = [];
|
|
444
459
|
for ( let data of totalnumberstores ) {
|
|
445
|
-
if ( infraissueStore.length > 0 && !infraissueStore.includes( data ) ) {
|
|
460
|
+
if ( infraissueStore.length > 0 && !infraissueStore.includes( data )&&!installpendingticket.includes( data ) ) {
|
|
446
461
|
result.push( data );
|
|
447
462
|
}
|
|
448
463
|
}
|
|
@@ -494,12 +509,13 @@ export async function infraIssuesTable( req, res ) {
|
|
|
494
509
|
);
|
|
495
510
|
}
|
|
496
511
|
if ( req.body.sortColumName && req.body.sortColumName !== '' && req.body.sortBy ) {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
512
|
+
const sortOption = { $sort: { [req.body.sortColumName]: req.body.sortBy } };
|
|
513
|
+
query.push( sortOption );
|
|
514
|
+
storesQuery.push( sortOption );
|
|
515
|
+
} else {
|
|
516
|
+
const sortOption = { $sort: { 'storeId': -1 } };
|
|
517
|
+
query.push( sortOption );
|
|
518
|
+
storesQuery.push( sortOption );
|
|
503
519
|
}
|
|
504
520
|
let count;
|
|
505
521
|
if ( req.body.infrafilterIssue == 'Live Stores' || req.body.infrafilterIssue == 'Total Stores' ) {
|
|
@@ -563,15 +579,24 @@ export async function infraIssuesTable( req, res ) {
|
|
|
563
579
|
if ( req.body.export && result.length > 0 ) {
|
|
564
580
|
const exportdata = [];
|
|
565
581
|
result.forEach( ( element ) => {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
582
|
+
if ( req.body.infrafilterIssue == 'Live Stores' || req.body.infrafilterIssue == 'Total Stores' ) {
|
|
583
|
+
exportdata.push( {
|
|
584
|
+
'Created On': element.createdAt,
|
|
585
|
+
'StoreID': element.storeId,
|
|
586
|
+
'StoreName': element.storeName,
|
|
587
|
+
'Status': element.status,
|
|
588
|
+
} );
|
|
589
|
+
} else {
|
|
590
|
+
exportdata.push( {
|
|
591
|
+
'Created On': element.createdAt,
|
|
592
|
+
'StoreID': element.storeId,
|
|
593
|
+
'StoreName': element.storeName,
|
|
594
|
+
'Primary Issue': element.primaryIssue,
|
|
595
|
+
'Sub Issue': element.secondaryIssue,
|
|
596
|
+
'Issue Identified on': element.issueIdentifiedDate? dayjs( element.issueIdentifiedDate ).tz( 'Asia/Kolkata' ).format( 'YYYY-MM-DD HH:mm A' ):'',
|
|
597
|
+
'Status': element.status,
|
|
598
|
+
} );
|
|
599
|
+
}
|
|
575
600
|
} );
|
|
576
601
|
await download( exportdata, res );
|
|
577
602
|
return;
|
|
@@ -998,7 +1023,6 @@ export async function hourWiseDownstores( req, res ) {
|
|
|
998
1023
|
$match: {
|
|
999
1024
|
'$and': [
|
|
1000
1025
|
{ 'clientId': req.body.clientId },
|
|
1001
|
-
{ 'edge.firstFile': true },
|
|
1002
1026
|
{ 'status': 'active' },
|
|
1003
1027
|
{ 'createdAt': { $lte: new Date( req.body.toDate ) } },
|
|
1004
1028
|
],
|
|
@@ -457,7 +457,7 @@ export async function viewedgeAppLog( req, res ) {
|
|
|
457
457
|
if ( !store ) {
|
|
458
458
|
return res.sendError( 'Stores Not fond', 204 );
|
|
459
459
|
}
|
|
460
|
-
const inputDate = dayjs( req.body.Date ).format( '
|
|
460
|
+
const inputDate = dayjs( req.body.Date ).format( 'DD-MM-YYYY' );
|
|
461
461
|
const fromTime = req.body.from;
|
|
462
462
|
const toTime = req.body.to;
|
|
463
463
|
let response = {};
|
|
@@ -475,12 +475,12 @@ export async function viewedgeAppLog( req, res ) {
|
|
|
475
475
|
},
|
|
476
476
|
{
|
|
477
477
|
'term': {
|
|
478
|
-
'store_date.keyword':
|
|
478
|
+
'store_date.keyword': inputDate,
|
|
479
479
|
},
|
|
480
480
|
},
|
|
481
481
|
{
|
|
482
482
|
'term': {
|
|
483
|
-
'
|
|
483
|
+
'storeId.keyword': req.body.storeId,
|
|
484
484
|
},
|
|
485
485
|
},
|
|
486
486
|
{
|
|
@@ -488,8 +488,12 @@ export async function viewedgeAppLog( req, res ) {
|
|
|
488
488
|
'log_subtype.keyword': 'AppStart_Time',
|
|
489
489
|
},
|
|
490
490
|
},
|
|
491
|
+
{
|
|
492
|
+
'term': {
|
|
493
|
+
'data.message.keyword': 'Login Success Event',
|
|
494
|
+
},
|
|
495
|
+
},
|
|
491
496
|
],
|
|
492
|
-
|
|
493
497
|
},
|
|
494
498
|
},
|
|
495
499
|
};
|
|
@@ -509,17 +513,22 @@ export async function viewedgeAppLog( req, res ) {
|
|
|
509
513
|
},
|
|
510
514
|
{
|
|
511
515
|
'term': {
|
|
512
|
-
'store_date.keyword':
|
|
516
|
+
'store_date.keyword': inputDate,
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
'term': {
|
|
521
|
+
'storeId.keyword': req.body.storeId,
|
|
513
522
|
},
|
|
514
523
|
},
|
|
515
524
|
{
|
|
516
525
|
'term': {
|
|
517
|
-
'
|
|
526
|
+
'log_subtype.keyword': 'App_Quit_Time',
|
|
518
527
|
},
|
|
519
528
|
},
|
|
520
529
|
{
|
|
521
530
|
'term': {
|
|
522
|
-
'
|
|
531
|
+
'data.message.keyword': 'App Quit With password',
|
|
523
532
|
},
|
|
524
533
|
},
|
|
525
534
|
],
|
|
@@ -550,17 +559,17 @@ export async function viewedgeAppLog( req, res ) {
|
|
|
550
559
|
},
|
|
551
560
|
{
|
|
552
561
|
'term': {
|
|
553
|
-
'store_date.keyword':
|
|
562
|
+
'store_date.keyword': inputDate,
|
|
554
563
|
},
|
|
555
564
|
},
|
|
556
565
|
{
|
|
557
566
|
'term': {
|
|
558
|
-
'
|
|
567
|
+
'storeId.keyword': req.body.storeId,
|
|
559
568
|
},
|
|
560
569
|
},
|
|
561
570
|
{
|
|
562
571
|
'term': {
|
|
563
|
-
'log_subtype.keyword': '
|
|
572
|
+
'log_subtype.keyword': 'App_Close_Event',
|
|
564
573
|
},
|
|
565
574
|
},
|
|
566
575
|
],
|
|
@@ -592,12 +601,12 @@ export async function viewedgeAppLog( req, res ) {
|
|
|
592
601
|
},
|
|
593
602
|
{
|
|
594
603
|
'term': {
|
|
595
|
-
'store_date.keyword':
|
|
604
|
+
'store_date.keyword': inputDate,
|
|
596
605
|
},
|
|
597
606
|
},
|
|
598
607
|
{
|
|
599
608
|
'term': {
|
|
600
|
-
'
|
|
609
|
+
'storeId.keyword': req.body.storeId,
|
|
601
610
|
},
|
|
602
611
|
},
|
|
603
612
|
{
|
|
@@ -618,7 +627,6 @@ export async function viewedgeAppLog( req, res ) {
|
|
|
618
627
|
let suspendedTime;
|
|
619
628
|
let resumedTime;
|
|
620
629
|
const differences = [];
|
|
621
|
-
|
|
622
630
|
for ( const sourceData of screenStatus.body.hits.hits ) {
|
|
623
631
|
if ( Number( sourceData._source.data.occuringTime.split( ':' )[0] )== Number( fromTime.split( ':' )[0] ) ) {
|
|
624
632
|
if ( sourceData._source.data.message.trim() === 'SYSTEM SUSPENDED' ) {
|
|
@@ -653,7 +661,7 @@ export async function viewedgeAppLog( req, res ) {
|
|
|
653
661
|
},
|
|
654
662
|
{
|
|
655
663
|
'term': {
|
|
656
|
-
'store_date.keyword':
|
|
664
|
+
'store_date.keyword': inputDate,
|
|
657
665
|
},
|
|
658
666
|
},
|
|
659
667
|
{
|
|
@@ -705,12 +713,12 @@ export async function viewedgeAppLog( req, res ) {
|
|
|
705
713
|
},
|
|
706
714
|
{
|
|
707
715
|
'term': {
|
|
708
|
-
'
|
|
716
|
+
'storeId.keyword': req.body.storeId,
|
|
709
717
|
},
|
|
710
718
|
},
|
|
711
719
|
{
|
|
712
720
|
'term': {
|
|
713
|
-
'store_date.keyword':
|
|
721
|
+
'store_date.keyword': inputDate,
|
|
714
722
|
},
|
|
715
723
|
},
|
|
716
724
|
{
|
|
@@ -727,8 +735,16 @@ export async function viewedgeAppLog( req, res ) {
|
|
|
727
735
|
],
|
|
728
736
|
},
|
|
729
737
|
);
|
|
730
|
-
response.antiVirus = antiVirus.body.hits.hits.length > 0 && antiVirus.body.hits.hits[0]._source.data.message == 'st-launch-1.0.exe is deleted' ? antiVirus.body.hits.hits[0]._source.data.occuringTime : '';
|
|
731
|
-
|
|
738
|
+
// response.antiVirus = antiVirus.body.hits.hits.length > 0 && antiVirus.body.hits.hits[0]._source.data.message == 'st-launch-1.0.exe is deleted' ? antiVirus.body.hits.hits[0]._source.data.occuringTime : '';
|
|
739
|
+
if ( antiVirus.body.hits.hits&&antiVirus.body.hits.hits.length > 0 ) {
|
|
740
|
+
for ( const sourceData of antiVirus.body.hits.hits ) {
|
|
741
|
+
if ( Number( sourceData._source.data.occuringTime.split( ':' )[0] )== Number( fromTime.split( ':' )[0] ) ) {
|
|
742
|
+
if ( sourceData._source.data.message == 'st-launch-1.0.exe is deleted' ) {
|
|
743
|
+
response.antiVirus = antiVirus.body.hits.hits.length > 0 ? sourceData._source.data.occuringTime : '';
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
732
748
|
|
|
733
749
|
res.sendSuccess( response );
|
|
734
750
|
} catch ( error ) {
|
|
@@ -55,24 +55,24 @@ export async function validateTicket( req, res, next ) {
|
|
|
55
55
|
{
|
|
56
56
|
'basicDetails.storeId': req.body.basicDetails.storeId,
|
|
57
57
|
'issueType': 'infra',
|
|
58
|
-
'
|
|
58
|
+
'status': { $ne: 'closed' },
|
|
59
59
|
},
|
|
60
60
|
);
|
|
61
61
|
if ( Ticket ) {
|
|
62
|
-
return res.sendSuccess( 'Infra Ticket Already Exists
|
|
62
|
+
return res.sendSuccess( 'Infra Ticket Already Exists' );
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
let refreshTicket = await findOneTangoTicket(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
);
|
|
73
|
-
if ( refreshTicket ) {
|
|
74
|
-
|
|
75
|
-
}
|
|
65
|
+
// let refreshTicket = await findOneTangoTicket(
|
|
66
|
+
// {
|
|
67
|
+
// 'basicDetails.storeId': req.body.basicDetails.storeId,
|
|
68
|
+
// 'issueType': 'infra',
|
|
69
|
+
// 'status': { $ne: 'closed' },
|
|
70
|
+
// 'ticketDetails.ticketRefreshTime': { $lte: new Date() },
|
|
71
|
+
// },
|
|
72
|
+
// );
|
|
73
|
+
// if ( refreshTicket ) {
|
|
74
|
+
// return res.sendSuccess( 'refreshTicket Ticket Already Exists for the Store' );
|
|
75
|
+
// }
|
|
76
76
|
} else if ( req.body.issueType == 'installation' ) {
|
|
77
77
|
let Ticket = await findOneTangoTicket(
|
|
78
78
|
{
|