tango-app-api-trax 3.7.5-halfshutter-2 → 3.7.5-halfshutter-4
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
|
@@ -302,7 +302,7 @@ export async function PCLconfigCreation( req, res ) {
|
|
|
302
302
|
},
|
|
303
303
|
} );
|
|
304
304
|
let getSections = await CLquestions.aggregate( sectionQuery );
|
|
305
|
-
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' ].includes( getCLconfig.checkListType ) ) {
|
|
305
|
+
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 ) ) {
|
|
306
306
|
if ( getSections.length ) {
|
|
307
307
|
for ( let element3 of getSections ) {
|
|
308
308
|
let collectQuestions = {};
|
|
@@ -600,11 +600,11 @@ export async function PCLconfigCreation( req, res ) {
|
|
|
600
600
|
// }
|
|
601
601
|
}
|
|
602
602
|
} else {
|
|
603
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking' ].includes( getCLconfig.checkListType ) ) {
|
|
603
|
+
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 ) ) {
|
|
604
604
|
let storeNameList = allQuestion.map( ( item ) => item.store_id );
|
|
605
|
-
let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
|
|
605
|
+
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 } );
|
|
606
606
|
let storeList = storeDetails.map( ( store ) => store.storeId );
|
|
607
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking' ].includes( getCLconfig.checkListType ) ) {
|
|
607
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
608
608
|
allQuestion = allQuestion.filter( ( ele ) => storeList.includes( ele?.store_id ) );
|
|
609
609
|
} else {
|
|
610
610
|
allQuestion = storeDetails.map( ( item ) => {
|
|
@@ -638,7 +638,7 @@ export async function PCLconfigCreation( req, res ) {
|
|
|
638
638
|
client_id: getCLconfig.client_id,
|
|
639
639
|
aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => store.store_id ) : [],
|
|
640
640
|
};
|
|
641
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking' ].includes( getCLconfig.checkListType ) ) {
|
|
641
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
642
642
|
let processData = {
|
|
643
643
|
aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => {
|
|
644
644
|
return { storeName: store.storeName, storeId: store.store_id, events: store.events };
|
|
@@ -878,7 +878,7 @@ async function insertData( requestData ) {
|
|
|
878
878
|
},
|
|
879
879
|
} );
|
|
880
880
|
let getSections = await CLquestions.aggregate( sectionQuery );
|
|
881
|
-
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' ].includes( getCLconfig.checkListType ) ) {
|
|
881
|
+
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 ) ) {
|
|
882
882
|
if ( getSections.length ) {
|
|
883
883
|
for ( let element3 of getSections ) {
|
|
884
884
|
let collectQuestions = {};
|
|
@@ -1172,11 +1172,11 @@ async function insertData( requestData ) {
|
|
|
1172
1172
|
// }
|
|
1173
1173
|
}
|
|
1174
1174
|
} else {
|
|
1175
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking' ].includes( getCLconfig.checkListType ) ) {
|
|
1175
|
+
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 ) ) {
|
|
1176
1176
|
let storeNameList = allQuestion.map( ( item ) => item.store_id );
|
|
1177
|
-
let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
|
|
1177
|
+
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 } );
|
|
1178
1178
|
let storeList = storeDetails.map( ( store ) => store.storeId );
|
|
1179
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking' ].includes( getCLconfig.checkListType ) ) {
|
|
1179
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
1180
1180
|
allQuestion = allQuestion.filter( ( ele ) => storeList.includes( ele?.store_id ) );
|
|
1181
1181
|
} else {
|
|
1182
1182
|
allQuestion = storeDetails.map( ( item ) => {
|
|
@@ -1210,7 +1210,7 @@ async function insertData( requestData ) {
|
|
|
1210
1210
|
client_id: getCLconfig.client_id,
|
|
1211
1211
|
aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => store.store_id ) : [],
|
|
1212
1212
|
};
|
|
1213
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking' ].includes( getCLconfig.checkListType ) ) {
|
|
1213
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
1214
1214
|
let processData = {
|
|
1215
1215
|
aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => {
|
|
1216
1216
|
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' ] },
|
|
609
|
+
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter' ] },
|
|
610
610
|
},
|
|
611
611
|
{ checkListType: 1 },
|
|
612
612
|
);
|
|
@@ -2584,7 +2584,6 @@ export const flagChecklistTableV1 = async ( req, res ) => {
|
|
|
2584
2584
|
// let LamdaURL = 'https://vpcejaftccr3jzqf5wrdkks7yy0krqix.lambda-url.ap-south-1.on.aws/'; // Prod
|
|
2585
2585
|
let LamdaURL = url.flagChecklistTableV1; // test
|
|
2586
2586
|
let resultData = await LamdaServiceCall( LamdaURL, reqestData );
|
|
2587
|
-
// console.log( 'resultData =>', resultData );
|
|
2588
2587
|
if ( resultData ) {
|
|
2589
2588
|
if ( resultData.status_code == '200' ) {
|
|
2590
2589
|
if ( reqestData?.filter === 'runAI' ) {
|
|
@@ -2739,7 +2738,7 @@ export const checklistDropdownV1 = async ( req, res ) => {
|
|
|
2739
2738
|
$or: [
|
|
2740
2739
|
{ questionFlag: { $gte: 1 } },
|
|
2741
2740
|
{ timeFlag: { $gte: 1 } },
|
|
2742
|
-
{ checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking' ] } },
|
|
2741
|
+
{ checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter' ] } },
|
|
2743
2742
|
{
|
|
2744
2743
|
runAIQuestionCount: { $gte: 1 },
|
|
2745
2744
|
},
|
|
@@ -2941,7 +2940,7 @@ export const flagComparisonCardsV2 = async ( req, res ) => {
|
|
|
2941
2940
|
{
|
|
2942
2941
|
client_id: requestData.clientId,
|
|
2943
2942
|
publish: true,
|
|
2944
|
-
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking' ] },
|
|
2943
|
+
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter' ] },
|
|
2945
2944
|
},
|
|
2946
2945
|
{ checkListType: 1 },
|
|
2947
2946
|
);
|
|
@@ -3033,7 +3032,8 @@ export const flagTablesV2 = async ( req, res ) => {
|
|
|
3033
3032
|
);
|
|
3034
3033
|
if ( requestData.clientId == '11' ) {
|
|
3035
3034
|
findAndQuery.push(
|
|
3036
|
-
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: requestData.userEmailes } } ] },
|
|
3035
|
+
// { $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: requestData.userEmailes } } ] },
|
|
3036
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: requestData.userEmailes } }, { aiStoreList: { $in: requestData.storeId } } ] },
|
|
3037
3037
|
);
|
|
3038
3038
|
} else {
|
|
3039
3039
|
findAndQuery.push(
|
|
@@ -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' ] } } ] } );
|
|
3045
|
+
findAndQuery.push( { $or: [ { checkListType: { $in: [ 'custom', 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter' ] } } ] } );
|
|
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' ] } } );
|
|
3053
|
+
findAndQuery.push( { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter' ] } } );
|
|
3054
3054
|
} else if ( requestData?.filter === 'runAI' ) {
|
|
3055
3055
|
if ( req.body.runAIChecklistName ) {
|
|
3056
3056
|
findAndQuery.push( { checkListName: { $in: req.body.runAIChecklistName } } );
|
|
@@ -3239,7 +3239,8 @@ export const flagTablesV2 = async ( req, res ) => {
|
|
|
3239
3239
|
} else {
|
|
3240
3240
|
if ( requestData?.filter == 'all' ) {
|
|
3241
3241
|
getChecklistPerformanceData[index].runAIFlag = 0;
|
|
3242
|
-
getChecklistPerformanceData[index].
|
|
3242
|
+
getChecklistPerformanceData[index].flagCount = resultData?.[getChecklistPerformanceData[index]?.checkListType] || 0;
|
|
3243
|
+
getChecklistPerformanceData[index].flaggedStores = resultData?.[`${getChecklistPerformanceData[index]?.checkListType}_flaggedstores`] || 0;
|
|
3243
3244
|
} else {
|
|
3244
3245
|
getChecklistPerformanceData[index].flagCount = 0;
|
|
3245
3246
|
getChecklistPerformanceData[index].flaggedStores = 0;
|
|
@@ -25,6 +25,7 @@ import * as clusterServices from '../services/cluster.service.js';
|
|
|
25
25
|
import * as teamsServices from '../services/teams.service.js';
|
|
26
26
|
import * as runAIFeatureServices from '../services/runAIFeatures.services.js';
|
|
27
27
|
import * as runAIRequestServices from '../services/runAIRequest.services.js';
|
|
28
|
+
import * as processedTaskService from '../services/processedTaskList.service.js';
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
export const checklist = async ( req, res ) => {
|
|
@@ -549,6 +550,7 @@ export const zoneList = async ( req, res ) => {
|
|
|
549
550
|
const allowedChecklists = [
|
|
550
551
|
'Outside Business Hours Queue Tracking',
|
|
551
552
|
'Store Half Shutter Detection',
|
|
553
|
+
'Mobile usage detection',
|
|
552
554
|
];
|
|
553
555
|
|
|
554
556
|
if ( inputBody.checkListName && allowedChecklists.includes( inputBody.checkListName ) ) {
|
|
@@ -4868,3 +4870,53 @@ export async function updateRunAIFeatures( req, res ) {
|
|
|
4868
4870
|
return res.sendError( error, 500 );
|
|
4869
4871
|
}
|
|
4870
4872
|
}
|
|
4873
|
+
|
|
4874
|
+
|
|
4875
|
+
export async function updateOSProcessedData( req, res ) {
|
|
4876
|
+
try {
|
|
4877
|
+
let requestData = req.body;
|
|
4878
|
+
let findQuery = [ {
|
|
4879
|
+
$match: {
|
|
4880
|
+
$and: [
|
|
4881
|
+
{ _id: new ObjectId( requestData._id ) },
|
|
4882
|
+
],
|
|
4883
|
+
},
|
|
4884
|
+
} ];
|
|
4885
|
+
if ( requestData.type && requestData.type=='checklist' ) {
|
|
4886
|
+
let getchecklist = await processedchecklist.aggregate( findQuery );
|
|
4887
|
+
if ( getchecklist && getchecklist.length > 0 ) {
|
|
4888
|
+
const requestOptions = {
|
|
4889
|
+
method: 'POST',
|
|
4890
|
+
headers: {
|
|
4891
|
+
'Content-Type': 'application/json',
|
|
4892
|
+
},
|
|
4893
|
+
body: JSON.stringify( { doc: { ...getchecklist[0] } } ),
|
|
4894
|
+
};
|
|
4895
|
+
let url = JSON.parse( process.env.LAMBDAURL );
|
|
4896
|
+
let searchResponse = await fetch( url.submitChecklist, requestOptions );
|
|
4897
|
+
return res.sendSuccess( searchResponse );
|
|
4898
|
+
} else {
|
|
4899
|
+
return res.sendError( { message: 'invalid _id' }, 400 );
|
|
4900
|
+
}
|
|
4901
|
+
} else if ( requestData.type && requestData.type=='task' ) {
|
|
4902
|
+
let gettask = await processedTaskService.aggregate( findQuery );
|
|
4903
|
+
if ( gettask && gettask.length > 0 ) {
|
|
4904
|
+
const requestOptions = {
|
|
4905
|
+
method: 'POST',
|
|
4906
|
+
headers: {
|
|
4907
|
+
'Content-Type': 'application/json',
|
|
4908
|
+
},
|
|
4909
|
+
body: JSON.stringify( { doc: { ...gettask[0] } } ),
|
|
4910
|
+
};
|
|
4911
|
+
let url = JSON.parse( process.env.LAMBDAURL );
|
|
4912
|
+
let searchResponse = await fetch( url.submitTask, requestOptions );
|
|
4913
|
+
return res.sendSuccess( searchResponse );
|
|
4914
|
+
} else {
|
|
4915
|
+
return res.sendError( { message: 'invalid _id' }, 400 );
|
|
4916
|
+
}
|
|
4917
|
+
}
|
|
4918
|
+
} catch ( e ) {
|
|
4919
|
+
logger.error( { functionName: 'updateCurlData', error: e } );
|
|
4920
|
+
return res.sendError( error, 500 );
|
|
4921
|
+
}
|
|
4922
|
+
}
|
|
@@ -185,4 +185,11 @@ export const runAIRequestValidation = {
|
|
|
185
185
|
body: runAIRequestSchema,
|
|
186
186
|
};
|
|
187
187
|
|
|
188
|
+
export const updateOSDataSchema = joi.object( {
|
|
189
|
+
_id: joi.string().required(),
|
|
190
|
+
type: joi.string().required(),
|
|
191
|
+
} );
|
|
188
192
|
|
|
193
|
+
export const updateOSDataValidation = {
|
|
194
|
+
body: updateOSDataSchema,
|
|
195
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { isAllowedSessionHandler, validate, accessVerification, isAllowedClient } from 'tango-app-api-middleware';
|
|
3
|
-
import { checklistValidation, checklistDetailsValidation, runaiValidation, checklistPageSchema, duplicateValidation, updateChecklistValidation, uploadUserValidation, aichecklistValidation, publishValidation, selectAssign, createChecklistNameValidation, runAIRequestValidation } from '../dtos/validation.dtos.js';
|
|
2
|
+
import { isAllowedSessionHandler, validate, accessVerification, isAllowedClient, isAllowedInternalAPIHandler } from 'tango-app-api-middleware';
|
|
3
|
+
import { checklistValidation, checklistDetailsValidation, runaiValidation, checklistPageSchema, duplicateValidation, updateChecklistValidation, uploadUserValidation, aichecklistValidation, publishValidation, selectAssign, createChecklistNameValidation, runAIRequestValidation, updateOSDataValidation } from '../dtos/validation.dtos.js';
|
|
4
4
|
import * as traxController from '../controllers/trax.controller.js';
|
|
5
5
|
|
|
6
6
|
export const traxRouter = express.Router();
|
|
@@ -34,6 +34,7 @@ traxRouter
|
|
|
34
34
|
.post( '/getRunAIFeatures', isAllowedSessionHandler, traxController.getRunAIFeatures )
|
|
35
35
|
.post( '/updateRunAIFeatures', isAllowedSessionHandler, traxController.updateRunAIFeatures )
|
|
36
36
|
.post( '/updateRunAIRequest', isAllowedSessionHandler, validate( runAIRequestValidation ), traxController.updateRunAIRequest )
|
|
37
|
-
.post( '/createChecklistName', isAllowedSessionHandler, validate( createChecklistNameValidation ), traxController.createChecklistName )
|
|
37
|
+
.post( '/createChecklistName', isAllowedSessionHandler, validate( createChecklistNameValidation ), traxController.createChecklistName )
|
|
38
|
+
.post( '/updateOSProcessedData', isAllowedInternalAPIHandler, validate( updateOSDataValidation ), traxController.updateOSProcessedData );
|
|
38
39
|
|
|
39
40
|
// isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ),
|