tango-app-api-audit 1.0.68 → 1.0.69
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 +38 -0
- package/package.json +3 -3
- package/src/controllers/audit.controllers.js +1 -1
package/app.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import express from 'express';
|
|
2
|
+
import { auditRouter } from './index.js';
|
|
3
|
+
import dotenv from 'dotenv';
|
|
4
|
+
import { logger } from 'tango-app-api-middleware';
|
|
5
|
+
import { connectdb } from './config/database/database.js';
|
|
6
|
+
import responseMiddleware from './config/response/response.js';
|
|
7
|
+
import errorMiddleware from './config/response/error.js';
|
|
8
|
+
import pkg from 'body-parser';
|
|
9
|
+
import { swaggerConfig } from './config/swagger/swagger.js';
|
|
10
|
+
import swagger from 'swagger-ui-express';
|
|
11
|
+
|
|
12
|
+
const { json, urlencoded } = pkg;
|
|
13
|
+
const env=dotenv.config();
|
|
14
|
+
|
|
15
|
+
const app = express();
|
|
16
|
+
const PORT = process.env.PORT || 3000;
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
app.use( json( { limit: '500mb' } ) );
|
|
20
|
+
app.use(
|
|
21
|
+
urlencoded( {
|
|
22
|
+
extended: true,
|
|
23
|
+
} ),
|
|
24
|
+
);
|
|
25
|
+
app.use( responseMiddleware );
|
|
26
|
+
app.use( errorMiddleware );
|
|
27
|
+
if ( env.error ) {
|
|
28
|
+
logger.error( '.env not found' );
|
|
29
|
+
process.exit( 1 );
|
|
30
|
+
}
|
|
31
|
+
app.use( '/api-docs', swagger.serve, swagger.setup( swaggerConfig ) );
|
|
32
|
+
app.use( '/v3/audit', auditRouter );
|
|
33
|
+
|
|
34
|
+
app.listen( PORT, () => {
|
|
35
|
+
logger.info( `server is running on port= ${PORT} ` );
|
|
36
|
+
connectdb();
|
|
37
|
+
} );
|
|
38
|
+
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-audit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.69",
|
|
4
4
|
"description": "audit & audit metrics apis",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "app.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"start": "nodemon --exec \"eslint --fix . && node
|
|
8
|
+
"start": "nodemon --exec \"eslint --fix . && node app.js\""
|
|
9
9
|
},
|
|
10
10
|
"engines": {
|
|
11
11
|
"node": ">=18.10.0"
|
|
@@ -641,7 +641,7 @@ export async function getFilterData( msg ) {
|
|
|
641
641
|
const bucket = JSON.parse( process.env.BUCKET );
|
|
642
642
|
const params = {
|
|
643
643
|
Bucket: `${bucket.auditOutput}`,
|
|
644
|
-
Key: `${msg.store_id}/${msg.zone_id}/${msg.curr_date}/${
|
|
644
|
+
Key: `${msg.store_id}/${msg.zone_id}/${msg.curr_date}/${bucket.masterJsonFile}`,
|
|
645
645
|
};
|
|
646
646
|
const mappingFile = await getJsonFileData( params );
|
|
647
647
|
if ( mappingFile.statusCode ) {
|