tango-app-api-analysis-traffic 3.8.22 → 3.8.24
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
|
@@ -268,7 +268,9 @@ export const footfallDirectoryFoldersV1 = async ( req, res ) => {
|
|
|
268
268
|
return res.sendError( 'Invalid Client Id', 400 );
|
|
269
269
|
}
|
|
270
270
|
reqestData.featureConfigs = getClientData.featureConfigs;
|
|
271
|
-
|
|
271
|
+
// Lambda URL resolved dynamically from secret manager (OPENSEARCH config) so test/prod can differ
|
|
272
|
+
const openSearch = JSON.parse( process.env.OPENSEARCH );
|
|
273
|
+
let LamdaURL = openSearch.revopFootfallDirectory;
|
|
272
274
|
let resultData = await LamdaServiceCall( LamdaURL, reqestData );
|
|
273
275
|
if ( resultData ) {
|
|
274
276
|
if ( resultData.status_code == '200' ) {
|
|
@@ -293,7 +295,9 @@ export const footfallDirectoryV1 = async ( req, res ) => {
|
|
|
293
295
|
return res.sendError( 'Invalid Client Id', 400 );
|
|
294
296
|
}
|
|
295
297
|
reqestData.featureConfigs = getClientData.featureConfigs;
|
|
296
|
-
|
|
298
|
+
// Lambda URL resolved dynamically from secret manager (OPENSEARCH config) so test/prod can differ
|
|
299
|
+
const openSearch = JSON.parse( process.env.OPENSEARCH );
|
|
300
|
+
let LamdaURL = openSearch.revopFootfallDirectory;
|
|
297
301
|
let resultData = await LamdaServiceCall( LamdaURL, reqestData );
|
|
298
302
|
if ( resultData ) {
|
|
299
303
|
if ( resultData.status_code == '200' ) {
|
|
@@ -63,11 +63,15 @@ export async function revoptagging( req, res ) {
|
|
|
63
63
|
'tempId': item.tempId,
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
|
+
{
|
|
67
|
+
'term': {
|
|
68
|
+
'type.keyword': 'tagging',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
66
71
|
],
|
|
67
72
|
},
|
|
68
73
|
},
|
|
69
74
|
};
|
|
70
|
-
|
|
71
75
|
let respo= await getOpenSearchData( openSearch.revops, searchQuery );
|
|
72
76
|
const revopData = respo?.body?.hits?.hits;
|
|
73
77
|
if ( revopData && revopData.length>0 ) {
|
|
@@ -1078,6 +1082,13 @@ export async function exportRevopTagging( req, res ) {
|
|
|
1078
1082
|
}
|
|
1079
1083
|
|
|
1080
1084
|
const exportData = [];
|
|
1085
|
+
// Convert camelCase revopsType to space-separated, capitalized words (e.g. nonShopper -> Non Shopper)
|
|
1086
|
+
const camelCaseToTitle = ( str ) => {
|
|
1087
|
+
if ( !str ) return '';
|
|
1088
|
+
return `${str}`
|
|
1089
|
+
.replace( /([a-z0-9])([A-Z])/g, '$1 $2' )
|
|
1090
|
+
.replace( /^./, ( s ) => s.toUpperCase() );
|
|
1091
|
+
};
|
|
1081
1092
|
logger.info( { allHits: allHits } );
|
|
1082
1093
|
for ( const hit of allHits ) {
|
|
1083
1094
|
const src = hit._source || {};
|
|
@@ -1117,7 +1128,7 @@ export async function exportRevopTagging( req, res ) {
|
|
|
1117
1128
|
const subCategory = Array.isArray( issueItem?.issue ) ? issueItem.issue.join( ', ' ) : ( issueItem?.issue || '' );
|
|
1118
1129
|
exportData.push( {
|
|
1119
1130
|
...base,
|
|
1120
|
-
'Tag Type': revopsType,
|
|
1131
|
+
'Tag Type': camelCaseToTitle( revopsType ),
|
|
1121
1132
|
'Tagged Category': issueItem?.name || '',
|
|
1122
1133
|
'Tagged Sub Category': subCategory,
|
|
1123
1134
|
'Description': src.description || '',
|
|
@@ -1126,7 +1137,7 @@ export async function exportRevopTagging( req, res ) {
|
|
|
1126
1137
|
} else {
|
|
1127
1138
|
exportData.push( {
|
|
1128
1139
|
...base,
|
|
1129
|
-
'Tag Type': revopsType,
|
|
1140
|
+
'Tag Type': camelCaseToTitle( revopsType ),
|
|
1130
1141
|
'Tagged Category': typeLower === 'nonshopper' ? ( src.nonshoperType || '' ) : '',
|
|
1131
1142
|
'Tagged Sub Category': '',
|
|
1132
1143
|
'Description': src.description || '',
|
|
@@ -328,7 +328,9 @@ export const footfallDirectoryFoldersV1 = async ( req, res ) => {
|
|
|
328
328
|
return res.sendError( 'Invalid Client Id', 400 );
|
|
329
329
|
}
|
|
330
330
|
reqestData.featureConfigs = getClientData.featureConfigs;
|
|
331
|
-
|
|
331
|
+
// Lambda URL resolved dynamically from secret manager (OPENSEARCH config) so test/prod can differ
|
|
332
|
+
const openSearch = JSON.parse( process.env.OPENSEARCH );
|
|
333
|
+
let LamdaURL = openSearch.revopFootfallDirectory;
|
|
332
334
|
let resultData = await LamdaServiceCall( LamdaURL, reqestData );
|
|
333
335
|
if ( resultData ) {
|
|
334
336
|
if ( resultData.status_code == '200' ) {
|
|
@@ -353,7 +355,9 @@ export const footfallDirectoryV1 = async ( req, res ) => {
|
|
|
353
355
|
return res.sendError( 'Invalid Client Id', 400 );
|
|
354
356
|
}
|
|
355
357
|
reqestData.featureConfigs = getClientData.featureConfigs;
|
|
356
|
-
|
|
358
|
+
// Lambda URL resolved dynamically from secret manager (OPENSEARCH config) so test/prod can differ
|
|
359
|
+
const openSearch = JSON.parse( process.env.OPENSEARCH );
|
|
360
|
+
let LamdaURL = openSearch.revopFootfallDirectory;
|
|
357
361
|
let resultData = await LamdaServiceCall( LamdaURL, reqestData );
|
|
358
362
|
if ( resultData ) {
|
|
359
363
|
if ( resultData.status_code == '200' ) {
|
|
@@ -1371,7 +1371,9 @@ export const footfallDirectoryFoldersV3 = async ( req, res ) => {
|
|
|
1371
1371
|
return res.sendError( 'Invalid Client Id', 400 );
|
|
1372
1372
|
}
|
|
1373
1373
|
reqestData.featureConfigs = getClientData.featureConfigs;
|
|
1374
|
-
|
|
1374
|
+
// Lambda URL resolved dynamically from secret manager (OPENSEARCH config) so test/prod can differ
|
|
1375
|
+
const openSearch = JSON.parse( process.env.OPENSEARCH );
|
|
1376
|
+
let LamdaURL = openSearch.revopFootfallDirectory;
|
|
1375
1377
|
let resultData = await LamdaServiceCall( LamdaURL, reqestData );
|
|
1376
1378
|
if ( resultData ) {
|
|
1377
1379
|
if ( resultData.status_code == '200' ) {
|
|
@@ -1396,7 +1398,9 @@ export const footfallDirectoryV3 = async ( req, res ) => {
|
|
|
1396
1398
|
return res.sendError( 'Invalid Client Id', 400 );
|
|
1397
1399
|
}
|
|
1398
1400
|
reqestData.featureConfigs = getClientData.featureConfigs;
|
|
1399
|
-
|
|
1401
|
+
// Lambda URL resolved dynamically from secret manager (OPENSEARCH config) so test/prod can differ
|
|
1402
|
+
const openSearch = JSON.parse( process.env.OPENSEARCH );
|
|
1403
|
+
let LamdaURL = openSearch.revopFootfallDirectory;
|
|
1400
1404
|
let resultData = await LamdaServiceCall( LamdaURL, reqestData );
|
|
1401
1405
|
if ( resultData ) {
|
|
1402
1406
|
if ( resultData.status_code == '200' ) {
|