tango-app-api-analysis-traffic 3.3.1-alpha.11 → 3.3.1-alpha.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/index.js CHANGED
@@ -1,10 +1,9 @@
1
1
 
2
2
 
3
3
  import { analysisTrafficRouter } from './src/routes/traffic.routes.js';
4
- import { revopRouter } from './src/routes/revop.routes.js';
5
4
  import { mobileTrafficAnalysisRouter } from './src/routes/mobileTraffic.routes.js';
6
5
  import { nobDocs } from './src/docs/nob.docs.js';
7
6
  import nobRouter from './src/routes/nob.routes.js';
8
7
 
9
- export { analysisTrafficRouter, mobileTrafficAnalysisRouter, nobDocs, nobRouter, revopRouter };
8
+ export { analysisTrafficRouter, mobileTrafficAnalysisRouter, nobDocs, nobRouter };
10
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-analysis-traffic",
3
- "version": "3.3.1-alpha.11",
3
+ "version": "3.3.1-alpha.13",
4
4
  "description": "Traffic Analysis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "mongodb": "^6.8.0",
24
24
  "nodemon": "^3.1.4",
25
25
  "swagger-ui-express": "^5.0.1",
26
- "tango-api-schema": "^2.2.109",
26
+ "tango-api-schema": "^2.2.7",
27
27
  "tango-app-api-middleware": "^3.1.55",
28
28
  "winston": "^3.13.1",
29
29
  "winston-daily-rotate-file": "^5.0.0"
@@ -99,7 +99,7 @@ export const conversionCardsV3 = async ( req, res ) => {
99
99
  reqestData.featureConfigs = getClientData.featureConfigs;
100
100
  reqestData.currency = getClientData.paymentInvoice?.currencyType || 'inr';
101
101
  reqestData.revenue = getClientData.averageTransactionValue || '0';
102
- let LamdaURL = 'https://shi4an3zee5kvaiqfgslwjrupq0srglf.lambda-url.ap-south-1.on.aws/';
102
+ let LamdaURL = 'https://uprslxkz2qpd6xi76dqgzfc6gq0wsfnv.lambda-url.ap-south-1.on.aws/';
103
103
  let resultData = await LamdaServiceCall( LamdaURL, reqestData );
104
104
  if ( resultData ) {
105
105
  if ( resultData.status_code == '200' ) {
@@ -261,7 +261,7 @@ export const funnelV3 = async ( req, res ) => {
261
261
  reqestData.featureConfigs = getClientData.featureConfigs;
262
262
  reqestData.currency = getClientData.paymentInvoice?.currencyType || 'inr';
263
263
  reqestData.revenue = getClientData.averageTransactionValue || '0';
264
- let LamdaURL = 'https://oeewcchsgznkfr5qwgjtdj4vhu0amilj.lambda-url.ap-south-1.on.aws/';
264
+ let LamdaURL = 'https://qhv7egrhdg3rwdwy5ttkavobnq0lsekh.lambda-url.ap-south-1.on.aws/';
265
265
  let resultData = await LamdaServiceCall( LamdaURL, reqestData );
266
266
  if ( resultData ) {
267
267
  if ( resultData.status_code == '200' ) {
@@ -390,7 +390,7 @@ export const overallCardsV3 = async ( req, res ) => {
390
390
  reqestData.featureConfigs = getClientData.featureConfigs;
391
391
  reqestData.currency = getClientData.paymentInvoice?.currencyType || 'inr';
392
392
  reqestData.revenue = getClientData.averageTransactionValue || '0';
393
- let LamdaURL = 'https://s3wltaeo66nbj7udu5qraqqqvu0dhqao.lambda-url.ap-south-1.on.aws/';
393
+ let LamdaURL = 'https://psxusablnvqw3it6j7q6o4v2mq0yutqb.lambda-url.ap-south-1.on.aws/';
394
394
  let resultData = await LamdaServiceCall( LamdaURL, reqestData );
395
395
  if ( resultData ) {
396
396
  if ( resultData.status_code == '200' ) {
@@ -592,7 +592,7 @@ export const summaryTableV3 = async ( req, res ) => {
592
592
  return res.sendError( 'Invalid Client Id', 400 );
593
593
  }
594
594
  reqestData.featureConfigs = getClientData.featureConfigs;
595
- let LamdaURL = 'https://ewen2vlmxmhieea4elztlbjuey0ddqee.lambda-url.ap-south-1.on.aws/';
595
+ let LamdaURL = 'https://lihe5wvikbgj6omqhgczd6g2cy0inwis.lambda-url.ap-south-1.on.aws/';
596
596
  let resultData;
597
597
  if ( reqestData.export ) {
598
598
  let limit = 10000;
@@ -700,7 +700,7 @@ export const footfallTrendV3 = async ( req, res ) => {
700
700
  return res.sendError( 'Invalid Client Id', 400 );
701
701
  }
702
702
  reqestData.featureConfigs = getClientData.featureConfigs;
703
- let LamdaURL = 'https://x6sjlqwaqd64kyioxhwrwfesbm0jjitx.lambda-url.ap-south-1.on.aws/';
703
+ let LamdaURL = 'https://srbukaxex4qhvquasdx5nsotsu0ywpwd.lambda-url.ap-south-1.on.aws/';
704
704
  let resultData = await LamdaServiceCall( LamdaURL, reqestData );
705
705
  if ( resultData ) {
706
706
  if ( resultData.status_code == '200' ) {
@@ -1,83 +0,0 @@
1
- import { logger, insertOpenSearchData, getOpenSearchData } from 'tango-app-api-middleware';
2
- import { findOnerevopConfig } from '../services/revopConfig.service.js';
3
-
4
- export async function getconfig( req, res ) {
5
- try {
6
- let result = await findOnerevopConfig( { clientId: req.query.clientId } );
7
- if ( result===null ) {
8
- return res.sendError( 'no data found', 204 );
9
- }
10
- return res.sendSuccess( result );
11
- } catch ( error ) {
12
- logger.error( { error: error, message: req.query, function: 'getconfig' } );
13
- return res.sendError( { error: error }, 500 );
14
- }
15
- }
16
-
17
- export async function revoptagging( req, res ) {
18
- try {
19
- const openSearch = JSON.parse( process.env.OPENSEARCH );
20
-
21
-
22
- for ( let item of req.body ) {
23
- item.createdAt = new Date();
24
- item.updatedAt = new Date();
25
- await insertOpenSearchData( openSearch.revops, item );
26
- }
27
- return res.sendSuccess( 'Data has been inserted successfully' );
28
- } catch ( error ) {
29
- logger.error( { error: error, message: req.query, function: 'revoptagging' } );
30
- return res.sendError( { error: error }, 500 );
31
- }
32
- }
33
- export async function getrevoptagging( req, res ) {
34
- try {
35
- const openSearch = JSON.parse( process.env.OPENSEARCH );
36
- console.log( req.body );
37
- let searchQuery={
38
- 'size': 1,
39
- 'query': {
40
- 'bool': {
41
- 'must': [
42
- {
43
- 'term': {
44
- 'storeId.keyword': req.body.storeId,
45
- },
46
- },
47
- {
48
- 'term': {
49
- 'processType': req.body.processType,
50
- },
51
- },
52
- {
53
- 'term': {
54
- 'dateString': req.body.dateString,
55
- },
56
- },
57
- // {
58
- // 'term': {
59
- // 'timeStamp': req.body.timeStamp,
60
- // },
61
- // },
62
- {
63
- 'term': {
64
- 'tempId': req.body.tempId,
65
- },
66
- },
67
- ],
68
- },
69
- },
70
- };
71
- let respo= await getOpenSearchData( openSearch.revops, searchQuery );
72
- const revopData = respo?.body?.hits?.hits;
73
- console.log( revopData );
74
- if ( revopData.length>0 ) {
75
- return res.sendSuccess( revopData[0]._source );
76
- } else {
77
- return res.sendError( 'no data found', 204 );
78
- }
79
- } catch ( error ) {
80
- logger.error( { error: error, message: req.query, function: 'getrevoptagging' } );
81
- return res.sendError( { error: error }, 500 );
82
- }
83
- }
@@ -1,13 +0,0 @@
1
-
2
- import express from 'express';
3
- import { getconfig, revoptagging, getrevoptagging } from '../controllers/revop.controller.js';
4
- import { isAllowedSessionHandler, isAllowedClient } from 'tango-app-api-middleware';
5
-
6
- export const revopRouter = express.Router();
7
-
8
- revopRouter
9
- .get( '/getconfig', isAllowedSessionHandler, isAllowedClient, getconfig )
10
- .post( '/tagging', isAllowedSessionHandler, isAllowedClient, revoptagging )
11
- .post( '/getrevoptagging', isAllowedSessionHandler, isAllowedClient, getrevoptagging );
12
-
13
- export default revopRouter;
@@ -1,16 +0,0 @@
1
- import revopConfigModel from 'tango-api-schema/schema/revopConfig.model.js';
2
-
3
-
4
- export async function createrevopConfig( field = {} ) {
5
- return await revopConfigModel.create( field );
6
- };
7
- export async function findOnerevopConfig( query = {} ) {
8
- return await revopConfigModel.findOne( query );
9
- };
10
-
11
- export async function updaterevopConfig( data={}, field = {} ) {
12
- return await revopConfigModel.updateOne( data, { $set: field } );
13
- };
14
- export async function aggregaterevopconfig( data ) {
15
- return await revopConfigModel.aggregate( data );
16
- };