tango-app-api-audit 3.3.0-alpha.6 → 3.3.0-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.3.0-alpha.6",
3
+ "version": "3.3.0-alpha.8",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -717,8 +717,6 @@ export async function getAuditImage( msg ) {
717
717
 
718
718
  export const getReauditImg = async ( filter, image ) => {
719
719
  const chunkedMappingData = await chunkArray( image, 10 );
720
- logger.info( { chunkedMappingData: chunkedMappingData, level: 5 } );
721
-
722
720
  const promises = chunkedMappingData.map( async ( chunk ) => {
723
721
  return mapFunction( chunk, filter );
724
722
  } );
@@ -3099,6 +3097,7 @@ export async function auditImages( req, res ) {
3099
3097
  }
3100
3098
 
3101
3099
  const reauditImg = await getReauditImg( filterData, auditImageAC );
3100
+ logger.info( { reauditImg: reauditImg } );
3102
3101
  if ( reauditImg?.length == 0 ) {
3103
3102
  return res.sendError( 'No Data Found', 204 );
3104
3103
  }
@@ -212,9 +212,10 @@ export async function getAuditImageData( data ) {
212
212
  const fileDate = data.fileDate;
213
213
  const files = [];
214
214
  const fetchData = {
215
- Bucket: `${bucket.auditUploadBucket}`,
215
+ Bucket: `${bucket.auditInput}`,
216
216
  filePath: `${fileDate}/${storeId}/${data.zoneName}/`,
217
217
  };
218
+
218
219
  const folderPath = await listFileWithoutLimit( fetchData );
219
220
  if ( folderPath.statusCode == 404 ) {
220
221
  return folderPath;
@@ -233,11 +234,10 @@ export async function getAuditImageData( data ) {
233
234
  };
234
235
  const data = await signedUrl( params );
235
236
  files.push( {
236
- imgPath: data,
237
- imgName: indexes[1],
238
- imgId: image[0],
237
+ img_path: data,
239
238
  img_name: indexes[1],
240
- // imgFile: auditImages[i],
239
+ img_id: image[0],
240
+ imgFile: auditImages[i],
241
241
  } );
242
242
  }
243
243
  return files;
@@ -254,9 +254,8 @@ export async function getAuditImageData( data ) {
254
254
  };
255
255
  const data = await signedUrl( params );
256
256
  files.push( {
257
- imgPath: data,
258
- imgName: indexes[1],
259
- imgId: image[0],
257
+ img_path: data,
258
+ img_id: image[0],
260
259
  imgFile: auditImages[i],
261
260
  img_name: indexes[1],
262
261
  } );
@@ -272,6 +271,7 @@ export async function getAuditImageData( data ) {
272
271
 
273
272
  export async function zipDownloadImage( data ) {
274
273
  try {
274
+ logger.info( { zipDownloadImage: data } );
275
275
  const bucket = JSON.parse( process.env.BUCKET );
276
276
  const zip = new AdmZip();
277
277
  const split = await chunkArray( data, 10 );
@@ -281,6 +281,7 @@ export async function zipDownloadImage( data ) {
281
281
  Bucket: `${bucket.auditInput}`,
282
282
  Key: chunk[i].imgFile.Key,
283
283
  };
284
+ logger.info( { params: params } );
284
285
  const fileBuffer = await getObject( params );
285
286
  zip.addFile( chunk[i].imgFile.Key, fileBuffer.Body );
286
287
  }