tango-app-api-audit 3.4.11-alpha.7 → 3.4.11-alpha.8

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.7",
3
+ "version": "3.4.11-alpha.8",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1251,46 +1251,35 @@ export async function getUpdatedFile( req, res ) {
1251
1251
  },
1252
1252
  ];
1253
1253
  break;
1254
- case 'unattended-customer':
1255
- for ( let i =0; i< msg.fileDetails.length; i++ ) {
1256
- const files = [];
1257
- const params ={
1254
+
1255
+ case 'uniform-detection':
1256
+ const files = [];
1257
+
1258
+ const params ={
1259
+ Bucket: msg.inputBucketName,
1260
+ Key: msg?.filePath,
1261
+ };
1262
+
1263
+ const isExists = await checkFileExist( params );
1264
+
1265
+ if ( isExists ) {
1266
+ const signedParams ={
1258
1267
  Bucket: msg.inputBucketName,
1259
- file_path: msg?.fileDetails[i]?.folderPath,
1260
- MaxKeys: 1000,
1268
+ file_path: msg?.filePath,
1261
1269
  };
1262
- const list = await listFileByPath( params );
1263
- const folderPath = list.data;
1264
- logger.info( { folderPath: list, params: params, list: list } );
1265
- if ( folderPath?.length ) {
1266
- for ( let i = 0; i < folderPath.length; i++ ) {
1267
- // const img = folderPath[i].Key.split( '/' );
1268
- // const image = img[3].split( '.' );
1269
- // const indexes = image[0].split( '_' );
1270
- const signedParams ={
1271
- Bucket: msg.inputBucketName,
1272
- file_path: folderPath[i].Key,
1273
- };
1274
- const data = await signedUrl( signedParams );
1270
+ const data = await signedUrl( signedParams );
1275
1271
 
1276
- files.push(
1277
- data,
1278
- );
1279
- }
1280
- } else {
1281
- logger.error( {
1282
- error: { folderPath: folderPath },
1283
- function: `getAuditFile - ${inputData.moduleType}`,
1284
- message: 'Bucket image data not availale',
1285
- } );
1286
- return res.sendError( 'Bucket is Empty', 204 );
1287
- }
1288
- result.push( {
1289
- type: msg.fileDetails[i].type,
1290
- file: files,
1291
- } );
1272
+ files.push(
1273
+ data,
1274
+ );
1292
1275
  }
1276
+ result.push( {
1277
+ type: 'image',
1278
+ file: files,
1279
+ } );
1280
+
1293
1281
  break;
1282
+ case 'unattended-customer':
1294
1283
  case 'left-in-middle':
1295
1284
  for ( let i =0; i< msg.fileDetails.length; i++ ) {
1296
1285
  const files = [];
@@ -1490,7 +1479,7 @@ export async function saveBinary( req, res ) {
1490
1479
  tempId: inputData.tempId,
1491
1480
  moduleType: inputData.moduleType,
1492
1481
  answer: inputData.answer,
1493
- inputBucketName: getFilePath?.inputBucketName,
1482
+ inputBucketName: getFilePath?.sqs?.Body?.inputBucketName,
1494
1483
  filePath: getFilePath?.sqs?.Body?.filePath,
1495
1484
  } ),
1496
1485
  };
@@ -4545,7 +4534,7 @@ export async function save( req, res ) {
4545
4534
  storeId: inputData.storeId,
4546
4535
  fileDate: inputData.fileDate,
4547
4536
  moduleType: inputData.moduleType,
4548
- inputBucketName: getFilePath?.inputBucketName,
4537
+ inputBucketName: getFilePath?.sqs?.Body?.inputBucketName,
4549
4538
  tempId: tempId,
4550
4539
  count: inputData.employeeCount,
4551
4540
  folderPath: getFilePath?.sqs?.Body?.folderPath,