tango-app-api-store-zone 3.3.1-beta.12 → 3.3.1-beta.13

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-store-zone",
3
- "version": "3.3.1-beta.12",
3
+ "version": "3.3.1-beta.13",
4
4
  "description": "zone",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -593,17 +593,17 @@ export const getCameraList = async ( req, res ) => {
593
593
  };
594
594
  export const getCameraListv2 = async ( req, res ) => {
595
595
  try {
596
- let cameraDetails = await cameraService.find( { clientId: req.query.clientId, storeId: req.query.storeId, isActivated: true, isUp: true }, { cameraNumber: 1, streamName: 1, isActivated: 1, isUp: 1, cameraName: 1, taggedChecklist: 1 } );
596
+ let cameraDetails = await cameraService.find( { clientId: req.body.clientId, storeId: req.body.storeId, isActivated: true, isUp: true }, { cameraNumber: 1, streamName: 1, isActivated: 1, isUp: 1, cameraName: 1, taggedChecklist: 1 } );
597
597
  if ( !cameraDetails.length ) {
598
598
  return res.sendError( 'no data found', 204 );
599
599
  }
600
600
  const folderPath = {
601
- file_path: `${req.query.storeId}/zone_base_images/`,
601
+ file_path: `${req.body.storeId}/zone_base_images/`,
602
602
  Bucket: JSON.parse( process.env.BUCKET ).zoneBaseImage, MaxKeys: 1000,
603
603
  };
604
604
  let fileList = await listFileByPath( folderPath );
605
605
  const TaggedfolderPath = {
606
- file_path: `${req.query.storeId}/zone_tagged_image/`,
606
+ file_path: `${req.body.storeId}/zone_tagged_image/`,
607
607
  Bucket: JSON.parse( process.env.BUCKET ).zoneTaggingImage, MaxKeys: 1000,
608
608
  };
609
609
  let tagFileList = await listFileByPath( TaggedfolderPath );
@@ -616,7 +616,7 @@ export const getCameraListv2 = async ( req, res ) => {
616
616
  baseImg: '',
617
617
  tagImg: '',
618
618
  };
619
- let taggingDetails = await taggingService.find( { cameraId: camera._id, streamName: camera.streamName, clientId: req.query.clientId, isDeleted: false }, { tagName: 1, coordinates: 1 } );
619
+ let taggingDetails = await taggingService.find( { cameraId: camera._id, streamName: camera.streamName, clientId: req.body.clientId, isDeleted: false }, { tagName: 1, coordinates: 1 } );
620
620
  if ( taggingDetails.length ) {
621
621
  tagList = taggingDetails.filter( ( item ) => item.coordinates.length ).map( ( item ) => {
622
622
  if ( item.coordinates.length ) {
@@ -631,7 +631,7 @@ export const getCameraListv2 = async ( req, res ) => {
631
631
  let splitStream = item.Key.split( '/' );
632
632
  let getStream = splitStream[splitStream.length - 1].split( '.' );
633
633
 
634
- if ( getStream && getStream[0] == `${req.query.storeId}_${camera.streamName}` ) {
634
+ if ( getStream && getStream[0] == `${req.body.storeId}_${camera.streamName}` ) {
635
635
  tagPath = item.Key;
636
636
  }
637
637
  }
@@ -641,7 +641,7 @@ export const getCameraListv2 = async ( req, res ) => {
641
641
  fileList.data.forEach( ( ele ) => {
642
642
  let splitStream = ele.Key.split( '/' );
643
643
  let getStream = splitStream[splitStream.length - 1].split( '.' );
644
- if ( getStream && getStream[0] == `${req.query.storeId}_${camera.streamName}` ) {
644
+ if ( getStream && getStream[0] == `${req.body.storeId}_${camera.streamName}` ) {
645
645
  imgPath = ele.Key;
646
646
  }
647
647
  } );
@@ -663,7 +663,7 @@ export const getCameraListv2 = async ( req, res ) => {
663
663
  camera.baseImg = cameraBaseImage;
664
664
  }
665
665
  camera.tagging = tagList;
666
- camera.taggedCount = tagList.filter( ( ele ) => ele.tagName===req.query.tagName );
666
+ camera.taggedCount = tagList.filter( ( ele ) => ele.tagName===req.body.tagName );
667
667
  cameraDetails[index] = camera;
668
668
  }
669
669
  cameraDetails.sort( ( a, b ) => a.tagging?.length > b.tagging?.length ? -1 : 1 );
@@ -20,7 +20,7 @@ export const tagSchema = joi.object( {
20
20
  } );
21
21
 
22
22
  export const validateTagParams = {
23
- query: tagSchema,
23
+ body: tagSchema,
24
24
  };
25
25
 
26
26
  export const validateUpdateTagSchema = joi.object( {
@@ -12,7 +12,7 @@ zoneTaggingRouter.get( '/customTagList', isAllowedSessionHandler, accessVerifica
12
12
  zoneTaggingRouter.get( '/customTagListv2', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoEye', name: 'ZoneTag', permissions: [ ] } ] } ), tagController.customTagListv2 );
13
13
  zoneTaggingRouter.post( '/tagging', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoEye', name: 'ZoneTag', permissions: [ 'isEdit' ] } ] } ), validate( validation.validateTaggingParams ), tagController.tagging );
14
14
  zoneTaggingRouter.get( '/cameraList', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoEye', name: 'ZoneTag', permissions: [ ] } ] } ), validate( validation.validateTagParams ), tagController.getCameraList );
15
- zoneTaggingRouter.get( '/cameraListv2', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoEye', name: 'ZoneTag', permissions: [ ] } ] } ), validate( validation.validateTagParams ), tagController.getCameraListv2 );
15
+ zoneTaggingRouter.post( '/cameraListv2', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoEye', name: 'ZoneTag', permissions: [ ] } ] } ), validate( validation.validateTagParams ), tagController.getCameraListv2 );
16
16
  zoneTaggingRouter.post( '/updateCustomTag', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoEye', name: 'ZoneTag', permissions: [ 'isEdit' ] } ] } ), validate( validation.validateUpdateTagParams ), tagController.updateTag );
17
17
  zoneTaggingRouter.post( '/deleteCustomTag', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoEye', name: 'ZoneTag', permissions: [ 'isEdit' ] } ] } ), validate( validation.validateDeleteTagParams ), tagController.deleteTag );
18
18
  zoneTaggingRouter.get( '/getCameraTagging', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoEye', name: 'ZoneTag', permissions: [ ] } ] } ), validate( validation.validateCameraTagParams ), tagController.getCameraTagging );