@xuda.io/ai_module 1.1.4959 → 1.1.4960
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 +5 -5
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -51,7 +51,7 @@ global._ = _;
|
|
|
51
51
|
const _common = await import(path.join(process.env.XUDA_HOME, 'common', 'xuda_node_common.mjs'));
|
|
52
52
|
const _utils = await import(path.join(process.env.XUDA_HOME, 'common', 'xuda-cpi-utils.mjs'));
|
|
53
53
|
|
|
54
|
-
const { get_active_account_profile_info, get_user_card, get_account_name } = await import(path.join(process.env.XUDA_HOME, 'common', 'cache_cpi.mjs'));
|
|
54
|
+
const { get_active_account_profile_info, get_user_card, get_account_name, get_contact_info } = await import(path.join(process.env.XUDA_HOME, 'common', 'cache_cpi.mjs'));
|
|
55
55
|
|
|
56
56
|
const { createDoc, valid_menuType } = await import(`${runtime_modules_path}/xuda-studio-doc-utils.mjs`);
|
|
57
57
|
const { xudaPrase } = await import(`${runtime_modules_path}/xuda-cli-plugin-html-parser-module.esm.mjs`);
|
|
@@ -3424,7 +3424,7 @@ export const create_conversation = async function (req, job_id, headers) {
|
|
|
3424
3424
|
if (conversation_doc.reference_type === 'contacts' && conversation_type === 'chat') {
|
|
3425
3425
|
// reference_id is the contact id
|
|
3426
3426
|
contact_id = reference_id;
|
|
3427
|
-
contact_doc = await
|
|
3427
|
+
contact_doc = await get_contact_info(uid, null, contact_id);
|
|
3428
3428
|
|
|
3429
3429
|
if (!contact_doc?.contact_uid) {
|
|
3430
3430
|
throw new Error('chat conversation to non user recipient is not allowed');
|
|
@@ -3670,11 +3670,11 @@ const contact_chat_conversation = async function (req, job_id, headers) {
|
|
|
3670
3670
|
|
|
3671
3671
|
const conversation_id = conversation_doc._id;
|
|
3672
3672
|
|
|
3673
|
-
const receiver_contact_doc = await
|
|
3673
|
+
const receiver_contact_doc = await get_contact_info(uid, null, conversation_doc.reference_id);
|
|
3674
3674
|
const receiver_app_id = await account_ms.get_account_default_project_id(receiver_contact_doc.contact_uid);
|
|
3675
3675
|
let receiver_conversation_doc = await db_module.get_app_couch_doc_native(receiver_app_id, conversation_id);
|
|
3676
3676
|
|
|
3677
|
-
const sender_contact_doc = await
|
|
3677
|
+
const sender_contact_doc = await get_contact_info(uid, null, conversation_doc.reference_id);
|
|
3678
3678
|
const sender_app_id = account_profile_info.app_id;
|
|
3679
3679
|
let sender_conversation_doc = await db_module.get_app_couch_doc_native(sender_app_id, conversation_id);
|
|
3680
3680
|
|
|
@@ -3809,7 +3809,7 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
3809
3809
|
throw new Error('not an contact conversation');
|
|
3810
3810
|
}
|
|
3811
3811
|
const contact_id = sender_conversation_doc.reference_id;
|
|
3812
|
-
const contact_info = await
|
|
3812
|
+
const contact_info = await get_contact_info(uid, null, contact_id);
|
|
3813
3813
|
if (!contact_info.email) {
|
|
3814
3814
|
throw new Error('empty contact email');
|
|
3815
3815
|
}
|