tango-app-api-audit 3.4.11-alpha.5 → 3.4.11-alpha.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-audit",
|
|
3
|
-
"version": "3.4.11-alpha.
|
|
3
|
+
"version": "3.4.11-alpha.7",
|
|
4
4
|
"description": "audit & audit metrics apis",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"mongodb": "^6.7.0",
|
|
25
25
|
"nodemon": "^3.1.3",
|
|
26
26
|
"swagger-ui-express": "^5.0.1",
|
|
27
|
-
"tango-api-schema": "^2.1.
|
|
27
|
+
"tango-api-schema": "^2.1.36",
|
|
28
28
|
"tango-app-api-middleware": "^3.1.33",
|
|
29
29
|
"winston": "^3.13.0",
|
|
30
30
|
"winston-daily-rotate-file": "^5.0.0"
|
|
@@ -998,7 +998,7 @@ export async function getAuditFile( req, res ) {
|
|
|
998
998
|
logger.info( { query: query } );
|
|
999
999
|
const traxInfo = await findOneTraxAuditData( query );
|
|
1000
1000
|
if ( !traxInfo ) {
|
|
1001
|
-
return res.sendError( 'The
|
|
1001
|
+
return res.sendError( 'The source record not found', 400 );
|
|
1002
1002
|
}
|
|
1003
1003
|
msg =traxInfo?.sqs?.Body;
|
|
1004
1004
|
break;
|
|
@@ -1043,40 +1043,39 @@ export async function getAuditFile( req, res ) {
|
|
|
1043
1043
|
];
|
|
1044
1044
|
break;
|
|
1045
1045
|
case 'uniform-detection':
|
|
1046
|
-
|
|
1047
|
-
const files = [];
|
|
1046
|
+
const files = [];
|
|
1048
1047
|
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1048
|
+
const params ={
|
|
1049
|
+
Bucket: msg.inputBucketName,
|
|
1050
|
+
Key: msg?.filePath,
|
|
1051
|
+
};
|
|
1053
1052
|
|
|
1054
|
-
|
|
1053
|
+
const isExists = await checkFileExist( params );
|
|
1055
1054
|
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1055
|
+
if ( isExists ) {
|
|
1056
|
+
const signedParams ={
|
|
1057
|
+
Bucket: msg.inputBucketName,
|
|
1058
|
+
file_path: msg?.filePath,
|
|
1059
|
+
};
|
|
1060
|
+
const data = await signedUrl( signedParams );
|
|
1062
1061
|
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
}
|
|
1067
|
-
// else {
|
|
1068
|
-
// logger.error( {
|
|
1069
|
-
// error: { folderPath: folderPath },
|
|
1070
|
-
// function: `getAuditFile - ${inputData.moduleType}`,
|
|
1071
|
-
// message: 'Bucket image data not availale',
|
|
1072
|
-
// } );
|
|
1073
|
-
// return res.sendError( 'Bucket is Empty', 204 );
|
|
1074
|
-
// }
|
|
1075
|
-
result.push( {
|
|
1076
|
-
type: msg.fileDetails[i].type,
|
|
1077
|
-
file: files,
|
|
1078
|
-
} );
|
|
1062
|
+
files.push(
|
|
1063
|
+
data,
|
|
1064
|
+
);
|
|
1079
1065
|
}
|
|
1066
|
+
// else {
|
|
1067
|
+
// logger.error( {
|
|
1068
|
+
// error: { folderPath: folderPath },
|
|
1069
|
+
// function: `getAuditFile - ${inputData.moduleType}`,
|
|
1070
|
+
// message: 'Bucket image data not availale',
|
|
1071
|
+
// } );
|
|
1072
|
+
// return res.sendError( 'Bucket is Empty', 204 );
|
|
1073
|
+
// }
|
|
1074
|
+
result.push( {
|
|
1075
|
+
type: 'image',
|
|
1076
|
+
file: files,
|
|
1077
|
+
} );
|
|
1078
|
+
|
|
1080
1079
|
break;
|
|
1081
1080
|
case 'unattended-customer':
|
|
1082
1081
|
case 'left-in-middle':
|
|
@@ -1491,6 +1490,7 @@ export async function saveBinary( req, res ) {
|
|
|
1491
1490
|
tempId: inputData.tempId,
|
|
1492
1491
|
moduleType: inputData.moduleType,
|
|
1493
1492
|
answer: inputData.answer,
|
|
1493
|
+
inputBucketName: getFilePath?.inputBucketName,
|
|
1494
1494
|
filePath: getFilePath?.sqs?.Body?.filePath,
|
|
1495
1495
|
} ),
|
|
1496
1496
|
};
|
|
@@ -4535,8 +4535,8 @@ export async function save( req, res ) {
|
|
|
4535
4535
|
}
|
|
4536
4536
|
const tempId=[];
|
|
4537
4537
|
if ( inputData.employeeCount > 0 ) {
|
|
4538
|
-
for ( let i =0; i<employee.length; i++ ) {
|
|
4539
|
-
tempId.push( employee[i].img_id );
|
|
4538
|
+
for ( let i =0; i<inputData?.employee.length; i++ ) {
|
|
4539
|
+
tempId.push( inputData?.employee[i].img_id );
|
|
4540
4540
|
}
|
|
4541
4541
|
}
|
|
4542
4542
|
const sqsProduceQueue = {
|
|
@@ -4545,6 +4545,7 @@ export async function save( req, res ) {
|
|
|
4545
4545
|
storeId: inputData.storeId,
|
|
4546
4546
|
fileDate: inputData.fileDate,
|
|
4547
4547
|
moduleType: inputData.moduleType,
|
|
4548
|
+
inputBucketName: getFilePath?.inputBucketName,
|
|
4548
4549
|
tempId: tempId,
|
|
4549
4550
|
count: inputData.employeeCount,
|
|
4550
4551
|
folderPath: getFilePath?.sqs?.Body?.folderPath,
|