@xuda.io/account_module 1.2.1906 → 1.2.1908

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 +29 -23
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2776,6 +2776,10 @@ export const not_spam_contact = async function (req, job_id, headers) {
2776
2776
  });
2777
2777
  debugger;
2778
2778
  for await (let email of emails.docs) {
2779
+ const app_id = await get_account_default_project_id(uid);
2780
+ if (email.conversation_id) await db_module.delete_app_couch_doc(app_id, email.conversation_id);
2781
+ if (email.conversation_item_id) await db_module.delete_app_couch_doc(app_id, email.conversation_item_id);
2782
+
2779
2783
  // save attachments
2780
2784
  // summarized_body
2781
2785
  req.uid = email.uid;
@@ -2785,29 +2789,31 @@ export const not_spam_contact = async function (req, job_id, headers) {
2785
2789
  // await process_email(email.email_account_id, profile, uid, email._id, job_id, headers, null, true);
2786
2790
  }
2787
2791
 
2788
- const conversations = await db_module.find_app_couch_query(account_profile_info.app_id, {
2789
- selector: {
2790
- docType: 'chat_conversation',
2791
- reference_id: contact_id,
2792
- stat: 3,
2793
-
2794
- process_stat: 'partial',
2795
- },
2796
- });
2797
-
2798
- for await (let conversation of conversations.docs) {
2799
- await ai_module.process_conversation(uid, conversation._id, account_profile_info, job_id, headers);
2800
- await ai_module.update_conversation_mood_level(uid, [{ uid: account_profile_info.uid, contact_id }], conversation._id, conversation.prompt, null, reference_id, conversation.reference_type === 'contacts', account_profile_info);
2801
-
2802
- const conversation_items = await db_module.find_app_couch_query(account_profile_info.app_id, {
2803
- selector: {
2804
- docType: 'chat_conversation_item',
2805
- conversation_id: conversation._id,
2806
- stat: 3,
2807
- process_stat: 'partial',
2808
- },
2809
- });
2810
- }
2792
+ // const conversations = await db_module.find_app_couch_query(account_profile_info.app_id, {
2793
+ // selector: {
2794
+ // docType: 'chat_conversation',
2795
+ // reference_id: contact_id,
2796
+ // stat: 3,
2797
+
2798
+ // process_stat: 'partial',
2799
+ // },
2800
+ // });
2801
+
2802
+ // for await (let conversation of conversations.docs) {
2803
+ // await ai_module.process_conversation(uid, conversation._id, account_profile_info, job_id, headers);
2804
+ // await ai_module.update_conversation_mood_level(uid, [{ uid: account_profile_info.uid, contact_id }], conversation._id, conversation.prompt, null, reference_id, conversation.reference_type === 'contacts', account_profile_info);
2805
+
2806
+ // const conversation_items = await db_module.find_app_couch_query(account_profile_info.app_id, {
2807
+ // selector: {
2808
+ // docType: 'chat_conversation_item',
2809
+ // conversation_id: conversation._id,
2810
+ // stat: 3,
2811
+ // process_stat: 'partial',
2812
+ // },
2813
+ // });
2814
+ // for await (let conversation_item of conversation_items.docs) {
2815
+ // }
2816
+ // }
2811
2817
 
2812
2818
  // update_conversation_mood_level
2813
2819
  // attachment_handler
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1906",
3
+ "version": "1.2.1908",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {