tango-app-api-trax 3.7.4-runai-airtelv2-11 → 3.7.5-halfshutter-1

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/app.js ADDED
@@ -0,0 +1,56 @@
1
+ import express from 'express';
2
+ import { traxDashboardRouter, traxFlagRouter, traxRouter, downloadRouter, mobileRouter, locusOrderRouter, internalTraxRouter, traxActivityLogRouter, galleryRouter } from './index.js';
3
+ import dotenv from 'dotenv';
4
+ import pkg from 'body-parser';
5
+ const { json, urlencoded } = pkg;
6
+ import { logger } from 'tango-app-api-middleware';
7
+ import { connectdb } from './config/database/database.js';
8
+ import responseMiddleware from './config/response/response.js';
9
+ import errorMiddleware from './config/response/error.js';
10
+ import cors from 'cors';
11
+ import admin from 'firebase-admin';
12
+ import fileupload from 'express-fileupload';
13
+
14
+
15
+ const serviceAccountPath = JSON.parse( process.env.FIREBASE );
16
+ admin.initializeApp( {
17
+ credential: admin.credential.cert( serviceAccountPath ),
18
+ } );
19
+
20
+ const env=dotenv.config();
21
+
22
+ const app = express();
23
+ const PORT = process.env.PORT || 3000;
24
+ app.use( cors() );
25
+
26
+
27
+ if ( env.error ) {
28
+ logger.error( '.env not found' );
29
+ process.exit( 1 );
30
+ }
31
+
32
+ app.use( json( { limit: '500mb' } ) );
33
+ app.use( fileupload() );
34
+ app.use(
35
+ urlencoded( {
36
+ extended: true,
37
+ } ),
38
+ );
39
+
40
+ app.use( responseMiddleware );
41
+ app.use( errorMiddleware );
42
+
43
+ app.use( '/trax/dashboard', traxDashboardRouter );
44
+ app.use( '/trax', traxRouter );
45
+ app.use( '/trax/flag', traxFlagRouter );
46
+ app.use( '/trax/downloads', downloadRouter );
47
+ app.use( '/trax/mobileAPI', mobileRouter );
48
+ app.use( '/trax/locusorder', locusOrderRouter );
49
+ app.use( '/trax/internalAPI', internalTraxRouter );
50
+ app.use( '/trax/activityLog', traxActivityLogRouter );
51
+ app.use( '/trax/gallery', galleryRouter );
52
+
53
+ app.listen( PORT, () => {
54
+ console.log( `server is running on port= ${PORT} ` );
55
+ connectdb();
56
+ } );
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "tango-app-api-trax",
3
- "version": "3.7.4-runai-airtelv2-11",
3
+ "version": "3.7.5-halfshutter-1",
4
4
  "description": "Trax",
5
- "main": "index.js",
5
+ "main": "app.js",
6
6
  "type": "module",
7
7
  "scripts": {
8
- "start": "nodemon --exec \"eslint --fix . && node index.js\""
8
+ "start": "nodemon --exec \"eslint --fix . && node app.js\""
9
9
  },
10
10
  "engines": {
11
11
  "node": ">=18.10.0"
@@ -27,7 +27,7 @@
27
27
  "mongodb": "^6.8.0",
28
28
  "nodemon": "^3.1.4",
29
29
  "path": "^0.12.7",
30
- "tango-api-schema": "^2.3.20",
30
+ "tango-api-schema": "^2.4.4",
31
31
  "tango-app-api-middleware": "^3.5.2",
32
32
  "url": "^0.11.4",
33
33
  "winston": "^3.13.1",
@@ -546,7 +546,12 @@ export const zoneList = async ( req, res ) => {
546
546
  try {
547
547
  let inputBody = req.query;
548
548
 
549
- if ( inputBody.checkListName && inputBody.checkListName == 'Outside Business Hours Queue Tracking' ) {
549
+ const allowedChecklists = [
550
+ 'Outside Business Hours Queue Tracking',
551
+ 'Store Half Shutter Detection',
552
+ ];
553
+
554
+ if ( inputBody.checkListName && allowedChecklists.includes( inputBody.checkListName ) ) {
550
555
  let query = [
551
556
  {
552
557
  $match: {
@@ -3945,7 +3950,7 @@ async function updateOpenSearch( user, data ) {
3945
3950
  export const aiChecklist = async ( req, res ) => {
3946
3951
  try {
3947
3952
  let storeDetails = await storeService.count( { clientId: req.query.clientId, status: 'active' } );
3948
- let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking' ];
3953
+ let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter' ];
3949
3954
  let checklistDetails = [];
3950
3955
  let publishList = [];
3951
3956
  let unpublishList = [];
@@ -3958,7 +3963,7 @@ export const aiChecklist = async ( req, res ) => {
3958
3963
  checklistDetails = [ ...publishList, ...unpublishList ];
3959
3964
 
3960
3965
  checklistDetails.forEach( ( item ) => {
3961
- if ( ![ 'mobileusagedetection', 'storeopenandclose', 'cleaning', 'scrum', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'outsidebusinesshoursqueuetracking' ].includes( item.checkListType ) ) {
3966
+ if ( ![ 'mobileusagedetection', 'storeopenandclose', 'cleaning', 'scrum', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( item.checkListType ) ) {
3962
3967
  item.storeCount = storeDetails;
3963
3968
  }
3964
3969
  } );