@xuda.io/account_module 1.2.1907 → 1.2.1909
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.
- package/index.mjs +35 -25
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2776,6 +2776,16 @@ 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) {
|
|
2781
|
+
await db_module.delete_app_couch_doc(app_id, email.conversation_id);
|
|
2782
|
+
email.conversation_id = null;
|
|
2783
|
+
}
|
|
2784
|
+
if (email.conversation_item_id) {
|
|
2785
|
+
await db_module.delete_app_couch_doc(app_id, email.conversation_item_id);
|
|
2786
|
+
email.conversation_item_id = null;
|
|
2787
|
+
}
|
|
2788
|
+
|
|
2779
2789
|
// save attachments
|
|
2780
2790
|
// summarized_body
|
|
2781
2791
|
req.uid = email.uid;
|
|
@@ -2785,31 +2795,31 @@ export const not_spam_contact = async function (req, job_id, headers) {
|
|
|
2785
2795
|
// await process_email(email.email_account_id, profile, uid, email._id, job_id, headers, null, true);
|
|
2786
2796
|
}
|
|
2787
2797
|
|
|
2788
|
-
const conversations = await db_module.find_app_couch_query(account_profile_info.app_id, {
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
});
|
|
2797
|
-
|
|
2798
|
-
for await (let conversation of conversations.docs) {
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
}
|
|
2798
|
+
// const conversations = await db_module.find_app_couch_query(account_profile_info.app_id, {
|
|
2799
|
+
// selector: {
|
|
2800
|
+
// docType: 'chat_conversation',
|
|
2801
|
+
// reference_id: contact_id,
|
|
2802
|
+
// stat: 3,
|
|
2803
|
+
|
|
2804
|
+
// process_stat: 'partial',
|
|
2805
|
+
// },
|
|
2806
|
+
// });
|
|
2807
|
+
|
|
2808
|
+
// for await (let conversation of conversations.docs) {
|
|
2809
|
+
// await ai_module.process_conversation(uid, conversation._id, account_profile_info, job_id, headers);
|
|
2810
|
+
// 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);
|
|
2811
|
+
|
|
2812
|
+
// const conversation_items = await db_module.find_app_couch_query(account_profile_info.app_id, {
|
|
2813
|
+
// selector: {
|
|
2814
|
+
// docType: 'chat_conversation_item',
|
|
2815
|
+
// conversation_id: conversation._id,
|
|
2816
|
+
// stat: 3,
|
|
2817
|
+
// process_stat: 'partial',
|
|
2818
|
+
// },
|
|
2819
|
+
// });
|
|
2820
|
+
// for await (let conversation_item of conversation_items.docs) {
|
|
2821
|
+
// }
|
|
2822
|
+
// }
|
|
2813
2823
|
|
|
2814
2824
|
// update_conversation_mood_level
|
|
2815
2825
|
// attachment_handler
|