@xuda.io/ai_module 1.1.5062 → 1.1.5064

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.
Files changed (2) hide show
  1. package/index.mjs +3 -30
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1324,9 +1324,8 @@ export const get_ai_chats = async function (req, job_id, headers) {
1324
1324
 
1325
1325
  let stat_type = filter_type === 'archived' ? 'archived' : 'all';
1326
1326
 
1327
- const profile_id = account_profile_info.is_main ? 'all' : account_profile_info.account_profile_id;
1328
- const conv_type = conversation_type ? conversation_type : 'all';
1329
- const mine_uid = filter_type === 'mine' ? uid : 'all';
1327
+ // const profile_id = account_profile_info.is_main ? 'all' : account_profile_info.account_profile_id;
1328
+ // const conv_type = conversation_type ? conversation_type : 'all';
1330
1329
 
1331
1330
  const ret = await db_module.get_app_couch_view(account_profile_info.app_id, 'ai_chat_list', {
1332
1331
  startkey: [stat_type, reference_id, 0],
@@ -1350,7 +1349,7 @@ export const get_ai_chats = async function (req, job_id, headers) {
1350
1349
  docs.push(conversations[val.value.conversation_id]);
1351
1350
  }
1352
1351
 
1353
- return ret;
1352
+ return { docs };
1354
1353
  };
1355
1354
 
1356
1355
  ////// FROM - IN
@@ -1422,32 +1421,6 @@ export const get_ai_chats = async function (req, job_id, headers) {
1422
1421
  doc.notifications = contact_chat_conversation_count_ret - contact_chat_conversation_read_ret;
1423
1422
  doc.chats = doc.interactions;
1424
1423
 
1425
- // // get conversation item
1426
- // let opt = {
1427
- // selector: {
1428
- // docType: 'chat_conversation_item',
1429
- // conversation_id: doc._id,
1430
- // },
1431
- // limit: 1,
1432
- // };
1433
- // const conversation_item_ret = await db_module.find_app_couch_query(account_profile_info.app_id, opt);
1434
- // doc.conversation_item = conversation_item_ret?.docs?.[0];
1435
- // if (doc?.conversation_item?.email_id) {
1436
- // doc.email_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, doc.conversation_item.email_id);
1437
- // }
1438
-
1439
- // doc.notifications = 0;
1440
- // doc.interactions = doc?.messages?.length || 0;
1441
- // for (let msg of doc.messages) {
1442
- // if (!msg.read) doc.notifications++;
1443
- // }
1444
-
1445
- // if (!doc.chat_image && (!doc.thumbnail_request_ts || Date.now() - doc.thumbnail_request_ts > 120000)) {
1446
- // if (headers) {
1447
- // update_thumbnail('conversation', doc, account_profile_info.app_id, uid, job_id, headers, null, null, account_profile_info);
1448
- // }
1449
- // }
1450
-
1451
1424
  doc.user_contact = await get_user_card(uid, doc.uid);
1452
1425
 
1453
1426
  doc.privilege = doc.uid === uid || doc?.account_profile_info?.uid === uid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.5062",
3
+ "version": "1.1.5064",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",