tango-app-api-analysis-traffic 3.8.15-alpha.0 → 3.8.16-dev
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 +1 -1
- package/src/dtos/validation.dtos.js +10 -0
- package/src/routes/traffic.routes.js +55 -55
package/package.json
CHANGED
|
@@ -89,6 +89,16 @@ export const validateOverallCharParams = {
|
|
|
89
89
|
body: validateOverallCharSchema,
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
+
// Same as validateOverallCharSchema, plus an optional hourFormat key used only by overallHourlyChart_v3
|
|
93
|
+
export const validateOverallHourlyCharSchema = validateOverallCharSchema.keys( {
|
|
94
|
+
hourBucket: joi.number().optional(),
|
|
95
|
+
} );
|
|
96
|
+
|
|
97
|
+
export const validateOverallHourlyCharParams = {
|
|
98
|
+
body: validateOverallHourlyCharSchema,
|
|
99
|
+
...validateOverallCharSchema,
|
|
100
|
+
};
|
|
101
|
+
|
|
92
102
|
export const validateSingleStoreChartSchema = joi.object( {
|
|
93
103
|
...baseSchema,
|
|
94
104
|
limit: joi.number().required(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { validate, isAllowedSessionHandler,
|
|
2
|
+
import { validate, isAllowedSessionHandler, getAssinedStore } from 'tango-app-api-middleware';
|
|
3
3
|
import * as validationDtos from '../dtos/validation.dtos.js';
|
|
4
4
|
|
|
5
5
|
export const analysisTrafficRouter = express.Router();
|
|
@@ -117,65 +117,65 @@ analysisTrafficRouter
|
|
|
117
117
|
.post( '/headerLocations', headerLocations )
|
|
118
118
|
.post( '/headerGroups', headerGroups )
|
|
119
119
|
.post( '/headerStores', headerStores )
|
|
120
|
-
.post( '/cardsFunnel_v1', isAllowedSessionHandler,
|
|
121
|
-
.post( '/funnel_v1', isAllowedSessionHandler,
|
|
122
|
-
.post( '/cardsGraphs_v1', isAllowedSessionHandler,
|
|
123
|
-
.post( '/recapVideo_v1', isAllowedSessionHandler,
|
|
124
|
-
.post( '/densityDwell_v1', isAllowedSessionHandler,
|
|
125
|
-
.post( '/overallCards_v1', isAllowedSessionHandler,
|
|
126
|
-
.post( '/overallHourlyChart_v1', isAllowedSessionHandler,
|
|
127
|
-
.post( '/overallChart_v1', isAllowedSessionHandler,
|
|
128
|
-
.post( '/singleStoreChart_v1', isAllowedSessionHandler,
|
|
129
|
-
.post( '/demographicChart_v1', isAllowedSessionHandler,
|
|
130
|
-
.post( '/buyerChart_v1', isAllowedSessionHandler,
|
|
131
|
-
.post( '/footfallDirectoryFolders_v1', isAllowedSessionHandler,
|
|
132
|
-
.post( '/footfallDirectory_v1', isAllowedSessionHandler,
|
|
133
|
-
.post( '/summaryTable_v1', isAllowedSessionHandler,
|
|
134
|
-
.post( '/footfallTrend_v1', isAllowedSessionHandler,
|
|
135
|
-
.post( '/storeOperation_v1', isAllowedSessionHandler,
|
|
136
|
-
.post( '/performanceMatrix_v1', isAllowedSessionHandler,
|
|
137
|
-
.post( '/zoneDwellTimeSplit_v1', isAllowedSessionHandler,
|
|
138
|
-
.post( '/storesMap_v1', isAllowedSessionHandler,
|
|
139
|
-
.post( '/headerLocations_v1', isAllowedSessionHandler,
|
|
140
|
-
.post( '/headerGroups_v1', isAllowedSessionHandler,
|
|
141
|
-
.post( '/headerStores_v1', isAllowedSessionHandler,
|
|
120
|
+
.post( '/cardsFunnel_v1', isAllowedSessionHandler, validate( validationDtos.validateCardFunnelParams ), cardsFunnelV1 )
|
|
121
|
+
.post( '/funnel_v1', isAllowedSessionHandler, validate( validationDtos.validateCardFunnelParams ), funnelV1 )
|
|
122
|
+
.post( '/cardsGraphs_v1', isAllowedSessionHandler, validate( validationDtos.validateCardGraphParams ), cardsGraphsV1 )
|
|
123
|
+
.post( '/recapVideo_v1', isAllowedSessionHandler, validate( validationDtos.validateRecapVideoParams ), recapVideoV1 )
|
|
124
|
+
.post( '/densityDwell_v1', isAllowedSessionHandler, validate( validationDtos.validateDensityDwellParams ), densityDwellV1 )
|
|
125
|
+
.post( '/overallCards_v1', isAllowedSessionHandler, validate( validationDtos.validateOverallCharParams ), overallCardsV1 )
|
|
126
|
+
.post( '/overallHourlyChart_v1', isAllowedSessionHandler, validate( validationDtos.validateOverallCharParams ), overallHourlyChartV1 )
|
|
127
|
+
.post( '/overallChart_v1', isAllowedSessionHandler, validate( validationDtos.validateOverallCharParams ), overallChartV1 )
|
|
128
|
+
.post( '/singleStoreChart_v1', isAllowedSessionHandler, validate( validationDtos.validateSingleStoreChartParams ), singleStoreChartV1 )
|
|
129
|
+
.post( '/demographicChart_v1', isAllowedSessionHandler, validate( validationDtos.validateDemographicChartParams ), demographicChartV1 )
|
|
130
|
+
.post( '/buyerChart_v1', isAllowedSessionHandler, validate( validationDtos.validateBuyerChartParams ), buyerChartV1 )
|
|
131
|
+
.post( '/footfallDirectoryFolders_v1', isAllowedSessionHandler, validate( validationDtos.validateFootfallDirectoryFoldersParams ), footfallDirectoryFoldersV1 )
|
|
132
|
+
.post( '/footfallDirectory_v1', isAllowedSessionHandler, validate( validationDtos.validateFootfallDirectoryParams ), footfallDirectoryV1 )
|
|
133
|
+
.post( '/summaryTable_v1', isAllowedSessionHandler, validate( validationDtos.validateSummaryTableParams ), summaryTableV1 )
|
|
134
|
+
.post( '/footfallTrend_v1', isAllowedSessionHandler, validate( validationDtos.validateFootfallTrendParams ), footfallTrendV1 )
|
|
135
|
+
.post( '/storeOperation_v1', isAllowedSessionHandler, validate( validationDtos.validateStoreOperationParams ), storeOperationV1 )
|
|
136
|
+
.post( '/performanceMatrix_v1', isAllowedSessionHandler, validate( validationDtos.validateperformanceMatrixParams ), performanceMatrixV1 )
|
|
137
|
+
.post( '/zoneDwellTimeSplit_v1', isAllowedSessionHandler, validate( validationDtos.validateStoreOperationParams ), zoneDwellTimeSplitV1 )
|
|
138
|
+
.post( '/storesMap_v1', isAllowedSessionHandler, validate( validationDtos.validateStoresMapParams ), storesMapV1 )
|
|
139
|
+
.post( '/headerLocations_v1', isAllowedSessionHandler, validate( validationDtos.validateHeaderParams ), headerLocationsV1 )
|
|
140
|
+
.post( '/headerGroups_v1', isAllowedSessionHandler, validate( validationDtos.validateHeaderParams ), headerGroupsV1 )
|
|
141
|
+
.post( '/headerStores_v1', isAllowedSessionHandler, validate( validationDtos.validateHeaderParams ), headerStoresV1 )
|
|
142
142
|
.post( '/getMySubscription', isAllowedSessionHandler, validate( validationDtos.getMyProductParams ), getMySubscription )
|
|
143
143
|
.post( '/getStoreMapData_v1', isAllowedSessionHandler, validate( validationDtos.getStoreCameraImageParams ), getStoreMapData )
|
|
144
144
|
.post( '/getStoreMapData', isAllowedSessionHandler, validate( validationDtos.getStoreCameraImageParams ), getStoreMapDataV3 )
|
|
145
|
-
.post( '/headerStores_v2', isAllowedSessionHandler,
|
|
146
|
-
.post( '/headercluster_v2', isAllowedSessionHandler,
|
|
147
|
-
.post( '/headerLocations_v2', isAllowedSessionHandler,
|
|
148
|
-
.post( '/cardsFunnel_v3', isAllowedSessionHandler,
|
|
149
|
-
.post( '/footfallCards_v3', isAllowedSessionHandler,
|
|
150
|
-
.post( '/conversionCards_v3', isAllowedSessionHandler,
|
|
151
|
-
.post( '/bouncedCards_v3', isAllowedSessionHandler,
|
|
152
|
-
.post( '/engagersCards_v3', isAllowedSessionHandler,
|
|
153
|
-
.post( '/missedOpportunityCards_v3', isAllowedSessionHandler,
|
|
154
|
-
.post( '/potentialBuyersCards_v3', isAllowedSessionHandler,
|
|
155
|
-
.post( '/potentialBuyersDistributionCards_v3', isAllowedSessionHandler,
|
|
156
|
-
.post( '/funnel_v3', isAllowedSessionHandler,
|
|
157
|
-
.post( '/cardsGraphs_v3', isAllowedSessionHandler,
|
|
158
|
-
.post( '/recapVideo_v3', isAllowedSessionHandler,
|
|
159
|
-
.post( '/densityDwell_v3', isAllowedSessionHandler,
|
|
160
|
-
.post( '/trafficDensityDwell_v3', isAllowedSessionHandler,
|
|
161
|
-
.post( '/overallCards_v3', isAllowedSessionHandler,
|
|
162
|
-
.post( '/overallHourlyChart_v3', isAllowedSessionHandler,
|
|
163
|
-
.post( '/overallChart_v3', isAllowedSessionHandler,
|
|
164
|
-
.post( '/singleStoreChart_v3', isAllowedSessionHandler,
|
|
165
|
-
.post( '/demographicChart_v3', isAllowedSessionHandler,
|
|
166
|
-
.post( '/buyerChart_v3', isAllowedSessionHandler,
|
|
167
|
-
.post( '/footfallDirectoryFolders_v3', isAllowedSessionHandler,
|
|
168
|
-
.post( '/footfallDirectory_v3', isAllowedSessionHandler,
|
|
169
|
-
.post( '/summaryTable_v3', isAllowedSessionHandler,
|
|
170
|
-
.post( '/footfallTrend_v3', isAllowedSessionHandler,
|
|
171
|
-
.post( '/storeOperation_v3', isAllowedSessionHandler,
|
|
172
|
-
.post( '/performanceMatrix_v3', isAllowedSessionHandler,
|
|
173
|
-
.post( '/zoneDwellTimeSplit_v3', isAllowedSessionHandler,
|
|
174
|
-
.post( '/storesMap_v1', isAllowedSessionHandler,
|
|
145
|
+
.post( '/headerStores_v2', isAllowedSessionHandler, validate( validationDtos.validateHeaderParamsv2 ), getAssinedStore, headerStoresV2 )
|
|
146
|
+
.post( '/headercluster_v2', isAllowedSessionHandler, validate( validationDtos.validateHeaderParams ), getAssinedStore, headerClustersV2 )
|
|
147
|
+
.post( '/headerLocations_v2', isAllowedSessionHandler, validate( validationDtos.validateHeaderParams ), getAssinedStore, headerLocationsV2 )
|
|
148
|
+
.post( '/cardsFunnel_v3', isAllowedSessionHandler, validate( validationDtos.validateCardFunnelParams ), cardsFunnelV3 )
|
|
149
|
+
.post( '/footfallCards_v3', isAllowedSessionHandler, validate( validationDtos.validateCardFunnelParams ), footfallCardsV3 )
|
|
150
|
+
.post( '/conversionCards_v3', isAllowedSessionHandler, validate( validationDtos.validateCardFunnelParams ), conversionCardsV3 )
|
|
151
|
+
.post( '/bouncedCards_v3', isAllowedSessionHandler, validate( validationDtos.validateCardFunnelParams ), bouncedCardsV3 )
|
|
152
|
+
.post( '/engagersCards_v3', isAllowedSessionHandler, validate( validationDtos.validateCardFunnelParams ), engagersCardsV3 )
|
|
153
|
+
.post( '/missedOpportunityCards_v3', isAllowedSessionHandler, validate( validationDtos.validateCardFunnelParams ), missedOpportunityCardsV3 )
|
|
154
|
+
.post( '/potentialBuyersCards_v3', isAllowedSessionHandler, validate( validationDtos.validateCardFunnelParams ), potentialBuyersCardsV3 )
|
|
155
|
+
.post( '/potentialBuyersDistributionCards_v3', isAllowedSessionHandler, validate( validationDtos.validateCardFunnelParams ), potentialBuyersDistributionCardsV3 )
|
|
156
|
+
.post( '/funnel_v3', isAllowedSessionHandler, validate( validationDtos.validateCardFunnelParams ), funnelV3 )
|
|
157
|
+
.post( '/cardsGraphs_v3', isAllowedSessionHandler, validate( validationDtos.validateCardGraphParams ), cardsGraphsV3 )
|
|
158
|
+
.post( '/recapVideo_v3', isAllowedSessionHandler, validate( validationDtos.validateRecapVideoParams ), recapVideoV3 )
|
|
159
|
+
.post( '/densityDwell_v3', isAllowedSessionHandler, validate( validationDtos.validateDensityDwellParams ), densityDwellV3 )
|
|
160
|
+
.post( '/trafficDensityDwell_v3', isAllowedSessionHandler, validate( validationDtos.validateDensityDwellParams ), trafficDensityDwellV3 )
|
|
161
|
+
.post( '/overallCards_v3', isAllowedSessionHandler, validate( validationDtos.validateOverallCharParams ), overallCardsV3 )
|
|
162
|
+
.post( '/overallHourlyChart_v3', isAllowedSessionHandler, validate( validationDtos.validateOverallHourlyCharParams ), overallHourlyChartV3 )
|
|
163
|
+
.post( '/overallChart_v3', isAllowedSessionHandler, validate( validationDtos.validateOverallCharParams ), overallChartV3 )
|
|
164
|
+
.post( '/singleStoreChart_v3', isAllowedSessionHandler, validate( validationDtos.validateSingleStoreChartParams ), singleStoreChartV3 )
|
|
165
|
+
.post( '/demographicChart_v3', isAllowedSessionHandler, validate( validationDtos.validateDemographicChartParams ), demographicChartV3 )
|
|
166
|
+
.post( '/buyerChart_v3', isAllowedSessionHandler, validate( validationDtos.validateBuyerChartParams ), buyerChartV3 )
|
|
167
|
+
.post( '/footfallDirectoryFolders_v3', isAllowedSessionHandler, validate( validationDtos.validateFootfallDirectoryFoldersParams ), footfallDirectoryFoldersV3 )
|
|
168
|
+
.post( '/footfallDirectory_v3', isAllowedSessionHandler, validate( validationDtos.validateFootfallDirectoryParams ), footfallDirectoryV3 )
|
|
169
|
+
.post( '/summaryTable_v3', isAllowedSessionHandler, validate( validationDtos.validateSummaryTableParams ), summaryTableV3 )
|
|
170
|
+
.post( '/footfallTrend_v3', isAllowedSessionHandler, validate( validationDtos.validateFootfallTrendParams ), footfallTrendV3 )
|
|
171
|
+
.post( '/storeOperation_v3', isAllowedSessionHandler, validate( validationDtos.validateStoreOperationParams ), storeOperationV3 )
|
|
172
|
+
.post( '/performanceMatrix_v3', isAllowedSessionHandler, validate( validationDtos.validateperformanceMatrixParams ), performanceMatrixV3 )
|
|
173
|
+
.post( '/zoneDwellTimeSplit_v3', isAllowedSessionHandler, validate( validationDtos.validateStoreOperationParams ), zoneDwellTimeSplitV3 )
|
|
174
|
+
.post( '/storesMap_v1', isAllowedSessionHandler, validate( validationDtos.validateStoresMapParams ), storesMapV1 )
|
|
175
175
|
.post( '/headerUserEmails_v2', isAllowedSessionHandler, getUserEmails )
|
|
176
|
-
.post( '/headerCountry_v2', isAllowedSessionHandler,
|
|
176
|
+
.post( '/headerCountry_v2', isAllowedSessionHandler, validate( validationDtos.validateCountryHeaderParamsv2 ), getAssinedStore, headerCountryV2 )
|
|
177
177
|
.post( '/checkTodayReportStatus', isAllowedSessionHandler, checkTodayReportStatus )
|
|
178
178
|
.post( '/headerZoneV2', isAllowedSessionHandler, headerZoneV2 )
|
|
179
179
|
.post( '/trafficDensityExport_v2', managerTrafficDensityExport )
|
|
180
|
-
.post( '/get-store-list-v2', isAllowedSessionHandler,
|
|
180
|
+
.post( '/get-store-list-v2', isAllowedSessionHandler, validate( validationDtos.validateGetStoreList ), getStoreListv2 );
|
|
181
181
|
export default analysisTrafficRouter;
|