tango-app-api-analysis-zone 3.0.0-alpha.31 → 3.0.0-alpha.32
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-analysis-zone",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.32",
|
|
4
4
|
"description": "zone Analysis",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"mongodb": "^6.8.0",
|
|
22
22
|
"nodemon": "^3.1.4",
|
|
23
23
|
"tango-api-schema": "^2.0.131",
|
|
24
|
-
"tango-app-api-middleware": "^3.1.
|
|
24
|
+
"tango-app-api-middleware": "^3.1.41",
|
|
25
25
|
"winston": "^3.13.1",
|
|
26
26
|
"winston-daily-rotate-file": "^5.0.0"
|
|
27
27
|
},
|
|
@@ -259,6 +259,20 @@ export const zoneSegmentationV1 = async ( req, res ) => {
|
|
|
259
259
|
let resultData = await LamdaServiceCall( LamdaURL, reqestData );
|
|
260
260
|
if ( resultData ) {
|
|
261
261
|
if ( resultData.status_code == '200' ) {
|
|
262
|
+
if ( reqestData.export ) {
|
|
263
|
+
if ( resultData.segmentationAnalysis.length>0 ) {
|
|
264
|
+
const exportdata = [];
|
|
265
|
+
resultData.segmentationAnalysis.forEach( ( element ) => {
|
|
266
|
+
exportdata.push( {
|
|
267
|
+
'Entrance': element.category,
|
|
268
|
+
'Entrance wise footfall': element.value,
|
|
269
|
+
} );
|
|
270
|
+
} );
|
|
271
|
+
return await download( exportdata, res );
|
|
272
|
+
} else {
|
|
273
|
+
return res.sendError( 'No Content', 204 );
|
|
274
|
+
}
|
|
275
|
+
}
|
|
262
276
|
return res.sendSuccess( resultData );
|
|
263
277
|
} else {
|
|
264
278
|
return res.sendError( 'No Content', 204 );
|
|
@@ -216,6 +216,7 @@ export const validateCustomerJourneyTableV2Params = {
|
|
|
216
216
|
|
|
217
217
|
export const validateZoneSegmentationSchema = joi.object( {
|
|
218
218
|
...baseSchema,
|
|
219
|
+
export: joi.boolean().required(),
|
|
219
220
|
} );
|
|
220
221
|
export const validateZoneSegmentationParams = {
|
|
221
222
|
body: validateZoneSegmentationSchema,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { validate, isAllowedSessionHandler,
|
|
2
|
+
import { validate, isAllowedSessionHandler, authorize } from 'tango-app-api-middleware';
|
|
3
3
|
import * as validationDtos from '../dtos/validation.dtos.js';
|
|
4
4
|
|
|
5
5
|
export const analysisZoneRouter = express.Router();
|
|
@@ -36,44 +36,44 @@ analysisZoneRouter
|
|
|
36
36
|
.post( '/zoneConcentrationSummaryTable', zoneConcentrationSummaryTable )
|
|
37
37
|
.post( '/zoneHeatmapAvailableDates', zoneHeatmapAvailableDates )
|
|
38
38
|
.post( '/zoneHeatmapDatas', zoneHeatmapDatas )
|
|
39
|
-
.post( '/cardsAgeAnalysis_v1', isAllowedSessionHandler, isAllowedClient,
|
|
39
|
+
.post( '/cardsAgeAnalysis_v1', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
40
40
|
userType: [ 'tango', 'client' ], access: [
|
|
41
|
-
{ featureName: '
|
|
41
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
42
42
|
],
|
|
43
43
|
} ), validate( validationDtos.validateCardsAgeAnalysisParams ), cardsAgeAnalysisV1 )
|
|
44
|
-
.post( '/topPerformingZones_v1', isAllowedSessionHandler, isAllowedClient,
|
|
44
|
+
.post( '/topPerformingZones_v1', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
45
45
|
userType: [ 'tango', 'client' ], access: [
|
|
46
|
-
{ featureName: '
|
|
46
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
47
47
|
],
|
|
48
48
|
} ), validate( validationDtos.validateTopPerformingZonesParams ), topPerformingZonesV1 )
|
|
49
|
-
.post( '/topPerformingStores_v1', isAllowedSessionHandler, isAllowedClient,
|
|
49
|
+
.post( '/topPerformingStores_v1', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
50
50
|
userType: [ 'tango', 'client' ], access: [
|
|
51
|
-
{ featureName: '
|
|
51
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
52
52
|
],
|
|
53
53
|
} ), validate( validationDtos.validateTopPerformingStoresParams ), topPerformingStoresV1 )
|
|
54
|
-
.post( '/zoneSummaryTable_v1', isAllowedSessionHandler, isAllowedClient,
|
|
54
|
+
.post( '/zoneSummaryTable_v1', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
55
55
|
userType: [ 'tango', 'client' ], access: [
|
|
56
|
-
{ featureName: '
|
|
56
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
57
57
|
],
|
|
58
58
|
} ), validate( validationDtos.validateZoneSummaryTableParams ), zoneSummaryTableV1 )
|
|
59
|
-
.post( '/zoneConcentrationSummaryTable_v1', isAllowedSessionHandler, isAllowedClient,
|
|
59
|
+
.post( '/zoneConcentrationSummaryTable_v1', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
60
60
|
userType: [ 'tango', 'client' ], access: [
|
|
61
|
-
{ featureName: '
|
|
61
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
62
62
|
],
|
|
63
63
|
} ), validate( validationDtos.validateZoneConcentrationSummaryTableParams ), zoneConcentrationSummaryTableV1 )
|
|
64
|
-
.post( '/zoneHeatmapAvailableDates_v1', isAllowedSessionHandler, isAllowedClient,
|
|
64
|
+
.post( '/zoneHeatmapAvailableDates_v1', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
65
65
|
userType: [ 'tango', 'client' ], access: [
|
|
66
|
-
{ featureName: '
|
|
66
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
67
67
|
],
|
|
68
68
|
} ), validate( validationDtos.validateZoneHeatmapAvailableDatesParams ), zoneHeatmapAvailableDatesV1 )
|
|
69
|
-
.post( '/zoneHeatmapDatas_v1', isAllowedSessionHandler, isAllowedClient,
|
|
69
|
+
.post( '/zoneHeatmapDatas_v1', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
70
70
|
userType: [ 'tango', 'client' ], access: [
|
|
71
|
-
{ featureName: '
|
|
71
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
72
72
|
],
|
|
73
73
|
} ), validate( validationDtos.validateZoneHeatmapDatasParams ), zoneHeatmapDatasV1 )
|
|
74
|
-
.post( '/zoneSegmentation_v1', isAllowedSessionHandler, isAllowedClient,
|
|
74
|
+
.post( '/zoneSegmentation_v1', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
75
75
|
userType: [ 'tango', 'client' ], access: [
|
|
76
|
-
{ featureName: '
|
|
76
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
77
77
|
],
|
|
78
78
|
} ), validate( validationDtos.validateZoneSegmentationParams ), zoneSegmentationV1 );
|
|
79
79
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { validate, isAllowedSessionHandler,
|
|
2
|
+
import { validate, isAllowedSessionHandler, authorize, isAllowedClient } from 'tango-app-api-middleware';
|
|
3
3
|
import * as validationDtos from '../dtos/validation.dtos.js';
|
|
4
4
|
|
|
5
5
|
export const analysisZoneV2Router = express.Router();
|
|
@@ -44,64 +44,64 @@ analysisZoneV2Router
|
|
|
44
44
|
.post( '/trajectoryAnalysis', trajectoryAnalysis )
|
|
45
45
|
.post( '/customerJourney', customerJourney )
|
|
46
46
|
.post( '/customerJourneyTable', customerJourneyTable )
|
|
47
|
-
.post( '/zonecards_V2', isAllowedSessionHandler, isAllowedClient,
|
|
47
|
+
.post( '/zonecards_V2', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
48
48
|
userType: [ 'tango', 'client' ], access: [
|
|
49
|
-
{ featureName: '
|
|
49
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
50
50
|
],
|
|
51
51
|
} ), validate( validationDtos.validateZoneCardsV2Params ), zonecardsV2 )
|
|
52
|
-
.post( '/topPerformingZones_v2', isAllowedSessionHandler, isAllowedClient,
|
|
52
|
+
.post( '/topPerformingZones_v2', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
53
53
|
userType: [ 'tango', 'client' ], access: [
|
|
54
|
-
{ featureName: '
|
|
54
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
55
55
|
],
|
|
56
56
|
} ), validate( validationDtos.validateTopPerformingZonesV2Params ), topPerformingZonesV2 )
|
|
57
|
-
.post( '/topPerformingStores_v2', isAllowedSessionHandler, isAllowedClient,
|
|
57
|
+
.post( '/topPerformingStores_v2', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
58
58
|
userType: [ 'tango', 'client' ], access: [
|
|
59
|
-
{ featureName: '
|
|
59
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
60
60
|
],
|
|
61
61
|
} ), validate( validationDtos.validateTopPerformingStoresV2Params ), topPerformingStoresV2 )
|
|
62
|
-
.post( '/zoneSummaryTable_v2', isAllowedSessionHandler, isAllowedClient,
|
|
62
|
+
.post( '/zoneSummaryTable_v2', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
63
63
|
userType: [ 'tango', 'client' ], access: [
|
|
64
|
-
{ featureName: '
|
|
64
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
65
65
|
],
|
|
66
66
|
} ), validate( validationDtos.validateZoneSummaryTableV2Params ), zoneSummaryTableV2 )
|
|
67
|
-
.post( '/availableZoneNames_v2', isAllowedSessionHandler, isAllowedClient,
|
|
67
|
+
.post( '/availableZoneNames_v2', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
68
68
|
userType: [ 'tango', 'client' ], access: [
|
|
69
|
-
{ featureName: '
|
|
69
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
70
70
|
],
|
|
71
71
|
} ), validate( validationDtos.validateAvailableZoneNamesV2Params ), availableZoneNamesV2 )
|
|
72
|
-
.post( '/zoneConcentrationSummary_v2', isAllowedSessionHandler, isAllowedClient,
|
|
72
|
+
.post( '/zoneConcentrationSummary_v2', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
73
73
|
userType: [ 'tango', 'client' ], access: [
|
|
74
|
-
{ featureName: '
|
|
74
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
75
75
|
],
|
|
76
76
|
} ), validate( validationDtos.validateZoneConcentrationSummaryV2Params ), zoneConcentrationSummaryV2 )
|
|
77
|
-
.post( '/overallStoreConcentrationDates_v2', isAllowedSessionHandler, isAllowedClient,
|
|
77
|
+
.post( '/overallStoreConcentrationDates_v2', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
78
78
|
userType: [ 'tango', 'client' ], access: [
|
|
79
|
-
{ featureName: '
|
|
79
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
80
80
|
],
|
|
81
81
|
} ), validate( validationDtos.validateOverallStoreConcentrationDatesV2Params ), overallStoreConcentrationDatesV2 )
|
|
82
|
-
.post( '/overallStoreConcentrationHeatmap_v2', isAllowedSessionHandler, isAllowedClient,
|
|
82
|
+
.post( '/overallStoreConcentrationHeatmap_v2', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
83
83
|
userType: [ 'tango', 'client' ], access: [
|
|
84
|
-
{ featureName: '
|
|
84
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
85
85
|
],
|
|
86
86
|
} ), validate( validationDtos.validateOverallStoreConcentrationHeatmapV2Params ), overallStoreConcentrationHeatmapV2 )
|
|
87
|
-
.post( '/trajectoryAnalysis_v2', isAllowedSessionHandler, isAllowedClient,
|
|
87
|
+
.post( '/trajectoryAnalysis_v2', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
88
88
|
userType: [ 'tango', 'client' ], access: [
|
|
89
|
-
{ featureName: '
|
|
89
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
90
90
|
],
|
|
91
91
|
} ), validate( validationDtos.validateTrajectoryAnalysisV2Params ), trajectoryAnalysisV2 )
|
|
92
|
-
.post( '/trajectoryAnalysisRate_v2', isAllowedSessionHandler, isAllowedClient,
|
|
92
|
+
.post( '/trajectoryAnalysisRate_v2', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
93
93
|
userType: [ 'tango', 'client' ], access: [
|
|
94
|
-
{ featureName: '
|
|
94
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
95
95
|
],
|
|
96
96
|
} ), validate( validationDtos.validateTrajectoryAnalysisRateV2Params ), trajectoryAnalysisRateV2 )
|
|
97
|
-
.post( '/customerJourney_v2', isAllowedSessionHandler, isAllowedClient,
|
|
97
|
+
.post( '/customerJourney_v2', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
98
98
|
userType: [ 'tango', 'client' ], access: [
|
|
99
|
-
{ featureName: '
|
|
99
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
100
100
|
],
|
|
101
101
|
} ), validate( validationDtos.validateCustomerJourneyV2Params ), customerJourneyV2 )
|
|
102
|
-
.post( '/customerJourneyTable_v2', isAllowedSessionHandler, isAllowedClient,
|
|
102
|
+
.post( '/customerJourneyTable_v2', isAllowedSessionHandler, isAllowedClient, authorize( {
|
|
103
103
|
userType: [ 'tango', 'client' ], access: [
|
|
104
|
-
{ featureName: '
|
|
104
|
+
{ featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
|
|
105
105
|
],
|
|
106
106
|
} ), validate( validationDtos.validateCustomerJourneyTableV2Params ), customerJourneyTableV2 );
|
|
107
107
|
export default analysisZoneV2Router;
|