tango-app-api-audio-analytics 1.0.28 → 1.0.29

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-audio-analytics",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "audioAnalytics",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -250,15 +250,15 @@ export async function chatHistoryList( req, res ) {
250
250
  user_id: userId,
251
251
  },
252
252
  },
253
- _source: [ 'session_id', 'session_title' ], // Only fetch required fields
253
+ _source: [ 'session_id', 'session_title', 'user_id', 'session_start_time' ], // Only fetch required fields
254
254
  size: Number( limit ),
255
255
  from: Number( offset ),
256
- sort: [ { _id: { order: 'desc' } } ], // Sort by creation date, most recent first
256
+ sort: [ { session_start_time: { order: 'desc' } } ], // Sort by creation date, most recent first
257
257
  };
258
258
 
259
259
  // Search in tango-ai-session index
260
260
  const result = await searchOpenSearchData( 'tango-ai-sessions', query );
261
- logger.info( { message: 'Chat history search result', resultHits: result?.body?.hits?.hits?.length } );
261
+ logger.info( { message: 'Chat history search result', resultHits: result?.body?.hits?.hits } );
262
262
 
263
263
  if ( !result || !result.body || !result.body.hits ) {
264
264
  return res.sendError( 'Failed to fetch chat history', 500 );
@@ -268,6 +268,7 @@ export async function chatHistoryList( req, res ) {
268
268
  const sessions = ( result.body.hits.hits || [] ).map( ( hit ) => ( {
269
269
  session_id: hit._source.session_id,
270
270
  session_title: hit._source.session_title,
271
+ // userId: hit._source.user_id,
271
272
  } ) );
272
273
  /* eslint-enable camelcase */
273
274