@xuda.io/ai_module 1.1.4630 → 1.1.4631

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 +10 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1730,10 +1730,10 @@ export const get_chat_conversation = async function (req) {
1730
1730
  conversation_doc = await db_module.get_app_couch_doc_native(reference_doc.shared_from_app_id, reference_doc.share_item_id);
1731
1731
  conversation_doc.reference_doc = reference_doc;
1732
1732
  }
1733
- let conversation = await db_module.find_app_couch_query(account_profile_info.app_id, {
1733
+ let conversation_items = await db_module.find_app_couch_query(account_profile_info.app_id, {
1734
1734
  selector: {
1735
1735
  docType: 'chat_conversation_item',
1736
- conversation_id: conversation_id,
1736
+ conversation_id,
1737
1737
  stat: 3,
1738
1738
  },
1739
1739
  limit,
@@ -1741,7 +1741,14 @@ export const get_chat_conversation = async function (req) {
1741
1741
  sort: ['date_created_ts'],
1742
1742
  });
1743
1743
 
1744
- return { code: 15, data: { conversation, ...conversation_doc } };
1744
+ for (let conversation_item_doc of conversation_items.docs || []) {
1745
+ if (!conversation_item_doc.read) {
1746
+ conversation_item_doc.read = {};
1747
+ }
1748
+ conversation_item_doc.read[uid] = Date.now();
1749
+ }
1750
+
1751
+ return { code: 15, data: { conversation_items, ...conversation_doc } };
1745
1752
  } catch (err) {
1746
1753
  return { code: -15, data: err.message };
1747
1754
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4630",
3
+ "version": "1.1.4631",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",