tango-app-api-task 3.2.1 → 3.3.1-airtelai-0

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,43 @@
1
+ import express from 'express';
2
+ import { taskDashboardRouter, taskActionCenterRouter, taskRouter, internalAPIRouter } from './index.js';
3
+
4
+ import dotenv from 'dotenv';
5
+ import pkg from 'body-parser';
6
+ const { json, urlencoded } = pkg;
7
+ import { logger } from 'tango-app-api-middleware';
8
+ import { connectdb } from './config/database/database.js';
9
+ import responseMiddleware from './config/response/response.js';
10
+ import errorMiddleware from './config/response/error.js';
11
+ import cors from 'cors';
12
+
13
+ const env=dotenv.config();
14
+
15
+ const app = express();
16
+ const PORT = process.env.PORT || 3000;
17
+ app.use( cors() );
18
+
19
+
20
+ if ( env.error ) {
21
+ logger.error( '.env not found' );
22
+ process.exit( 1 );
23
+ }
24
+
25
+ app.use( json( { limit: '500mb' } ) );
26
+ app.use(
27
+ urlencoded( {
28
+ extended: true,
29
+ } ),
30
+ );
31
+
32
+ app.use( responseMiddleware );
33
+ app.use( errorMiddleware );
34
+
35
+ app.use( '/task', taskRouter );
36
+ app.use( '/task/dashboard', taskDashboardRouter );
37
+ app.use( '/task/actionCenter', taskActionCenterRouter );
38
+ app.use( '/task/internalAPI', internalAPIRouter );
39
+
40
+ app.listen( PORT, () => {
41
+ console.log( `server is running on port= ${PORT} ` );
42
+ connectdb();
43
+ } );
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "tango-app-api-task",
3
- "version": "3.2.1",
3
+ "version": "3.3.1-airtelai-0",
4
4
  "description": "Task",
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"
@@ -24,8 +24,8 @@
24
24
  "mongodb": "^6.10.0",
25
25
  "nodemon": "^3.1.7",
26
26
  "npm": "^10.9.2",
27
- "tango-api-schema": "^2.2.16",
28
- "tango-app-api-middleware": "^3.1.50",
27
+ "tango-api-schema": "^2.2.52",
28
+ "tango-app-api-middleware": "^3.1.58",
29
29
  "winston": "^3.17.0",
30
30
  "winston-daily-rotate-file": "^5.0.0"
31
31
  },
@@ -126,7 +126,7 @@ async function insertData( requestData ) {
126
126
  }
127
127
  }
128
128
 
129
- console.log( resultchecklist );
129
+ // console.log( resultchecklist );
130
130
 
131
131
 
132
132
  if ( resultchecklist.length ) {
@@ -141,7 +141,7 @@ async function insertData( requestData ) {
141
141
  let startTimeIso; let endTimeIso;
142
142
  startTimeIso = dayjs.utc( `${currentdate} ${sTime}`, 'YYYY-MM-DD hh:mm A' );
143
143
  endTimeIso = dayjs.utc( getCLconfig.scheduleEndTimeISO );
144
- console.log( endTimeIso );
144
+ // console.log( endTimeIso );
145
145
 
146
146
  let insertdata = {};
147
147
  insertdata.date_iso = new Date( dayjs( currentdate, 'YYYY-MM-DD' ).format( 'YYYY-MM-DD' ) );
@@ -269,7 +269,7 @@ async function insertData( requestData ) {
269
269
  if ( userIdList.length ) {
270
270
  allQuestion = allQuestion.filter( ( item ) => typeof item._id == 'undefined' );
271
271
  }
272
- console.log( allQuestion );
272
+ // console.log( allQuestion );
273
273
 
274
274
  if ( allQuestion ) {
275
275
  let assigndeletequery = {};