@xuda.io/ai_module 1.1.5085 → 1.1.5086

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 +0 -21
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1173,13 +1173,10 @@ export const get_ai_chats = async function (req, job_id, headers) {
1173
1173
  reduce: true,
1174
1174
  group_level: 999,
1175
1175
 
1176
- // key: [contact_id, conversation_id],
1177
-
1178
1176
  startkey: [reference_id, ''],
1179
1177
  endkey: [reference_id, 'zzzzzz'],
1180
1178
  });
1181
1179
 
1182
- // return counts_ret?.rows?.[0]?.value || 0;
1183
1180
  let counts = {};
1184
1181
  for (const val of counts_ret?.rows) {
1185
1182
  counts[val.key[1]] = val.value;
@@ -1191,13 +1188,11 @@ export const get_ai_chats = async function (req, job_id, headers) {
1191
1188
  const counts_ret = await db_module.get_app_couch_view(account_profile_info.app_id, 'chat_conversation_item_read', {
1192
1189
  reduce: true,
1193
1190
  group_level: 999, //2,
1194
- // key: [uid, contact_id, conversation_id],
1195
1191
 
1196
1192
  startkey: [uid, reference_id, ''],
1197
1193
  endkey: [uid, reference_id, 'zzzzzz'],
1198
1194
  });
1199
1195
 
1200
- // return counts_ret?.rows?.[0]?.value || 0;
1201
1196
  let counts = {};
1202
1197
  for (const val of counts_ret?.rows) {
1203
1198
  counts[val.key[2]] = val.value;
@@ -1402,19 +1397,6 @@ export const get_ai_chats = async function (req, job_id, headers) {
1402
1397
  } else {
1403
1398
  ai_chats = await get_data_find();
1404
1399
  }
1405
-
1406
- // ai_chats = await db_module.find_app_couch_query(account_profile_info.app_id, opt);
1407
- // if (!limit || conversation_id) {
1408
- // ai_chats.total_docs = ai_chats.docs.length;
1409
- // } else {
1410
- // delete opt.sort;
1411
- // delete opt.skip;
1412
- // opt.limit = 9999;
1413
- // opt.fields = ['_id'];
1414
-
1415
- // const counter = await db_module.find_app_couch_query(account_profile_info.app_id, opt);
1416
- // ai_chats.total_docs = counter.docs.length;
1417
- // }
1418
1400
  }
1419
1401
 
1420
1402
  let docs = [];
@@ -1431,9 +1413,6 @@ export const get_ai_chats = async function (req, job_id, headers) {
1431
1413
  doc.reference_doc = reference_doc;
1432
1414
  }
1433
1415
 
1434
- // const contact_chat_conversation_count_ret = await chat_conversation_count(doc.reference_id, doc._id);
1435
- // const contact_chat_conversation_read_ret = await chat_conversation_read(doc.reference_id, doc._id);
1436
-
1437
1416
  doc.interactions = contact_chat_conversation_count_ret[doc._id];
1438
1417
  doc.notifications = contact_chat_conversation_count_ret[doc._id] - contact_chat_conversation_read_ret[doc._id];
1439
1418
  doc.chats = doc.interactions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.5085",
3
+ "version": "1.1.5086",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",