tango-app-api-trax 3.7.27 → 3.7.28
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,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-trax",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.28",
|
|
4
4
|
"description": "Trax",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"start": "nodemon --exec \"eslint --fix . && node
|
|
8
|
+
"start": "nodemon --exec \"eslint --fix . && node app.js\""
|
|
9
9
|
},
|
|
10
10
|
"engines": {
|
|
11
11
|
"node": ">=18.10.0"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"mongodb": "^6.8.0",
|
|
28
28
|
"nodemon": "^3.1.4",
|
|
29
29
|
"path": "^0.12.7",
|
|
30
|
-
"tango-api-schema": "^2.
|
|
30
|
+
"tango-api-schema": "^2.5.31",
|
|
31
31
|
"tango-app-api-middleware": "^3.5.2",
|
|
32
32
|
"url": "^0.11.4",
|
|
33
33
|
"winston": "^3.13.1",
|
|
@@ -305,7 +305,7 @@ export async function PCLconfigCreation( req, res ) {
|
|
|
305
305
|
},
|
|
306
306
|
} );
|
|
307
307
|
let getSections = await CLquestions.aggregate( sectionQuery );
|
|
308
|
-
if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
308
|
+
if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
|
|
309
309
|
if ( getSections.length ) {
|
|
310
310
|
for ( let element3 of getSections ) {
|
|
311
311
|
let collectQuestions = {};
|
|
@@ -604,11 +604,11 @@ export async function PCLconfigCreation( req, res ) {
|
|
|
604
604
|
// }
|
|
605
605
|
}
|
|
606
606
|
} else {
|
|
607
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
607
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
|
|
608
608
|
let storeNameList = allQuestion.map( ( item ) => item.store_id );
|
|
609
|
-
let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
|
|
609
|
+
let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
|
|
610
610
|
let storeList = storeDetails.map( ( store ) => store.storeId );
|
|
611
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
611
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
|
|
612
612
|
allQuestion = allQuestion.filter( ( ele ) => storeList.includes( ele?.store_id ) );
|
|
613
613
|
} else {
|
|
614
614
|
allQuestion = storeDetails.map( ( item ) => {
|
|
@@ -642,7 +642,7 @@ export async function PCLconfigCreation( req, res ) {
|
|
|
642
642
|
client_id: getCLconfig.client_id,
|
|
643
643
|
aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => store.store_id ) : [],
|
|
644
644
|
};
|
|
645
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
645
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
|
|
646
646
|
let processData = {
|
|
647
647
|
aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => {
|
|
648
648
|
return { storeName: store.storeName, storeId: store.store_id, events: store.events };
|
|
@@ -883,7 +883,7 @@ async function insertData( requestData ) {
|
|
|
883
883
|
},
|
|
884
884
|
} );
|
|
885
885
|
let getSections = await CLquestions.aggregate( sectionQuery );
|
|
886
|
-
if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
886
|
+
if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
|
|
887
887
|
if ( getSections.length ) {
|
|
888
888
|
for ( let element3 of getSections ) {
|
|
889
889
|
let collectQuestions = {};
|
|
@@ -1178,11 +1178,11 @@ async function insertData( requestData ) {
|
|
|
1178
1178
|
// }
|
|
1179
1179
|
}
|
|
1180
1180
|
} else {
|
|
1181
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
1181
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
|
|
1182
1182
|
let storeNameList = allQuestion.map( ( item ) => item.store_id );
|
|
1183
|
-
let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
|
|
1183
|
+
let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
|
|
1184
1184
|
let storeList = storeDetails.map( ( store ) => store.storeId );
|
|
1185
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
1185
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
|
|
1186
1186
|
allQuestion = allQuestion.filter( ( ele ) => storeList.includes( ele?.store_id ) );
|
|
1187
1187
|
} else {
|
|
1188
1188
|
allQuestion = storeDetails.map( ( item ) => {
|
|
@@ -1216,7 +1216,7 @@ async function insertData( requestData ) {
|
|
|
1216
1216
|
client_id: getCLconfig.client_id,
|
|
1217
1217
|
aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => store.store_id ) : [],
|
|
1218
1218
|
};
|
|
1219
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
1219
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
|
|
1220
1220
|
let processData = {
|
|
1221
1221
|
aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => {
|
|
1222
1222
|
return { storeName: store.storeName, storeId: store.store_id, events: store.events };
|
|
@@ -606,7 +606,7 @@ export const flagCardsV1 = async ( req, res ) => {
|
|
|
606
606
|
{
|
|
607
607
|
client_id: clientId,
|
|
608
608
|
publish: true,
|
|
609
|
-
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter' ] },
|
|
609
|
+
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ] },
|
|
610
610
|
},
|
|
611
611
|
{ checkListType: 1 },
|
|
612
612
|
);
|
|
@@ -2738,7 +2738,7 @@ export const checklistDropdownV1 = async ( req, res ) => {
|
|
|
2738
2738
|
$or: [
|
|
2739
2739
|
{ questionFlag: { $gte: 1 } },
|
|
2740
2740
|
{ timeFlag: { $gte: 1 } },
|
|
2741
|
-
{ checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter' ] } },
|
|
2741
|
+
{ checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ] } },
|
|
2742
2742
|
{
|
|
2743
2743
|
runAIQuestionCount: { $gte: 1 },
|
|
2744
2744
|
},
|
|
@@ -2940,7 +2940,7 @@ export const flagComparisonCardsV2 = async ( req, res ) => {
|
|
|
2940
2940
|
{
|
|
2941
2941
|
client_id: requestData.clientId,
|
|
2942
2942
|
publish: true,
|
|
2943
|
-
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter' ] },
|
|
2943
|
+
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ] },
|
|
2944
2944
|
},
|
|
2945
2945
|
{ checkListType: 1 },
|
|
2946
2946
|
);
|
|
@@ -3042,7 +3042,7 @@ export const flagTablesV2 = async ( req, res ) => {
|
|
|
3042
3042
|
}
|
|
3043
3043
|
|
|
3044
3044
|
if ( requestData?.filter === 'all' ) {
|
|
3045
|
-
findAndQuery.push( { $or: [ { checkListType: { $in: [ 'custom', 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter' ] } } ] } );
|
|
3045
|
+
findAndQuery.push( { $or: [ { checkListType: { $in: [ 'custom', 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ] } } ] } );
|
|
3046
3046
|
} else if ( requestData?.filter === 'question' ) {
|
|
3047
3047
|
findAndQuery.push( { checkListType: 'custom' } );
|
|
3048
3048
|
findAndQuery.push( { questionFlag: { $gte: 1 } } );
|
|
@@ -3050,7 +3050,7 @@ export const flagTablesV2 = async ( req, res ) => {
|
|
|
3050
3050
|
findAndQuery.push( { checkListType: 'custom' } );
|
|
3051
3051
|
findAndQuery.push( { timeFlag: { $gte: 1 } } );
|
|
3052
3052
|
} else if ( requestData?.filter === 'detection' ) {
|
|
3053
|
-
findAndQuery.push( { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter' ] } } );
|
|
3053
|
+
findAndQuery.push( { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ] } } );
|
|
3054
3054
|
} else if ( requestData?.filter === 'runAI' ) {
|
|
3055
3055
|
if ( req.body.runAIChecklistName ) {
|
|
3056
3056
|
findAndQuery.push( { checkListName: { $in: req.body.runAIChecklistName } } );
|
|
@@ -596,6 +596,7 @@ export const zoneList = async ( req, res ) => {
|
|
|
596
596
|
'Outside Business Hours Queue Tracking',
|
|
597
597
|
'Store Half Shutter Detection',
|
|
598
598
|
'Mobile usage detection',
|
|
599
|
+
'Store TV Compliance',
|
|
599
600
|
];
|
|
600
601
|
|
|
601
602
|
if ( inputBody.checkListName && allowedChecklists.includes( inputBody.checkListName ) ) {
|
|
@@ -4049,7 +4050,7 @@ async function updateOpenSearch( user, data ) {
|
|
|
4049
4050
|
export const aiChecklist = async ( req, res ) => {
|
|
4050
4051
|
try {
|
|
4051
4052
|
let storeDetails = await storeService.count( { clientId: req.query.clientId, status: 'active' } );
|
|
4052
|
-
let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter' ];
|
|
4053
|
+
let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ];
|
|
4053
4054
|
let checklistDetails = [];
|
|
4054
4055
|
let publishList = [];
|
|
4055
4056
|
let unpublishList = [];
|
|
@@ -4062,7 +4063,7 @@ export const aiChecklist = async ( req, res ) => {
|
|
|
4062
4063
|
checklistDetails = [ ...publishList, ...unpublishList ];
|
|
4063
4064
|
|
|
4064
4065
|
checklistDetails.forEach( ( item ) => {
|
|
4065
|
-
if ( ![ 'mobileusagedetection', 'storeopenandclose', 'cleaning', 'scrum', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( item.checkListType ) ) {
|
|
4066
|
+
if ( ![ 'mobileusagedetection', 'storeopenandclose', 'cleaning', 'scrum', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( item.checkListType ) ) {
|
|
4066
4067
|
item.storeCount = storeDetails;
|
|
4067
4068
|
}
|
|
4068
4069
|
} );
|