tango-app-api-audit 3.6.42-eyetest-dynamicization.3 → 3.6.42-eyetest-dynamicization.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-audit",
3
- "version": "3.6.42-eyetest-dynamicization.3",
3
+ "version": "3.6.42-eyetest-dynamicization.4",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -29,7 +29,7 @@
29
29
  "nodemon": "^3.1.3",
30
30
  "swagger-ui-express": "^5.0.1",
31
31
  "tango-api-schema": "^2.5.27",
32
- "tango-app-api-middleware": "^3.6.16",
32
+ "tango-app-api-middleware": "^3.6.17",
33
33
  "winston": "^3.13.0",
34
34
  "winston-daily-rotate-file": "^5.0.0"
35
35
  },
@@ -401,6 +401,7 @@ export async function viewFile( req, res ) {
401
401
  const bucket = JSON.parse( process.env.BUCKET );
402
402
  // const url = JSON.parse( process.env.URL );
403
403
  const updatedDate = process.env.EYE_TEST_UPDATED_DATE;
404
+ const remoteUpdatedDate = process.env.REMOTE_UPDATED_DATE;
404
405
  let isEnable =true;
405
406
  const order = [
406
407
  'Distance-VA-Check',
@@ -476,7 +477,7 @@ export async function viewFile( req, res ) {
476
477
  const getUserName = await findOneUser( { _id: new mongoose.Types.ObjectId( temp?._source?.userId ) }, { userName: 1 } );
477
478
  const inputBucketName = getData?.type === 'remote'? bucket?.remoteInput : bucket?.physicalInput;
478
479
  const inputOldBucketName = getData?.type === 'remote'? bucket?.remoteOldInput : bucket?.physicalOldInput;
479
- const configDate = new Date( updatedDate );
480
+ const configDate = getData?.type === 'remote'? new Date( remoteUpdatedDate ): new Date( updatedDate );
480
481
  const fileDate = new Date( getData?.fileDate );
481
482
  const params = {
482
483
  file_path: getData?.filePath,
@@ -606,6 +607,7 @@ export async function getFile( req, res ) {
606
607
  const openSearch = JSON.parse( process.env.OPENSEARCH );
607
608
  const bucket = JSON.parse( process.env.BUCKET );
608
609
  const updatedDate = process.env.EYE_TEST_UPDATED_DATE;
610
+ const remoteUpdatedDate = process.env.REMOTE_UPDATED_DATE;
609
611
  const getInput = await getOpenSearchById( openSearch.EyeTestInput, inputData.id );
610
612
  if ( !getInput || !getInput?.body ) {
611
613
  return res.sendError( 'No Data Found', 204 );
@@ -659,7 +661,7 @@ export async function getFile( req, res ) {
659
661
  const searchData = searchRes?.body?.hits?.hits?.lenght > 0? searchRes?.body?.hits?.hits[0] : null;
660
662
  const inputBucketName = getData?.type === 'remote'? bucket?.remoteInput : bucket?.physicalInput;
661
663
  const inputOldBucketName = getData?.type === 'remote'? bucket?.remoteOldInput : bucket?.physicalOldInput;
662
- const configDate = new Date( updatedDate );
664
+ const configDate = getData?.type === 'remote'? new Date( remoteUpdatedDate ): new Date( updatedDate );
663
665
  const fileDate = new Date( getData?.fileDate );
664
666
  const params = {
665
667
  file_path: getData?.filePath,
@@ -780,6 +782,7 @@ export async function save( req, res ) {
780
782
  const bucket = JSON.parse( process.env.BUCKET );
781
783
  // const url = JSON.parse( process.env.URL );
782
784
  const updatedDate = process.env.EYE_TEST_UPDATED_DATE;
785
+ const remoteUpdatedDate = process.env.REMOTE_UPDATED_DATE;
783
786
 
784
787
  let searchFilter =[
785
788
  {
@@ -935,7 +938,7 @@ export async function save( req, res ) {
935
938
  );
936
939
  const inputBucketName = inputUpdatedData?._source?.type === 'remote'? bucket?.remoteInput : bucket?.physicalInput;
937
940
  const inputOldBucketName = inputUpdatedData?._source?.type === 'remote'? bucket?.remoteOldInput : bucket?.physicalOldInput;
938
- const configDate = new Date( updatedDate );
941
+ const configDate = getData?.type === 'remote'? new Date( remoteUpdatedDate ): new Date( updatedDate );
939
942
  const fileDate = new Date( inputUpdatedData?._source?.fileDate );
940
943
  const params = {
941
944
  file_path: inputUpdatedData?._source?.filePath,