@xuda.io/ai_module 1.1.4596 → 1.1.4597
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 +30 -9
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4501,22 +4501,43 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
4501
4501
|
sender_conversation_doc.messages.push(obj);
|
|
4502
4502
|
await db_module.save_app_couch_doc_native(sender_app_id, sender_conversation_doc);
|
|
4503
4503
|
|
|
4504
|
-
|
|
4505
|
-
_id:
|
|
4504
|
+
let out_conversation_item_obj = {
|
|
4505
|
+
_id: await _common.xuda_get_uuid('chat_conversation_item'),
|
|
4506
4506
|
stat: 3,
|
|
4507
4507
|
docType: 'chat_conversation_item',
|
|
4508
|
-
sent_email_result,
|
|
4509
|
-
ts: obj.ts,
|
|
4510
4508
|
uid,
|
|
4511
|
-
conversation_type:
|
|
4512
|
-
|
|
4509
|
+
conversation_type: 'email',
|
|
4510
|
+
type: 'email',
|
|
4511
|
+
date_created_ts: Date.now(),
|
|
4512
|
+
ts: Date.now(),
|
|
4513
4513
|
conversation_id,
|
|
4514
|
-
body,
|
|
4514
|
+
text: body,
|
|
4515
|
+
reference_id: conversation_doc.reference_id,
|
|
4516
|
+
conversation_item_reference_id: item.data[0].id,
|
|
4517
|
+
direction: 'out',
|
|
4518
|
+
role: 'user',
|
|
4515
4519
|
email_id,
|
|
4516
4520
|
subject,
|
|
4517
4521
|
last_email_item_id: last_email_item?._id,
|
|
4518
|
-
|
|
4519
|
-
|
|
4522
|
+
};
|
|
4523
|
+
|
|
4524
|
+
const save_ret = await db_module.save_app_couch_doc_native(sender_app_id, out_conversation_item_obj);
|
|
4525
|
+
// const save_ret = await db_module.save_app_couch_doc_native(sender_app_id, {
|
|
4526
|
+
// _id: obj.id,
|
|
4527
|
+
// stat: 3,
|
|
4528
|
+
// docType: 'chat_conversation_item',
|
|
4529
|
+
// sent_email_result,
|
|
4530
|
+
// ts: obj.ts,
|
|
4531
|
+
// uid,
|
|
4532
|
+
// conversation_type: obj.conversation_type,
|
|
4533
|
+
// date_created_ts: obj.ts,
|
|
4534
|
+
// conversation_id,
|
|
4535
|
+
// body,
|
|
4536
|
+
// email_id,
|
|
4537
|
+
// subject,
|
|
4538
|
+
// last_email_item_id: last_email_item?._id,
|
|
4539
|
+
// reference_id: conversation_doc.reference_id,
|
|
4540
|
+
// });
|
|
4520
4541
|
|
|
4521
4542
|
return save_ret;
|
|
4522
4543
|
} catch (err) {
|