@xuda.io/ai_module 1.1.4200 → 1.1.4202

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 +14 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4365,10 +4365,10 @@ const update_conversation_mood_level = async function (conversation_id, prompt,
4365
4365
  };
4366
4366
  const sender_contact_ret = await account_module.find_contact_query(receiver_uid, opt);
4367
4367
 
4368
- if (!sender_contact_ret?.rows?.length) {
4368
+ if (!sender_contact_ret?.docs?.length) {
4369
4369
  throw new Error('sender contact id not found');
4370
4370
  }
4371
- const sender_contact_id = sender_contact_ret?.rows[0].id;
4371
+ const sender_contact_id = sender_contact_ret?.docs[0]._id;
4372
4372
  let sender_contact_doc = await account_module.get_contact(sender_uid, sender_contact_id);
4373
4373
  sender_contact_doc.contact_mood_level = mood_level_obj.mood_level;
4374
4374
  sender_contact_doc.ts = Date.now();
@@ -4384,7 +4384,18 @@ const update_conversation_mood_level = async function (conversation_id, prompt,
4384
4384
  await db_module.save_app_couch_doc_native(receiver_app_id, receiver_conversation_doc);
4385
4385
 
4386
4386
  if (update_contact) {
4387
- const receiver_contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_contact_uid', { key: [sender_uid, receiver_uid] });
4387
+ // const receiver_contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_contact_uid', { key: [sender_uid, receiver_uid] });
4388
+
4389
+ const opt = {
4390
+ selector: {
4391
+ docType: 'contact',
4392
+ stat: 3,
4393
+ contact_uid: receiver_uid,
4394
+ },
4395
+ limit: 1,
4396
+ fields: ['_id'],
4397
+ };
4398
+ const receiver_contact_ret = await account_module.find_contact_query(sender_uid, opt);
4388
4399
 
4389
4400
  if (!receiver_contact_ret?.rows?.length) {
4390
4401
  throw new Error('receiver contact id not found');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4200",
3
+ "version": "1.1.4202",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",